Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/patch/9legacy/fshalt-bypass.diff

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


--- /n/sources/plan9/rc/bin/fshalt	Fri Jul 19 14:55:08 2013
+++ /rc/bin/fshalt	Fri Nov 29 09:55:35 2019
@@ -4,9 +4,10 @@
 rfork nes
 kern=()
 kerncopy=()
+loadkern=yes
 reboot=no
 fn usage {
-	echo usage: $1 '[-r] [new-kernel]' >[1=2]
+	echo usage: $1 '[-r] [-R] [new-kernel]' >[1=2]
 	exit usage
 }
 if (! ~ $#* 0)
@@ -14,6 +15,10 @@
 	case -r
 		reboot=yes
 		shift
+	case -R
+		loadkern=no
+		reboot=yes
+		shift
 	case -*
 		usage $0
 	}
@@ -53,7 +58,8 @@
 }
 
 # make a copy of the right kernel
-if (~ $reboot yes) {
+if (~ $reboot yes)
+if (~ $loadkern yes) {
 	if (~ $#kern 0)
 		kern=`{echo $terminal |
 			sed 's;^([^ ]+) .*/([^/ ]+).*$;/n/boot/'$cputype'/9\2;'}
--- /n/sources/plan9/sys/man/8/fshalt	Thu Jun 13 16:28:02 2013
+++ /sys/man/8/fshalt	Fri Nov 29 10:03:14 2019
@@ -6,6 +6,8 @@
 [
 .B -r
 ] [
+.B -R
+] [
 .I new-kernel
 ]
 .br
@@ -26,7 +28,9 @@
 If given
 .BR -r ,
 .I fshalt
-will then reboot the machine.
+will then reboot the machine by loading a new kernel. Specifying
+.BR -R
+will bypass loading a new kernel and restart the machine.
 If
 .I new-kernel
 is given, it will be loaded as the new kernel rather than

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.