# HG changeset patch # User Rob Landley # Date 1277599192 18000 # Node ID f2cd0b4f39362f4e8342a97ba50d8501970b165e # Parent 08fa64c3c6fce4fc61c62e1db43bf41f1ded4749 New cron job to populate snapshots directory. diff -r 08fa64c3c6fc -r f2cd0b4f3936 sources/more/cronjob.sh --- a/sources/more/cronjob.sh Sat Jun 26 17:02:25 2010 -0500 +++ b/sources/more/cronjob.sh Sat Jun 26 19:39:52 2010 -0500 @@ -1,82 +1,99 @@ #!/bin/bash -# This script is run by a nightly cron job to build snapshots using the current -# build scripts from the repository. +# Build stable versions of all packages with current scripts. + +# This gets run in the aboriginal top directory. -# It builds a "stable" version of each architecture using stable version of all -# packages (according to the current ./download.sh), and then iterates through -# the packages listed in $PACKAGES grabbing a repository snapshot of each one -# and building each architecture again. Finally, it builds an "all" version -# using the unstable versions of every listed package simultaneously. - -# The cron job is run under a dedicated user, and invokes this script via the -# following code snippet: +pull_repo() +{ + # Clone working copy -# cd firmware -# hg pull -u -# export PREFERRED_MIRROR=http://impactlinux.com/fwl/mirror -# export PACKAGES="busybox uClibc linux" -# sources/more/cronjob.sh >/dev/null 2>/dev/null \ - "$TOP"/packages/alt-$PACKAGE-0.tar.bz2 + pull_repo $USE_UNSTABLE + SNAPNAME=$USE_UNSTABLE fi - # Build everything with unstable version of that package, and stable - # version of everything else (including build scripts). + [ "$USE_UNSTABLE" == linux ] && + sources/more/for-each-arch.sh 'sources/more/migrate-kernel.sh $TARGET' + + # Update manifest + + ./download.sh + + # If it's unchanged, just hardlink the previous binaries instead of rebuilding - cd "$TOP" - FORK=1 nice -n 20 sources/more/buildall.sh + if cmp -s snapshots/latest/$SNAPNAME/MANIFEST packages/MANIFEST + then + cp -rl snapshots/latest/$SNAPNAME/* snapshots/$SNAPSHOT_DATE/$SNAPNAME + return + fi + + # Build it + + nice -n 20 sources/more/buildall.sh + rm build/simple-cross-compiler-*.tar.bz2 + mv build/*.tar.bz2 build/logs build/MANIFEST snapshots/$SNAPSHOT_DATE/$SNAPNAME +} - # Move results to output directory. +build_snapshot base + +# build qemu-git - DESTDIR="$TOP/../snapshots/$PACKAGE/$SNAPSHOT_DATE" - rm -rf "$DESTDIR" - mkdir -p "$DESTDIR" - mv build/MANIFEST build/logs build/*.tar.bz2 "$DESTDIR" - mv build "$TEMPDIR/triage.$PACKAGE" -done +QPATH="" +CPUS=$(echo /sys/devices/system/cpu/cpu[0-9]* | wc -w) +pull_repo qemu +pushd build/packages/alt-qemu +./configure --disable-werror && +nice -n 20 make -j $CPUS && +QPATH="$(for i in *-softmmu;do echo -n $(pwd)/$i:; done)" +popd + +# test all with qemu-git + +[ -z "$QPATH" ] || + PATH="$QPATH:$PATH" sources/more/for-each-target.sh \ + './smoketest.sh $TARGET | tee snapshots/$SNAPSHOT_DATE/base/logs/newqemu-smoketest-$TARGET.txt' + +exit + +USE_UNSTABLE=linux build_snapshot +USE_UNSTABLE=uClibc build_snapshot +USE_UNSTABLE=busybox build_snapshot