9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Jacob Moody <moody@mail.posixcafe.org>
To: 9front@9front.org
Subject: [9front] [PATCH] specify argument for new kernel in reboot(1)
Date: Sun, 5 Jun 2022 15:21:42 -0600	[thread overview]
Message-ID: <9de319f0-7881-1e38-3c47-341ef236038c@posixcafe.org> (raw)

This allows kernel configuration to be modified through
additional arguments to reboot.

; reboot /amd64/9pc64 'nobootprompt=tcp!'

---
diff df92301d8fc8310fbfdf3de91b97a156ca0504d4 uncommitted
--- a//rc/bin/reboot
+++ b//rc/bin/reboot
@@ -1,2 +1,11 @@
 #!/bin/rc
-echo reboot $* > /dev/reboot
+rfork e
+
+kern=$1
+shift
+for(i in $*){
+	kv=`'=' {echo -n $i}
+	echo $kv(2) >> '#ec/'$kv(1)
+}
+
+echo reboot $kern > /dev/reboot
--- a//sys/man/8/fshalt
+++ b//sys/man/8/fshalt
@@ -11,6 +11,9 @@
 [
 .I kernelpath
 ]
+[
+.IR key=value ...
+]
 .br
 .B scram
 .SH DESCRIPTION
@@ -41,6 +44,16 @@
 is specified then the machine will load and start that
 kernel directly instead of returning to the system rom. (see
 .IR cons (3)).
+The new kernel inherits the existing configuration stored
+in
+.B #ec
+(see
+.IR env (3)).
+Additional arguments in the form
+.I key=value
+will be overwrite keys in
+.B #ec
+before rebooting.
 .PP
 .I Scram
 shuts down the machine it is invoked on.

                 reply	other threads:[~2022-06-05 21:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9de319f0-7881-1e38-3c47-341ef236038c@posixcafe.org \
    --to=moody@mail.posixcafe.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).