summaryrefslogtreecommitdiff
path: root/stand
Commit message (Collapse)AuthorAgeFilesLines
* lualoader: fix lua-lint runKyle Evans2020-12-171-1/+1
| | | | | | | | | | | luacheck rightfully complains that i is unused in the show-module-options loop at the end (it was used for some debugging in the process). We've added a new pager module that's compiled in, so declare that as an acceptable global. Notes: svn path=/head/; revision=368729
* lualoader: cli: provide a show-module-options loader commandKyle Evans2020-12-174-2/+91
| | | | | | | | | | | | | This effectively dumps everything lualoader knows about to the console using the libsa pager; that particular lua interface was added in r368591. A pager stub implementation has been added that just dumps the output as-is as a compat shim for older loader binaries that do not have lpager. This stub should be moved into a more appropriate .lua file if we add anything else that needs the pager. Notes: svn path=/head/; revision=368728
* Drop EFI_STAGING_SIZE back down to 64MWarner Losh2020-12-171-3/+1
| | | | | | | | | | | vmware can't cope with anything larger than 64MB. Drop this back to 64MB everywhere but arm. PR: 251866 MFC After: 1 week Notes: svn path=/head/; revision=368721
* loader: allow loader to accept zfs feature com.delphix:bookmark_writtenToomas Soome2020-12-151-0/+1
| | | | | | | | | We do not need to actually read bookmarks, just whitelist this feature. Reported by: mjg Notes: svn path=/head/; revision=368684
* loader: allow loader to accept zfs feature com.datto:bookmark_v2Toomas Soome2020-12-151-0/+1
| | | | | | | | | We do not need to actually read bookmarks, just whitelist this feature Reported by: jpaetzel Notes: svn path=/head/; revision=368677
* loader: Ignore the .interp section on RISC-VJessica Clarke2020-12-141-0/+1
| | | | | | | | | | | | | | Without this we risk having the .interp section be placed earlier in the file and mess with section offsets; in particular it has been seen to be placed at the start of the file and cause the PE/COFF header to not be at address 0. This is the same fix as was done for arm64 in r365578. Reviewed by: mhorne, imp Approved by: mhorne, imp Differential Revision: https://reviews.freebsd.org/D27603 Notes: svn path=/head/; revision=368626
* loader: Print autoboot countdown immediately, not at 9Jessica Clarke2020-12-141-2/+3
| | | | | | | | | | | | | | For the first second otime and ntime are equal so no message gets printed. Instead we should print the countdown right from the start, although we do it at the end of the first iteration so that if a key has already been pressed then the message is suppressed. Reviewed by: imp Approved by: imp Differential Revision: https://reviews.freebsd.org/D26935 Notes: svn path=/head/; revision=368623
* stand: liblua: add a pager moduleKyle Evans2020-12-124-1/+92
| | | | | | | | | | | | | | | This is nearly a 1:1 mapping of the pager API from libsa. The only real difference is that pager.output() will accept any number of arguments and coerce all of them to strings for output using luaL_tolstring (i.e. the __tostring metamethod will be used). The only consumer planned at this time is the upcoming "show-module-options" implementation. MFC after: 1 week Notes: svn path=/head/; revision=368591
* lualoader: config: fix module enabled checkKyle Evans2020-12-121-1/+1
| | | | | | | | A last minute rewrite left this logically wrong; if it's present in modules_blacklist, then we do not load it. Notes: svn path=/head/; revision=368579
* lualoader: provide module-manipulation commandsKyle Evans2020-12-124-10/+129
| | | | | | | | | | | | | | | | | | Specifically, we have: - enable-module - disable-module - toggle-module These can be used to add/remove modules to be loaded or force modules to be loaded in spite of modules_blacklist. In the typical case, a user is expected to use them to recover an issue happening due to a module directive they've added to their loader.conf or because they discover that they've under-specified what to load. MFC after: 1 week Notes: svn path=/head/; revision=368575
* Properly define the bool type in the BSD kernel shim.Hans Petter Selasky2020-12-071-1/+6
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=368415
* loader: xdr_array is missing countToomas Soome2020-12-071-120/+245
| | | | | | | | | | | The integer arrays are encoded in nvlist as counted array <count, i0, i1...>, loader xdr_array() is missing the count. This will affect the pool import when there are hole devices in pool. Also fix the new data add and print functions. Notes: svn path=/head/; revision=368410
* Add missing busdma prototypes for load and unload and implement dummy syncHans Petter Selasky2020-12-072-4/+21
| | | | | | | | | | function for kernel bootloader shim code. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=368408
* Tidy up code a bit. Add missing section comments.Hans Petter Selasky2020-12-071-12/+20
| | | | | | | | | | No functional change. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=368407
* Add CFI start/end proc directives to arm64, i386, and ppcConrad Meyer2020-12-053-0/+16
| | | | | | | | | | | | | | Follow-up to r353959 and r368070: do the same for other architectures. arm32 already seems to use its own .fnstart/.fnend directives, which appear to be ARM-specific variants of the same thing. Likewise, MIPS uses .frame directives. Reviewed by: arichardson Differential Revision: https://reviews.freebsd.org/D27387 Notes: svn path=/head/; revision=368354
* Fix mis-spelled macro in the kernel shim.Hans Petter Selasky2020-12-041-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=368341
* Add more macros, types and prototypes for building kernel code into bootloaders.Hans Petter Selasky2020-12-041-1/+17
| | | | | | | | MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=368330
* Fix definition of int64_t and uint64_t when long is 64-bit. This gets the kernelHans Petter Selasky2020-12-041-0/+8
| | | | | | | | | | shim code in line with the rest of the kernel, sys/x86/include/_types.h. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=368329
* ficl: make dump a bit friendlierToomas Soome2020-12-011-6/+32
| | | | | | | would be nice to have dump to output hex and ascii. Notes: svn path=/head/; revision=368266
* ficl: instead of pad, emit can use local variableToomas Soome2020-12-011-1/+1
| | | | | | | | | Pad in forth is used as "scratchpad" and internal implementations should not use it. Ficl does not really follow this rule and this can fire back. emit has no need to use pad, we can use local variable instead. Notes: svn path=/head/; revision=368261
* Unobfuscate "KERNLOAD" parameter on amd64. This change lines-up amd64 with theMaxim Sobolev2020-11-251-5/+3
| | | | | | | | | | | | | | | | | i386 and the rest of supported architectures by defining KERNLOAD in the vmparam.h and getting rid of magic constant in the linker script, which albeit documented via comment but isn't programmatically accessible at a compile time. Use KERNLOAD to eliminate another (matching) magic constant 100 lines down inside unremarkable TU "copy.c" 3 levels deep in the EFI loader tree. Reviewed by: markj Approved by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D27355 Notes: svn path=/head/; revision=368041
* Fix build of USB bootloader code by adding checks for _STANDALONE being defined.Hans Petter Selasky2020-11-181-2/+5
| | | | | | | | | | Currently the USB bootloader code is not part of buildworld. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367787
* zfsboot: add prototype for main()Toomas Soome2020-11-151-0/+2
| | | | | | | | | | Some compilers are complaining about missing prototype. PR: 251150 Reported by: markiyan.kushnir@gmail.com Notes: svn path=/head/; revision=367710
* loader: cstyle cleanup of console.cToomas Soome2020-11-141-173/+187
| | | | | | | cstyle cleanup only, no functional changes intended. Notes: svn path=/head/; revision=367674
* loader: cstyle cleanup of bootstrap.h did miss a bitToomas Soome2020-11-081-3/+3
| | | | | | | correct small issues - misplaced comment and typos. Notes: svn path=/head/; revision=367480
* loader: cstyle cleanup of bootstrap.hToomas Soome2020-11-081-119/+133
| | | | | | | No functional changes intended. Notes: svn path=/head/; revision=367479
* loader: add aarch64 support for zstdWarner Losh2020-10-281-2/+0
| | | | | | | | | | | | | | | | | | We don't have NEON available in the boot loader, so we have to disable it. OpenZFS included ZSTD which used the wrong symbol to bring in neon support. Change to use the code that's been submitted upstream as a pull request to both. __ARM_NEON is the proper symbol, defined in ARM C Language Extensions Release 2.1 (https://developer.arm.com/documentation/ihi0053/d/). Some sources suggest __ARM_NEON__, but that's the obsolete spelling from prior versions of the standard. OpenZFS Pull Request: https://github.com/openzfs/zfs/pull/11055 ZSTD Pull Request: https://github.com/facebook/zstd/pull/2356 Notes: svn path=/head/; revision=367119
* loader: revert r342161 and r342151Toomas Soome2020-10-221-18/+4
| | | | | | | | | | We are using asize property from pool label and we do not depend on partition data to find last two pool labels and to validate LBA for disk IO. This does allow us to re-enable support for partitionless disk setups. Notes: svn path=/head/; revision=366951
* Add 'netserver' command to EFI loader.Michal Meloun2020-10-141-0/+35
| | | | | | | | | | | | | | | | | | In some environments is difficult to access bootp/dhcp configuration as "standard user". Add a command that allows to set or display the URI of the network server used as "net:" device. Currently only tftp and nfs protocols are supported. Typical usage pattern is: netserver tftp://192.168.168.1/path_to_obj_dir/arm.armv7/sys/GENERIC/ boot net:kernel Reviewed by: imp, kevans MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D26736 Notes: svn path=/head/; revision=366700
* Use adrp in the arm64 efi loaderAndrew Turner2020-10-131-5/+10
| | | | | | | | | | | | | | | | | On startup the arm64 efi loaders need to know PC-relative addresses. Previously we used the adr instruction to find this address, however this instruction is limited to +/- 1MiB. Switch to adrp to find the 4k page the address is within and an add to set the bottom 12 bits. This lets us address +/- 4GiB which should be large enough for now. Reported by: imp MFC after: 2 weeks Sponsored by: Innovate UK Notes: svn path=/head/; revision=366670
* Force __BMI__ experimental instructions off.Warner Losh2020-10-131-0/+1
| | | | | | | | | | | | The OpenZFS code that uses the BMI instructions is broken. Forcibly disable them to prevent their use. When enabled, the build breaks. This fixes the build when compiled for a core with BMI instructions. This is the same fix committed in r364777, for the same issue. Submitted by: Jung-uk Kim Notes: svn path=/head/; revision=366660
* Add back org.freebsd:zstd_compress to features_for_readWarner Losh2020-10-131-2/+0
| | | | | | | | This list is the of features that are allowed on the whole pool, not the list of features that are implemented. Notes: svn path=/head/; revision=366659
* Turn off zstd on aarch64Warner Losh2020-10-132-1/+11
| | | | | | | | loader support for zstd and zfs doesn't work for aarch64. Disable it to unbreak the build. Notes: svn path=/head/; revision=366658
* Add zstd support to the boot loader.Warner Losh2020-10-124-3/+66
| | | | | | | | | | | | | | | Add support to the _STANDALONE environment enough bits of the kernel that we can compile it. We still have a small zstd_shim.c since there were 3 items that were a bit hard to nail down and may be cleaned up in the future. These go hand in hand with a number of commits to sys/sys in the past weeks, should this need be MFCd. Discussed with: mmacy (in review and on IRC/Slack) Reviewed by: freqlabs (on openzfs repo) Differential Revision: https://reviews.freebsd.org/D26218 Notes: svn path=/head/; revision=366657
* Link efi programs with -pie rather than -sharedAlex Richardson2020-10-122-2/+2
| | | | | | | | | | | This was causing build failures in CheriBSD where we were passing -pie already by default. Reviewed By: andrew Differential Revision: https://reviews.freebsd.org/D24787 Notes: svn path=/head/; revision=366644
* loader: edd_device_path_v3 is too smallToomas Soome2020-10-121-18/+1
| | | | | | | | | | | | | | | The EDD v3[1], see table 13, page 33, does define device path as double qword, that is, 16 bytes, we have only qword. Also remove edd_device_path_v4 and edd_params_v4 because those are not used, and there is no size difference in v3 versus v4. [1] http://www.t13.org/documents/UploadedDocuments/docs2004/d1572r3-EDD3.pdf MFC after: 2 weeks Notes: svn path=/head/; revision=366631
* Fix a few mandoc issuesGordon Bergling2020-10-093-10/+16
| | | | | | | | | | | | - whitespace at end of input line - skipping paragraph macro: Pp at the end of Sh - new sentence, new line - consider using OS macro: Fx - AUTHORS section without An macro - skipping paragraph macro: Pp before Ss Notes: svn path=/head/; revision=366575
* lualoader: improve the design of the brand-/logo- mechanismKyle Evans2020-10-047-138/+171
| | | | | | | | | | | | | | | | | | | | | | | | In the previous world order, any brand/logo was forced to pull in the drawer and call drawer.add{Brand,Logo} with the name their brand/logo is taking and a table describing it. In the new world order, these files just need to return a table that maps out graphics types to a table of the exact same format as what was previously being passed back into the drawer. The appeal here is not needing to grab a reference back to the drawer module and having a cleaner data-driven looking format for these. The format has been renamed to 'gfx-*' prefixes and each one can provide a logo and a brand. drawer.addBrand/drawer.addLogo will remain in place until FreeBSD 13, as there's no overhead to them and it's not yet worth the break in compatibility with any pre-existing brands and logos. Reviewed by: freqlabs MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24966 Notes: svn path=/head/; revision=366435
* Correct the documented size of kern.msgbufsizeMateusz Piotrowski2020-10-021-2/+2
| | | | | | | | | | | The correct value is 96KB after r226090. PR: 249971 Submitted by: johannes@jo-t.de MFC after: 3 days Notes: svn path=/head/; revision=366364
* lualoader: clear up some luacheck warningsKyle Evans2020-10-013-4/+4
| | | | | | | | | | | - One (1) unused argument - One (1) trailing whitespace - Two (2) "non-standard global" (curenv, rewind) tools/boot/lua-lint.sh is once again happy. Notes: svn path=/head/; revision=366314
* Implement some time variables from kernelWarner Losh2020-09-292-0/+38
| | | | | | | | | OpenZFS will start using some of the kernel timekeeping bits shortly. This implements the bare minimum of that which currently is just the time_seconds variable. Notes: svn path=/head/; revision=366260
* Report the kernel console on the boot screenWarner Losh2020-09-282-0/+45
| | | | | | | | | | | | | | | | | | | | | | | Report what console the boot loader is telling the kernel to use: o Dual (Serial Primary) o Dual (Video Primary) o Serial o Video This allows the user to interrupt the boot and tweak the cosnole, if needed, in a trivial way. Useful for installs where the default selected may not be quite what you want, or when you are running a dual setup and need to toggle over to the other console being primary. The 'c'/'C' keys will do the cycling through the consoles. Note: you'll still have to drop into the loader to set details about serial consoles. And this doesn't change the console the loader is using. Reviewed by: kevans@ MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D26573 Notes: svn path=/head/; revision=366228
* Fix video on PCI heuristicWarner Losh2020-09-281-2/+4
| | | | | | | | | | | | | | | | | | The video on PCI heuristic was broken. It was supposed to infer a video device when the last element of the path was a PCI DEVICE PATH node. However, the last node in the device path is an END node, so this heuristic never fired. This leads, among other things, to bhyve only producing output in the serial connection once we leave the boot loader. This restores the dual headed boot on bhyve + UEFI (as we did in 11.2), but will favor serial in the absence of other config which may be a change from 11.2. MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D26572 Notes: svn path=/head/; revision=366216
* loader: fix non-zfs buildToomas Soome2020-09-233-1/+5
| | | | | | | | | We can not include zfs headers while building without zfs. Reported by: Oscar Holmlund Notes: svn path=/head/; revision=366087
* loader: zfs_probe_dev should pick first matching zfs poolToomas Soome2020-09-232-2/+4
| | | | | | | | | | | | | | | | | | During devswitch probe, we pick boot pool based on boot disk, if the boot disk happens to have multiple pools in freebsd-zfs partitions, the current code does pick last pool from boot disk as boot pool. While there is no way at that stage to test, the more logical approach would be to pick first matching pool. This patch is assuming we do pass pool guid pointer with guid value 0, this will help us to determine, if the guid value is already set or not. The general suggestion would be not to share disk between different pools. Reported by: Alexander Leidinger Notes: svn path=/head/; revision=366066
* Work around cp breakage in current from last weekWarner Losh2020-09-232-2/+2
| | | | | | | | | | | | | | | There was a small window cp was broken. Work around this by using :> instead of cp /dev/null. Ideally, we'd keep the cp /dev/null in the build as a regression test, but doing so breaks people that upgraded during the cp breakage and this is simpler than bootstrapping a working cp since there's no good __FreeBSD_version sign posts for that. Suggested by: lots of people Too stubborn for his own good: imp Notes: svn path=/head/; revision=366042
* [PowerPC64LE] Set up powerpc.powerpc64le architectureBrandon Bergren2020-09-221-4/+4
| | | | | | | | | | | | | | | | | | This is the initial set up for PowerPC64LE. The current plan is for this arch to remain experimental for FreeBSD 13. This started as a weekend learning project for me and kinda snowballed from there. (More to follow momentarily.) Reviewed by: imp (earlier version), emaste Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D26399 Notes: svn path=/head/; revision=366032
* Tweak ficl definition from r365724Brandon Bergren2020-09-221-1/+1
| | | | | | | | | | | | | | I had overthought how to do the FICL_TRUE change. We do not need to explicitly specify how big the 0 is before the cast to the correct size. The same change was suggested by both imp@ and Gunther Nikl independently. Tested on powerpc. Reported by: imp, Gunther Nikl Notes: svn path=/head/; revision=366029
* stand/reloc_elf: Handle relative relocations for arm{,64} and riscvD Scott Phillips2020-09-211-1/+10
| | | | | | | | | | | | | | | Extend the powerpc relative relocation handling from r240782 to a handful of other architectures. This is needed to properly read dependency information from kernel modules. Reviewed by: jhb Approved by: scottl (implicit) MFC after: 1 week Sponsored by: Ampere Computing, Inc. Differential Revision: https://reviews.freebsd.org/D26365 Notes: svn path=/head/; revision=365982
* loader: zfs should support bootonce an nextbootToomas Soome2020-09-2125-494/+2803
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bootonce feature is temporary, one time boot, activated by "bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag. By default, the bootonce setting is reset on attempt to boot and the next boot will use previously active BE. By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will be set permanently active. bootonce dataset name is recorded in boot pool labels, bootenv area. in case of nextboot, the nextboot_enable boolean variable is recorded in freebsd:nvstore nvlist, also stored in boot pool label bootenv area. On boot, the loader will process /boot/nextboot.conf if nextboot_enable is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf processing on next boot. bootonce and nextboot features are usable in both UEFI and BIOS boot. To use bootonce/nextboot features, the boot loader needs to be updated on disk; if loader.efi is stored on ESP, then ESP needs to be updated and for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated (gpart or other tools). At this time, only lua loader is updated. Sponsored by: Netflix, Klara Inc. Differential Revision: https://reviews.freebsd.org/D25512 Notes: svn path=/head/; revision=365938