9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [PATCH] Preserve nobootprompt
@ 2022-06-09 17:14 Jacob Moody
  0 siblings, 0 replies; only message in thread
From: Jacob Moody @ 2022-06-09 17:14 UTC (permalink / raw)
  To: 9front

In our bootrc we currently completely blank out
nobootprompt. If you are attempting to do a warm
reboot into another kernel, it is quite annoying
to respecify it for each boot. We were blanking it
(seemingly) due to how rc(1) stashes lists in to /env/, which is
using a null between list members. This would cause the kernel
to skip all arguments past the first when doing successive reboots.

Instead we can 'flatten' the variable back in to '#ec' on the way
out to preserve things how we found them.

diff 1b5ea51ee1203952900fafc0def48985d900f7a7 uncommitted
--- a//sys/src/9/boot/bootrc
+++ b//sys/src/9/boot/bootrc
@@ -74,7 +74,6 @@
 			ask bootargs ' is (tcp, tls, il, local!device)' $"bootargs
 		if not bootargs=$nobootprompt
-		nobootprompt=()
 		mn=`{echo $bootargs | sed 's,!, ,'}
@@ -146,6 +145,9 @@
 		if not
 			init=($init -t)
+	if(! ~ $#nobootprompt 0)
+		echo -n $nobootprompt > '#ec/nobootprompt'

 	# remove enviroment variables
 	rm -f '#e/'^$mt '#e/'? '#e/'?? '#e/fn#'*

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-09 17:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 17:14 [9front] [PATCH] Preserve nobootprompt Jacob Moody

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).