logo

bootstrap-initrd

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

iproute2.sh (680B)


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