bootstrap.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. set -e
  3. HOSTBIN=$(go env GOHOSTOS)_$(go env GOHOSTARCH)/bin
  4. export GOBIN=$(pwd)/$HOSTBIN
  5. echo GOBIN is now $GOBIN
  6. echo Building harvey-os.org commands into $HOSTBIN
  7. GO111MODULE=on go get harvey-os.org/cmd/...
  8. echo Building u-root into $HOSTBIN
  9. GO111MODULE=on go get github.com/u-root/u-root@c370a343c8b0b01faac358c1dafb409e5576ae1a
  10. # Download u-root sources into $GOPATH because that's what u-root expects.
  11. # See https://github.com/u-root/u-root/issues/805
  12. # and https://github.com/u-root/u-root/issues/583
  13. GO111MODULE=off go get -d github.com/u-root/u-root
  14. # this will make booting a VM easier
  15. mkdir -p tmp
  16. cat <<EOF
  17. To build for x86_64 (CC=clang is also supported):
  18. export HARVEY=$(pwd)
  19. PATH=\$PATH:\$HARVEY/$HOSTBIN CC=gcc ARCH=amd64 build
  20. To enable access to files, create a harvey and none user (none is only required for drawterm/cpu access):
  21. sudo useradd harvey
  22. sudo useradd none
  23. To run in qemu in cpu mode:
  24. ./util/GO9PCPU
  25. or to run in terminal mode:
  26. ./util/GO9PTERM
  27. To netboot, follow the instructions here: https://github.com/Harvey-OS/harvey/wiki/Booting-Harvey-on-real-hardware-I-(TFTP)
  28. EOF