[ -n "$RELEASE" ] && INFOTEXT="$INFOTEXT
Using release: $RELEASE"
[ -n "$HOSTNAME" ] && INFOTEXT="$INFOTEXT
- Using hostname $HOSTNAME"
+ Using hostname: $HOSTNAME"
[ -n "$MIRROR" ] && INFOTEXT="$INFOTEXT
Using mirror: $MIRROR"
[ -n "$ISO" ] && INFOTEXT="$INFOTEXT
Using ISO: $ISO"
+ [ -n "$ARCH" ] && INFOTEXT="$INFOTEXT
+ Using arch: $ARCH"
INFOTEXT="$INFOTEXT
fi
[ -n "$RELEASE" ] && echo " Using release: $RELEASE"
- [ -n "$MIRROR" ] && echo " Using mirror: $MIRROR"
[ -n "$HOSTNAME" ] && echo " Using hostname: $HOSTNAME"
+ [ -n "$MIRROR" ] && echo " Using mirror: $MIRROR"
[ -n "$ISO" ] && echo " Using ISO: $ISO"
+ [ -n "$ARCH" ] && echo " Using arch: $ARCH"
if [ -n "$VIRTUAL" ] ; then
echo " Deploying as Virtual Machine."
[ -n "$VMSIZE" ] && echo " Using Virtual Disk file with size of ${VMSIZE}."
fi
# }}}
+# architecture setup {{{
+if [ -n "$ARCH" ] ; then
+ ARCHCMD="--arch $ARCH"
+ ARCHINFO=" (${ARCH})"
+else
+ ARCH="$(dpkg --print-architecture)"
+ ARCHCMD="--arch $ARCH"
+ ARCHINFO=" (${ARCH})"
+fi
+# }}}
+
checkconfiguration
# finally make sure at least $TARGET is set [the partition for the new system] {{{
fi
# }}}
-# architecture setup {{{
-if [ -n "$ARCH" ] ; then
- ARCHCMD="--arch $ARCH"
- ARCHINFO=" (${ARCH})"
-else
- ARCH="$(dpkg --print-architecture)"
- ARCHCMD="--arch $ARCH"
- ARCHINFO=" (${ARCH})"
-fi
-# }}}
-
# make sure we have the right syntax when using an iso image {{{
if [ -n "$ISO" ] ; then
case $ISO in
file*) # do nothing
;;
*)
- ISO=file:$1
+ ISO=file:$ISO
;;
esac
fi
ISODIR=${ISODIR%%/}
# }}}
+# Debian ISOs do not contain signed Release files {{{
+if [ -n "$ISO" ] ; then
+ DEBOOTSTRAP_OPT="$DEBOOTSTRAP_OPT --no-check-gpg"
+fi
+# }}}
+
# create filesystem {{{
mkfs() {
if [ -n "$DIRECTORY" ] ; then
# if dm-mod isn't available then kpartx will fail with
# "Is device-mapper driver missing from kernel? [...]"
- if ! kpartx -av $TARGET >/dev/null 2>&1 ; then
+ if ! kpartx -av $TARGET >/dev/null 2>&1 || ! grep -q device-mapper /proc/misc >/dev/null 2>&1 ; then
einfo "Device-mapper not ready yet, trying to load dm-mod module."
modprobe dm-mod ; eend $?
fi
eend 1 ; exit 1
fi
- einfo "Running $DEBOOTSTRAP $DEBOOTSTRAP_OPT for release ${RELEASE}${ARCHINFO} using ${MIRROR}${ISO}"
- if [ -n "$MIRROR" ] ; then
- einfo "Executing: $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $MIRROR"
- $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $MIRROR
- RC=$?
- else
+ if [ -n "$ISO" ] ; then
+ einfo "Running $DEBOOTSTRAP $DEBOOTSTRAP_OPT for release ${RELEASE}${ARCHINFO} using ${ISO}"
einfo "Executing: $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $ISO"
$DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $ISO
RC=$?
+ else
+ einfo "Running $DEBOOTSTRAP $DEBOOTSTRAP_OPT for release ${RELEASE}${ARCHINFO} using ${MIRROR}"
+ einfo "Executing: $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $MIRROR"
+ $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $MIRROR
+ RC=$?
fi
if [ $RC -ne 0 ] ; then