ref: 58444da3151734e66122926542fcf41235f612ef
parent: 5438a58a546f119dd7d1fbc1c6b39b2c9814305d
author: Jacob Moody <moody@posixcafe.org>
date: Tue Jun 14 04:16:57 EDT 2022
kernel: bootrc: add bootloop=
--- a/sys/man/8/plan9.ini
+++ b/sys/man/8/plan9.ini
@@ -712,6 +712,12 @@
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
--- a/sys/src/9/boot/bootrc
+++ b/sys/src/9/boot/bootrc
@@ -68,6 +68,11 @@
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
--- a/sys/src/9/boot/reboot.rc
+++ b/sys/src/9/boot/reboot.rc
@@ -32,6 +32,7 @@
# 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
--
⑨