view sources/more/setup-native-static-build.sh @ 848:63d79a2b0816

Cosmetic improvement, allows log monitoring to see stages.
author Rob Landley <rob@landley.net>
date Wed, 14 Oct 2009 03:51:57 -0500
parents 2ca7ea5d3ec1
children 858297fa5ad0
line wrap: on
line source

#!/bin/bash

# Create hdc image to build dropbear, strace, and busybox statically.

. sources/include.sh

if [ -z "$1" ]
then
  print "Need directory name" >&2
  exit 1
fi

# Set up working directories

WORK="$1"
blank_tempdir "$WORK"
WORK="$WORK"/sub
mkdir -p "$WORK" || dienow

# Extract source code into new image directory

setupfor dropbear
setupfor strace
setupfor busybox

cp "$SOURCES"/trimconfig-busybox "$WORK" || dienow

cat > "$WORK"/init << 'EOF' || dienow
#!/bin/bash

echo Started second stage init

cd /home &&
mkdir output &&

echo === Native build static dropbear

cp -sfR /mnt/dropbear dropbear &&
cd dropbear &&
LDFLAGS="--static" ./configure --disable-zlib &&
make -j $CPUS PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1 SCPPROGRESS=1 &&
cp dropbearmulti /home/output &&
cd .. &&
rm -rf dropbear || exit 1

echo === Native build static strace

cp -sfR /mnt/strace strace &&
cd strace &&
CFLAGS="--static" ./configure &&
make -j $CPUS &&
cp strace /home/output &&
cd .. &&
rm -rf strace || dienow

echo === Native build static busybox

cp -sfR /mnt/busybox busybox &&
cd busybox &&
make allyesconfig KCONFIG_ALLCONFIG=/mnt/trimconfig-busybox &&
LDFLAGS="--static" make -j $CPUS &&
cp busybox /home/output &&
rm -rf busybox || dienow

echo === Upload

cd /home/output
for i in *
do
  ftpput 10.0.2.2 -P $OUTPORT $ARCH-$i $i
done

sync

EOF

chmod +x "$WORK"/init || dienow

mksquashfs "$WORK" "$WORK"/../hdc.sqf -noappend -all-root