forked from Harvey-OS/harvey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·47 lines (35 loc) · 1.44 KB
/
bootstrap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
set -e
export GOBIN=$(pwd)/$(go env GOHOSTOS)_$(go env GOHOSTARCH)/bin
echo GOBIN is now $GOBIN
echo Building the build tool...
GO111MODULE=on go get ./util/src/harvey/cmd/...
echo Fetching u-root and building it...
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
echo Fetch harvey-os.org commands and build them into $GOBIN
GO111MODULE=on go get harvey-os.org/cmd/...@8978eaed48985e0d89d36e383ece0a6a382eb6b8
echo FIXME -- once we get more architectures, this needs to be done in sys/src/cmds/build.json
echo Build tmpfs command into amd64 plan 9 bin
GO111MODULE=on GOOS=plan9 GOARCH=amd64 go build -o plan9_amd64/bin/tmpfs harvey-os.org/cmd/tmpfs
# this will make booting a VM easier
mkdir -p tmp
cat <<EOF
# We support RISC-V, but the default is x86_64 (which we call amd64 for historical reasons):
export ARCH=amd64
# You also need to export your C compiler flavor (gcc, clang, gcc-7...)
export CC=gcc
# And build:
$GOBIN/build
# See \`build -h' for more information on the build tool.
To enable access to files, create a harvey and none user:
sudo useradd harvey
sudo useradd none
none is only required for drawterm/cpu access
Also:
export HARVEY=$(pwd)
add $GOBIN to your path
EOF