build 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. umount /mnt # optional
  3. test -x "bin/busybox-$HOST" && {
  4. echo "Found bin/busybox-$HOST, using it"
  5. cp -a "bin/busybox-$HOST" bin/busybox
  6. bin/busybox --install -s bin/
  7. # Supply missing stuff (e.g. bzip2):
  8. PATH="$PATH:$PWD/bin"
  9. # Override known-buggy host binaries:
  10. cp -af bin/od `which od`
  11. }
  12. (
  13. #set -e -x
  14. cd busybox
  15. make defconfig
  16. # Want static build
  17. sed 's/^.*CONFIG_STATIC.*$/CONFIG_STATIC=y/' -i .config
  18. bzip2 </dev/null >/dev/null || {
  19. # Drats, newer Aboriginal Linux has no bzip2
  20. sed 's/^.*CONFIG_FEATURE_COMPRESS_USAGE.*$/# CONFIG_FEATURE_COMPRESS_USAGE is not set/' -i .config
  21. }
  22. test x"`uname -m`" = x"mips" && {
  23. # Without this, I get MIPS-I binary instead of MIPS32.
  24. # No idea what's the difference, but my router wants MIPS32.
  25. sed 's/^.*CONFIG_EXTRA_CFLAGS.*$/CONFIG_EXTRA_CFLAGS="-mips32"/' -i .config
  26. }
  27. # These won't build because of toolchain/libc breakage:
  28. sed 's/^.*CONFIG_FEATURE_SYNC_FANCY.*$/# CONFIG_FEATURE_SYNC_FANCY is not set/' -i .config # no syncfs() on armv4l, sparc
  29. sed 's/^.*CONFIG_FEATURE_WTMP.*$/# CONFIG_FEATURE_WTMP is not set/' -i .config
  30. sed 's/^.*CONFIG_FEATURE_UTMP.*$/# CONFIG_FEATURE_UTMP is not set/' -i .config
  31. sed 's/^.*CONFIG_FEATURE_INETD_RPC.*$/# CONFIG_FEATURE_INETD_RPC is not set/' -i .config
  32. make #V=1 || sh
  33. test -f busybox || exit 1
  34. size busybox
  35. ./busybox || echo "Exit code: $?"
  36. if uuencode TEST </dev/null >/dev/null && bzip2 </dev/null >/dev/null; then
  37. bzip2 <busybox | uuencode busybox.bz2
  38. else
  39. od -v -tx1 <busybox
  40. fi
  41. #test "x$FTP_PORT" = x ||
  42. # ftpput -P "$FTP_PORT" "$FTP_SERVER" strace
  43. ) 2>&1 | tee build.log
  44. mount -o remount,ro /home
  45. sync
  46. sleep 1