Commit 173e8cf8 authored by segfault's avatar segfault Committed by intrigeri
Browse files

Remove unsupported cases of LB_BINARY_IMAGES (refs: #15990)

parent 533b3c41
......@@ -122,8 +122,6 @@ export MKSQUASHFS_OPTIONS
case "$LB_BINARY_IMAGES" in
iso)
BUILD_FILENAME_EXT=iso
BUILD_FILENAME=binary
which isohybrid >/dev/null || fatal 'Cannot find isohybrid in $PATH'
installed_syslinux_utils_upstream_version="$(syslinux_utils_upstream_version)"
if dpkg --compare-versions \
......@@ -135,23 +133,11 @@ case "$LB_BINARY_IMAGES" in
"while we need at least '${REQUIRED_SYSLINUX_UTILS_UPSTREAM_VERSION}'."
fi
;;
iso-hybrid)
BUILD_FILENAME_EXT=iso
BUILD_FILENAME=binary-hybrid
;;
tar)
BUILD_FILENAME_EXT=tar.gz
BUILD_FILENAME=binary-tar
;;
usb-hdd)
BUILD_FILENAME_EXT=img
BUILD_FILENAME=binary
;;
*)
fatal "Image type ${LB_BINARY_IMAGES} is not supported."
;;
esac
BUILD_ISO_FILENAME="${BUILD_BASENAME}.${BUILD_FILENAME_EXT}"
BUILD_ISO_FILENAME="${BUILD_BASENAME}.iso"
BUILD_MANIFEST="${BUILD_ISO_FILENAME}.build-manifest"
BUILD_APT_SOURCES="${BUILD_ISO_FILENAME}.apt-sources"
BUILD_PACKAGES="${BUILD_ISO_FILENAME}.packages"
......@@ -173,30 +159,27 @@ trap "kill -9 $! 2>/dev/null" EXIT HUP INT QUIT TERM
cat config/chroot_sources/*.chroot
) > "$BUILD_APT_SOURCES"
echo "Building $LB_BINARY_IMAGES image ${BUILD_BASENAME}..."
echo "Building ISO image ${BUILD_BASENAME}..."
set -o pipefail
time lb build noauto ${@}
RET=$?
if [ -e "${BUILD_FILENAME}.${BUILD_FILENAME_EXT}" ]; then
if [ -e binary.iso ]; then
echo "Image was successfully created"
[ "$RET" -eq 0 ] || \
echo "Warning: lb build exited with code $RET"
if [ "$LB_BINARY_IMAGES" = iso ]; then
ISO_FILE="${BUILD_FILENAME}.${BUILD_FILENAME_EXT}"
print_iso_size "$ISO_FILE"
echo "Hybriding it..."
isohybrid $AMNESIA_ISOHYBRID_OPTS "$ISO_FILE" || fatal "isohybrid failed"
print_iso_size "$ISO_FILE"
truncate -s %2048 "$ISO_FILE"
print_iso_size "$ISO_FILE"
fi
print_iso_size binary.iso
echo "Hybriding it..."
isohybrid $AMNESIA_ISOHYBRID_OPTS binary.iso || fatal "isohybrid failed"
print_iso_size binary.iso
truncate -s %2048 binary.iso
print_iso_size binary.iso
echo "Renaming generated files..."
mv -i "${BUILD_FILENAME}.${BUILD_FILENAME_EXT}" "${BUILD_ISO_FILENAME}"
mv -i binary.iso "${BUILD_ISO_FILENAME}"
mv -i binary.packages "${BUILD_PACKAGES}"
generate-build-manifest chroot/debootstrap "${BUILD_MANIFEST}"
else
fatal "lb build failed ($?)."
fi
echo "Creating disk image ${BUILD_USB_IMAGE_FILENAME}..."
echo "Creating USB image ${BUILD_USB_IMAGE_FILENAME}..."
create-usb-image-from-iso "${BUILD_ISO_FILENAME}"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment