shithub: 9ferno

Download patch

ref: 52f8d420c74c33aed20043fbea77752bbac4bc95
parent: e74fa5bc5a9171c3b21e2a616f4b8ac98c472067
author: joe9 <joe9mail@gmail.com>
date: Fri Jul 30 13:09:09 EDT 2021

working kfs shutdown hack

--- a/dis/shutdown	Fri Jul 30 00:10:28 2021
+++ b/dis/shutdown	Fri Jul 30 13:09:09 2021
@@ -1,15 +1,30 @@
-#!/dis/sh
+#!/dis/sh -nx
 load std
 x=$*
-{~ $#x 1 && ~ ${hd $x} -h -r} || {echo usage: shutdown -h or shutdown -r >[1=2]; exit usage}
+{~ $#x 1 && ~ ${hd $x} -h -r} || {
+	echo usage: shutdown -h or shutdown -r >[1=2];
+	exit usage
+}
 # the following is a bit pointless until kfs has halt
 #	but, the sync will atleast write out all the dirty blocks
 ftest -f /dis/disk/kfscmd.dis && {
 	for(a in /chan/kfs.*.cmd){
 		b=${hd ${tl ${split '.' $a}}}
-		~ $b '*' || disk/kfscmd -n $b sync # halt
+		~ $"b '\*' || {
+			disk/kfscmd -n $b sync # halt
+		}
 	}
 }
+
+# need a better way of doing this - this is dumb
+#	there is no way to clean up all the mounts and binds
+ns | grep '/n/rootdisk/dis /dis' &&
+	unmount /n/rootdisk/dis /dis
+unmount /n/rootdisk /
+unmount /n/rootdisk
+status=()
+ns
+
 if {~ $1 -r} {
 	echo reboot >/dev/sysctl
 } {~ $1 -h} {
--- a/os/pc64/pc64	Fri Jul 30 00:10:28 2021
+++ b/os/pc64/pc64	Fri Jul 30 13:09:09 2021
@@ -178,6 +178,7 @@
 	/dis/cat.dis
 	/dis/bind.dis
 	/dis/mount.dis
+	/dis/unmount.dis
 	/dis/mntgen.dis
 	/dis/pwd.dis
 	/dis/echo.dis