bootstrap.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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=off go get -d -u harvey-os.org/cmd/...
  8. GO111MODULE=off go install harvey-os.org/cmd/build
  9. GO111MODULE=off go install harvey-os.org/cmd/elf2c
  10. GO111MODULE=off go install harvey-os.org/cmd/mksys
  11. GO111MODULE=off go install harvey-os.org/cmd/data2c
  12. GO111MODULE=off go install harvey-os.org/cmd/qtap
  13. echo 'Can not build ... until ipfs gets fixed :-('
  14. echo GO111MODULE=off go install harvey-os.org/cmd/...
  15. echo Building u-root into $HOSTBIN
  16. # Download u-root sources into $GOPATH because that's what u-root expects.
  17. # See https://github.com/u-root/u-root/issues/805
  18. # and https://github.com/u-root/u-root/issues/583
  19. GO111MODULE=off go get -d -u github.com/u-root/u-root
  20. GO111MODULE=off go install github.com/u-root/u-root
  21. # this will make booting a VM easier
  22. mkdir -p tmp
  23. cat <<EOF
  24. To build for x86_64 (CC=clang is also supported):
  25. export HARVEY=$(pwd)
  26. PATH=\$PATH:\$HARVEY/$HOSTBIN CC=gcc ARCH=amd64 build
  27. To enable access to files, create a harvey and none user (none is only required for drawterm/cpu access):
  28. sudo useradd harvey
  29. sudo useradd none
  30. To run in qemu in cpu mode:
  31. ./util/GO9PCPU
  32. or to run in terminal mode:
  33. ./util/GO9PTERM
  34. To netboot, follow the instructions here: https://github.com/Harvey-OS/harvey/wiki/Booting-Harvey-on-real-hardware-I-(TFTP)
  35. You may want to run the following to get APEX installed:
  36. OS=linux ARCH=amd64 CC=gcc sh getapex.sh
  37. EOF