summaryrefslogtreecommitdiffstats
path: root/sys/stand
AgeCommit message (Collapse)AuthorFilesLines
2020-06-15align the random buffer so mdrandom() can fill it with register-widthnaddy1-2/+2
writes without incurring unaligned accesses; ok deraadt@
2020-05-26/etc/random.seed reuse can now be detected. The stat +T bit marks the filederaadt1-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...
2020-05-25make loadrandom() return 0 for success, -1 for failure. While here,deraadt2-13/+18
relax the fstat() check because the system will have left the file in the right mode. ok visa kettenis
2020-05-25If either mdrandom() or fwrandom() return 0, set RB_GOODRANDOMderaadt1-3/+5
ok kettenis
2020-05-25Adjust fwrandom() to return 0 for sucess, -1 for failurederaadt1-3/+3
2019-12-02For 32 bit systems, cast the long long used by strtoll() to unsigned longderaadt1-2/+2
and then a void * for calling the hexdump() operator with bluhm
2019-11-28Implement a hexdump command in the boot loader. This helps tobluhm1-1/+26
inspect the memory layout that the firmware has created. It is especially useful for UEFI debugging. OK deraadt@ kettenis@
2019-10-29Use arc4 to bit-spread the 512-byte random buffer over the .openbsd.randomdataderaadt1-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
2019-08-03In the bootblocks, after discovering and opening /bsd.upgrade, fchmod -xderaadt2-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
2019-05-10Fix prototype of upgrade(). OK benno@claudio1-2/+2
2019-04-10Unbreak "boot bsd.up" line in /etc/boot.confflorian1-3/+3
Found the hard way by Raf Czlonka (rczlonka AT gmail), thanks! OK deraadt
2019-04-10change marks[] array to uint64_t, so the code can track full 64-bitderaadt1-2/+2
details from the ELF header instead of faking it. Proposal from mlarkin, tested on most architectures already
2019-04-08Detect /bsd.upgrade kernel and boot it if present instead of defaultflorian3-3/+18
/bsd. To be used for unattended upgrades in the future. Idea & OK deraadt
2018-04-08Add a hook to use a firmware-supplied random function in addition to thekettenis2-3/+7
MD-supplied random function to insert entropy into the kernel. ok deraadt@
2017-06-19As early as possible, create a link /bsd.booted to the /bsd kernel wederaadt1-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
2017-02-28Update header to clean up defines, add the SATA device path and thepatrick1-7/+38
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL protocol. ok yasuoka@
2017-01-20Fix (currently unused) GUID definitions to match the EFI_GUID struct.jsg9-18/+17
2016-12-13Add an efibind.h for arm64. Taken from edk2, modified to be similarpatrick1-0/+165
to our arm version. ok millert@
2016-05-11Add an efibind.h for arm; from FreeBSD.kettenis1-0/+165
2016-05-11Move EFI header files to a location where they can be used on otherkettenis21-0/+4801
architectures besides amd64. ok deraadt@, krw@
2015-09-02Initial commit of uefi boot loader of OpenBSD.yasuoka2-2/+48
ok deraadt yuo
2014-07-20Merge cmd.c from zboot into boot, dropping "clear" command while at it.tobias1-26/+21
With input from deraadt@ okay jasper@, uebayashi@
2014-07-11whatever mickey had to drink 13 years ago, he's not going to find it again. sojasper1-14/+1
just remove the comment and unneeded functionality which has been "#ifdef notused" for the past 13 years. OK uebayasi@
2014-06-27Avoid buffer overflow on max line length by ending string with just one \0.tobias1-2/+2
ok deraadt@
2014-06-27Avoid buffer overflow if there were too many arguments, also adjust lenptobias1-7/+9
to contain actually consumed space on truncation. bootarg_list can be static again, it's not referenced from outside. ok deraadt@
2014-02-19Don't try to close(-1) if EPERM.miod1-4/+3
2014-01-24OK, loadrandom should not care about EPERM I supposederaadt1-1/+3
2014-01-24remove irrelevant error handling in loadrandom; this operates on thederaadt2-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
2014-01-24Only report about random seed failures, not attempts.deraadt1-4/+4
Discussed with jsing
2014-01-02loadrandom() status should be ignored, so that we do not loop.deraadt1-4/+5
issue reported by halex
2013-12-28Try to load entropy data from disk:/etc/random.seed, and additionallyderaadt2-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
2013-12-23remove junkderaadt1-11/+1
2013-06-01Remove the old mkuboot since it was moved.bmercer3-395/+0
yes of course deraadt@
2013-05-30Make mkuboot install into the path so we can use it during builds.bmercer1-1/+2
OK jasper@
2011-04-17Tweak the behaviour of boot(8) on hppa. Normal boots now will give you akettenis1-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@
2010-07-10Remove debug print left in on last commit.drahn1-2/+1
2010-06-30tweak previous;jmc2-4/+4
2010-06-30Add support for naming images and setting the type, including boot scripts.drahn2-9/+81
Input from deraadt@ and mk@
2010-03-10fix the option that sets the image operating system.sobrado1-3/+3
ok jmc@
2010-02-12Add mkuboot, a utility to build images for Das U-Boot.mk3-0/+323
This code is basically sys/arch/socppc/stand/mkboot/ but fixed to work on little endian machines and extended slightly to allow specifying the image OS and platform. Input from drahn and kettenis. ok kettenis
2009-04-30add another settable variable called db_console which the MD parts of adlg1-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@
2009-02-16Cancel the automatic boot when you hold ctrl to skip boot.conf.sthen1-1/+2
"I like it" deraadt "sweet" tedu "love it" marco
2007-06-26loadfile() returns an open file descriptor on successful exit, sotom1-2/+5
close it before going off to execute the newly-loaded kernel. ok deraadt@
2007-06-24When bootfile was made global so that macppc could modify it, ittom1-6/+6
clashed with a global variable already used by the bootblocks. Therefore rename bootfile here to kernelfile. ok drahn@
2007-06-13Switch macppc to the interactive bootloader in stand/boot.drahn2-4/+5
Much more useable on serial console systems.
2007-05-29these standalone commands are never used anymore; ok tomderaadt3-252/+0
2007-05-29remove support for many alternative kernel choices -- only try /bsd andderaadt1-14/+8
not the other stupid names. that feature was retarded. tested on a few architectures by a few people
2007-04-27Check for Control key held down when starting, and don't read boot.conftom1-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@
2007-02-21hand-cruft an isprint() for deciding which characters to echo to thederaadt1-6/+8
console; ignore all others. based on idea by didickman@gmail.com, ok tom
2005-05-24printf(s) -> printf("%s", s)uwe1-2/+2