export LANG=C
export LC_ALL=C
+# avoid leaking into chroots
+unset TMPDIR
+
# define function getfilesize before "set -e"
if stat --help >/dev/null 2>&1; then
getfilesize='stat -c %s' # GNU stat
umount $CHROOT_OUTPUT/dev/pts 2>/dev/null || /bin/true
umount $CHROOT_OUTPUT/dev 2>/dev/null || /bin/true
+ if [ -n "$EXTRACT_ISO_NAME" ] ; then
+ umount "$EXTRACT_ISO_NAME" 2>/dev/null || /bin/true
+ fi
+
# certain FAI versions sadly leave a ramdisk behind, so better safe than sorry
if [ -x /usr/lib/fai/mkramdisk ] ; then
/usr/lib/fai/mkramdisk -u "$(readlink -f ${CHROOT_OUTPUT}/var/lib/dpkg)" >/dev/null 2>&1 || /bin/true
echo -n "Is this ok for you? [y/N] "
read a
if ! [ "$a" = 'y' -o "$a" = 'Y' ] ; then
- bailout 1 "Exiting as requested."
+ CLEAN_ARTIFACTS=0
+ echo "Exiting as requested."
+ exit 0
fi
echo
fi
eend 1
bailout 1
fi
- unsquashfs -d "${CHROOT_OUTPUT}" "${mountpoint}"/live/*/*.squashfs ; rc=$?
+
+ if ls "${mountpoint}"/live/*/*.squashfs 2>/dev/null | grep -q . ; then # ISOs >=2011.12
+ log "Using ${mountpoint}/live/*/*.squashfs for unsquashfs"
+ unsquashfs -d "${CHROOT_OUTPUT}" "${mountpoint}"/live/*/*.squashfs ; rc=$?
+ elif ls "${mountpoint}"/live/*.squashfs 2>/dev/null | grep -q . ; then # ISOs before 2011.12
+ log "Using ${mountpoint}/live/*.squashfs for unsquashfs"
+ unsquashfs -d "${CHROOT_OUTPUT}" "${mountpoint}"/live/*.squashfs ; rc=$?
+ else
+ log "Error: Could not find any *.squashfs files on the ISO"
+ eerror "Error: Could not find any *.squashfs files on the ISO"
+ eend 1
+ bailout 1
+ fi
+
umount "$mountpoint"
rmdir "$mountpoint"
if [ "$rc" != 0 ]; then
# validate whether the specified architecture class matches the
# architecture (option), otherwise installation of kernel will fail
-if echo $CLASSES | grep -qi i386 ; then
+if echo $CLASSES | grep -qw I386 ; then
if ! [[ "$ARCH" == "i386" ]] ; then
log "Error: You specified the I386 class but are trying to build something else (AMD64?)."
eerror "Error: You specified the I386 class but are trying to build something else (AMD64?)."
# generate nfsroot configuration for FAI on the fly
if [ -z "$FAI_DEBOOTSTRAP" ] ; then
- FAI_DEBOOTSTRAP="$SUITE http://cdn.debian.net/debian"
+ FAI_DEBOOTSTRAP="$SUITE http://http.debian.net/debian"
fi
if [ -z "$FAI_DEBOOTSTRAP_OPTS" ] ; then
copy_addon_file ipxe.lkrn /usr/lib/ipxe addons
copy_addon_file pci.ids /usr/share/misc addons
copy_addon_file memtest86+.bin /boot addons
- for file in memdisk chain.c32 hdt.c32 menu.c32; do
+ for file in memdisk chain.c32 hdt.c32 mboot.c32 menu.c32; do
copy_addon_file "${file}" /usr/lib/syslinux addons
done
# (hidden NTFS, IIRC), as the partition type is sometimes needed
# to get the BIOS even look at the partition created by isohybrid
if isohybrid --help | grep -q -- --uefi ; then
- log "Detected uefi support for isohybrid, enabling"
- einfo "Detected uefi support for isohybrid, enabling"
- ISOHYBRID_OPTIONS=--uefi
+ if echo $CLASSES | grep -qw I386 ; then
+ log "Detected uefi support for isohybrid but 32bit systems do not support it, ignoring."
+ einfo "Detected uefi support for isohybrid but 32bit systems do not support it, ignoring."
+ else
+ log "Detected uefi support for isohybrid, enabling"
+ einfo "Detected uefi support for isohybrid, enabling"
+ ISOHYBRID_OPTIONS=--uefi
+ fi
fi
log "isohybrid $ISOHYBRID_OPTIONS ${ISO_OUTPUT}/${ISO_NAME}"