logo

bootstrap-initrd

Linux initrd to bootstrap from a small binary seed git clone https://anongit.hacktivis.me/git/bootstrap-initrd.git/

cproc.sh (671B)


  1. #!/bin/sh
  2. set -ex
  3. die() {
  4. echo "die: $@"
  5. exit 1
  6. }
  7. tar xof /distfiles/cproc-*.tar.gz
  8. cd cproc-*/
  9. ./configure \
  10. --prefix=/usr \
  11. --with-cpp=@TCC_CPP@ \
  12. --with-as=@TCCAS@ \
  13. --with-ld=@TCCLD@
  14. # strip out manual musl linking in startfiles / endfiles
  15. # setup assemblecmd / linkcmd against tcc
  16. ed config.h <<'EOF'
  17. /startfiles
  18. s;{.*};{};p
  19. /endfiles
  20. s;{.*};{};p
  21. /@TCC_CPP@
  22. c
  23. "tcc",
  24. "-E",
  25. .
  26. /assemblecmd
  27. s;{.*};{"tcc", "-c", "-xa", "-"};p
  28. /linkcmd
  29. s;{.*};{"tcc", "-xb"};p
  30. w
  31. q
  32. EOF
  33. # tcc -Os -Wall -Wextra -c -o driver.c
  34. # tcc: error: no input files
  35. ed Makefile <<'EOF'
  36. g/$(stagedeps) ;/s/;/#;/
  37. w
  38. q
  39. EOF
  40. pdpmake CC=$CC
  41. pdpmake PREFIX=/usr install
  42. cd ..
  43. rm -fr cproc-*/