shithub: ninethings

Download patch

ref: 58def1b6b397519cca5cd753fec20c102f9cdcc9
parent: 3846b37df35fbe47340b421cc7e0c7e39475e176
author: Aaron Bieber <[email protected]>
date: Fri Nov 3 16:03:14 EDT 2023

add mkfiles and move things around

diff: cannot open a/rc/bin//null: file does not exist: 'a/rc/bin//null'
--- /dev/null
+++ b/mkfile
@@ -1,0 +1,20 @@
+</$objtype/mkfile
+
+DIRS=`{echo */mkfile | sed 's,/mkfile *,\n,g'}
+
+</sys/src/cmd/mkmany
+
+%.dirs:V:
+	for(i in $DIRS) @{
+		cd $i
+		echo mk $i
+		mk $MKFLAGS $stem
+	}
+
+all:V:
+	mk $MKFLAGS all.dirs
+
+%.install:V: $BIN/%
+
+install:V:
+	mk $MKFLAGS install.dirs
--- a/rc/bin/drawlisten
+++ /dev/null
@@ -1,7 +1,0 @@
-#!/bin/rc
-rfork en
-pw=`{echo | awk 'BEGIN { srand() } END { print rand() }'}
-echo $pw
-echo 'key proto=dp9ik dom=cirno user='$user' !password='$pw >/mnt/factotum/ctl
-aux/listen1 -t 'tcp!*!rcpu' /rc/bin/service/tcp17019
-
--- a/rc/bin/sysbuild
+++ /dev/null
@@ -1,49 +1,0 @@
-#!/bin/rc -b
-rfork en
-
-flagfmt='f:force';
-eval `''{aux/getflags $*} || exec aux/usage
-
-cd /
-if(! test -d .git)
-	bind -ac /dist/plan9front /
-branch=`{git/branch}
-cid=`{cat /.git/refs/$branch}
-ver=unknown
-
-if(test -f /sys/version)
-	ver=`{cat /sys/version}
-
-if(! ~ $force 1){
-	if(~ $ver $cid){
-		echo System up-to-date: $ver
-		exit 0
-	}
-}
-
-fn build{
-	mk && mk install
-}
-
-cd /sys/src
-build
-
-machine=`{echo $terminal | awk -F/ '{print $5}'}
-switch($machine){
-case imx8
-	cd /sys/src/9/imx8
-	build
-	if(! test -f /srv/ext4)
-		ext4srv
-	mount /srv/ext4 /n/emmc /dev/sdO0/linux
-	cp /arm64/9reform.u /n/emmc/
-case pc64
-	cd /sys/src/9/pc64
-	build
-	bind -a '#S' /dev
-	9fs 9fat
-	cp /amd64/9pc64 /n/9fat/
-}
-
-echo $cid >/sys/version
-echo Updated to $cid
--- /dev/null
+++ b/rc/drawlisten
@@ -1,0 +1,7 @@
+#!/bin/rc
+rfork en
+pw=`{echo | awk 'BEGIN { srand() } END { print rand() }'}
+echo $pw
+echo 'key proto=dp9ik dom=cirno user='$user' !password='$pw >/mnt/factotum/ctl
+aux/listen1 -t 'tcp!*!rcpu' /rc/bin/service/tcp17019
+
--- /dev/null
+++ b/rc/mkfile
@@ -1,0 +1,17 @@
+</$objtype/mkfile
+
+BIN=/rc/bin/9am
+RC=\
+	drawlisten\
+	sysbuild
+
+</sys/src/cmd/mkmany
+
+install:V:
+	mkdir -p $BIN
+	for (i in $RC)
+		mk $MKFLAGS $i.rcinstall
+
+%.rcinstall:V:
+	cp $stem $BIN/$stem
+	chmod +x $BIN/$stem
--- /dev/null
+++ b/rc/sysbuild
@@ -1,0 +1,49 @@
+#!/bin/rc -b
+rfork en
+
+flagfmt='f:force';
+eval `''{aux/getflags $*} || exec aux/usage
+
+cd /
+if(! test -d .git)
+	bind -ac /dist/plan9front /
+branch=`{git/branch}
+cid=`{cat /.git/refs/$branch}
+ver=unknown
+
+if(test -f /sys/version)
+	ver=`{cat /sys/version}
+
+if(! ~ $force 1){
+	if(~ $ver $cid){
+		echo System up-to-date: $ver
+		exit 0
+	}
+}
+
+fn build{
+	mk && mk install
+}
+
+cd /sys/src
+build
+
+machine=`{echo $terminal | awk -F/ '{print $5}'}
+switch($machine){
+case imx8
+	cd /sys/src/9/imx8
+	build
+	if(! test -f /srv/ext4)
+		ext4srv
+	mount /srv/ext4 /n/emmc /dev/sdO0/linux
+	cp /arm64/9reform.u /n/emmc/
+case pc64
+	cd /sys/src/9/pc64
+	build
+	bind -a '#S' /dev
+	9fs 9fat
+	cp /amd64/9pc64 /n/9fat/
+}
+
+echo $cid >/sys/version
+echo Updated to $cid