Mercurial > hg > aboriginal
changeset 1296:fe5af321ed29
Move bootstrap-skeleton/files to bootstrap-skeleton/mnt, to be consistent.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 21 Nov 2010 19:08:01 -0600 |
parents | 76b940abfd8f |
children | 171fed38f126 |
files | sources/control-images/bootstrap-skeleton/control-image-wrapper.sh sources/control-images/bootstrap-skeleton/files/build-one-package.sh sources/control-images/bootstrap-skeleton/files/functions.sh sources/control-images/bootstrap-skeleton/files/init sources/control-images/bootstrap-skeleton/files/run-build-stages.sh sources/control-images/bootstrap-skeleton/mnt/build-one-package.sh sources/control-images/bootstrap-skeleton/mnt/functions.sh sources/control-images/bootstrap-skeleton/mnt/init sources/control-images/bootstrap-skeleton/mnt/run-build-stages.sh |
diffstat | 9 files changed, 137 insertions(+), 137 deletions(-) [+] |
line wrap: on
line diff
--- a/sources/control-images/bootstrap-skeleton/control-image-wrapper.sh Sun Nov 21 15:02:47 2010 -0600 +++ b/sources/control-images/bootstrap-skeleton/control-image-wrapper.sh Sun Nov 21 19:08:01 2010 -0600 @@ -26,7 +26,7 @@ # Copy common infrastructure to target -cp "$MYDIR"/../bootstrap-skeleton/files/* "$WORK" || exit 1 +cp "$MYDIR"/../bootstrap-skeleton/mnt/* "$WORK" || exit 1 if [ -e "$MYDIR/mnt" ] then cp -a "$MYDIR/mnt/." "$WORK" || exit 1
--- a/sources/control-images/bootstrap-skeleton/files/build-one-package.sh Sun Nov 21 15:02:47 2010 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -#!/bin/ash - -# Yes, ash. Because neither bash 2 nor hush support -o pipefail - -set -o pipefail - -source /mnt/functions.sh || exit 1 - -# build $1 - -set_titlebar "$1" - -if [ -d "/mnt/packages/$1" ] -then - - # Snapshot source - - cd /home && - rm -rf "/home/$1" && - cp -sfR "/mnt/packages/$1" "$1" && - cd "$1" || exit 1 - - # Lobotomize config.guess so it won't complain about unknown target types. - # 99% of packages do not care, but autoconf throws a temper tantrum if - # the version of autoconf that created this back when the package shipped - # didn't know what a microblaze or hexagon was. Repeat after me: - # "Autoconf is useless" - - for guess in $(find . -name config.guess) - do - rm "$guess" && - echo -e "#!/bin/sh\ngcc -dumpmachine" > "$guess" || exit 1 - done - EXT=sh -else - EXT=nosrc -fi - -# Call package build script - -mkdir -p /home/log -time "/mnt/build/${1}.$EXT" 2>&1 | tee "/home/log/$1.log" -if [ $? -ne 0 ] -then - echo "$1" died >&2 - exit 1 -fi - -# Delete copy of source if build succeeded - -if [ -d "/mnt/packages/$1" ] -then - cd /home && - rm -rf "$1" && - sync || exit 1 -fi
--- a/sources/control-images/bootstrap-skeleton/files/functions.sh Sun Nov 21 15:02:47 2010 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -#!/bin/echo This file is sourced not run - -upload_result() -{ - ftpput $FTP_SERVER -P $FTP_PORT "$1-$HOST" "$1" -} - -set_titlebar() -{ - echo -en "\033]2;($HOST) $1\007" - echo === "$1" -} - -dotprogress() -{ - while read i; do echo -n .; done; echo -} - -do_in_chroot() -{ - # Copy root filesystem into a new chroot directory and restart in there. - - CHROOT="$1" - shift - - set_titlebar "Setup chroot" - mkdir "$CHROOT" - cp -a /mnt/files/. "$CHROOT" - find / -xdev | cpio -m -v -p "$CHROOT" | dotprogress - for i in mnt proc sys dev; do mount --bind /$i "$CHROOT"/$i; done - - echo Chroot - chroot "$CHROOT" "$@" - RC=$? - - echo Chroot cleanup - for i in mnt proc sys dev; do umount "$CHROOT"/$i; done - - return $RC -}
--- a/sources/control-images/bootstrap-skeleton/files/init Sun Nov 21 15:02:47 2010 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -#!/bin/bash - -# Start running here, and hand off to run-build-stages.sh in chroot. - -. /mnt/functions.sh - -[ -z "$NATIVE_BUILD" ] && NATIVE_BUILD=chroot - -# Always chroot, because even if root filesystem is writeable it's hard to -# tell tar to skip /proc and /sys and such without unmounting bits of the -# host environment. - -do_in_chroot /home/"$NATIVE_BUILD" /mnt/run-build-stages.sh - -if [ $? -eq 0 ] -then - set_titlebar "upload tarball" - tar czvf "$NATIVE_BUILD".tar.gz "$NATIVE_BUILD" | dotprogress && - upload_result "$NATIVE_BUILD".tar.gz -fi
--- a/sources/control-images/bootstrap-skeleton/files/run-build-stages.sh Sun Nov 21 15:02:47 2010 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -#!/bin/sh - -# Run each of the individual package build files, in order. - -[ -z "$MANIFEST" ] && MANIFEST=/usr/src/packages -touch "$MANIFEST" - -[ -z "$FILTER" ] || FILTER="/$FILTER/d" -for i in $(sed -r -e "$FILTER" -e "s@#.*@@" /mnt/package-list) -do - if [ -z "$FORCE" ] && grep -q "$i" "$MANIFEST" - then - echo "$i already installed" - continue - fi - /mnt/build-one-package.sh "$i" || exit 1 - - sed -i -e "/$i/d" "$MANIFEST" && - echo "$i" >> "$MANIFEST" || exit 1 -done
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/control-images/bootstrap-skeleton/mnt/build-one-package.sh Sun Nov 21 19:08:01 2010 -0600 @@ -0,0 +1,56 @@ +#!/bin/ash + +# Yes, ash. Because neither bash 2 nor hush support -o pipefail + +set -o pipefail + +source /mnt/functions.sh || exit 1 + +# build $1 + +set_titlebar "$1" + +if [ -d "/mnt/packages/$1" ] +then + + # Snapshot source + + cd /home && + rm -rf "/home/$1" && + cp -sfR "/mnt/packages/$1" "$1" && + cd "$1" || exit 1 + + # Lobotomize config.guess so it won't complain about unknown target types. + # 99% of packages do not care, but autoconf throws a temper tantrum if + # the version of autoconf that created this back when the package shipped + # didn't know what a microblaze or hexagon was. Repeat after me: + # "Autoconf is useless" + + for guess in $(find . -name config.guess) + do + rm "$guess" && + echo -e "#!/bin/sh\ngcc -dumpmachine" > "$guess" || exit 1 + done + EXT=sh +else + EXT=nosrc +fi + +# Call package build script + +mkdir -p /home/log +time "/mnt/build/${1}.$EXT" 2>&1 | tee "/home/log/$1.log" +if [ $? -ne 0 ] +then + echo "$1" died >&2 + exit 1 +fi + +# Delete copy of source if build succeeded + +if [ -d "/mnt/packages/$1" ] +then + cd /home && + rm -rf "$1" && + sync || exit 1 +fi
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/control-images/bootstrap-skeleton/mnt/functions.sh Sun Nov 21 19:08:01 2010 -0600 @@ -0,0 +1,40 @@ +#!/bin/echo This file is sourced not run + +upload_result() +{ + ftpput $FTP_SERVER -P $FTP_PORT "$1-$HOST" "$1" +} + +set_titlebar() +{ + echo -en "\033]2;($HOST) $1\007" + echo === "$1" +} + +dotprogress() +{ + while read i; do echo -n .; done; echo +} + +do_in_chroot() +{ + # Copy root filesystem into a new chroot directory and restart in there. + + CHROOT="$1" + shift + + set_titlebar "Setup chroot" + mkdir "$CHROOT" + cp -a /mnt/files/. "$CHROOT" + find / -xdev | cpio -m -v -p "$CHROOT" | dotprogress + for i in mnt proc sys dev; do mount --bind /$i "$CHROOT"/$i; done + + echo Chroot + chroot "$CHROOT" "$@" + RC=$? + + echo Chroot cleanup + for i in mnt proc sys dev; do umount "$CHROOT"/$i; done + + return $RC +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/control-images/bootstrap-skeleton/mnt/init Sun Nov 21 19:08:01 2010 -0600 @@ -0,0 +1,20 @@ +#!/bin/bash + +# Start running here, and hand off to run-build-stages.sh in chroot. + +. /mnt/functions.sh + +[ -z "$NATIVE_BUILD" ] && NATIVE_BUILD=chroot + +# Always chroot, because even if root filesystem is writeable it's hard to +# tell tar to skip /proc and /sys and such without unmounting bits of the +# host environment. + +do_in_chroot /home/"$NATIVE_BUILD" /mnt/run-build-stages.sh + +if [ $? -eq 0 ] +then + set_titlebar "upload tarball" + tar czvf "$NATIVE_BUILD".tar.gz "$NATIVE_BUILD" | dotprogress && + upload_result "$NATIVE_BUILD".tar.gz +fi
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/control-images/bootstrap-skeleton/mnt/run-build-stages.sh Sun Nov 21 19:08:01 2010 -0600 @@ -0,0 +1,20 @@ +#!/bin/sh + +# Run each of the individual package build files, in order. + +[ -z "$MANIFEST" ] && MANIFEST=/usr/src/packages +touch "$MANIFEST" + +[ -z "$FILTER" ] || FILTER="/$FILTER/d" +for i in $(sed -r -e "$FILTER" -e "s@#.*@@" /mnt/package-list) +do + if [ -z "$FORCE" ] && grep -q "$i" "$MANIFEST" + then + echo "$i already installed" + continue + fi + /mnt/build-one-package.sh "$i" || exit 1 + + sed -i -e "/$i/d" "$MANIFEST" && + echo "$i" >> "$MANIFEST" || exit 1 +done