Quellcode durchsuchen

rc/bin: add flag to fshalt to bypass loading a new kernel (thanks Steven Stallion)

David du Colombier vor 3 Jahren
Ursprung
Commit
f39bb73c12
2 geänderte Dateien mit 13 neuen und 3 gelöschten Zeilen
  1. 8 2
      rc/bin/fshalt
  2. 5 1
      sys/man/8/fshalt

+ 8 - 2
rc/bin/fshalt

@@ -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 @@ if (! ~ $#* 0)
 	case -r
 		reboot=yes
 		shift
+	case -R
+		loadkern=no
+		reboot=yes
+		shift
 	case -*
 		usage $0
 	}
@@ -53,7 +58,8 @@ fn usekernel {
 }
 
 # 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;'}

+ 5 - 1
sys/man/8/fshalt

@@ -6,6 +6,8 @@ fshalt, reboot \- halt any local file systems and optionally reboot the system
 [
 .B -r
 ] [
+.B -R
+] [
 .I new-kernel
 ]
 .br
@@ -26,7 +28,9 @@ servers.
 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