aboutsummaryrefslogtreecommitdiff
path: root/stand
Commit message (Collapse)AuthorAgeFilesLines
* - Unbreak booting sparc64 kernels after the metadata unification inMarius Strobl2018-05-213-5/+9
| | | | | | | | | | | | | r329190; sparc64 kernels are always 64-bit but with that revision in place, the loader was treating them as 32-bit ones. - In order to reduce the likelihood of this kind of breakage in the future, #ifdef out md_load() on sparc64 and make md_load_dual() - which is currently local to metadata.c anyway - static. - Make md_getboothowto() - also local to metadata.c - static. - Get rid of the unused DTB pointer on sparc64. Notes: svn path=/head/; revision=333955
* Clarify that boot_mute / boot -m mutes kernel console onlyEd Maste2018-05-161-2/+2
| | | | | | | | | | | | Perhaps RB_MUTE could mute user startup (rc) output as well, but right now it mutes only kernel console output, so make the documentation match reality. PR: 228193 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=333662
* Revert r333365Warner Losh2018-05-101-0/+4
| | | | | | | | | Even though we don't use it, it appears something else requires it to be != 0 to work. This breaks tftp boot in loader.efi, so revert until that can be sorted out. Notes: svn path=/head/; revision=333471
* Introduce the 'n' flag for the geli attach command.Mariusz Zaborski2018-05-091-3/+3
| | | | | | | | | | | | | If the 'n' flag is provided the provided key number will be used to decrypt device. This can be used combined with dryrun to verify if the key is set correctly. This can be also used to determine which key slot we want to change on already attached device. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D15309 Notes: svn path=/head/; revision=333439
* Remove "All Rights Reserved" on files that I hold sole copyright onKyle Evans2018-05-099-9/+0
| | | | | | | | See r333391 for more detail; in summary: it holds no weight and may be removed. Notes: svn path=/head/; revision=333418
* We don't use f_devdata, so don't set it. Should that need to changeWarner Losh2018-05-081-4/+0
| | | | | | | | later, we can. This leaves ZFS as the only irregular f_devdata user in the tree. Notes: svn path=/head/; revision=333365
* Use M. Warner Losh everywhere on my copyrights.Warner Losh2018-05-014-8/+4
| | | | | | | Remove 'All Rights Reserved' where I can. Notes: svn path=/head/; revision=333143
* No need to make objects here.Warner Losh2018-04-271-0/+2
| | | | Notes: svn path=/head/; revision=333079
* forthloader: Remove "EFI boot environment message"Kyle Evans2018-04-251-2/+0
| | | | | | | | | | | | Contrary to what the message says, this is not only executed in an EFI context- it provides functions for use in an EFI environment. I don't think there's much reason to broadcast this fact when we haven't in the past, so just remove it. Reported by: emaste (a while ago), cperciva Notes: svn path=/head/; revision=332985
* Add support for linker-type-specific flagsEd Maste2018-04-191-5/+1
| | | | | | | | | | | | | r332090 added a LINKER_TYPE test to add the --no-rosegment flag when linking the i386 loader components with lld. Instead, introduce a general mechanism for setting LDFLAGS for a specific linker type, and use it for --no-rosegment. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14998 Notes: svn path=/head/; revision=332794
* efi loader: Address two nits with recent graphics changesKyle Evans2018-04-192-6/+10
| | | | | | | | | | - We should be setting a known graphics mode on conout, but we aren't. - We shouldn't be setting gop mode if we didn't find a good resolution to set, but we were. This made efi_max_resolution=1x1 effectively worthless, since it would always set gop mode 0 if nothing else. Notes: svn path=/head/; revision=332751
* Regenerate FAT templates after r332561Kyle Evans2018-04-164-0/+0
| | | | Notes: svn path=/head/; revision=332573
* loader: cstyle cleanup of command.cToomas Soome2018-04-161-329/+337
| | | | | | | | | | just clean it up. no functional changes intended. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D15087 Notes: svn path=/head/; revision=332565
* Rename volume label for ESPKyle Evans2018-04-161-1/+1
| | | | | | | | | | | | | | | Harry Schmalzbauer reports that some firmware, in his experience, trips over the ESP we install due to the volume label. It has been theorized that this is due to some confusion with the label and the path on the ESP to boot1.efi. Regardless, Harry found that renaming the label seems to fix it. PR: 214282 MFC after: 3 days Notes: svn path=/head/; revision=332561
* loader: make sure we do not return garbage from help_getnextToomas Soome2018-04-161-1/+1
| | | | | | | | | | | Since we do free subtopic and desc in help_getnext(), we need to set them also NULL, so we make sure we dont get double free(). Approved by: bapt Differential Revision: https://reviews.freebsd.org/D15082 Notes: svn path=/head/; revision=332560
* loader: command_errmsg should be constToomas Soome2018-04-162-2/+2
| | | | | | | Use const char * for command_errmsg. Notes: svn path=/head/; revision=332558
* loader: make sure we use snprintf() in commands.cToomas Soome2018-04-161-4/+4
| | | | | | | Safeguard against memory corruptions. Notes: svn path=/head/; revision=332557
* loader: provide values in help_getnext()Toomas Soome2018-04-161-1/+3
| | | | | | | | | | | | | With r328289 we attempt to make sure we free the resources allocated in help_getnext(), however, it is possible that we get no resources allocated and help_getnext() will return early. Make sure we have pointers set to NULL early in help_getnext(). Reported by: Andy Fiddaman Notes: svn path=/head/; revision=332555
* Remove support for the Arcnet protocol.Brooks Davis2018-04-131-1/+0
| | | | | | | | | | | | | | | | | | While Arcnet has some continued deployment in industrial controls, the lack of drivers for any of the PCI, USB, or PCIe NICs on the market suggests such users aren't running FreeBSD. Evidence in the PR database suggests that the cm(4) driver (our sole Arcnet NIC) was broken in 5.0 and has not worked since. PR: 182297 Reviewed by: jhibbits, vangyzen Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15057 Notes: svn path=/head/; revision=332490
* Refactor currdev settingWarner Losh2018-04-115-80/+277
| | | | | | | | | | | | | Refactor the currdev setting to find the device we booted from. Limit searching when we don't already have a reasonable currdev from that to the same device only. Search a little harder for ZFS volumes as that's needed for loader.efi to live on an ESP. Sponsored by: Netflix Differential Review: https://reviews.freebsd.org/D13784 Notes: svn path=/head/; revision=332416
* Revert r332275, r332272, r332270Warner Losh2018-04-114-4/+18
| | | | | | | | | | There's problems with them. The order of efi stuff isn't quite right, and there's various problems. Revert until thos problems can be fixed. Reviewed by: kevans@ Notes: svn path=/head/; revision=332413
* loader: 332270 did left out stand/i386/loader/loader.rcToomas Soome2018-04-081-3/+0
| | | | | | | we have 2 instances of loader.rc... Notes: svn path=/head/; revision=332275
* loader: 332270 did use wrong path for efi.4thToomas Soome2018-04-081-1/+1
| | | | | | | The correct path is still /boot/efi.4th Notes: svn path=/head/; revision=332272
* loader: include efi.4th only if we do have uefiToomas Soome2018-04-083-15/+4
| | | | | | | Also simplify efi.4th. Notes: svn path=/head/; revision=332270
* libsa: name is not used in dirmatch()Toomas Soome2018-04-071-2/+1
| | | | | | | Seems like variable 'name' is leftover. Notes: svn path=/head/; revision=332173
* libsa: cd9660: warning: 'lenskip' may be used uninitialized in this functionToomas Soome2018-04-072-1/+3
| | | | | | | We better provide value for lenskip in both instances. Notes: svn path=/head/; revision=332170
* lualoader: Fix menu skipping with loader.conf(5) varsKyle Evans2018-04-061-4/+6
| | | | | | | | | | | | | Earlier efforts to stop loading the menu broke the ability to skip the menu with, e.g., beastie_disable in loader.conf(5) as it was decided before configuration was read. Defer bringing in the menu module until we've loaded configuration so that we can make a more informed decision on whether the menu should be skipped or not. Notes: svn path=/head/; revision=332106
* stand: pass --no-rosegment for i386 bits when linking with lldEd Maste2018-04-061-0/+5
| | | | | | | | | | | | | | btxld does not correctly handle input with other than 2 PT_LOAD segments. Passing --no-rosegment lets lld produce output eqivalent to ld.bfd: 2 PT_LOAD segments and no PT_GNU_RELRO. PR: 225775 MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14956 Notes: svn path=/head/; revision=332090
* Add an ISO9660 "partition table" type to loader.Benno Rice2018-04-053-1/+53
| | | | | | | | | | | | | | When booted via isoboot(8) loader will be handed a disk that simply contains an ISO9660 image. Currently this confuses it greatly. Teach it how to spot that it's in this situation and that ISO9660 has one "partition" covering the whole disk. Reviewed by: imp Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14915 Notes: svn path=/head/; revision=332085
* Add isoboot(8) for booting BIOS systems from HDDs containing ISO images.Benno Rice2018-04-055-1/+1024
| | | | | | | | | | | | | | | | This is part of a project for adding the ability to create hybrid CD/USB boot images. In the BIOS case when booting from something that isn't a CD we need some extra boot code to actually find our next stage (loader) within an ISO9660 filesystem. This code will reside in a GPT partition (similar to gptboot(8) from which it is derived) and looks for /boot/loader in an ISO9660 filesystem on the image. Reviewed by: imp Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14914 Notes: svn path=/head/; revision=332084
* Various style(9) fixes.Benno Rice2018-04-051-10/+14
| | | | | | | | Reviewed by: strip --strip-debug -o - gptboot.o | md5 Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=332083
* Use consistent whitespace.Benno Rice2018-04-051-257/+271
| | | | | | | | Reviewed by: strip --strip-debug -o - gptboot.o | md5 Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=332082
* Default loader.conf: Drop efi_max_resolution to 1x1Kyle Evans2018-04-031-1/+1
| | | | | | | | | | | | | | | | | Effectively disabling the mode changing bits in the loader. No matter which way we go with it, it seems to be wrong- either the firmware doesn't change the resolution and reports the resolution we requested, or the firmware changes the resolution and doesn't report the resolution we requested. It some cases, it does the right thing, but the bad cases outweight those. Interested individuals can still set efi_max_resolution to 1080p or whatnot in loader.conf(5) to restore the new behavior, but the new behavior does not work out well for many cases. Discussed with: imp Notes: svn path=/head/; revision=331904
* lualoader: Don't try to lookup a nil logoKyle Evans2018-04-011-0/+3
| | | | Notes: svn path=/head/; revision=331860
* lualoader: Split logodefs out into logo-* filesKyle Evans2018-04-017-135/+322
| | | | | | | | | | | | | | | This commit splits all of the logodefs/graphics out into their own own files and provides a method for these files to register their logodefs with the drawer. Graphics are now loaded on demand if they don't exist in the current set of logodefs. The drawer module becomes a little easier to navigate through without all of the graphics mixed in. It's also easy to do one-off graphics like the 9.2 Die Hard tribute by dteske@ without adding even more to our memory requirements. Notes: svn path=/head/; revision=331859
* lualoader: Simplify some expressionsKyle Evans2018-04-011-23/+5
| | | | | | | | | | | | | | - No need for a 'goto' when our entire loop body is then wrapped in a conditional. - No need to leave commented out prints laying around - If an expression is clearly going to be either nil or an expression that isn't likely to be a boolean, we might as well use `or` to specify a default value for the expression. e.g. `loader.getenv(...) or "no"` Notes: svn path=/head/; revision=331857
* lualoader: revert whitespace change that snuck inKyle Evans2018-03-311-1/+0
| | | | Notes: svn path=/head/; revision=331856
* lualoader: Don't assume that {module}_load is setKyle Evans2018-03-311-0/+5
| | | | | | | | | | | | | | | The previous iteration of this assumed that {module}_load was set. In the old world order of default loader.conf(5), this was probably a safe assumption given that we had almost every module explicitly not-loaded in it. In the new world order, this is no longer the case, so one could delete a _load line inadvertently while leaving a _name, _type, _flags, _before, _after, or _error. This would have caused a confusing Lua error and borked module loading. Notes: svn path=/head/; revision=331855
* lualoader: Do case-insensitive comparison of "yes"Kyle Evans2018-03-311-1/+1
| | | | Notes: svn path=/head/; revision=331854
* fwohcireg.h is 99% the same between the boot loader and theWarner Losh2018-03-314-380/+3
| | | | | | | | kernel. Delete it and fix up the 1% difference because there's no need for them to be different. Notes: svn path=/head/; revision=331852
* efinet: Do not return only if ReceiveFilter failsEmmanuel Vadot2018-03-301-3/+1
| | | | | | | | | | If the network interface or the uefi implementation do not support the ReceiveFilter interface do not return only and just print a message. U-Boot doesn't support is and likely never will. Also even if this fails it doesn't mean that network in EFI isn't supported. Notes: svn path=/head/; revision=331767
* stand: Add workaround for HP BIOS issuesKyle Evans2018-03-291-0/+22
| | | | | | | | | | | | | | | | hrs@ and kuriyama@ have found that on some HP BIOS, a system will fail to boot immediately after installation with the claim that it can't work out which disk they are booting from. They tracked it down to a buffer overrun, and found that it could be alleviated by doing a dummy read before-hand. Submitted by: kuriyama MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14341 Notes: svn path=/head/; revision=331718
* Fix instructions in the zfsboot manual page.Eugene Grosbein2018-03-271-2/+2
| | | | | | | | | | | | | zfsloader(8) fails to probe a slice containing ZFS pool if its second sector contains traces of BSD label (DISKMAGIC == 0x82564557). Fix manual page to show working example erasing such traces. PR: 226714 Approved by: avg (mentor) MFC after: 3 days Notes: svn path=/head/; revision=331630
* lualoader: Actually re-raise error in try_includeKyle Evans2018-03-261-1/+1
| | | | | | | | | | | | | | | | It was previously only printed, but we do actually want to raise it as a full blown error so that things don't look OK when they've actually gone wrong. The second parameter to error, level, is set to 2 here so that the error message reflects the position of the try_include caller, rather than the try_include itself. Example: LUA ERROR: /boot/lua/loader.lua:46: /boot/lua/local.lua:1: attempt to call a nil value (global 'cxcint'). Notes: svn path=/head/; revision=331564
* lualoader: Implement try_include and use it for including the local moduleKyle Evans2018-03-262-5/+21
| | | | | | | | | | | | | | | | | | | | This provides a way to optionally include a module without having to wrap it in filesystem checks. try_include is a little more robust, using the lua search path instead of forcing us to explicitly consider all of the places we could want to include a module. Errors are still generally raised from trying to load the module, but ENOENT will not get raised unless we're doing a verbose load. This will also be used to split out logo/brand graphics into their own files so that we can safely scale up the number of graphics included without worrying about the extra memory consumption- opting to lazily load graphics instead. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D14658 Notes: svn path=/head/; revision=331563
* loader efifb: implement uga_autoresize as a call to text_autoresizeKyle Evans2018-03-261-2/+2
| | | | | | | | | | | | UGA does not have the same kind of mode enumeration that GOP does. Implement it instead as a call to text_autoresize so that firmwares with only UGA present still get some kind of autoresizing behavior. While here, rename a typo'd "gop" to "uga", although it will remain unused for the time being. Notes: svn path=/head/; revision=331547
* lualoader: Privatize some more config.lua bitsKyle Evans2018-03-241-84/+85
| | | | | | | | These functions are also not quite suitable for a public API, so privatize them to config. Notes: svn path=/head/; revision=331477
* lualoader: Make config env-related bits private APIKyle Evans2018-03-241-45/+45
| | | | | | | | | | This pertains exclusively to the set/restore functionality that we offer, where any changes made by loader.conf previously will be effectively removed upon reload of the configuration. We don't currently have a need to export these, so don't bother. Notes: svn path=/head/; revision=331476
* loader consoles: Implement SGR 24, 25Kyle Evans2018-03-242-0/+8
| | | | | | | | | Mostly for completeness sake- implement 24 (no underline) and 25 (no blink) MFC after: 3 days Notes: svn path=/head/; revision=331475
* efi loader: Choose a console mode instead if hw.vga.textmode is setKyle Evans2018-03-241-0/+29
| | | | | | | | | | | | | | | | Not all systems use efifb; pull hw.vga.textmode and choose a good console mode instead if it's set to something non-zero. This is basically a revival of the code that used to live in boot1, but instead rebased onto this different way of doing mode selection in loader.efi. Interestingly enough, the regression that was previously introduced where GOP would not reflect the console setting does not seem to exist when console mode selection is done here. I've not done any investigation as to why this is the case. Nevertheless, boot1.efi is still not the best place to do mode selection. Notes: svn path=/head/; revision=331474