3
0

build 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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()
  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. size busybox
  34. ./busybox || echo "Exit code: $?"
  35. if uuencode TEST </dev/null >/dev/null && bzip2 </dev/null >/dev/null; then
  36. bzip2 <busybox | uuencode busybox.bz2
  37. else
  38. od -v -tx1 <busybox
  39. fi
  40. #test "x$FTP_PORT" = x ||
  41. # ftpput -P "$FTP_PORT" "$FTP_SERVER" strace
  42. ) 2>&1 | tee build.log
  43. mount -o remount,ro /home
  44. sync
  45. sleep 1