Mercurial > hg > aboriginal
comparison sources/native-builds/gentoo-bootstrap/build/functions.sh @ 1252:ba951c11fb48
Refactor the gentoo bootstrap build some more. Add "build" and "files" subdirectories, split each package build into a separate file, break out reusable shell functions into functions.sh. Flow control now init chrooting into run-build-stages.sh calling the individual package scripts.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 25 Sep 2010 13:40:04 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1251:204238871b7c | 1252:ba951c11fb48 |
---|---|
1 #!/bin/echo This file is sourced not run | |
2 | |
3 upload_result() | |
4 { | |
5 ftpput $FTP_SERVER -P $FTP_PORT "$1-$HOST" "$1" | |
6 } | |
7 | |
8 set_titlebar() | |
9 { | |
10 echo -en "\033]2;($HOST) $1\007" | |
11 echo === "$1" | |
12 } | |
13 | |
14 dotprogress() | |
15 { | |
16 while read i; do echo -n .; done; echo | |
17 } | |
18 | |
19 do_in_chroot() | |
20 { | |
21 # Copy root filesystem into a new chroot directory and restart in there. | |
22 | |
23 CHROOT="$1" | |
24 shift | |
25 | |
26 set_titlebar "Setup chroot" | |
27 mkdir "$CHROOT" | |
28 cp -a /mnt/files/. "$CHROOT" | |
29 find / -xdev | cpio -m -v -p "$CHROOT" | dotprogress | |
30 for i in mnt proc sys dev; do mount --bind /$i "$CHROOT"/$i; done | |
31 | |
32 echo Chroot | |
33 chroot "$CHROOT" "$@" | |
34 RC=$? | |
35 | |
36 echo Chroot cleanup | |
37 for i in mnt proc sys dev; do umount "$CHROOT"/$i; done | |
38 | |
39 return $RC | |
40 } |