Commit Graph

52 Commits

Author SHA1 Message Date
Rebecca Cran
db8b561345 Rework UEFI ESP generation
Currently, the installer uses pre-created 800KB FAT12 filesystems that
it dd's onto the ESP partition.
This changeset improves that by having the installer generate a FAT32
filesystem directly onto the ESP using newfs_msdos and then copying
loader.efi into /EFI/freebsd.
For live installs it then runs efibootmgr to add a FreeBSD boot entry
in the BIOS.

Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D17947
2018-12-20 19:39:37 +00:00
Kyle Evans
f98c671d07 Update lualoader test script a little bit
Use userboot.so from the test directory if possible, fall back to .OBJDIR.
This avoids a problem that we've had since userboot coexistence was added,
where userboot.so alone no longer exists in the .OBJDIR but is instead just
a link installed later.
2018-10-25 02:04:01 +00:00
Marius Strobl
e94a7c27df Following r335259, don't copy boot1 from the running system for sparc64
either.
2018-08-23 22:57:42 +00:00
Warner Losh
1c70f60e23 also set multicons for tests 2018-07-27 21:50:10 +00:00
Ian Lepore
dfe34cea0f Make generated scripts executable. 2018-07-13 16:37:42 +00:00
Ian Lepore
394641cf3d More little fixes... fix a function name typo (eps vs esp), and cope with
newer versions of gpart that show mbr efi partition types with the name
'efi' rather than as '!239'.
2018-07-13 16:33:21 +00:00
Ian Lepore
7b4b55e520 Revert r336240, which contained unrelated changes accidentally committed. 2018-07-13 16:32:31 +00:00
Ian Lepore
0d55ac1622 More little fixes... fix a function name typo (eps vs esp), and cope with
newer versions of gpart that show mbr efi partition types with the name
'efi' rather than as '!239'.
2018-07-13 16:30:54 +00:00
Ian Lepore
e74c8ac80c Wee fix: $dev is passed in to the function with the /dev prefix already in
place, don't add it.
2018-07-12 17:22:25 +00:00
Warner Losh
c89deb8fcc Small refactor of install-boot
Use newfs_msdos to create the filesystem for the partition requested
and use loader.efi instead of boot1.efi.
2018-07-11 21:53:04 +00:00
Warner Losh
405111fde0 Remove armeb from the list of architectures we build for the boot
laoder testing scripts. It just adds to the build time, and will be
retired soon anyway, per discussions in freebsd-arch@ last month.
2018-07-09 18:02:23 +00:00
Ian Lepore
c7940ca2ad Fix the fstab entries for tests that have an efi partition in slice 1 and
put the rootfs on s2.
2018-07-03 16:07:04 +00:00
Ian Lepore
28acc09dc0 Doh! Commit the proper default values, not my local tweaks. 2018-07-02 22:59:29 +00:00
Ian Lepore
595deaf7f1 Move the passphrase and iteration count into variables.
This is purely to make it easier to tweak them locally; the machine I have
for testing takes forever to do 50,000 pw strengthening iterations, and
we're not testing the strength of geli's anti-pw-guessing logic here
(especially given that our test passphrase is "passphrase", except that
I tend to tweak that also, to 'x', because typing is hard).

Some day these should be settable as cmdline args.  But then, some day this
whole script should probably get a rewrite. :)
2018-07-02 22:58:04 +00:00
Ian Lepore
432b49211c Allow making just one flavor of boot-test image based on cmdline args. 2018-07-02 22:51:48 +00:00
Warner Losh
d050cd6b99 Switch to creating UEFI ESPs using loader.efi instead of boot1.efi.
Cope for the fact that laoder.efi, not being boot1, doesn't read
/boot.config by setting boot_serial and force the serial console.

Also add sysctl so we can display the boot method.

Provide a variable, do_boot1_efi, if you want to use boot1 for
testing. But since it's transient, it's just a variable and not
available on the command line.
2018-06-18 23:16:47 +00:00
Allan Jude
f438a1434e rootgen.sh: complete all profiles except GELI+MBR (not supported)
This extends the test suite to generate images for every combination of:
amd64: mbr/gpt geli/nogeli ufs/zfs legacy/uefi/both

Except for mbr+geli, which is not currently possible.

Reviewed by:	imp (previous version)
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D15846
2018-06-17 05:55:31 +00:00
Warner Losh
48cb46aaaf FreeBSD/amd64 requires 256MiB to boot UEFI, 128MB simply doesn't work.
128MiB still works for Legacy booting, however. Go ahead and do 256MiB
for all amd64 boxes, since the number of such boxes < 256MiB is
vanishingly small.
2018-06-17 02:49:42 +00:00
Allan Jude
4cbc23a925 rootgen.sh: Don't copy various bits of the bootcode from the running system
We want to use the versions of the bootcode we just built, rather than
ones from whatever happens to be in /boot on the test machine

These were incorrectly added by me in r334888
2018-06-16 17:45:44 +00:00
Allan Jude
712b4ca9ec Add ZFS+GPT EFI and LEGACY+EFI to rootgen.sh and installboot.sh
Reviewed by:	imp (maintainer)
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D15700
2018-06-09 17:49:43 +00:00
Allan Jude
2145d0ec65 Change rootgen.sh to use the default ZFS boot environment name
Reviewed by:	imp (maintainer)
Sponsored by:	Klara Systems
Differential Revision:	https://reviews.freebsd.org/D15699
2018-06-09 17:47:56 +00:00
Kyle Evans
ec88403d3f lua-lint: Hint that try_include is now an accepted global
try_include was added in r331563.
2018-03-26 19:08:19 +00:00
Kyle Evans
a284ff37fc lua-lint: Whitelist cli_execute_unparsed as a global 2018-03-07 18:41:16 +00:00
Kyle Evans
8960f9d7ad Add --globals printc to lua-lint
We provide a global 'printc' as of r330282; make luacheck aware of this fact
so that we can use it without complaints.
2018-03-02 16:51:43 +00:00
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
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
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
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
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
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
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
Warner Losh
4728f534ff Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI
Transition to WITH/WITHOUT_LOADER_GELI to flag support or not of GELI
in the boot loaders. Add HAVE_GELI so components can flag they need
support (since it's too large to include everywhere). Add temporary
warnings for the old forms to ease transition.

Also, update test script to build without GELI on x86.

Sponsored by: Netflix
2017-11-10 23:54:48 +00:00
Warner Losh
a179cd9114 Replace LOADER_FIREWIRE_SUPPORT variable
Rename LOADER_FIREWIRE_SUPPORT to MK_LOADER_FIREWIRE. Only build
libfirewire when this is "yes". Add note to updating. Fix build script
to build this for x86 so the option doesn't decay. sparc64 supports
ZFS, so also build it MK_ZFS=no.

Sponsored by: Netflix
2017-11-10 23:54:41 +00:00
Warner Losh
36f1c58dc5 Fix parallel build issues and add MK_ZFS=no case
To ensure that I don't break the MK_ZFS=no case (currently working),
add that to the build, at least for i386 and amd64. Also, out of an
abundance of caution, clean single threaded, and then build in a
separate make. Otherwise, I hit a race where we build before objdir
has been created, which breaks at the moment.

Sponsored by: Netflix
2017-10-30 03:12:34 +00:00