shithub: ninethings

Download patch

ref: 913a0d16bf8b82736a8f44b7b75324f3bb216629
parent: 122ea679f893515f80653f9abc9866bd8222e333
author: Aaron Bieber <aaron@bolddaemon.com>
date: Wed Nov 29 17:02:19 EST 2023

sysbuild: nuke and make libs, rename

--- /dev/null
+++ b/rc/sysbuild.rc
@@ -1,0 +1,54 @@
+#!/bin/rc -b
+rfork en
+
+build_news=/lib/news/build
+
+if(test -e /mnt/wsys/wctl){
+	echo scroll > /mnt/wsys/wctl
+}
+
+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 $build_news)
+	ver=`{cat $build_news}
+
+if(! ~ $force 1){
+	if(~ $ver $cid){
+		echo System up-to-date: $ver
+		exit 0
+	}
+}
+
+fn build{
+	mk && mk install
+}
+
+cd /sys/src
+mk nuke && mk libs && mk install
+
+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 Updated to $cid |tee >$build_news