Mercurial > hg > aboriginal
diff sources/control-images/bootstrap-skeleton/files/functions.sh @ 1275:a4cb2ed0a551
Move sources/native-builds to sources/control-images, so the naming is consistent.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 07 Nov 2010 15:55:26 -0600 |
parents | sources/native-builds/bootstrap-skeleton/files/functions.sh@c264495fbf21 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/control-images/bootstrap-skeleton/files/functions.sh Sun Nov 07 15:55:26 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 +}