Replicating same qemu support within bootstrap_debootstrao for bootstrap_cdebootstrap...
authorDaniel Baumann <daniel@debian.org>
Fri, 30 Nov 2012 14:08:27 +0000 (15:08 +0100)
committerDaniel Baumann <daniel@debian.org>
Fri, 30 Nov 2012 14:09:22 +0000 (15:09 +0100)
scripts/build/bootstrap_cdebootstrap

index c342301..1c778e3 100755 (executable)
@@ -113,7 +113,24 @@ then
        fi
 
        Echo_breakage "Running ${LB_BOOTSTRAP}... "
-       ${LB_ROOT_COMMAND} ${LB_BOOTSTRAP} ${CDEBOOTSTRAP_OPTIONS} "${LB_PARENT_DISTRIBUTION}" chroot "${LB_PARENT_MIRROR_BOOTSTRAP}"
+
+       # Run appropriate bootstrap, i.e. foreign or regular bootstrap
+       if [ "${LB_BOOTSTRAP_QEMU_ARCHITECTURES}" = "${LB_ARCHITECTURES}" ]; then
+
+               if [ -n "${LB_BOOTSTRAP_QEMU_EXCLUDE}" ]
+               then
+                       CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --exclude=$(echo ${LB_BOOTSTRAP_QEMU_EXCLUDE} | sed 's|  *|,|g')"
+               fi
+
+               Echo_message "Bootstrap will be foreign"
+               ${LB_ROOT_COMMAND} ${LB_BOOTSTRAP} ${CDEBOOTSTRAP_OPTIONS} --foreign "${LB_PARENT_DISTRIBUTION}" chroot "${LB_PARENT_MIRROR_BOOTSTRAP}"
+
+               Echo_message "Running debootstrap second stage under QEMU"
+               cp ${LB_BOOTSTRAP_QEMU_STATIC} chroot/usr/bin
+               Chroot chroot /bin/sh /sbin/cdebootstrap-foreign
+       else
+               ${LB_ROOT_COMMAND} ${LB_BOOTSTRAP} ${CDEBOOTSTRAP_OPTIONS} "${LB_PARENT_DISTRIBUTION}" chroot "${LB_PARENT_MIRROR_BOOTSTRAP}"
+       fi
 
        if [ -n "${LB_ROOT_COMMAND}" ]
        then