summaryrefslogtreecommitdiff
path: root/svc/termrc.work
diff options
context:
space:
mode:
authorCalvin <calvinm@kissingerassoc.com>2026-08-16 20:52:12 -0400
committerCalvin <calvinm@kissingerassoc.com>2026-08-16 20:52:12 -0400
commit147b0ca1e4e00f66abb47fff3c543b853033f609 (patch)
treea388172fc16723c139deff1e45a74c3d1c567cc0 /svc/termrc.work
Initial commit: svc supervisor, design docs, session transcript
Existing work moved from /storage/vms/9front/svc, previously unversioned. Object files and linked binaries excluded via .gitignore.
Diffstat (limited to 'svc/termrc.work')
-rwxr-xr-xsvc/termrc.work80
1 files changed, 80 insertions, 0 deletions
diff --git a/svc/termrc.work b/svc/termrc.work
new file mode 100755
index 0000000..9c12bf0
--- /dev/null
+++ b/svc/termrc.work
@@ -0,0 +1,80 @@
+#!/bin/rc
+# this file is run if service=terminal
+TIMESYNCARGS=(-rLa1000000)
+
+# parallelism for mk
+NPROC=`{wc -l </dev/sysstat}
+
+# bind all likely devices
+for(i in P S f æ t L A J '$')
+ bind -qa '#'^$i /dev
+rm -f /env/i
+
+mount -qb /srv/cons /dev
+
+# serial shell for host-side control
+while(){ rc -i </dev/eia0 >/dev/eia0 >[2=1]; sleep 1 }&
+
+# mount points (if not done by bootrc already)
+>[2]/dev/null {
+mntgen -s slashn /n && chmod 666 /srv/slashn
+mntgen -s slashmnt /mnt && chmod 666 /srv/slashmnt
+mntgen -s mntexport /mnt/exportfs && chmod 666 /srv/mntexport}
+
+# now that /mnt exists, mount factotum
+mount /srv/factotum /mnt/factotum factotum
+bind -q /mnt/factotum/factotum /mnt/factotum
+
+# usb listener
+nusbrc
+
+# supervised services. cs, dns and timesync are defined in /lib/svc and
+# are started from here on; if svcinit will not run the machine still boots,
+# it just has none of them.
+if(test -e /amd64/bin/svcinit && test -d /lib/svc)
+ svcinit -s svc -m /mnt/svcs >>/sys/log/svcinit >[2=1] &
+
+# we do this before we have a name. we may need to do network
+# setup so that we can get a name.
+if(test -e /rc/bin/termrc.local)
+ . /rc/bin/termrc.local
+
+# cs is a service; see /lib/svc/cs
+sysname=`{cat /dev/sysname}
+if(~ $#sysname 0 || ~ $sysname ''){
+ sysname=cirno # default
+ echo -n $sysname >/dev/sysname
+}
+
+# set up any partitions
+diskparts
+
+# start up local swapping
+disk=`{ls /dev/sd*/swap >[2]/dev/null}
+if (! ~ $#disk 0)
+ swap $disk(1) >/dev/null >[2=1]
+rm -f /env/disk
+
+# machine specific startup (e.g., for devices not probed)
+if(test -e /cfg/$sysname/termrc)
+ . /cfg/$sysname/termrc
+
+# ip configuration is a service; see /lib/svc/ipconfig
+
+# dns is a service; see /lib/svc/dns
+
+# timesync is a service; see /lib/svc/timesync
+
+# setup mouse and graphics
+screenrc
+
+if(test -f /dev/apm)
+ aux/apm
+
+if(~ $terminal *reform*){
+ reform/pm
+ reform/audio
+}
+
+dontkill '^(9660srv|cfs|cs|cwfs.*|disk|dns|dossrv|ether|factotum|gefs|hjfs|ipconfig|kb|kfs|mntgen|paqfs|reboot|usbd|venti|wpa)$'
+