Commit Graph

4404 Commits

Author SHA1 Message Date
Kyle Evans
5af17cb319 lua-lint: Add note about luacheck in ports, silence warning
luacheck was added in ports r462609.

Silence warning about cli_execute -- it's non-standard, but for our setup it
will be a standard global.
2018-02-22 15:29:57 +00:00
Kyle Evans
c8a0a7ab9b Add script for linting stand/lua to tools/boot.
We require some --globals due to custom loader extensions in our
environment. Add everything required for this to tools/boot so that other
interested parties can get up and go with linting our scripts and not get a
bunch of false-positives.
2018-02-22 04:28:52 +00:00
Warner Losh
0c5ec6c2f7 Add LOADER_DEBUG regression test 2018-02-21 23:49:18 +00:00
Eitan Adler
1983a2326b tools/80211: correct array index
wh->i_dur is a two byte value; not a single byte set twice

Reported by:	swildner@DragonFlyBSD.org
2018-02-19 19:01:46 +00:00
Hans Petter Selasky
78b52692f2 Remove obsolete tool, bus_autoconf, which is replaced by devmatch(8). 2018-02-17 14:40:28 +00:00
Kyle Evans
574a8bf981 lua-test: Image the loader test directory if it doesn't exist yet 2018-02-16 20:26:18 +00:00
Kyle Evans
ff8409871e Default to /tmp/loadertest for lua test scripts 2018-02-16 20:23:48 +00:00
Warner Losh
2ec3d49ea3 Simplify building before installing. 2018-02-15 18:58:03 +00:00
Kyle Evans
29cb326c9c Build loader before installing it in lua-img.sh
Slightly more foolproof when all you're wanting to do is quickly get off the
ground with testing the lua loader.
2018-02-15 17:56:45 +00:00
Kyle Evans
f86b2f4817 Set svn:executable on lua-img.sh 2018-02-15 17:47:43 +00:00
Warner Losh
f52add1296 Simple script to image a small test area from a built tree. Build with
'cd stand; make MK_FORTH=no MK_LOADER_LUA=yes' then run this script.
You can then test with lua-test.sh with the same parameter.
2018-02-14 18:21:54 +00:00
Warner Losh
ca72e2e288 A quick test script that we can run to use userboot's test mode to
excersize the load loader. Assumes that we already have a suitable
root area that you pass in with the first arg.
2018-02-14 17:51:51 +00:00
Warner Losh
5ec69a1509 Add lua to build script 2018-02-12 15:32:05 +00:00
Warner Losh
7cafeaa1fd Add Lua as a scripting langauge to /boot/loader
liblua glues the lua run time into the boot loader. It implements all
the runtime routines that lua expects. In addition, it has a few
standard 'C' headers that nueter various aspects of the LUA build that
are too specific to lua to be in libsa. Many refinements from the
original code to improve implementation and the number of included lua
libraries. Use int64_t for lua_Number. Have "/boot/lua" be the default
module path. Numerous cleanups from the original GSoC project,
including hacking libsa to allow lua to be built with only one change
outside luaconf.h.

Add the final bit of lua glue to bring in liblua and plug into the
multiple interpreter framework, previously committed.

Add LOADER_LUA option, currently off by default.

Presently, this is an experimental option. One must opt-in to using
this by defining WITH_LOADER_LUA and WITHOUT_FORTH. It's been
lightly tested, so keep a backup copy of your old loader handy.
The menu code, coming in the next commit, hasn't been exhaustively
tested. A LUA boot loader is 60k larger than a FORTH one, which is
80k larger than a no-interpreter one. Subtle changes in size
may tip things past some subtle limit (the binary is ~430k now
when built with LUA). A future version may offer coexistance.

Bump FreeBSD version to 1200058 to mark the milestone.

Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur,
Zakary Nafziger and Wojciech A. Koszek also contributed. Warner Losh
reworked it extensively into its current form.

Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader
Sponsored by: Google Summer of Code
Relnotes: Yes
MFC After: 1 month
Differential Review: https://reviews.freebsd.org/D14295
2018-02-12 15:31:53 +00:00
Alan Somers
dc4e221c3a Convert tools/regression/sockets/socketpair to ATF
Reviewed by:	cem
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D14305
2018-02-10 19:43:52 +00:00
Ed Maste
1b49115a40 Promote llvm-cov to a standalone option
Introduce WITH_/WITHOUT_LLVM_COV to match GCC's WITH_/WITHOUT_GCOV.
It is intended to provide a superset of the interface and functionality
of gcov.

It is enabled by default when building Clang, similarly to gcov and GCC.

This change moves one file in libllvm to be compiled unconditionally.
Previously it was included only when WITH_CLANG_EXTRAS was set, but the
complexity of a new special case for (CLANG_EXTRAS | LLVM_COV) is not
worth avoiding a tiny increase in build time.

Reviewed by:	dim, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D142645
2018-02-10 00:22:35 +00:00
Kirk McKusick
c97f1d3f37 Add an explanation of the block size units output by prtblknos.
Suggested by: Ravi Pokala (rpokala@)
2018-02-09 22:23:10 +00:00
Kirk McKusick
16c0c8eeec This is a little C-program that can be used to print out the list
of blocks used by a requested list of inodes.

For example, to list the blocks referenced by your kernel:

guest_12 % df /
Filesystem      1K-blocks     Used   Avail Capacity  Mounted on
/dev/gpt/rootfs  20307196 10707336 7975288    57%    /

guest_12 % ls -i /boot/kernel/kernel
160603 /boot/kernel/kernel

guest_12 % ./prtblknos /dev/gpt/rootfs 160603
160603:	lbn 0-7 blkno 3217584-3217647
	lbn 8-11 blkno 3217864-3217895 distance 216
First-level indirect, blkno 3217896-3217903 distance 0
	lbn 12-19 blkno 3217904-3217967 distance 8
	lbn 20-75 blkno 3251816-3252263 distance 33848
	lbn 76-83 blkno 3252368-3252431 distance 104
	lbn 84-91 blkno 3252464-3252527 distance 32
	lbn 92-852 blkno 3252896-3258983 distance 368

Each contiguous range of blocks is printed on a line.
The distance metric is the size of the gap from the end of the
previous set of blocks to the beginning of the next set of blocks.
Short distances are desirable.
2018-02-09 19:10:46 +00:00
Kyle Evans
312640ff19 Teach nanobsd about armv7, add -m to qemu invocations
qemu defaults to 128 MiB of RAM, which has been found to not necessarily be
enough for booting the system, at least on amd64 and armv7

Add a sensible -m 512 to the examples so that they'll work out of the box
in the general case.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D14234
2018-02-09 14:31:11 +00:00
Baptiste Daroussin
a273973175 Remove gdbtui, it was already not installed on every arches
only installed on arm and sparc64.
It is the only bits that keeps us having libreadline in base
The rest of gdb can be switched to libedit and will be in another
commit
2018-02-06 11:54:20 +00:00
Marius Strobl
ba8d50d08b Flesh out the creation of sparc64 UFS images. This has only been verified
to yield working images in a native build as rootgen.sh generally doesn't
support cross-testing so far.
2018-02-05 00:18:21 +00:00
Warner Losh
9a0e2e232b Fix backward conditional.
Pointed out by: david boyer
2018-02-03 21:56:38 +00:00
Eitan Adler
8d6a5512ab tools: remove note about diffburst.
Said tool was removed in 1999 in r51579
2018-01-28 05:45:20 +00:00
Dimitry Andric
c79126f2e4 Merge ^/head r327624 through r327885. 2018-01-12 18:23:35 +00:00
Conrad Meyer
dc045f499a Add encrypt+authenticate modes to cryptotest tool
Like jhb's cryptocheck (uncommitted so far), express encrypt+authenticate
modes as "-a <encalg>+<authalg>".

Example use with aesni(4) on AMD Zen family:

$ ./cryptotest -d aesni0 -a aes256        10000 $((128*1024))
   2.331 sec,   20000 aes256       crypts,  131072 bytes, 1124707930 byte/sec,  8580.8 Mb/sec
$ ./cryptotest -d aesni0 -a sha256        10000 $((128*1024))
   1.109 sec,   10000 sha256       crypts,  131072 bytes, 1181577161 byte/sec,  9014.7 Mb/sec
$ ./cryptotest -d aesni0 -a aes256+sha256 10000 $((128*1024))
   3.805 sec,   10000 sha256+aes256 crypts,  131072 bytes, 344460116 byte/sec,  2628.0 Mb/sec

Reported by:	jhb
Sponsored by:	Dell EMC Isilon
2018-01-10 23:19:32 +00:00
Dimitry Andric
4b49587c3d Merge ^/head r327341 through r327623. 2018-01-06 16:13:17 +00:00
Poul-Henning Kamp
5a57de683b Add a crude workaround for ports with flavors 2017-12-29 15:38:43 +00:00
Dimitry Andric
4fc74049d2 Merge ^/head r327169 through r327340. 2017-12-29 12:51:26 +00:00
Dimitry Andric
fe4fed2e4d Merge llvm, clang, lld, lldb, compiler-rt and libc++ trunk r321545,
update build glue and version numbers, add new intrinsics headers, and
update OptionalObsoleteFiles.inc.
2017-12-29 00:56:15 +00:00
Eitan Adler
9914452050 other: Fix several typos and minor errors
- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by:	imp, benno
2017-12-27 03:23:58 +00:00
Dimitry Andric
54b4b13c4a Merge ^/head r326936 through r327149. 2017-12-24 13:22:57 +00:00
Dimitry Andric
c9d5cb1774 Update OptionalObsoleteFiles.inc again. 2017-12-24 13:19:02 +00:00
Dimitry Andric
0c4684a8bc Update OptionalObsoleteFiles.inc for new headers and libraries under
/usr/lib/clang/6.0.0.
2017-12-24 12:46:28 +00:00
Dimitry Andric
9509d906c1 Add new llvm-objcopy utility, enabled when MK_CLANG_EXTRAS=yes. 2017-12-24 12:36:31 +00:00
Dimitry Andric
6252156da5 Vendor import of clang trunk r321414:
https://llvm.org/svn/llvm-project/cfe/trunk@321414
2017-12-24 01:00:23 +00:00
Dimitry Andric
d49fee24bb Update ObsoleteFiles.inc and OptionalObsoleteFiles.inc. 2017-12-20 20:29:15 +00:00
Warner Losh
22cf6021fc Support more images (but still no geli)
Print a qemu line to a shell script to ease testing each image
Start to support multiple architectures (still very green)
Create /etc/rc that echos success and halts the system for better
automation (also include halt)
Create /etc/fstab on a per-boot type to test loader's passing root
to kernel.

This lets me run a test, connect to it with telnet and get either a
timeout, or a report of success.

Sponsored by: Netflix
2017-12-19 00:18:17 +00:00
Dimitry Andric
461a67fa15 Vendor import of clang trunk r321017:
https://llvm.org/svn/llvm-project/cfe/trunk@321017
2017-12-18 20:11:37 +00:00
Warner Losh
328884aef7 Use -h -D in preference to -D so that the serial port gets the
interactive console rather than the video port. qemu has issues with X
on my mac at the moment and this is the easiest path forward.

Sponsored by: Netflix
2017-12-15 23:16:42 +00:00
Warner Losh
16457354e0 Be a little verbose and list the loader files we're putting on the
drive when making zfs roots as a sanity check for what's on there.
2017-12-15 23:16:37 +00:00
Warner Losh
9b544478b1 For now, make the gpart commands verbose so we know exactly what's
being installed.

Fix problem with gpt + zfs installing the wrong loader...

Sponsored by: Netflix
2017-12-15 23:16:27 +00:00
Warner Losh
502742f35a Add missing of=/dev/${dev}s${s} when installing zfsboot. 2017-12-15 06:44:11 +00:00
Warner Losh
082c6764e6 Script to generate minimal boot images for each of the 24 supported
boot images for x86. This will be enhanced to generate all the other
images (u-boot, powerpc CHRP, etc).

At the moment, it's only generating three of them. zfs+gpt+legacy
works with qemu:
	qemu-system-x86_64 --drive file=${file},format=raw -serial telnet::4444,server
but the ufs ones still have issues I'm tracking down.

These images are the boot blocks, /boot/loader, a kernel, maybe a
couple of modules, /sbin/init, /bin/sh, /libexec/ld-elf.so, libc.so,
libedit and libncursesw. This is just enough to get to single user. At
the moment, these come from the host system, but should come from
OBJTOP.

At the moment, this requires root to build since the zfs tools require
it (and GELI will too when we add support for that).

Sponsored by: Netflix
2017-12-15 06:34:27 +00:00
Warner Losh
cfc948287d Script that knows how to put boot blocks onto a device. Eventually,
this will be installed into /usr/sbin, but for now it's just used for
the boot loader regression script. It's still a bit green, and likely
will get edge cases wrong still. It's also x86 centric at the moment,
but will be enhanced shortly for u-boot, CHRP PowerPC and other
methods.

Sponsored by: Netflix
2017-12-15 06:34:11 +00:00
Conrad Meyer
b797f66c80 netmap pkt-gen tool: Fix memset(3) argument order
Submitted by:	Michael McConville <mmcco AT mykolab.com>
Sponsored by:	Dell EMC Isilon
2017-12-13 19:36:29 +00:00
Warner Losh
14382fcf29 Start adding commands that I know are good to build up residual
knowledge about qemu's quirks. Other qemu commands are possible, but
this is the quickest for testing.

Sponsored by: Netflix
2017-12-11 02:44:15 +00:00
Warner Losh
5b88c56a92 Add -I to just run the imaging part of nanobsd so you can test out
changes to the packaging part of nanobsd more easily, or experiment
with the image contents w/o regenerating a whole new image tree. This
can save minutes when you don't need to do the installworld /
installkernel, etc.

Sponsored by: Netflix
2017-12-11 02:44:10 +00:00
Warner Losh
36fe34c7c9 Fix the std-x86 layout to produce a bootable system. Due to
limitations in mkimg we're still not quite to where I'd like to be
(I'd like to put s3 first on the disk, then s1, but mkimg won't allow
that currently). However, the resulting image now boots with qemu using:

qemu-system-x86_64 -hdd $file -serial telnet::4444,server -nographic

We'll need tweaks to create a specialized /etc/rc.d/growfs that can
create a properly grown image for either the simple or ping-pong
cases, but that will be later. Switched to pure serial console (-h)
instead of video or serial (-P) since that fits this usecase better.

Sponsored by: Netflix
2017-12-11 02:43:56 +00:00
Warner Losh
cbde6ac324 Don't automatically create objdir here. We're just after the
TMPPATH. We'll make the paths later.

Sponsored by: Netflix
2017-12-08 21:59:50 +00:00
Warner Losh
7052e3fb73 Remove local here. It was a cut and paste error.
Sponsored by: Netflix
2017-12-08 21:59:42 +00:00