2015-10-05 12:34:04 +05:30
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
umount /mnt # optional
|
|
|
|
|
|
|
|
test -x "bin/busybox-$HOST" && {
|
|
|
|
echo "Found bin/busybox-$HOST, using it"
|
|
|
|
cp -a "bin/busybox-$HOST" bin/busybox
|
|
|
|
bin/busybox --install -s bin/
|
|
|
|
# Supply missing stuff (e.g. bzip2):
|
|
|
|
PATH="$PATH:$PWD/bin"
|
|
|
|
# Override known-buggy host binaries:
|
|
|
|
cp -af bin/od `which od`
|
|
|
|
}
|
|
|
|
|
|
|
|
(
|
|
|
|
#set -e -x
|
|
|
|
cd busybox
|
2015-10-05 16:13:04 +05:30
|
|
|
|
2015-10-05 12:34:04 +05:30
|
|
|
make defconfig
|
|
|
|
# Want static build
|
|
|
|
sed 's/^.*CONFIG_STATIC.*$/CONFIG_STATIC=y/' -i .config
|
|
|
|
bzip2 </dev/null >/dev/null || {
|
2015-10-05 16:13:04 +05:30
|
|
|
# Drats, newer Aboriginal Linux has no bzip2
|
2015-10-05 12:34:04 +05:30
|
|
|
sed 's/^.*CONFIG_FEATURE_COMPRESS_USAGE.*$/# CONFIG_FEATURE_COMPRESS_USAGE is not set/' -i .config
|
|
|
|
}
|
2015-10-05 16:13:04 +05:30
|
|
|
test x"`uname -m`" = x"mips" && {
|
|
|
|
# Without this, I get MIPS-I binary instead of MIPS32.
|
|
|
|
# No idea what's the difference, but my router wants MIPS32.
|
|
|
|
sed 's/^.*CONFIG_EXTRA_CFLAGS.*$/CONFIG_EXTRA_CFLAGS="-mips32"/' -i .config
|
|
|
|
}
|
2015-10-05 12:34:04 +05:30
|
|
|
# These won't build because of toolchain/libc breakage:
|
2017-01-02 18:18:06 +05:30
|
|
|
sed 's/^.*CONFIG_FEATURE_SYNC_FANCY.*$/# CONFIG_FEATURE_SYNC_FANCY is not set/' -i .config # no syncfs() on armv4l, sparc
|
2015-10-05 12:34:04 +05:30
|
|
|
sed 's/^.*CONFIG_FEATURE_WTMP.*$/# CONFIG_FEATURE_WTMP is not set/' -i .config
|
|
|
|
sed 's/^.*CONFIG_FEATURE_UTMP.*$/# CONFIG_FEATURE_UTMP is not set/' -i .config
|
|
|
|
sed 's/^.*CONFIG_FEATURE_INETD_RPC.*$/# CONFIG_FEATURE_INETD_RPC is not set/' -i .config
|
2015-10-05 16:13:04 +05:30
|
|
|
|
2015-10-05 12:34:04 +05:30
|
|
|
make #V=1 || sh
|
2017-01-02 18:18:06 +05:30
|
|
|
test -f busybox || exit 1
|
2015-10-05 12:34:04 +05:30
|
|
|
size busybox
|
|
|
|
./busybox || echo "Exit code: $?"
|
|
|
|
if uuencode TEST </dev/null >/dev/null && bzip2 </dev/null >/dev/null; then
|
|
|
|
bzip2 <busybox | uuencode busybox.bz2
|
|
|
|
else
|
2015-10-05 16:04:24 +05:30
|
|
|
od -v -tx1 <busybox
|
2015-10-05 12:34:04 +05:30
|
|
|
fi
|
|
|
|
#test "x$FTP_PORT" = x ||
|
|
|
|
# ftpput -P "$FTP_PORT" "$FTP_SERVER" strace
|
|
|
|
) 2>&1 | tee build.log
|
|
|
|
mount -o remount,ro /home
|
|
|
|
sync
|
|
|
|
sleep 1
|