diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-08-16 17:09:14 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-08-22 13:08:49 +0100 |
commit | 6890972473e7bd413c651b3817f19fe9b03d4afe (patch) | |
tree | be0e4a52730446f3015b3af08bb7a0175d4bdf65 /run-bootstrap-in-chroot | |
parent | 61caa7404224ad5904d2be56111d54258deb703a (diff) | |
download | morph-6890972473e7bd413c651b3817f19fe9b03d4afe.tar.gz |
Allow setting ARCH explicitly for bootstrapping
This is required to bootstrap on Fedora, where debootstrap fails to
autodetect the architecture due to dpkg not being present.
Diffstat (limited to 'run-bootstrap-in-chroot')
-rwxr-xr-x | run-bootstrap-in-chroot | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/run-bootstrap-in-chroot b/run-bootstrap-in-chroot index 2453d15f..b72626ad 100755 --- a/run-bootstrap-in-chroot +++ b/run-bootstrap-in-chroot @@ -104,6 +104,11 @@ then exit 1 fi +if ! which dpkg 2> /dev/null; then + echo "Warning: dpkg not found -- should debootstrap fail to autodetect " + echo "your architecture, set ARCH in the environment (probably to amd64)" +fi + # prepare the ccache directory in the chroot, if necessary if [ "x$CCACHE_HOST_DIR" = "x" ]; then # print a warning if the CCACHE_HOST_DIR is not set @@ -123,7 +128,14 @@ if ! "$snapshot" || ! has_pass pass1a; then EXTRAPACKAGES="build-essential,gawk,bison,flex,python,autoconf" EXTRAPACKAGES="$EXTRAPACKAGES,autopoint,automake,gettext,libtool" EXTRAPACKAGES="$EXTRAPACKAGES,help2man,texinfo,sudo,ccache,gperf" - debootstrap --include="$EXTRAPACKAGES" squeeze "$dir" "$DEBIAN_MIRROR" + + EXTRAARGS= + if [ -n $ARCH]; then + EXTRAARGS=$ARCH + fi + + debootstrap $EXTRAARGS --include="$EXTRAPACKAGES" squeeze \ + "$dir" "$DEBIAN_MIRROR" mkdir -p "$dir/etc" hostname > "$dir/etc/hostname" |