summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Moody <moody@posixcafe.org>2022-06-14 08:16:57 +0000
committerJacob Moody <moody@posixcafe.org>2022-06-14 08:16:57 +0000
commitbe1789d78bcf1be0cc48cd036942969824dacfa5 (patch)
treed8883c84957d124c886d9a68030893af03491d15
parent28709be9a68beaff12f7227f49fae1fc49be0660 (diff)
kernel: bootrc: add bootloop=
-rw-r--r--sys/man/8/plan9.ini6
-rwxr-xr-xsys/src/9/boot/bootrc5
-rwxr-xr-xsys/src/9/boot/reboot.rc1
3 files changed, 12 insertions, 0 deletions
diff --git a/sys/man/8/plan9.ini b/sys/man/8/plan9.ini
index 8be2e4f47..8d9ad93a5 100644
--- a/sys/man/8/plan9.ini
+++ b/sys/man/8/plan9.ini
@@ -712,6 +712,12 @@ Suppress the
prompt and use
.I value
as the answer instead.
+.SS \fLbootloop=\fIvalue\fP
+Always use
+.I value
+as the answer to the
+.L bootargs
+prompt, retrying if unsuccessful.
.SS \fLrootdir=\fB/root/\fIdir\fP
.SS \fLrootspec=\fIspec\fP
Changes the mount arguments for the root file server
diff --git a/sys/src/9/boot/bootrc b/sys/src/9/boot/bootrc
index c0823e6f4..49a936381 100755
--- a/sys/src/9/boot/bootrc
+++ b/sys/src/9/boot/bootrc
@@ -68,6 +68,11 @@ mt=()
fn main{
mp=()
while(~ $#mp 0){
+ if(! ~ $#bootloop 0){
+ nobootprompt=$bootloop
+ # 'flatten' for the next boot
+ echo -n $bootloop > '#ec/bootloop'
+ }
if(~ $#nobootprompt 0){
echo
showlocaldevs
diff --git a/sys/src/9/boot/reboot.rc b/sys/src/9/boot/reboot.rc
index 536ac2009..e2521b768 100755
--- a/sys/src/9/boot/reboot.rc
+++ b/sys/src/9/boot/reboot.rc
@@ -32,6 +32,7 @@ fn connectreboot {
# set new kernel parameters
echo -n $bootargs > '#ec/bootargs'
+ rm -f '#ec/bootloop'
# remove part of our temporary root
/mnt/broot/$cputype/bin/unmount /$cputype/bin /bin