summaryrefslogtreecommitdiffstats
path: root/sys/stand/boot (follow)
Commit message (Collapse)AuthorAgeFilesLines
* align the random buffer so mdrandom() can fill it with register-widthnaddy2020-06-151-2/+2
| | | | writes without incurring unaligned accesses; ok deraadt@
* /etc/random.seed reuse can now be detected. The stat +T bit marks the filederaadt2020-05-261-1/+7
| | | | | (fchmod +T by bootcode, chmod 600 by /etc/rc). If the seed is reused, and HWRNG isn't available, the kernel won't get RB_GOODSEED indication...
* make loadrandom() return 0 for success, -1 for failure. While here,deraadt2020-05-252-13/+18
| | | | | | relax the fstat() check because the system will have left the file in the right mode. ok visa kettenis
* If either mdrandom() or fwrandom() return 0, set RB_GOODRANDOMderaadt2020-05-251-3/+5
| | | | ok kettenis
* Adjust fwrandom() to return 0 for sucess, -1 for failurederaadt2020-05-251-3/+3
|
* For 32 bit systems, cast the long long used by strtoll() to unsigned longderaadt2019-12-021-2/+2
| | | | | and then a void * for calling the hexdump() operator with bluhm
* Implement a hexdump command in the boot loader. This helps tobluhm2019-11-281-1/+26
| | | | | | inspect the memory layout that the firmware has created. It is especially useful for UEFI debugging. OK deraadt@ kettenis@
* Use arc4 to bit-spread the 512-byte random buffer over the .openbsd.randomdataderaadt2019-10-291-1/+5
| | | | | | | | | section, which has grown a fair bit with the introduction of retguard. Mortimer discovered the repeated 512-byte sequence as retguard keys, and this resolves the issue. (Chacha does not fit on the media, so 1.5K early drop RC4 is hopefully sufficient in our KARL link universe) Version crank the bootblocks. sysupgrade -s will install new bootblocks. ok djm mortimer
* In the bootblocks, after discovering and opening /bsd.upgrade, fchmod -xderaadt2019-08-032-3/+20
| | | | | | | | | | | | | | | | so the file cannot be re-executed upon the next boot. This provides a stronger one-shot-upgrade model than the upgrade script's rm /bsd.upgrade. Now various forms of upgrade failure will reboot into /bsd, which is probably more recoverable. Performing fchmod -x depends on (1) use of MI boot.c (not alpha/macppc/sparc64/sgi/octeon) and (2) "can write blocks" functionality in the IO layer. Most architectures have this support now. Two diagnostics "fchmod a-x %s: failed" and "/bsd.upgrade is not u+x" will remain in the tree while refinements happen for some of the laggard architectures. based upon a discussion florian tested in snapshots for more than a week without any complaints
* Fix prototype of upgrade(). OK benno@claudio2019-05-101-2/+2
|
* Unbreak "boot bsd.up" line in /etc/boot.confflorian2019-04-101-3/+3
| | | | | Found the hard way by Raf Czlonka (rczlonka AT gmail), thanks! OK deraadt
* change marks[] array to uint64_t, so the code can track full 64-bitderaadt2019-04-101-2/+2
| | | | | details from the ELF header instead of faking it. Proposal from mlarkin, tested on most architectures already
* Detect /bsd.upgrade kernel and boot it if present instead of defaultflorian2019-04-083-3/+18
| | | | | /bsd. To be used for unattended upgrades in the future. Idea & OK deraadt
* Add a hook to use a firmware-supplied random function in addition to thekettenis2018-04-082-3/+7
| | | | | | MD-supplied random function to insert entropy into the kernel. ok deraadt@
* As early as possible, create a link /bsd.booted to the /bsd kernel wederaadt2017-06-191-1/+11
| | | | | | | | | | | presume we booted from. If you boot from another kernel, we cannot help you later with hibernate, sorry -- The kernel does not get a useable filename from the bootblocks. In the bootblocks, detect a live hibernate signature and boot from /bsd.booted instead. with yasuoka, lots of discussion with mlarkin, ok tom
* Initial commit of uefi boot loader of OpenBSD.yasuoka2015-09-022-2/+48
| | | | ok deraadt yuo
* Merge cmd.c from zboot into boot, dropping "clear" command while at it.tobias2014-07-201-26/+21
| | | | | | With input from deraadt@ okay jasper@, uebayashi@
* whatever mickey had to drink 13 years ago, he's not going to find it again. sojasper2014-07-111-14/+1
| | | | | | | just remove the comment and unneeded functionality which has been "#ifdef notused" for the past 13 years. OK uebayasi@
* Avoid buffer overflow on max line length by ending string with just one \0.tobias2014-06-271-2/+2
| | | | ok deraadt@
* Avoid buffer overflow if there were too many arguments, also adjust lenptobias2014-06-271-7/+9
| | | | | | | | to contain actually consumed space on truncation. bootarg_list can be static again, it's not referenced from outside. ok deraadt@
* Don't try to close(-1) if EPERM.miod2014-02-191-4/+3
|
* OK, loadrandom should not care about EPERM I supposederaadt2014-01-241-1/+3
|
* remove irrelevant error handling in loadrandom; this operates on thederaadt2014-01-242-15/+7
| | | | | principe of fire and forget, and we really want developers to start trying to write per-architecture XOR thingies using timers and such
* Only report about random seed failures, not attempts.deraadt2014-01-241-4/+4
| | | | Discussed with jsing
* loadrandom() status should be ignored, so that we do not loop.deraadt2014-01-021-4/+5
| | | | issue reported by halex
* Try to load entropy data from disk:/etc/random.seed, and additionallyderaadt2013-12-282-8/+56
| | | | | | | use a MD-supplied random function. Then, insert this into the ELF openbsd.randomdata of the kernel, so that it has entropy right from the start. Some help from jsing for the softraid aspects. Also tested by phessler
* remove junkderaadt2013-12-231-11/+1
|
* Tweak the behaviour of boot(8) on hppa. Normal boots now will give you akettenis2011-04-171-2/+3
| | | | | | | | | | | chance to interrupt the boot procedure before booting the default kernel, just like (most) of our other hardware platforms. Interactive boots, where you interrupt the firmware boot procedure and answer "Y" to the "Interact with IPL?" question will now wait for human intervention at the boot> prompt (without a timeout). Should reduce frustration when trying to boot an alternative kernel. ok deraadt@, miod@, jsing@, todd@
* add another settable variable called db_console which the MD parts of adlg2009-04-301-1/+31
| | | | | | | | | bootloader will pass to the kernel to allow you to force ddb.console to be set (and set early) on a machine without having to do it on a per kernel basis using code or config tweaks. requested by art@ (who owes me good whiskey now) no problem! deraadt@
* Cancel the automatic boot when you hold ctrl to skip boot.conf.sthen2009-02-161-1/+2
| | | | "I like it" deraadt "sweet" tedu "love it" marco
* loadfile() returns an open file descriptor on successful exit, sotom2007-06-261-2/+5
| | | | | | close it before going off to execute the newly-loaded kernel. ok deraadt@
* When bootfile was made global so that macppc could modify it, ittom2007-06-241-6/+6
| | | | | | | clashed with a global variable already used by the bootblocks. Therefore rename bootfile here to kernelfile. ok drahn@
* Switch macppc to the interactive bootloader in stand/boot.drahn2007-06-132-4/+5
| | | | Much more useable on serial console systems.
* remove support for many alternative kernel choices -- only try /bsd andderaadt2007-05-291-14/+8
| | | | | not the other stupid names. that feature was retarded. tested on a few architectures by a few people
* Check for Control key held down when starting, and don't read boot.conftom2007-04-271-1/+12
| | | | | | | | | | | if it is. This gives a way to recover from "switching to com0" when there's no serial cable handy. Bump version numbers. A similar change will be made to amd64 boot soon. ok toby@ deraadt@
* hand-cruft an isprint() for deciding which characters to echo to thederaadt2007-02-211-6/+8
| | | | | console; ignore all others. based on idea by didickman@gmail.com, ok tom
* printf(s) -> printf("%s", s)uwe2005-05-241-2/+2
|
* Simplify expression in loop.tom2004-06-261-2/+2
| | | | ok deraadt@
* Avoid spurious error message "line too long" (introduced with last commit,tom2004-06-251-3/+12
| | | | | | which fixed a buffer overflow here). ok weingart@
* Identify ourselves on the new console device when it's changed.tom2004-06-241-1/+3
| | | | ok weingart@
* Turn off timeouts if the user types anything at all. This prevents antom2004-06-242-5/+9
| | | | | | automatic boot in 5 seconds after you type "set tty com0", for example. "I like this" deraadt@, "oh! yes" henning@, ok weingart@
* Minor changes (structural, not behavioural) in order to support a regresstom2004-06-242-7/+20
| | | | | | test for boot command handling. Suggested by avsm@; discussed with avsm@ and weingart@ - thanks
* Add comment explaining what "bootprompt" is fortom2004-06-241-1/+3
|
* If a line in boot.conf is too long for our buffer, stop before wetom2004-06-241-9/+20
| | | | | | | | overrun the buffer, print an error message, then stop processing boot.conf. Also change name of variable "eof" to "rc", since it's not just for eof. ok weingart@
* Allow the machine-dependent part of BOOT to change the program name.tom2004-01-292-5/+10
| | | | ok weingart@, deraadt@
* typos from Jonathon Gray;jmc2003-11-081-2/+2
|
* ansification and knf and protosderaadt2003-08-115-75/+61
|
* three four kill ... dale agrees on this one as he holds a kprite on it toomickey2003-06-021-6/+1
|
* three four kill ...mickey2003-06-025-30/+5
|
* strcpy/strcat/sprintf removal in all bootblocks. various testing byderaadt2003-06-016-37/+48
| | | | | various people. outside of some messy things in src/gnu, only one thing in the main tree now violates this rule: bind