aboutsummaryrefslogtreecommitdiff
path: root/stand
Commit message (Collapse)AuthorAgeFilesLines
* Serial console menus for lua.Warner Losh2018-08-202-26/+0
| | | | | | | | | | | Remove a bunch of special cases for UEFI and serial consoles. We do want to do curses and menu things here. This makes us match what we do in FORTH, with the possible exception of boxes around menus. Differential Revision: https://reviews.freebsd.org/D16816 Notes: svn path=/head/; revision=338108
* lualoader: Install all manpagesKyle Evans2018-08-201-0/+10
| | | | | | | | | | Now that a complete set is written, save for one describing loader.lua, install all of them. This was not previously done as they were written to hopefully avoid confusion as bits and pieces of the overall system were undocumented. Notes: svn path=/head/; revision=338086
* Add color.lua(8), password.lua(8), and screen.lua(8)Kyle Evans2018-08-203-0/+308
| | | | Notes: svn path=/head/; revision=338085
* Add drawer.lua(8)Kyle Evans2018-08-201-0/+179
| | | | Notes: svn path=/head/; revision=338083
* lualoader: Add drawer-exported variables for default logodefsKyle Evans2018-08-191-2/+4
| | | | | | | | | | | Uncovered while writing the documentation from this, we previously explicitly fell back to orb or orbbw if an invalid or incompatible logodef was selected -- in contrast to branddefs, which have an exported variable that one can whip up a quick local.lua to override in a safe manner that works regardless of whether or not loader.conf(5) successfully loads. Notes: svn path=/head/; revision=338067
* lualoader: Hide the rest of the private interfacesKyle Evans2018-08-191-46/+56
| | | | | | | | | These are less controversial than the others, thus done in a separate commit. These are all used internally and ways to override are provided via soon-to-be-documented API or loader.conf(5) variables. Notes: svn path=/head/; revision=338066
* lualoader: Hide most of the internal drawing functionsKyle Evans2018-08-191-128/+128
| | | | | | | | | Ideally, all of the functionality to revamp the loader screen has associated APIs that are flexible enough that third-party scripts wouldn't need to override these. Notes: svn path=/head/; revision=338065
* Turn back the clock just a little: make userboot.so always be 4thWarner Losh2018-08-191-0/+1
| | | | | | | | | | | | | | | | | Turns out there was a hidden dependency we hasn't counted upon. The host load /boot/userboot.so to boot the VMs it runs. This means that the change to lua meant suddently that nobody could run their older VMs because LUA wasn't in 10.0, last month's HardenedBSD, 11.2 or whatever. Even more than for the /boot/loader* binaries, we need a good coexistance strategy for this. While that's being designed and implemented, drop back to always 4th for userboot.so. This will fail safe in all but the most extreme environments (but lua-only hacks to .lua files won't be processes in VMs until we fix it). Differential Review: https://reviews.freebsd.org/D16805 Notes: svn path=/head/; revision=338064
* lualoader: Stop exporting drawer.drawKyle Evans2018-08-191-9/+9
| | | | | | | | drawer.draw is the back-end for drawlogo and drawbrand and should not be used directly. Notes: svn path=/head/; revision=338063
* Add config.lua(8) to the treeKyle Evans2018-08-191-0/+188
| | | | | | | | Reviewed by: 0mp, rpokala (earlier version) Differential Revision: https://reviews.freebsd.org/D14819 Notes: svn path=/head/; revision=338054
* libsa: Add lshrdi3.c for powerpc* and mipsKyle Evans2018-08-191-2/+2
| | | | Notes: svn path=/head/; revision=338052
* stand: Flip the default interpreter to LuaKyle Evans2018-08-191-3/+3
| | | | | | | | | | | | | | After years in the making, lualoader is ready to make its debut. Both flavors of loader are still built by default, and may be installed as /boot/loader or /boot/loader.efi as appropriate either by manually creating hard links or using LOADER_DEFAULT_INTERP as documented in build(7). Discussed with: imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16795 Notes: svn path=/head/; revision=338050
* Fix casts between 64-bit physical addresses and pointers in EFI.John Baldwin2018-08-183-10/+10
| | | | | | | | | | | | | | | Compiling FreeBSD/i386 with modern GCC triggers warnings for various places that convert 64-bit EFI_ADDRs to pointers and vice versa. - Cast pointers to uintptr_t rather than to uint64_t when assigning to a 64-bit integer. - Cast 64-bit integers to uintptr_t before a cast to a pointer. Reviewed by: kevans MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16586 Notes: svn path=/head/; revision=338022
* Add ashldi3 and ashrdi3 to mips.Warner Losh2018-08-161-0/+5
| | | | | | | Now that we're using -Os, mips needs these routines. Notes: svn path=/head/; revision=337927
* Install links for loader.efi.Warner Losh2018-08-161-0/+4
| | | | | | | Submitted by: ben wilber Notes: svn path=/head/; revision=337914
* libi386: bd_io_workaround() is to be called for reads onlyToomas Soome2018-08-161-2/+2
| | | | | | | | bd_io() can perform either reads or writes, we only need bd_io_workaround() for reads. Notes: svn path=/head/; revision=337891
* libi386: small style updates in biosdiskToomas Soome2018-08-161-2/+2
| | | | | | | | Use break instead of return in for loop, as done earlier. Insert and remove some blank lines. No functional changes intended. Notes: svn path=/head/; revision=337890
* libi386: use BD_RD and BR_WR constantsToomas Soome2018-08-151-7/+9
| | | | | | | | | Use BD_RD and BD_WR instead of 0 and 1. Reported by: ian Notes: svn path=/head/; revision=337881
* libi386: remove bd_read() and bd_write() wrappersToomas Soome2018-08-151-20/+3
| | | | | | | Those wroappers are nice, but do not really add much value. Notes: svn path=/head/; revision=337878
* libsa: zfs_probe() needs to set spa to NULLToomas Soome2018-08-151-0/+1
| | | | | | | Silence the warning about possibly uninitialized use of spa. Notes: svn path=/head/; revision=337874
* libi386: remove BD_SUPPORT_FRAGSToomas Soome2018-08-152-41/+0
| | | | | | | | | | | | | | BD_SUPPORT_FRAGS is preprocessor knob to allow partial reads in bioscd/biosdisk level. However, we already have support for partial reads in bcache, and there is no need to have duplication via preprocessor controls. Note that bioscd/biosdisk interface is assumed to perform IO in 512B blocks, so the only translation we have to do is 512 <-> native block size. Differential Revision: https://reviews.freebsd.org/D16600 Notes: svn path=/head/; revision=337872
* pkgfs_init: Initialize pkgKyle Evans2018-08-151-0/+1
| | | | | | | | | new_package may not set *pp if it errors out, leaving pkg uninitialized. Reported by: GCC Notes: svn path=/head/; revision=337871
* stand: Use -Oz/-Os for all loader/stand builds.Warner Losh2018-08-151-1/+6
| | | | | | | | | | | | | | | | | | | | While we're not super size constrained, the x86 BIOS /boot/loader has to be less than about 520k-530k to be reliable. The LUA loader is at this size today. -Oz saves 15-20% on the size, keeping us safely small enough (comparable to where we were with the 4th loader). This will also help with sjg's work on bringing in bearssl, though we may again be looking for space in the LUA loader. Size table for clang 6.0.0: default -O1 -Os -Oz 4th 442368 417792 389120 376832 lua 524288 479232 446464 430080 Tested by: kevans91@ (ubldr on armv7), dhw@ (loader on amdy64) Differential Revision: https://reviews.freebsd.org/D16724 Notes: svn path=/head/; revision=337868
* Improve formatting.Edward Tomasz Napierala2018-08-151-1/+1
| | | | | | | | MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=337836
* Add SECURITY section to loader(8).Edward Tomasz Napierala2018-08-151-1/+37
| | | | | | | | | | Reviewed by: bcr, jilles, imp (earlier version) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16700 Notes: svn path=/head/; revision=337834
* MFV r337586: lua: Update to 5.3.5Kyle Evans2018-08-141-0/+7
| | | | | | | | | | Bugfix release, nothing too major. Tested with: lualoader via userboot, lualoader live Differential Revision: https://reviews.freebsd.org/D16665 Notes: svn path=/head/; revision=337810
* For our INT64 implementation, we can compare integers and numbersWarner Losh2018-08-141-3/+1
| | | | | | | | | directly because they are the same thing. Reviewed by: kevans@ Notes: svn path=/head/; revision=337809
* Create a loader for each interpreter for x86 BIOS and all EFIWarner Losh2018-08-1413-21/+82
| | | | | | | | | | | | | | | | | | Create loader_{4th,lua,simp}{,.efi}. All of these are installed by default. Create LOADER_DEFAULT_INTERP to specify the default interpreter when no other is specified. LOADER_INTERP is the current interpreter language building. Turn building of lua on by default to match 4th. simploader is a simplified loader build w/o any interpreter language (but with a simple loader). This is the historic behavir you got with WITHOUT_FORTH. Make a hard link to the default loader. This has to be a hard link rather than the more desirable soft link because older zfsboot blocks don't support symlinks. RelNotes: Yes Differential Revision: https://reviews.freebsd.org/D16705 Notes: svn path=/head/; revision=337806
* Add init_exec kenv(1) variable, to make init(8) execute a fileEdward Tomasz Napierala2018-08-141-1/+4
| | | | | | | | | | | | | | | | | after opening the console, replacing init as PID 1. From the user point of view, it makes it possible to run eg the shell as PID 1, using 'set init_exec=/bin/sh' at the loader(8) prompt. Reviewed by: kib MFC after: 2 weeks Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16625 Notes: svn path=/head/; revision=337740
* Add microcode update configuration to the default loader.conf.Mark Johnston2018-08-131-0/+8
| | | | | | | | MFC after: 6 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=337716
* lualoader: Fix parsing of negative number loader.conf(5) variablesKyle Evans2018-08-131-1/+1
| | | | | | | | They would previously cause errors, as the regex for these did not tolerate a leading negative sign, and the variable would simply not parse. Notes: svn path=/head/; revision=337711
* Move around text in loader(8), in particular stuff related to ZFS,Edward Tomasz Napierala2018-08-131-61/+51
| | | | | | | | | | to restore the usual section order. MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=337707
* libi386: Fix typo in pxe.hKyle Evans2018-08-091-1/+1
| | | | | | | | | PR: 207337 Submitted by: Tony Narlock <tony@git-pull.com> MFC after: 1 week Notes: svn path=/head/; revision=337524
* libsa: exit on EOF in ngetsKyle Evans2018-08-091-2/+6
| | | | | | | | | | | | It was possible in some rare circumstances for ngets to behave terribly with bhyveload and some form of redirecting user input over a pipe. PR: 198706 Submitted by: Ivan Krivonos <int0dster@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=337523
* isoboot, gptboot: Fix WITHOUT_LOADER_GELI (gptboot) and isoboot in generalKyle Evans2018-08-092-3/+4
| | | | | | | | | | | | | gptboot was broken when r316078 added the LOADER_GELI_SUPPORT #ifdef to not pass geliargs via __exec. KARGS_FLAGS_EXTARG must not be used if we're not going to pass an additional argument to __exec. PR: 228151 Submitted by: guyyur@gmail.com MFC after: 1 week Notes: svn path=/head/; revision=337520
* Move description of init_shell, init_script, and init_chroot kenvEdward Tomasz Napierala2018-08-071-57/+5
| | | | | | | | | | | tunables from loader(8) to init(8), since it's init that actually uses them. Add .Xrs at their old place. MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=337435
* libsa: gzipfs.c converts pointers to integer types with different signToomas Soome2018-08-071-1/+1
| | | | | | | Signed versus unsigned char. Notes: svn path=/head/; revision=337413
* libsa: dos_checksum() should take unsigned charsToomas Soome2018-08-071-1/+1
| | | | | | | Fix pointers to integers with different sign issue. Notes: svn path=/head/; revision=337412
* loader: bd_open() should cleanup from disk_open() errorToomas Soome2018-08-051-4/+12
| | | | | | | | | | Since bd_open() does early increment for reference counter and bcache allocation, it also should undo those in case of the error. Also remove unused variables rdev, g_err. Notes: svn path=/head/; revision=337356
* loader: 337353 did miss to rename 2 write instancesToomas Soome2018-08-051-2/+2
| | | | | | | 2 write instances got somehow missed. Notes: svn path=/head/; revision=337354
* loader: cstyle cleanup for biosdisk.cToomas Soome2018-08-051-305/+312
| | | | | | | | Also switch u_int to uint32_t. Also replace "write" by "dowrite". No functional changes intended. Notes: svn path=/head/; revision=337353
* zfsboot: Fix startup crashKristof Provost2018-08-051-5/+2
| | | | | | | | | | | | | | | | On a FreeNAS mini XL, with geli encrypted drives the loader crashed in geli_read(). When we iterate over the list of disks and allocate the zfsdsk structures we don’t zero out the gdev pointer. In one case that resulted in geli_read() (called on the bogus pointer) dividing by zero. Use calloc() to ensure the zfsdsk structure is always zeroed, so the pointer is initialised to NULL. As a side benefit it gets rid of one #ifdef LOADER_GELI_SUPPORT. Notes: svn path=/head/; revision=337349
* loader: biosdisk.c has leftover geli header.Toomas Soome2018-08-041-4/+0
| | | | | | | A small cleanup, remove unneeded #include. Notes: svn path=/head/; revision=337326
* In r337271, we limited the sector number to the lower of calculatedXin LI2018-08-041-1/+1
| | | | | | | | | | | | | number and CHS based number. However, on some systems, BIOS would report 0 in CHS fields, making the system to think there is 0 sectors. Add a check before comparing the calculated total with bd_sectors. Reviewed by: tsoome, cy Differential Revision: https://reviews.freebsd.org/D16577 Notes: svn path=/head/; revision=337317
* efi-autoresizecons: Don't fail the boot w/o GOP or UGAKyle Evans2018-08-041-1/+8
| | | | | | | | | | | | | | | | | | | | efi-autoresizecons is currently executed for every boot. If it fails, we risk failing the boot, and we really shouldn't do that unless we absolutely must. Not being able to locate GOP or UGA is not a significant enough failure to kill the boot. We always have the option to fall back to resizing ConOut to a higher text mode resolution (if available), so do that. This was detected by Doug [1] while attempting a bhyve + UEFI + PXE boot. This patch was effectively also submitted by Doug, but I expanded the comment he had originally sent me a little bit to indicate why this is an OK idea. Reported by: Doug Ambrisko <ambrisko@ambrisko.com> [1] Notes: svn path=/head/; revision=337285
* Some drives report a geometry that is inconsisetent with the totalCy Schubert2018-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | number of sectors reported through the BIOS. Cylinders * heads * sectors may not necessarily be equal to the total number of sectors reported through int13h function 48h. An example of this is when a Mediasonic HD3-U2B PATA to USB enclosure with a 80 GB disk is attached. Loader hangs at line 506 of stand/i386/libi386/biosdisk.c while attempting to read sectors beyond the end of the disk, sector 156906855. I discovered that the Mediasonic enclosure was reporting the disk with 9767 cylinders, 255 heads, 63 sectors/track. That's 156906855 sectors. However camcontrol and Windows 10 both report report the disk having 156301488 sectors, not the calculated value. At line 280 biosdisk.c sets the sectors to the higher of either bd->bd_sectors or the total calculated at line 276 (156906855) instead of the lower and correct value of 156301488 reported by int 13h 48h. This was tested on all three of my Mediasonic HD3-U2B PATA to USB enclosures. Instead of using the higher of bd_sectors (returned by int13h) or the calculated value, this patch uses the lower and safer of the values. Reviewed by: tsoome@ Differential Revision: https://reviews.freebsd.org/D16577 Notes: svn path=/head/; revision=337271
* loader.efi: clean up misleading noise from missing block devicesToomas Soome2018-08-031-4/+2
| | | | | | | | | | | If there are no block devices, there is no need to printout error (ENOENT). In case of netboot, our image path has no block device, no need to make noise about it. Notes: svn path=/head/; revision=337231
* loader.efi: efipart_inithandles() failure should not prevent devsw ↵Toomas Soome2018-08-021-6/+9
| | | | | | | | | | initialization The efipart_inithandles() can return error code when there are no block devices, however, we still should walk and initialize devsw. Notes: svn path=/head/; revision=337131
* libsa: dereferencing type-punned pointer in cd9660Toomas Soome2018-08-022-2/+2
| | | | | | | | The warning is given by gcc build, but it is good to fix anyhow. use bcopy instead of direct assignment. Notes: svn path=/head/; revision=337065
* ubldr: Bump heap size, 1MB -> 2MBKyle Evans2018-08-011-1/+1
| | | | | | | | | | | 1MB was leaving very little margin in some of the worse-case scenarios with lualoader. 2MB is still low enough that we shouldn't have any problems with UBoot-supported boards. MFC after: 1 week Notes: svn path=/head/; revision=337060