shithub: riscv

Download patch

ref: 0461c5843310c5c51bf43b0835f180492e32f579
parent: e9a55e0333d2da1f0f3a129310cf210684590494
author: stanley lieber <[email protected]>
date: Wed May 4 14:55:08 EDT 2011

add cpu server to the installer; add more files for cpu server; make sure they are included on the cd-rom.

--- a/cfg/cirno/cpurc
+++ b/cfg/cirno/cpurc
@@ -7,6 +7,7 @@
 
 # example: adjust to fit your network
 ip/ipconfig -g 192.168.0.1 ether /net/ether0 192.168.0.2 255.255.255.0
+ndb/dns -rs
 
 # outgoing mail will appear to originate from this domain
 site=9front
--- a/cfg/cirno/termrc
+++ b/cfg/cirno/termrc
@@ -1,5 +1,6 @@
 # example: adjust to fit your network
 ip/ipconfig -g 192.168.0.1 ether /net/ether0 192.168.0.2 255.255.255.0
+ndb/dns -r
 
 # outgoing mail will appear to originate from this domain
 site=9front
--- a/lib/ndb/local
+++ b/lib/ndb/local
@@ -8,7 +8,22 @@
 
 auth=sources.cs.bell-labs.com authdom=outside.plan9.bell-labs.com
 
+auth=cirno.9front authdom=9front
+
+ntp=pool.ntp.org
+
 #
 #  because the public demands the name localsource
 #
 ip=127.0.0.1 sys=localhost dom=localhost
+
+# example: adjust to fit your network
+ipnet=9front ip=192.168.0.0 ipmask=255.255.255.0
+	auth=cirno.9front
+	cpu=cirno.9front
+	dns=192.168.0.2
+	dnsdom=9front
+	smtp=cirno.9front
+
+ip=192.168.0.1 sys=gw dom=gw.9front
+ip=192.168.0.2 sys=cirno dom=cirno.9front
--- a/rc/bin/cpurc
+++ b/rc/bin/cpurc
@@ -38,8 +38,8 @@
 
 # If you are on an auth server, start these before listening:
 #
-# auth/keyfs -wp -m /mnt/keys /adm/keys >/dev/null >[2=1]
-# auth/cron >>/sys/log/cron >[2=1] &
+auth/keyfs -wp -m /mnt/keys /adm/keys >/dev/null >[2=1]
+auth/cron >>/sys/log/cron >[2=1] &
 #
 # also rename some files:
 #
--- a/rc/bin/cpurc.local
+++ b/rc/bin/cpurc.local
@@ -9,3 +9,6 @@
 fileserver=kfs
 # replace FACEDOM with the local domain to be used in the faces database
 facedom=FACEDOM
+
+for(i in m i P S t)
+	bind -a '#'^$i /dev >/dev/null >[2=1]
--- /dev/null
+++ b/rc/bin/inst/authsetup
@@ -1,0 +1,36 @@
+#!/bin/rc
+
+# desc: set system password for auth, invalidate nvram
+# prereq: systype copydist
+
+nvram=`{echo `{basename -d $fs}^/nvram}
+
+switch($1) {
+case checkdone
+	if(! ~ $syst cpu || ! grep trust $nvram){
+		authsetup=ready
+		export authsetup
+	}
+case go
+	echo
+	echo 'Setup keyfs and provide a password for the machine'
+	echo
+
+	auth/keyfs
+
+	if(! grep trust $nvram)
+		echo 'trust, but verify' >$nvram >[2=1]
+
+	echo
+	echo 'You will be asked to enter an authid, authdom, secstore key,'
+	echo 'and password upon next boot. The authid is the hostowner.'
+	echo 'The authdom is the domain from your network configuration.'
+	echo 'The secstore key and password should be a secret password'
+	echo 'of eight characters or greater in length. Remember the'
+	echo 'password, you will need to use it again when creating the'
+	echo 'bootes user on the auth server.'
+	echo
+
+	authsetup=done
+	export authsetup
+}
--- a/rc/bin/inst/bootsetup
+++ b/rc/bin/inst/bootsetup
@@ -1,7 +1,7 @@
 #!/bin/rc
 
 # desc: create a boot floppy or configure hard disk to boot plan 9
-# prereq: copydist
+# prereq: systype copydist
 
 switch($1) {
 case go
@@ -18,9 +18,14 @@
 	}
 
 	if(! test -f /tmp/plan9.ini) {
+		if(~ $syst cpu)
+			bootfile=9pccpuf
+		if not
+			bootfile=9pcf
 		{
-			echo 'bootfile=9pcf'
+			echo 'bootfile='^$bootfile
 			echo 'bootargs=local!'^$fs
+			echo 'sysname=cirno'
 			echo 'mouseport='^$mouseport
 			echo 'monitor='^$monitor
 			echo 'vgasize='^$vgasize
@@ -47,6 +52,7 @@
 	logprog cp /tmp/plan9.ini /n/9fat/plan9.ini
 	logprog cp /n/newfs/386/9bootfat /n/9fat/9bootfat
 	logprog cp /n/newfs/386/9pcf /n/9fat/9pcf
+	logprog cp /n/newfs/386/9pccpuf /n/9fat/9pccpuf
 
 	echo
 	echo 'There are myriad ways to boot a Plan 9 system.'
--- a/rc/bin/inst/main
+++ b/rc/bin/inst/main
@@ -12,6 +12,7 @@
 
 # must be topologically sorted (by prereq)
 tasks=(\
+	systype\
 	configfs\
 	partdisk prepdisk\
 	mountfs\
@@ -20,6 +21,7 @@
 	mountdist\
 	download\
 	copydist\
+	authsetup\
 	bootsetup finish stop\
 	stopether stopppp\
 )
--- a/rc/bin/inst/mountcwfs
+++ b/rc/bin/inst/mountcwfs
@@ -1,6 +1,7 @@
 #!/bin/rc
 
 # desc: choose and mount file system partition
+# prereq: systype
 
 switch($1){
 case go
@@ -61,8 +62,10 @@
 				echo service cwfs
 				echo config $fs
 
-				# new config option
-				echo noauth
+				if(! ~ $syst cpu){
+					# new config option
+					echo noauth
+				}
 
 				echo filsys main c'('$fs')('$fsworm')'
 				echo filsys dump o
@@ -97,18 +100,23 @@
 		echo cfs main
 		echo create /adm adm adm 775 d
 		echo create /adm/users adm adm 664
-		echo create /usr sys sys 775 d
 		echo create /dist sys sys 775 d
+		echo create /usr sys sys 775 d
+		echo newuser adm +bootes
+		echo newuser sys +bootes
+		echo newuser upas +bootes
 		echo newuser $user
-		echo newuser sys +$user
 		echo newuser adm +$user
+		echo newuser sys +$user
 		echo newuser upas +$user
 		if(! ~ $fsother ''){
 			echo cfs other
+			echo create /dist sys sys 775 d
 			echo create /usr sys sys 775 d
+			echo create /usr/bootes bootes bootes 775 d
+			echo create /usr/bootes/tmp bootes bootes 750 d
 			echo create /usr/$user $user $user 775 d
 			echo create /usr/$user/tmp $user $user 750 d
-			echo create /dist sys sys 775 d
 			echo cfs main
 		}
 	} >>/srv/cwfs.cmd
--- /dev/null
+++ b/rc/bin/inst/systype
@@ -1,0 +1,23 @@
+#!/bin/rc
+
+# desc: choose system type
+
+switch($1){
+case checkdone
+	if(~ $#syst 1 && ~ $syst cpu terminal)
+		systype=done
+	if not
+		systype=ready
+	export systype
+	if(~ $syst terminal)
+		tasks=`{echo $tasks | sed 's/authsetup//g'}
+	export tasks
+case go
+	echo
+
+	options=(terminal cpu)
+	
+	prompt -d terminal 'System type' $options
+	syst=$rd
+	export syst
+}
--- a/sys/lib/sysconfig/proto/cdproto
+++ b/sys/lib/sysconfig/proto/cdproto
@@ -3,10 +3,13 @@
 adm	d775 adm adm
 	uid=adm
 	gid=adm
+	keys.who 665
 	timezone	d775
 		*
 cfg	d775
 	+
+cron	d777 sys sys
+	bootes	d775 bootes bootes
 fd	d775
 lib	d775
 	+
@@ -16,6 +19,8 @@
 	uid=upas
 	gid=upas
 	box	d775
+		bootes	d775 bootes bootes
+			mbox	a662 bootes bootes
 		glenda	d775 glenda glenda
 			mbox	a662 glenda glenda
 	faxoutqueue	d777
@@ -88,7 +93,8 @@
 	lib	d775
 		skip=\.(pyo|pyc)$
 		+
-	log	d775
+	log	d777 sys sys
+		cron	a664 bootes bootes
 	man	d775
 		+
 	src	d775
@@ -97,6 +103,17 @@
 		
 tmp	d555
 usr	d775
+	bootes	d775 bootes bootes
+		uid=bootes
+		gid=bootes
+		bin d775
+			386 d775
+				+
+			rc d775
+				+
+		lib d775
+			*
+		tmp d775
 	glenda	d775 glenda glenda
 		uid=glenda
 		gid=glenda
--- /dev/null
+++ b/usr/bootes/lib/plumbing
@@ -1,0 +1,6 @@
+# to update: cp /usr/bootes/lib/plumbing /mnt/plumb/rules
+
+editor = acme
+
+include basic
+
--- /dev/null
+++ b/usr/bootes/lib/profile
@@ -1,0 +1,39 @@
+bind -a $home/bin/rc /bin
+bind -a $home/bin/$cputype /bin
+bind -c $home/tmp /tmp
+font = /lib/font/bit/pelm/euro.9.font
+switch($service){
+case terminal
+	plumber
+	startupasfs
+	echo -n accelerated > '#m/mousectl'
+	echo -n 'res 3' > '#m/mousectl'
+	prompt=('term% ' '	')
+	fn term%{ $* }
+	exec rio
+case cpu
+	if (test -e /mnt/term/mnt/wsys) {
+		# rio already running
+		wsys = /mnt/term^`{cat /mnt/term/env/wsys}
+		bind -a /mnt/term/mnt/wsys /dev
+		echo -n $sysname > /dev/label
+	}
+	bind /mnt/term/dev/cons /dev/cons
+	bind /mnt/term/dev/consctl /dev/consctl
+	bind -a /mnt/term/dev /dev
+	prompt=('cpu% ' '	')
+	fn cpu%{ $* }
+	startupasfs
+	news
+	if (! test -e /mnt/term/mnt/wsys) {
+		# cpu call from drawterm
+		font=/lib/font/bit/pelm/latin1.8.font
+		plumber
+		auth/factotum
+		exec rio
+	}
+case con
+	prompt=('cpu% ' '	')
+	startupasfs
+	news
+}