aboutsummaryrefslogtreecommitdiff
path: root/stand
Commit message (Collapse)AuthorAgeFilesLines
* Initialize variables we later free so they aren't usedWarner Losh2018-06-131-5/+4
| | | | | | | | | | uninitialized in the error path. Remove unused variables. Sponsored by: Netflix Notes: svn path=/head/; revision=335071
* Remove unused variables.Warner Losh2018-06-132-3/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=335070
* Remove fail: label. It's unused.Warner Losh2018-06-131-1/+0
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=335069
* lualoader: Match Forth module-loading behavior w.r.t flagsKyle Evans2018-06-121-3/+3
| | | | | | | | Also as documented in loader.conf(5), ${module}_flags are actually flags to be passed to the module, not to `load` as was done thus far. Notes: svn path=/head/; revision=335009
* lualoader: More black-on-white fixesKyle Evans2018-06-122-7/+8
| | | | | | | | | | | | | | | | | | | | To recap the problem: with a black-on-white xterm, the menu draws terribly. Ideally, we would try our best for a white-on-black context for the menu since graphics and whatnot might not be tested for other setups and there's no reasonable way to sample the terminal at this point for the used color scheme. This commit attempts to address that further in two ways: - Instead of issuing CSI bg/fg resets (CSI 39m and CSI 49m respectively for "default"), issue CSI bg/fg escape sequences for our expected color scheme - Reset to *our* default color scheme before we even attempt to load the local module, so that we personally don't have any earlier text with the console default color scheme. Reported by: emaste (again) Notes: svn path=/head/; revision=334986
* lualoader: Allow brand-*.lua for adding new brandsKyle Evans2018-06-111-2/+25
| | | | | | | | | | | | | | | | | | | | dteske@, I believe, had originally pointed out that lualoader failed to allow logo-*.lua for new logos to be added. When correcting this mistake, I failed to do the same for brands. Correct the sub-mistake: creating new brands is almost identical to creating new logos, except one must use `drawer.addBrand` and 'graphic' is the only valid key for a branddef at the moment. While here, I've added `drawer.default_brand` to be set to name of brand to be used (e.g. 'fbsd', project default). Eventually this whole goolash will be documented. Reported by: kmoore, iXsystems Notes: svn path=/head/; revision=334939
* lualoader: Support variable substitution in env var settingsKyle Evans2018-06-101-2/+21
| | | | | | | | | | | | | | | | | | | | We support both of the following cases of substitution: bar="y" foo="${bar}" foo="$bar" The latter substitution syntax is, of course, not recommended- all punctuation must be considered potential variable names, and we do not go through the effort of searching the different combinations of, for instance, "$x.y.z" to determine if the variable is $x, $x.y, or $x.y.z. This is not officially documented as supported, but it has worked in forthloader for what is most likely a long time as `evaluate` is used to process the right hand side of the assignment. Notes: svn path=/head/; revision=334912
* lualoader: Process loader_conf_files properlyKyle Evans2018-06-101-11/+29
| | | | | | | | | | | loader.conf(5) documents loader_conf_files to mean "additional configuration files to be processed right after the present file." However, lualoader ignored loader_conf_files after processing /boot/defaults/loader.conf. Rewrite these bits to process loader_conf_files after each loaded file. Notes: svn path=/head/; revision=334907
* lualoader: Add cli.lua(8) to the treeKyle Evans2018-06-091-0/+112
| | | | | | | | Reviewed by: rpokala Differential Revision: https://reviews.freebsd.org/D14818 Notes: svn path=/head/; revision=334891
* stand: One more trivial consolidation (setting environment from howto)Kyle Evans2018-06-095-14/+15
| | | | Notes: svn path=/head/; revision=334885
* stand: Fix build after r334882Kyle Evans2018-06-091-0/+1
| | | | | | | Not sure how this was not caught in Universe. Notes: svn path=/head/; revision=334884
* stand: Consolidate checking for boot flags driven by environment varsKyle Evans2018-06-096-27/+24
| | | | | | | | | | | | | | e.g. boot_mute, boot_single, boot_verbose, and friends; we checked for these in multiple places, consolidate into common/ and allow a setting of "NO" for any of these to turn them off. This allows systems with multiple loader.conf(5) or loader.conf(5) overlay systems to easily turn off variables in later processed files by setting it to NO. Reported by: Nick Wolff @ iXsystems Reviewed by: imp Notes: svn path=/head/; revision=334882
* lualoader: Add hook.lua(8) to treeKyle Evans2018-06-091-0/+94
| | | | | | | | Reviewed by: rpokala (w/ "All Rights Reserved" previously added) Differential Revision: https://reviews.freebsd.org/D14815 Notes: svn path=/head/; revision=334879
* libsa(3): Correct statement about FS Write-support, name changeKyle Evans2018-06-091-5/+5
| | | | | | | | | | | - jhb implemented UFS write support a little over 16 years ago. - Update the library name while we're here. Reviewed by: jhb, rpokala Differential Revision: https://reviews.freebsd.org/D14476 Notes: svn path=/head/; revision=334878
* Add st_mtime, st_ino and st_dev for ufs_statSimon J. Gerraty2018-06-091-0/+16
| | | | | | | Differential Revision: D15064 Notes: svn path=/head/; revision=334868
* lualoader: Add a loaded hook for others to execute upon config loadKyle Evans2018-06-061-2/+6
| | | | | | | | | | This will not be executed on reload, though later work could allow for that. It's intended/expected that later work won't generally need to happen on every config load, just once (for, e.g., menu initialization) or just when config is reloaded but not upon the initial load. Notes: svn path=/head/; revision=334723
* Remove comments and assertions that are no longer valid after r330809.Ian Lepore2018-06-056-14/+4
| | | | | | | | | | | | r330809 replaced duplication of devdesc struct fields with an embedded copy of the devdesc struct, to avoid fragility. That means all the scattered comments indicating that structs must match are no longer valid. Likewise asserts that attempted to mitigate some of the old fragility. Reviewed by: imp@ Notes: svn path=/head/; revision=334695
* Make the v*printf() functions in libsa return int instead of void.Ian Lepore2018-06-052-8/+13
| | | | | | | | | | This makes them compatible with the C standard signatures, avoiding spurious mismatch errors in the places where the oddball requirements of standalone code end up putting two declarations of the same function in play. Notes: svn path=/head/; revision=334665
* Add vsnprintf() to libsa. Alpha-sort the printf prototypes in stand.h.Ian Lepore2018-06-052-1/+16
| | | | | | | | I'm not sure why the v*printf() functions in libsa return void instead of int, but this maintains that convention for the new function. Notes: svn path=/head/; revision=334656
* Fix build of stand with base gccDimitry Andric2018-05-317-7/+9
| | | | | | | | | | | | | | | | | | | * Make autoboot() a static function in stand/common/boot.c, so it does not shadow local variables in gptboot.c and zfsboot.c. * Remove -Winline from the Makefiles for gptboot, gptzfsboot and zfsboot, as gcc will always fail to inline some functions, and there is nothing we can do about it. * For gcc <= 4.2.1, silence -Wuninitialized for isoboot, as it produces a false positive warning. * Remove deprecated and unnecessary -mcpu=i386 flag from stand/defs.mk, as there is already a -march=i386 flag further in the file. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15628 Notes: svn path=/head/; revision=334432
* Pass a struct devdesc to the format commands. Use proper type ratherWarner Losh2018-05-312-13/+14
| | | | | | | | | | | | | | | | than doing weird type-punning that happened to work because the size was right. We copied a zfs devdesc into a disk_devdesc and then after passing through a NULL pointer reinterpreted it as a zfs_devdesc. Instead, pass the base devdesc around and 'upcase' when we know the types are right. This has the happy side effect of fixing a gcc warning about bad type punning. Differential Revision: https://reviews.freebsd.org/D15629 Notes: svn path=/head/; revision=334412
* Teach ufs_module.c about bsd labels and probe 'a' partition.Warner Losh2018-05-292-1/+46
| | | | | | | | | | | | | | | | | | | | If the check for a UFS partition at offset 0 on the disk fails, check to see if there's a BSD disklabel at block 1 (standard) or at offset 512 (install images assume 512 sector size). If found, probe for UFS on the 'a' partition. This fixes UEFI booting images from a BSD labeled MBR slice when the 'a' partiton isn't at offset 0. This is a stop-gap fix since we plan on removing boot1.efi in FreeBSD 12. We can't easily do that for 11.2, however, hence the short MFC window. Tested by: emaste@ MFC After: 3 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D15598 Notes: svn path=/head/; revision=334310
* - 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