diff --git a/dashboard/env/plan9-386/.gitignore b/dashboard/env/plan9-386/.gitignore new file mode 100644 index 00000000..b5a531d4 --- /dev/null +++ b/dashboard/env/plan9-386/.gitignore @@ -0,0 +1,2 @@ +disk.raw +plan9-gce.iso diff --git a/dashboard/env/plan9-386/README b/dashboard/env/plan9-386/README new file mode 100644 index 00000000..f1e99d65 --- /dev/null +++ b/dashboard/env/plan9-386/README @@ -0,0 +1,21 @@ +make.bash creates a Google Compute Engine VM image to run the Go +Plan 9 builder, booting up to run the buildlet. + +make.bash should be run on a Linux box with qemu. + +After it completes, it creates a file plan9-386-gce.tar.gz + +The make.bash script depends on the following packages: + +$ sudo apt-get install bzip2 curl expect qemu +or +$ sudo yum install bzip2 curl expect qemu + +It has been tested with QEMU 1.4.2 to 2.2.0, as provided with: + + - Ubuntu 14.04 (Trusty Tahr) and above + - Debian 8.0 (Jessie) and above + - Fedora 19 and above + +Also, due to an ATA bug affecting QEMU 1.6 and 1.7, the +Plan 9 CD can't be booted with these versions. diff --git a/dashboard/env/plan9-386/make.bash b/dashboard/env/plan9-386/make.bash new file mode 100755 index 00000000..6c113baa --- /dev/null +++ b/dashboard/env/plan9-386/make.bash @@ -0,0 +1,236 @@ +# Copyright 2015 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +set -e + +# Download Plan 9 +if ! sha1sum -c plan9-gce.iso.sha1; then + curl --fail -O http://9legacy.org/download/go/plan9-gce.iso.bz2 + bunzip2 plan9-gce.iso.bz2 + sha1sum -c plan9-gce.iso.sha1 +fi + +# Initialize disk image. +rm -f disk.raw +qemu-img create -f raw disk.raw 10G + +# Run the installer to create the disk image. +expect <>> " +send "w\n" + +expect -exact ">>> " +send "q\n" + +expect -exact "Task to do \[prepdisk\]:" +send "\n" + +expect -exact "Plan 9 partition to subdivide \(/dev/sd00/plan9\)\[/dev/sd00/plan9\]:" +send "\n" + +expect -exact ">>> " +send "w\n" + +expect -exact ">>> " +send "q\n" + +expect -exact "Task to do \[fmtfossil\]:" +send "\n" + +expect -exact "Fossil partition to format \(/dev/sd00/fossil\)\[/dev/sd00/fossil\]:" +send "\n" + +expect -exact "Task to do \[mountfs\]:" +send "\n" + +expect -exact "Fossil partition \(/dev/sd00/fossil\)\[/dev/sd00/fossil\]:" +send "\n" + +expect -exact "Task to do \[configdist\]:" +send "\n" + +expect -exact "Distribution is from \(local, net\)\[local\]:" +send "\n" + +expect -exact "Task to do \[mountdist\]:" +send "\n" + +expect -exact "Distribution disk \[no default\]:" +send "/dev/sdD0/data\n" + +expect -exact "Location of archives \[browse\]:" +send "/\n" + +expect -exact "Task to do \[copydist\]:" +send "\n" + +# Need to wait for the copy to finish. +expect -timeout 600 -exact "Task to do \[bootsetup\]:" +send "\n" + +expect -exact "Enable boot method (floppy, plan9, win9x, winnt)\[no default\]:" +send "plan9\n" + +expect -exact "Install the Plan 9 master boot record (y, n)\[no default\]:" +send "y\n" + +expect -exact "Task to do \[finish\]:" +send "\n" + +expect -exact "Feel free to turn off your computer." +exit +EOF + +# Configuration. +expect </tmp/plan9.ini\n" + +expect -exact "term% " +send "mv /tmp/plan9.ini /n/9fat/plan9.ini\n" + +expect -exact "term% " +send "cp /386/9pccpuf /n/9fat\n" + +expect -exact "term% " +send "sed s/sd00/sd01/ /n/9fat/plan9.ini >/tmp/plan9.ini\n" + +expect -exact "term% " +send "mv /tmp/plan9.ini /n/9fat/plan9.ini\n" + +expect -exact "term% " +send "unmount /n/9fat\n" + +expect -exact "term% " +send "fossil/conf /dev/sd00/fossil | sed s/sd00/sd01/ >/tmp/fossil.conf\n" + +expect -exact "term% " +send "fossil/conf -w /dev/sd00/fossil /tmp/fossil.conf\n" + +expect -exact "term% " +send "rm /tmp/fossil.conf\n" + +expect -exact "term% " +send "mkdir /cfg/helix\n" + +expect -exact "term% " +send "dircp /cfg/example /cfg/helix\n" + +expect -exact "term% " +send "echo ip/ipconfig >>/cfg/helix/cpurc\n" + +expect -exact "term% " +send "echo ndb/dns -r >>/cfg/helix/cpurc\n" + +expect -exact "term% " +send "echo echo remove 10.0.0.0 /104 10.0.0.0 '>'/net/iproute >>/cfg/helix/cpurc\n" + +expect -exact "term% " +send "echo ramfs -u >>/cfg/helix/cpustart\n" + +expect -exact "term% " +send "echo echo downloading git >>/cfg/helix/cpustart\n" + +expect -exact "term% " +send "echo hget http://9legacy.org/9legacy/tools/git '>'/usr/glenda/bin/rc/git >>/cfg/helix/cpustart\n" + +expect -exact "term% " +send "echo chmod +x /usr/glenda/bin/rc/git >>/cfg/helix/cpustart\n" + +expect -exact "term% " +send "echo >>/cfg/helix/cpustart\n" + +expect -exact "term% " +send "echo echo starting buildlet script >>/cfg/helix/cpustart\n" + +expect -exact "term% " +send "echo 'hget \`{hget -r '''Metadata-Flavor: Google''' http://metadata.google.internal/computeMetadata/v1/instance/attributes/buildlet-binary-url} >/tmp/buildlet' >>/cfg/helix/cpustart\n" + +expect -exact "term% " +send "echo chmod +x /tmp/buildlet >>/cfg/helix/cpustart\n" + +expect -exact "term% " +send "echo exec /tmp/buildlet >>/cfg/helix/cpustart\n" + +expect -exact "term% " +send "echo fshalt >>/cfg/helix/cpustart\n" + +expect -exact "term% " +send "auth/wrkey\n" + +expect -exact "authid: " +send "glenda\n" + +expect -exact "authdom: " +send "go\n" + +expect -exact "auth password: " +send "glenda123\n" + +expect -exact "secstore password: " +send "glenda123\n" + +expect -exact "term% " +send "fshalt\n" + +expect -exact "done halting" +exit +EOF + +# Create Compute Engine disk image. +echo "Archiving disk.raw... (this may take a while)" +tar -Szcf plan9-386-gce.tar.gz disk.raw + +echo "Done. GCE image is plan9-386-gce.tar.gz." diff --git a/dashboard/env/plan9-386/plan9-gce.iso.sha1 b/dashboard/env/plan9-386/plan9-gce.iso.sha1 new file mode 100644 index 00000000..3bc91faf --- /dev/null +++ b/dashboard/env/plan9-386/plan9-gce.iso.sha1 @@ -0,0 +1 @@ +6c3ca633d65d6d00dff668b2b2dd3746c9883145 plan9-gce.iso