summaryrefslogtreecommitdiff
path: root/stand
Commit message (Collapse)AuthorAgeFilesLines
...
* [PowerPC] Remove obsolete MK_LOADER_FORCE_LEBrandon Bergren2020-09-151-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | In D12421, the ability to compile stand/ in little-endian was added, with the intention to extend loader.kboot to run in Petitboot. However, no further work was done, as the kernel then gained self-execution capabilities as Petitboot was taught to load FreeBSD kernels directly. The FreeBSD installer on powerpc64 (on POWER8 and POWER9) uses /boot/etc/kboot.conf instead of loader. As this option does nothing but cause stand/ to be miscompiled and actively causes confusion, remove it. (I have a functioning petitboot loader in my local tree, however, it turned out to be quite inconvient to use due to the current petitboot plugin design so I put it on hold.) Reviewed by: emaste, imp, jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D26430 Notes: svn path=/head/; revision=365739
* stand/ficl 64-bit compatibilityBrandon Bergren2020-09-143-5/+8
| | | | | | | | | | | | | | | | | | | Currently, the only thing that prevents a functioning 64-bit FICL build is a few integer types that were intended to be fixed-width. Changing them to C99 integer types allows building a functioning 64-bit FICL. While this isn't applicable to the default settings of any in-tree loaders, it is necessary for a future Petitboot loader, due to the requirement that it be compiled as a 64-bit program. Reviewed by: tsoome, imp (earlier revision) Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D26364 Notes: svn path=/head/; revision=365724
* Only set WARNS if not definedKyle Evans2020-09-113-3/+3
| | | | | | | | | | | | | This would allow interested parties to do experimental runs with an environment set appropriately to raise all the warnings throughout the build; e.g. env WARNS=6 NO_WERROR=yes buildworld. Not currently touching the numerous instances in ^/tools. MFC after: 1 week Notes: svn path=/head/; revision=365631
* Ignore the .interp section in the arm64 EFI loaderAndrew Turner2020-09-101-0/+1
| | | | | | | | | | | | When building the loader an unneeded .interp section may be added. Move this to the unused section region so offsets of used sections don't change. Obtained from: CheriBSD Sponsored by: Innovate UK Notes: svn path=/head/; revision=365578
* stand/efihttp: Work around a bug in edk2 http instance reconfigurationD Scott Phillips2020-09-091-0/+16
| | | | | | | | | | | | | | | | | | | A bug in the EFI HTTP driver of TianoCore EDK2 causes memory corruption when an http instance that uses tls is reconfigured, leading to a crash. Work around this by forcing a new http instance for each request instead of reconfiguring the existing one. The upstream bug report is https://bugzilla.tianocore.org/show_bug.cgi?id=1917 Submitted by: bcran Reviewed By: imp, kevans, tsoome MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21281 Notes: svn path=/head/; revision=365505
* Fix 64-bit build of libofw.Brandon Bergren2020-09-081-10/+10
| | | | | | | | | | | | | | Adjust a couple of printf() lines that deal with dumping out addresses to cast to uintmax_t. This allows building a 64-bit libofw for use in things like a future Petitboot loader for PowerPC64, and other FDT platforms that require a 64-bit loader binary and want to use forth. Sponsored by: Tag1 Consulting, Inc. Notes: svn path=/head/; revision=365483
* Quiet int-to-pointer-cast warnings on i386 with GCC 9.John Baldwin2020-09-041-2/+2
| | | | | | | | Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D26200 Notes: svn path=/head/; revision=365318
* Update to today's dateWarner Losh2020-09-011-3/+1
| | | | | | | Also, fix a whitespace botch Notes: svn path=/head/; revision=365027
* Add defines for OpenZFS variablesWarner Losh2020-09-011-0/+3
| | | | | | | | | | | OZFS is the top of the OpenZFS tree (aka src/sys/contrib/openzfs). ZFSOSSRC is the path to the OepnZFS sources ZFSOSINC is the path to the OepnZFS includes MFC After: 3 days Notes: svn path=/head/; revision=365026
* Very preliminary loader.efi(8) man pageWarner Losh2020-09-012-0/+55
| | | | Notes: svn path=/head/; revision=365025
* Document boot1.efiWarner Losh2020-09-012-0/+102
| | | | | | | Crude man page for boo1.efi. Notes: svn path=/head/; revision=365024
* zalloc_malloc:Free hexdump preceeding buffer when we detect overflowSimon J. Gerraty2020-08-297-45/+96
| | | | | | | | | | | | | | | Move hexdump from stand/common/misc.c to stand/libsa/hexdump.c (svn cp) Disable use of pager - causes linking issue for boot1 can be re-enabled by defining HEXDUMP_PAGER. Reviewed by: stevek, imp MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D26235 Notes: svn path=/head/; revision=364965
* Create CFLAGS_EARLY.file for boot loader.Warner Losh2020-08-281-0/+5
| | | | | | | | | | | | | | | | | | Some external code requires a specific set of include paths to work properly since it emulates the typical environment the code is used in. Enable this by creating a CFLAGS_EARLY.file variable that can be used to build this stack. Otherwise the include stack we build for stand programs may get in the way. Code that uses this feature has to tolerate the normal stack of inclues being last on the list (and presumably unused), though. Generally, it it should only be used for the specific include directories. Defines and that sort of thing should be done in the normal CFLAGS variable. There is a global CFLAGS_EARY hook as well for everything in a Makefile. Notes: svn path=/head/; revision=364924
* Declare time()Warner Losh2020-08-281-0/+5
| | | | | | | | Time is used and was accidentally brought in through header pollution. Declare it in stand.h directly instead. Notes: svn path=/head/; revision=364901
* ZFS: remove duplicate "com.datto:encryption" from loaderMatt Macy2020-08-271-1/+0
| | | | Notes: svn path=/head/; revision=364893
* libsa: only skein_block.c is using SKEIN_LOOPToomas Soome2020-08-261-2/+2
| | | | | | | Only use SKEIN_LOOP while compiling skein_block.c Notes: svn path=/head/; revision=364827
* ZFS: whitelist zstd and encryption in the loaderMatt Macy2020-08-251-0/+2
| | | | | | | | | | Please note that neither zstd nor encryption is supported by the loader at this instant. This change makes it safe to use those features in one's root pool, but not in one's root dataset. Notes: svn path=/head/; revision=364787
* Fix userboot after r364355Matt Macy2020-08-251-1/+1
| | | | | | | | r364355 replaced init_zfs_bootenv with init_zfs_boot_options and neglected to update userboot in the process. Notes: svn path=/head/; revision=364773
* Avoid adding duplicates to SRCS/OBJS/SOBJS/POBJSAlex Richardson2020-08-241-1/+0
| | | | | | | | | | | | | | | | | This is a change in preparation for stopping to use lorder.sh (D26044) and instead assume that we have a linker newer than ~1990. Without lorder.sh duplicates end up being passed to the linker when building .so files and this can result in duplicate symbol definition errors. There is one minor change: libcompiler_rt.a will no longer provide gcc_personality_v0 and instead we now only have it in libgcc_eh.a/libgcc_s.so. This matches GCC's behaviour. Reviewed By: emaste, cem Differential Revision: https://reviews.freebsd.org/D26042 Notes: svn path=/head/; revision=364649
* When we have a command returned by zfs_nextboot() that is longerGleb Smirnoff2020-08-201-1/+6
| | | | | | | | | | | | | than command in the loader.conf, the latter needs to be nul terminated, otherwise garbage trailer left from zfs_nextboot() will be passed to parse_cmd() together with loader.conf command. While here, reset cmd to empty string if read() returns error. Reviewed by: tsoome Notes: svn path=/head/; revision=364441
* libsa: smbios: Parse the chassis type and export it as smbios.chassis.typeEmmanuel Vadot2020-08-201-0/+85
| | | | | | | | | | | | It can be useful to know what type of machine we are running on for desktop related thing. It also allow us to support all the DMI variable that linux driver can fetch. MFC after: 1 week Sponsored by: Sponsored-by: The FreeBSD Foundation Notes: svn path=/head/; revision=364421
* libsa: remove leftover whitespaceToomas Soome2020-08-191-1/+1
| | | | | | | Tiny cleanup, no functional changes. Notes: svn path=/head/; revision=364408
* libsa: make env_discard() publicToomas Soome2020-08-192-3/+2
| | | | | | | Allow env_discard() to be used outside environment.c Notes: svn path=/head/; revision=364398
* libsa: cstyle cleanup for environment.cToomas Soome2020-08-191-119/+118
| | | | | | | No functional changes. Notes: svn path=/head/; revision=364397
* zfs: add an option to the bootloader to rewind the ZFS checkpointMariusz Zaborski2020-08-187-81/+212
| | | | | | | | | | | | | | | | | | The checkpoints are another way of keeping the state of ZFS. During the rewind, the pool has to be exported. This makes checkpoints unusable when using ZFS as root. Add the option to rewind the ZFS checkpoint at the boot time. If checkpoint exists, a new option for rewinding a checkpoint will appear in the bootloader menu. We fully support boot environments. If the rewind option is selected, the boot loader will show a list of boot environments that existed before the checkpoint. Reviewed by: tsoome, allanjude, kevans (ok with high-level overview) Differential Revision: https://reviews.freebsd.org/D24920 Notes: svn path=/head/; revision=364355
* Fix stand/newvers.sh with zsh in sh modeAlex Richardson2020-08-121-2/+4
| | | | | | | | | | | | When building on macOS with sh==zsh, newvers.sh was producing an unterminated string literal due to \\n being turned as a newline. Fix this by using a here document instead. Reviewed By: imp Differential Revision: https://reviews.freebsd.org/D26036 Notes: svn path=/head/; revision=364167
* Allow overriding the tool used for stripping binariesAlex Richardson2020-08-111-1/+1
| | | | | | | | | | | | | | | | | | | Since the make variable STRIP is already used for other purposes, this uses STRIPBIN (which is also used for the same purpose by install(1). This allows using LLVM objcopy to strip binaries instead of the in-tree elftoolchain objcopy. We make use of this in CheriBSD since passing binaries generated by our toolchain to elftoolchain strip sometimes results in assertion failures. This allows working around https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248516 by specifying STRIPBIN=/path/to/llvm-strip Obtained from: CheriBSD Reviewed By: emaste, brooks Differential Revision: https://reviews.freebsd.org/D25988 Notes: svn path=/head/; revision=364119
* stand: use portable ln -n instead of ln -hAlex Richardson2020-08-061-1/+1
| | | | | | | | | This fixes the build on Linux Differential Revision: https://reviews.freebsd.org/D24783 Notes: svn path=/head/; revision=363993
* Fix compilation error for install.c in loaderStephen J. Kiernan2020-07-311-5/+1
| | | | | | | | | | | | | Fix typo in interp_include() invocation (missing 'p') Remove setting tftpip, as servip is used by the tftp code in libsa. There is no separate tftpip global variable any more. Obtained from: Juniper Networks, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25897 Notes: svn path=/head/; revision=363738
* loader: Avoid -Wpointer-to-int cast warnings for Arm and RISC-VJessica Clarke2020-07-262-2/+2
| | | | | | | | | | | | | | | | | On RISC-V, Clang warns with: cast to smaller integer type 'unsigned int' from 'void (*)(void *)' Instead, use %p as the standard format specifier for printing pointers. Whilst Arm's pointer size is the same as unsigned, it's still cleaner to use the right thing there too. Reviewed by: brooks (mentor), emaste Approved by: brooks (mentor), emaste Differential Revision: https://reviews.freebsd.org/D25718 Notes: svn path=/head/; revision=363572
* Revert that!Simon J. Gerraty2020-07-192-12/+3
| | | | Notes: svn path=/head/; revision=363351
* Oops missed Makefile.configSimon J. Gerraty2020-07-192-3/+12
| | | | Notes: svn path=/head/; revision=363350
* loader: cstyle cleanupToomas Soome2020-07-191-229/+250
| | | | | | | | | No functional changes intended. Sponsored by: Netflix, Klara Inc. Notes: svn path=/head/; revision=363318
* Really fix cleandir after r362973Mitchell Horne2020-07-141-1/+2
| | | | | | | | | | | | | | | | | | I made an attempt to fix this in r362978, but all it really did was confine the issue to the $MACHINE_CPUARCH == "riscv" case. The real problem is that LINKER_FEATURES is not defined here, so bsd.linker.mk needs to be included. This error with cleandir only occurs when META_MODE is disabled, which explains why it was missed by both CI and myself. Note that this effectively reverts r362978. Reported by: mjg Reviewed by: imp, kevans (in IRC) Notes: svn path=/head/; revision=363197
* Loader: explain the syntax of currdevAllan Jude2020-07-131-3/+9
| | | | | | | | | | | | | | The origin text was: "Syntax for devices is odd." That is not very helpful. PR: 199103 Reviewed by: kevans, tsoome Sponsored by: Klara Inc. Event: July 2020 Bugathon Differential Revision: https://reviews.freebsd.org/D25629 Notes: svn path=/head/; revision=363139
* loader: implement GELI writesToomas Soome2020-07-116-46/+85
| | | | | | | | | | | | | Bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247482 This patch is based on initial work from allanjude. PR: 247482 Obtained from: https://reviews.freebsd.org/D10236 Differential Revision: https://reviews.freebsd.org/D25605 Notes: svn path=/head/; revision=363090
* Properly backout r362998Warner Losh2020-07-101-4/+4
| | | | | | | | | | Correct a small mistake in r363060's backaout of r362998 by reverse-applying r362998 by hand to loader.conf. Differential Revision: https://reviews.freebsd.org/D25606 Notes: svn path=/head/; revision=363063
* Revert r362998, r326999 while a better compatibility strategy is devised.Scott Long2020-07-091-1/+1
| | | | Notes: svn path=/head/; revision=363060
* loader: setting vdev size based on label asize is not workingToomas Soome2020-07-091-4/+54
| | | | | | | | | | | | Because we need to read asize from vdev_tree. We also need to consider different vdev type difference. Reviewed by: allanjude Sponsored by: Netflix, Klara Inc. Differential Revision: https://reviews.freebsd.org/D25586 Notes: svn path=/head/; revision=363042
* Fix a example/docs typo from r362998, no functional change.Scott Long2020-07-071-1/+1
| | | | Notes: svn path=/head/; revision=362999
* Migrate the feature of excluding RAM pages to use "excludelist"Scott Long2020-07-071-4/+4
| | | | | | | | | as its nomenclature. MFC after: 1 week Notes: svn path=/head/; revision=362998
* loader: geli_dev_ioctl does return huge mediasizeToomas Soome2020-07-071-1/+1
| | | | | | | | | | | The DIOCGMEDIASIZE is calculated md->md_sectorsize * md->md_provsize, and for boot disk, the md_sectorsize is 4k. However, the md_provsize is already in units of bytes. Sponsored by: Netflix, Klara Inc. Notes: svn path=/head/; revision=362989
* Fix cleandir target post r362973Mitchell Horne2020-07-061-1/+1
| | | | | | | Reported by: mmacy Notes: svn path=/head/; revision=362978
* RISC-V boot1.efi and loader.efi supportMitchell Horne2020-07-0611-8/+598
| | | | | | | | | | | | | | | | | | | | | This implementation doesn't have any major deviations from the other EFI ports. I've copied the boilerplate from arm and arm64. I've tested this with the following boot flows: OpenSBI (M-mode) -> u-boot (S-mode) -> loader.efi -> FreeBSD OpenSBI (M-mode) -> u-boot (S-mode) -> boot1.efi -> loader.efi -> FreeBSD Due to the way that u-boot handles secondary CPUs, OpenSBI >= v0.7 is required, as the HSM extension is needed to bring them up explicitly. Because of this, using BBL as the SBI implementation will not be possible. Additionally, there are a few recent u-boot changes that are required as well, all of which will be present in the upcoming v2020.07 release. Looks good: emaste Differential Revision: https://reviews.freebsd.org/D25135 Notes: svn path=/head/; revision=362973
* loader: zfs reader does not need BOOT2 bitsToomas Soome2020-07-021-28/+0
| | | | | | | | | | After switching zfsloader to use full libsa, we do not need spa_get_primary() and spa_get_primary_vdev() any more. Sponsored by: Netflix, Klara Inc. Notes: svn path=/head/; revision=362884
* loader: potential memory leak and check return valuesToomas Soome2020-07-021-2/+12
| | | | | | | | | Need to free nvlist before return from vdev_from_nvlist(). Sponsored by: Netflix, Klara Inc. Notes: svn path=/head/; revision=362883
* boot1.efi: use malloc family from libsaToomas Soome2020-06-301-36/+16
| | | | | | | | | | | | | | | The zfs reader development did reach to the point where linking boot1, we will get errors about duplicate symbols Malloc, Free, Calloc. We can just use libsa version, just as loader.efi does. The only concern is, libsa zalloc is using fixed size heap region, I did pick 64MB as other stage instances are using, but this size is likely not optimal. In any case, with limited memory setups, we should boot loader.efi directly. Sponsored by: Netflix, Klara Inc. Notes: svn path=/head/; revision=362812
* loader: can not read zfs pool with slog removedToomas Soome2020-06-261-2/+12
| | | | | | | | | | | The vdev_init() does check for "known" vdev types, the [log] device removal will create "hole" device, but vdev_init() does not allow it. Obtained from: illumos MFC after: 1 week Notes: svn path=/head/; revision=362663
* stand: remove redundant declarationsKyle Evans2020-06-233-3/+1
| | | | | | | | | | | | | These are picked out by the amd64-gcc6 build; time() is declared in <time.h> and delay() is declared in <bootstrap.h>. These are the correct places for these in stand/, so remove the duplicate declarations and make sure the delay() consumer in libefi that depended on the extra delay() declaration includes <bootstrap.h>. MFC after: 1 week Notes: svn path=/head/; revision=362564
* Revert r362466Baptiste Daroussin2020-06-222-4/+4
| | | | | | | | | Such change should not have happen without prior discussion and review. With hat: transitioning core Notes: svn path=/head/; revision=362488