logo

bootstrap-initrd

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

iproute2.sh (746B)


  1. #!/bin/sh
  2. set -ex
  3. die() {
  4. echo "die: $@"
  5. exit 1
  6. }
  7. # With pdpmake-2.0.3:
  8. # pdpmake: don't know how to make %.c
  9. command -v make || die "Run /extras/make.sh"
  10. command -v pkg-config || die "Run /extras/pkgconf-lite.sh"
  11. tar xof /distfiles/iproute2-*.tar.gz
  12. cd ./iproute2-*/
  13. ed ip/iplink.c <<EOF
  14. 1a
  15. #include <limits.h>
  16. .
  17. w
  18. q
  19. EOF
  20. ./configure --prefix /usr
  21. # tc(1) requires flex (or at least a lex with -o)
  22. # -maxdepth 1 is unsupported by both sbase and heirloom find(1)
  23. printf '%s\n' \
  24. '/SUBDIRS=/s;tc ;;' \
  25. '/iproute2 -maxdepth 1/s;install;\# install;' \
  26. w q | ed Makefile
  27. # Requires static_assert which is guarded behind C11
  28. export CFLAGS="${CFLAGS} -std=c11"
  29. unset MAKE
  30. make clean
  31. make HOSTCC=$CC
  32. make install
  33. cd ..
  34. rm -r ./iproute2-*/