Browse Source

fix uroot build. if it exists, load in cpurc

Signed-off-by: Graham MacDonald <grahamamacdonald@gmail.com>
Graham MacDonald 3 years ago
parent
commit
4f4360efa2

+ 1 - 1
bootstrap.sh

@@ -10,11 +10,11 @@ echo Building harvey-os.org commands into $HOSTBIN
 GO111MODULE=on go get harvey-os.org/cmd/...
 
 echo Building u-root into $HOSTBIN
-GO111MODULE=on go get github.com/u-root/u-root@c370a343c8b0b01faac358c1dafb409e5576ae1a
 # Download u-root sources into $GOPATH because that's what u-root expects.
 # See https://github.com/u-root/u-root/issues/805
 # and https://github.com/u-root/u-root/issues/583
 GO111MODULE=off go get -d github.com/u-root/u-root
+GO111MODULE=on go get github.com/u-root/u-root
 
 # this will make booting a VM easier
 mkdir -p tmp

+ 11 - 0
rc/bin/cpurc

@@ -1,4 +1,15 @@
 #!/bin/rc
+
+if (test -e /boot/uroot) {
+	echo 'unpacking uroot'
+	olddir=`{pwd}
+	cd '#@'
+	decompress /boot/uroot > uroot.cpio
+	cpio i < uroot.cpio
+	bind -b '#@' /
+	cd $olddir
+}
+
 # cpu server start up
 date > /env/boottime
 

+ 1 - 1
sys/src/9/amd64/allbuild.json

@@ -12,6 +12,7 @@
 		],
 		"Projects": [
 			"gocmds.json",
+			"gocmdswithmods.json",
 			"u-root.json"
 		],
 		"Kernel": {
@@ -120,7 +121,6 @@
 				"sed": "/$ARCH/bin/sed",
 				"srv": "/$ARCH/bin/srv",
 				"startdisk": "startdisk",
-				"tmpfs": "/plan9_$ARCH/bin/tmpfs",
 				"usbd": "/$ARCH/bin/usb/usbd",
 				"venti": "/$ARCH/bin/venti/venti",
 				"vga": "/$ARCH/bin/aux/vga",

+ 1 - 2
sys/src/9/amd64/gocmds.json

@@ -2,12 +2,11 @@
 	{
 		"Name": "gocmds",
 		"Env": [
-			"GO111MODULE=on",
+			"GO111MODULE=off",
 			"GOOS=plan9",
 			"GOARCH=amd64"
 		],
 		"Pre": [
-			"go build -o /plan9_amd64/bin/decompress harvey-os.org/cmd/decompress",
 			"go build -o /plan9_amd64/bin/cpio github.com/u-root/u-root/cmds/core/cpio"
 		]
 	}

+ 13 - 0
sys/src/9/amd64/gocmdswithmods.json

@@ -0,0 +1,13 @@
+[
+	{
+		"Name": "gocmds",
+		"Env": [
+			"GO111MODULE=on",
+			"GOOS=plan9",
+			"GOARCH=amd64"
+		],
+		"Pre": [
+			"go build -o /plan9_amd64/bin/decompress harvey-os.org/cmd/decompress"
+		]
+	}
+]

+ 1 - 1
sys/src/9/amd64/u-root.json

@@ -7,7 +7,7 @@
 			"GOARCH=amd64"
 		],
 		"Pre": [
-			"u-root -shellbang -initcmd= -o uroot.cpio -files /amd64/bin:amd64/bin -files /rc/bin:rc/bin -files /lib/ndb:lib/ndb $UROOTEXTRARGS plan9 $UROOTEXTRAPACKAGES",
+			"u-root -shellbang -initcmd= -o uroot.cpio plan9",
 			"lzma -f -k -3 uroot.cpio"
 		]
 	}