# HG changeset patch # User Rob Landley # Date 1269582725 18000 # Node ID 6762d6b8d5fc032d4d86a40dcdcf2135161b6743 # Parent 2d5e356580b9a09430f9d3c451ea00c610f72b0e Move sources/more/setup-native-build.sh to sources/native-builds/static-tools.sh, and add native-builds/hello-world.sh while I'm at it. diff -r 2d5e356580b9 -r 6762d6b8d5fc sources/more/buildall.sh --- a/sources/more/buildall.sh Thu Mar 25 23:30:20 2010 -0500 +++ b/sources/more/buildall.sh Fri Mar 26 00:52:05 2010 -0500 @@ -68,7 +68,7 @@ # Build dropbear and strace -sources/more/setup-native-build.sh build/host-temp/hdc.sqf && +sources/native-build/setup-native-build.sh build/host-temp/hdc.sqf && mkdir -p build/native-static && for i in ${ARCHES} do diff -r 2d5e356580b9 -r 6762d6b8d5fc sources/more/setup-native-build.sh --- a/sources/more/setup-native-build.sh Thu Mar 25 23:30:20 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -#!/bin/bash - -# Download all the source tarballs we haven't got up-to-date copies of. - -# The tarballs are downloaded into the "packages" directory, which is -# created as needed. - -source sources/include.sh || exit 1 - -if [ $# -ne 1 ] -then - echo "usage: $0 FILENAME" >&2 - exit 1 -fi - -if [ -e "$1" ] -then - echo "$1" exists - exit 0 -fi - -SRCDIR="$SRCDIR/native" -mkdir -p "$SRCDIR" || dienow - -echo "=== Download source code." - -# Note: set SHA1= blank to skip checksum validation. - -URL=http://downloads.sf.net/sourceforge/strace/strace-4.5.19.tar.bz2 \ -SHA1=5554c2fd8ffae5c1e2b289b2024aa85a0889c989 \ -download || dienow - -URL=http://matt.ucc.asn.au/dropbear/releases/dropbear-0.52.tar.bz2 \ -SHA1=8c1745a9b64ffae79f28e25c6fe9a8b96cac86d8 \ -download || dienow - -echo === Got all source. - -cleanup_oldfiles - -# Set up working directories - -WORK="$WORK"/sub -blank_tempdir "$WORK" - -# Extract source code into new image directory - -setupfor dropbear -setupfor strace - -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 === 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 - -cd "$TOP" - -mksquashfs "$WORK" "$1" -noappend -all-root diff -r 2d5e356580b9 -r 6762d6b8d5fc sources/native-builds/hello-world.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/native-builds/hello-world.sh Fri Mar 26 00:52:05 2010 -0500 @@ -0,0 +1,44 @@ +#!/bin/bash + +# Download all the source tarballs we haven't got up-to-date copies of. + +# The tarballs are downloaded into the "packages" directory, which is +# created as needed. + +source sources/include.sh || exit 1 + +if [ $# -ne 1 ] +then + echo "usage: $0 FILENAME" >&2 + exit 1 +fi + +if [ -e "$1" ] +then + echo "$1" exists + exit 0 +fi + +# Set up working directories + +WORK="$WORK"/sub +blank_tempdir "$WORK" + +cat > "$WORK"/init << 'EOF' || dienow +#!/bin/bash + +echo Started second stage init + +cd /home && +gcc -lpthread /usr/src/thread-hello2.c -o hello && +./hello + +sync + +EOF + +chmod +x "$WORK"/init || dienow + +cd "$TOP" + +mksquashfs "$WORK" "$1" -noappend -all-root diff -r 2d5e356580b9 -r 6762d6b8d5fc sources/native-builds/static-tools.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/native-builds/static-tools.sh Fri Mar 26 00:52:05 2010 -0500 @@ -0,0 +1,95 @@ +#!/bin/bash + +# Download all the source tarballs we haven't got up-to-date copies of. + +# The tarballs are downloaded into the "packages" directory, which is +# created as needed. + +source sources/include.sh || exit 1 + +if [ $# -ne 1 ] +then + echo "usage: $0 FILENAME" >&2 + exit 1 +fi + +if [ -e "$1" ] +then + echo "$1" exists + exit 0 +fi + +SRCDIR="$SRCDIR/native" +mkdir -p "$SRCDIR" || dienow + +echo "=== Download source code." + +# Note: set SHA1= blank to skip checksum validation. + +URL=http://downloads.sf.net/sourceforge/strace/strace-4.5.19.tar.bz2 \ +SHA1=5554c2fd8ffae5c1e2b289b2024aa85a0889c989 \ +download || dienow + +URL=http://matt.ucc.asn.au/dropbear/releases/dropbear-0.52.tar.bz2 \ +SHA1=8c1745a9b64ffae79f28e25c6fe9a8b96cac86d8 \ +download || dienow + +echo === Got all source. + +cleanup_oldfiles + +# Set up working directories + +WORK="$WORK"/sub +blank_tempdir "$WORK" + +# Extract source code into new image directory + +setupfor dropbear +setupfor strace + +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 === 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 + +cd "$TOP" + +mksquashfs "$WORK" "$1" -noappend -all-root