Commit Graph

4392 Commits

Author SHA1 Message Date
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
Warner Losh
ac20456c39 Build WITHOUT_FORTH too, at least for amd64 and i386
Sponsored by: Netflix
2017-12-08 19:57:21 +00:00
Warner Losh
1f99cce2b0 Just use the last line of the output from getting .OBJDIR. The
buildenv target prints other stuff too that needs to be ignored.

Sponsored by: Netflix
2017-12-04 16:38:20 +00:00
Warner Losh
02cfd60482 Remove the entire objdir tree to avoid picking up stale binaries from
prior builds. Move GELI to building first.

Sponsored by: Netflix
2017-12-04 01:14:17 +00:00
Dimitry Andric
d4419f6fa8 Upgrade our copies of clang, llvm, lldb and libc++ to r319231 from the
upstream release_50 branch.  This corresponds to 5.0.1 rc2.

MFC after:	2 weeks
2017-12-03 12:14:34 +00:00
Eitan Adler
efea29ab90 diag/httpd-error: remove
This is a script for a web server in a specific
configuration. Current web servers don't produce
similar log files and it isn't FreeBSD's
goal to produce a log file analyzer.
2017-12-02 17:10:13 +00:00
Dimitry Andric
b5ea630dfd Vendor import of clang release_50 branch r319231:
https://llvm.org/svn/llvm-project/cfe/branches/release_50@319231
2017-12-02 12:46:48 +00:00
Pedro F. Giffuni
64de3fdd58 SPDX: use the Beerware identifier. 2017-11-30 20:33:45 +00:00
Brad Davis
a812deb1f2 Fix handling -U. It does not take any arguments.
Approved by:	will
2017-11-27 02:28:40 +00:00
Pedro F. Giffuni
8a16b7a18f General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2017-11-20 19:49:47 +00:00
Pedro F. Giffuni
df57947f08 spdx: initial adoption of licensing ID tags.
The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

Initially, only tag files that use BSD 4-Clause "Original" license.

RelNotes:	yes
Differential Revision:	https://reviews.freebsd.org/D13133
2017-11-18 14:26:50 +00:00
Hans Petter Selasky
ea4fe0b6a2 Improve the library dependencies helper script in src/tools.
Implement double pass of the relevant Makefiles. First make a list of
library names and directories and then scan for all the dependencies.
Spaces in directories in the source tree are not supported.

This avoids using hardcoded mappings between the library name
and the directory containing the library Makefile.

Add support for scanning contrib/ofed .

Bail out on any errors.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
2017-11-16 15:26:39 +00:00
Warner Losh
ca987d4641 Move sys/boot to stand. Fix all references to new location
Sponsored by:	Netflix
2017-11-14 23:02:19 +00:00