bootstrap.sh 1.6 KB

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