shithub: riscv

Download patch

ref: 8b93667775fb7cd82bc0d7c6b5b566b577081fce
parent: 31ed86ce239e3be6233cd707e838b5e1c834edfa
author: cinap_lenrek <[email protected]>
date: Fri Aug 17 14:19:03 EDT 2012

lib/profile: remove startupasfs, start rio as subprocess so we drop to rc if it fails (no framebuffer), drawterm

--- a/sys/lib/dist/usr/glenda/lib/profile
+++ b/sys/lib/dist/usr/glenda/lib/profile
@@ -6,16 +6,10 @@
 if(! syscall create /tmp/xxx 1 0666 >[2]/dev/null)
 	ramfs	# in case we're running off a cd
 font=/lib/font/bit/vga/unicode.font
-fn cd { builtin cd $* && awd }  # for acme
 switch($service){
 case terminal
-	if(! test -w $home/lib/webcookies){
-		touch /tmp/webcookies
+	if(! webcookies >[2]/dev/null)
 		webcookies -f /tmp/webcookies
-	}
-	if not {
-		webcookies
-	}
 	webfs
 	plumber
 	echo -n accelerated > '#m/mousectl'
@@ -22,22 +16,18 @@
 	echo -n 'res 3' > '#m/mousectl'
 	prompt=('term% ' '	')
 	fn term%{ $* }
-	exec rio -i riostart
+	rio -i riostart
 case cpu
-	if (test -e /mnt/term/mnt/wsys) { # rio already running
-		bind -a /mnt/term/mnt/wsys /dev
-		if(test -w /dev/label)
-			echo -n $sysname > /dev/label
-	}
 	bind /mnt/term/dev/cons /dev/cons
-	bind /mnt/term/dev/consctl /dev/consctl
+	bind -q /mnt/term/dev/consctl /dev/consctl
+	>[2] /dev/null {
+		cp /dev/sysname /mnt/term/dev/label
+		if(wsys=`{cat /mnt/term/env/wsys})
+			wsys=/mnt/term^$wsys
+	} 
 	bind -a /mnt/term/dev /dev
 	prompt=('cpu% ' '	')
 	fn cpu%{ $* }
-	if (! test -e /mnt/term/mnt/wsys) {	# cpu call from drawterm
-		font=/lib/font/bit/vga/unicode.font
-		exec rio
-	}
 case con
 	prompt=('cpu% ' '	')
 }
--- a/sys/lib/newuser
+++ b/sys/lib/newuser
@@ -10,8 +10,6 @@
 x='$'
 mkdir bin bin/rc bin/mips bin/386 bin/power bin/arm
 mkdir lib tmp
-touch lib/webcookies
-chmod 600 lib/webcookies
 chmod +t tmp
 bind -qc /n/other/usr/$user/tmp $home/tmp
 bind -c $home/tmp /tmp
@@ -30,35 +28,32 @@
 	webcookies
 	webfs
 	plumber
-	startupasfs
 	echo -n accelerated > '#m/mousectl'
 	echo -n 'res 3' > '#m/mousectl'
 	prompt=('term% ' '	')
 	fn term%{ $x^* }
-	exec rio
+	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 $x^sysname > /dev/label
-	}
 	bind /mnt/term/dev/cons /dev/cons
-	bind /mnt/term/dev/consctl /dev/consctl
+	bind -q /mnt/term/dev/consctl /dev/consctl
+	>[2] /dev/null {
+		cp /dev/sysname /mnt/term/dev/label
+		if(wsys=`{cat /mnt/term/env/wsys})
+			wsys=/mnt/term^$x^wsys
+	} 
 	bind -a /mnt/term/dev /dev
 	prompt=('cpu% ' '	')
 	fn cpu%{ $x^* }
-	startupasfs
-	if (! test -e /mnt/term/mnt/wsys) {
-		# cpu call from drawterm
-		font=/lib/font/bit/vga/unicode.font
-		plumber
+	if(! test -e /mnt/term/dev/wsys){
+		# call from drawterm
 		auth/factotum
-		exec rio
+		webcookies
+		webfs
+		plumber
+		rio
 	}
 case con
 	prompt=('cpu% ' '	')
-	startupasfs
 }
 !
 cat > lib/plumbing <<!