From c66942f06ed5dcebab29711afee6dcef8d865adf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 18 Feb 2010 17:34:29 +0100 Subject: Reworking iso-hybrid as an independent binary image type. --- functions/architecture.sh | 43 ++++++++++++++++++++++--------------------- functions/defaults.sh | 21 ++++++++++++++++++--- helpers/binary_disk | 2 +- helpers/binary_grub | 4 ++-- helpers/binary_grub2 | 4 ++-- helpers/binary_iso | 31 ++++++++++++++++++++----------- helpers/binary_silo | 4 ++-- helpers/binary_syslinux | 6 +++--- helpers/binary_yaboot | 4 ++-- helpers/clean | 4 ++-- helpers/source_disk | 12 ++++++++---- helpers/source_iso | 12 ++++++++---- manpages/lh_config.en.1 | 6 +++--- 13 files changed, 93 insertions(+), 60 deletions(-) diff --git a/functions/architecture.sh b/functions/architecture.sh index cd8e073..9f18ad4 100755 --- a/functions/architecture.sh +++ b/functions/architecture.sh @@ -59,28 +59,29 @@ Check_multiarchitecture () if [ "$(echo ${LH_ARCHITECTURE} | wc -w)" -gt "1" ] then # First, only support multiarch on iso - if [ "${LH_BINARY_IMAGES}" = "iso" ] - then - # Assemble multi-arch - case "${LH_CURRENT_ARCHITECTURE}" in - amd64) - DESTDIR="${DESTDIR}.amd" - DESTDIR_LIVE="${DESTDIR_LIVE}.amd" - DESTDIR_INSTALL="${DESTDIR_INSTALL}.amd" - ;; + case "${LH_BINARY_IMAGES}" in + iso*) + # Assemble multi-arch + case "${LH_CURRENT_ARCHITECTURE}" in + amd64) + DESTDIR="${DESTDIR}.amd" + DESTDIR_LIVE="${DESTDIR_LIVE}.amd" + DESTDIR_INSTALL="${DESTDIR_INSTALL}.amd" + ;; - i386) - DESTDIR="${DESTDIR}.386" - DESTDIR_LIVE="${DESTDIR_LIVE}.386" - DESTDIR_INSTALL="${DESTDIR_INSTALL}.386" - ;; + i386) + DESTDIR="${DESTDIR}.386" + DESTDIR_LIVE="${DESTDIR_LIVE}.386" + DESTDIR_INSTALL="${DESTDIR_INSTALL}.386" + ;; - powerpc) - DESTDIR="${DESTDIR}.ppc" - DESTDIR_LIVE="${DESTDIR_LIVE}.ppc" - DESTDIR_INSTALL="${DESTDIR_INSTALL}.ppc" - ;; - esac - fi + powerpc) + DESTDIR="${DESTDIR}.ppc" + DESTDIR_LIVE="${DESTDIR_LIVE}.ppc" + DESTDIR_INSTALL="${DESTDIR_INSTALL}.ppc" + ;; + esac + ;; + esac fi } diff --git a/functions/defaults.sh b/functions/defaults.sh index a5712b7..f46ec23 100755 --- a/functions/defaults.sh +++ b/functions/defaults.sh @@ -669,8 +669,23 @@ Set_defaults () esac # Setting image type - LH_BINARY_IMAGES="${LH_BINARY_IMAGES:-iso}" - LH_BINARY_ISO_HYRBID="${LH_BINARY_ISO_HYBRID:-false}" + case "${LH_DISTRIBUTION}" in + squeeze|sid) + case "${LH_ARCHITECTURE}" in + amd64|i386) + LH_BINARY_IMAGES="${LH_BINARY_IMAGES:-iso-hybrid}" + ;; + + *) + LH_BINARY_IMAGES="${LH_BINARY_IMAGES:-iso}" + ;; + esac + ;; + + *) + LH_BINARY_IMAGES="${LH_BINARY_IMAGES:-iso}" + ;; + esac # Setting apt indices if echo ${LH_PACKAGES_LISTS} | grep -qs -E "(stripped|minimal)\b" @@ -753,7 +768,7 @@ Set_defaults () if [ -n "${LH_DEBIAN_INSTALLER_PRESEEDFILE}" ] then case "${LH_BINARY_IMAGES}" in - iso) + iso*) _LH_BOOTAPPEND_PRESEED="file=/cdrom/install/${LH_DEBIAN_INSTALLER_PRESEEDFILE}" ;; diff --git a/helpers/binary_disk b/helpers/binary_disk index 8116734..b6edf4a 100755 --- a/helpers/binary_disk +++ b/helpers/binary_disk @@ -24,7 +24,7 @@ Read_conffiles config/all config/common config/bootstrap config/chroot config/bi Set_defaults case "${LH_BINARY_IMAGES}" in - iso|usb*) + iso*) ;; *) exit 0 diff --git a/helpers/binary_grub b/helpers/binary_grub index b3f9ba1..373d64e 100755 --- a/helpers/binary_grub +++ b/helpers/binary_grub @@ -128,7 +128,7 @@ esac # Setting destination directory case "${LH_BINARY_IMAGES}" in - iso|tar) + iso*|tar) case "${LH_INITRAMFS}" in casper) DESTDIR_LIVE="binary/casper" @@ -276,7 +276,7 @@ mkdir -p binary/boot/grub cp -r "${TEMPLATES}"/* binary/boot/grub case ${LH_BINARY_IMAGES} in - iso) + iso*) FILES="chroot/usr/lib/grub/*/stage2_eltorito" ;; diff --git a/helpers/binary_grub2 b/helpers/binary_grub2 index 0cf0618..7a7b26e 100755 --- a/helpers/binary_grub2 +++ b/helpers/binary_grub2 @@ -102,7 +102,7 @@ esac # Setting destination directory case "${LH_BINARY_IMAGES}" in - iso|tar) + iso*|tar) case "${LH_INITRAMFS}" in casper) DESTDIR_LIVE="binary/casper" @@ -249,7 +249,7 @@ mkdir -p binary/boot/grub cp -r "${TEMPLATES}"/* binary/boot/grub case ${LH_BINARY_IMAGES} in - iso) + iso*) FILES="chroot/usr/lib/grub/i386-pc/*.mod chroot/usr/lib/grub/i386-pc/*.lst chroot/usr/lib/grub/i386-pc/efiemu??.o chroot/usr/share/grub/*.pf2" ;; diff --git a/helpers/binary_iso b/helpers/binary_iso index 4012a70..811310d 100755 --- a/helpers/binary_iso +++ b/helpers/binary_iso @@ -23,10 +23,19 @@ Arguments "${@}" Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source Set_defaults -if ! In_list iso "${LH_BINARY_IMAGES}" -then - exit 0 -fi +case "${LH_BINARY_IMAGES}" in + iso) + IMAGE="binary.iso" + ;; + + iso-hybrid) + IMAGE="binary-hybrid.iso" + ;; + + *) + exit 0 + ;; +esac Echo_message "Begin building binary iso image..." @@ -45,7 +54,7 @@ Create_lockfile .lock # Checking depends Check_package chroot/usr/bin/genisoimage genisoimage -if [ "${LH_BINARY_ISO_HYBRID}" = "true" ] +if [ "${LH_BINARY_IMAGES}" = "iso-hybrid" ] then Check_package chroot/usr/bin/isohybrid syslinux-common fi @@ -57,9 +66,9 @@ Restore_cache cache/packages_binary Install_package # Remove old iso image -if [ -f binary.iso ] +if [ -f ${IMAGE} ] then - rm -f binary.iso + rm -f ${IMAGE} fi # Handle genisoimage generic options @@ -177,15 +186,15 @@ fi cat >> binary.sh << EOF -genisoimage ${GENISOIMAGE_OPTIONS} -o binary.iso binary +genisoimage ${GENISOIMAGE_OPTIONS} -o ${IMAGE} binary EOF -if [ "${LH_BINARY_ISO_HYRBID}" = "true" ] +if [ "${LH_BINARY_IMAGES}" = "iso-hybrid" ] then cat >> binary.sh << EOF -isohybrid binary.iso +isohybrid ${IMAGE} EOF fi @@ -199,7 +208,7 @@ case "${LH_CHROOT_BUILD}" in Chroot chroot "sh binary.sh" # Move image - mv chroot/binary chroot/binary.iso ./ + mv chroot/binary chroot/${IMAGE} ./ rm -f chroot/binary.sh ;; diff --git a/helpers/binary_silo b/helpers/binary_silo index df7ee10..356c47e 100755 --- a/helpers/binary_silo +++ b/helpers/binary_silo @@ -30,7 +30,7 @@ fi # Check image type case "${LH_BINARY_IMAGES}" in - iso|usb*|tar) + iso*|usb*|tar) ;; net) @@ -225,7 +225,7 @@ fi LINUX_INSTALL="$(/bin/echo ${LINUX_INSTALL} | sed -e 's|binary||g' -e 's|//|/|g')" case "${LH_BINARY_IMAGES}" in - iso|usb*) + iso*|usb*) # Copying silo mkdir -p binary/boot diff --git a/helpers/binary_syslinux b/helpers/binary_syslinux index 9d4cab1..4fa2805 100755 --- a/helpers/binary_syslinux +++ b/helpers/binary_syslinux @@ -90,7 +90,7 @@ Syslinux_live_entry () APPEND="${5}" case "${LH_BINARY_IMAGES}" in - iso|usb*) + iso*|usb*) NUMBER="$(ls -1 ${KERNEL_PATH} | grep 'vmlinuz[0-9]\+$' | wc -l)" NUMBER="$((${NUMBER} +1))" @@ -363,7 +363,7 @@ esac # Setting boot method specific variables case "${LH_BINARY_IMAGES}" in - iso) + iso*) SYSLINUX_PATH="binary/isolinux" KERNEL_PATH="binary/${INITFS}" SCREEN_PATH="${SYSLINUX_PATH}" @@ -581,7 +581,7 @@ Configure_syslinux_templates # Configure syslinux setup per boot method case "${LH_BINARY_IMAGES}" in - iso) + iso*) case "${LH_CHROOT_BUILD}" in true) cp chroot/usr/lib/syslinux/isolinux.bin ${SCREEN_PATH} diff --git a/helpers/binary_yaboot b/helpers/binary_yaboot index ef44e6e..b896eac 100755 --- a/helpers/binary_yaboot +++ b/helpers/binary_yaboot @@ -135,7 +135,7 @@ esac # Setting destination directory case "${LH_BINARY_IMAGES}" in - iso) + iso*) case "${LH_INITRAMFS}" in casper) DESTDIR_LIVE="binary/casper" @@ -272,7 +272,7 @@ fi LINUX_INSTALL="$(/bin/echo ${LINUX_INSTALL} | sed -e 's|binary||g' -e 's|//|/|g')" case "${LH_BINARY_IMAGES}" in - iso|usb*) + iso*|usb*) # Copying yaboot mkdir -p binary/yaboot diff --git a/helpers/clean b/helpers/clean index 8f74209..0596e39 100755 --- a/helpers/clean +++ b/helpers/clean @@ -90,7 +90,7 @@ do --binary) ${LH_ROOT_COMMAND} umount -f binary.tmp > /dev/null 2>&1 || true rm -rf binary.tmp binary.deb binary.udeb - rm -f binary.iso + rm -f binary*.iso rm -f binary*.img rm -f binary*.tar.gz rm -f binary.sh @@ -122,7 +122,7 @@ do ;; --source) - rm -f source.iso + rm -f source*.iso rm -f source*.img rm -f source*.tar rm -f source*.tar.gz diff --git a/helpers/source_disk b/helpers/source_disk index a765bb4..50db471 100755 --- a/helpers/source_disk +++ b/helpers/source_disk @@ -23,10 +23,14 @@ Arguments "${@}" Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source Set_defaults -if [ "${LH_SOURCE_IMAGES}" != "iso" ] -then - exit 0 -fi +case "${LH_SOURCE_IMAGES}" in + iso*) + ;; + + *) + exit 0 + ;; +esac Echo_message "Begin installing disk information..." diff --git a/helpers/source_iso b/helpers/source_iso index 0ef1bcb..0752ebe 100755 --- a/helpers/source_iso +++ b/helpers/source_iso @@ -28,10 +28,14 @@ then exit 0 fi -if ! In_list iso "${LH_SOURCE_IMAGES}" -then - exit 0 -fi +case "${LH_SOURCE_IMAGES}" in + iso*) + ;; + + *) + exit 0 + ;; +esac Echo_message "Begin building source iso image..." diff --git a/manpages/lh_config.en.1 b/manpages/lh_config.en.1 index d4b114f..3a3e4cf 100644 --- a/manpages/lh_config.en.1 +++ b/manpages/lh_config.en.1 @@ -26,7 +26,7 @@ lh_config \- create configuration for live\-helper .br [\-a|\fB\-\-architecture\fR \fIARCHITECTURE\fR] .br - [\-b|\fB\-\-binary\-images\fR iso|net|tar|usb\-hdd] + [\-b|\fB\-\-binary\-images\fR iso|iso-hybrid|net|tar|usb\-hdd] .br [\fB\-\-binary\-filesystem\fR fat16|fat32|ext2] .br @@ -226,8 +226,8 @@ defines if apt should install recommended packages automatically. By default, th defines if apt should check repository signatures. This is true by default. .IP "\-a|\fB\-\-architecture\fR \fIARCHITECTURE\fR" 4 defines the architecture of the to be build image. By default, this is set to the host architecture. Note that you cannot crossbuild for another architecture if your host system is not able to execute binaries for the target architecture natively. For example, building amd64 images on i386 and vice versa is possile if you have a 64bit capable i386 processor and the right kernel. But building powerpc images on an i386 system is not possible. -.IP "\-b|\fB\-\-binary\-images\fR iso|net|tar|usb\-hdd" 4 -defines the image type to build. By default this is set to iso to build CD/DVD images. +.IP "\-b|\fB\-\-binary\-images\fR iso|iso-hybrid|net|tar|usb\-hdd" 4 +defines the image type to build. By default this is set to iso to build CD/DVD images, for squeeze and newer it defaults to iso-hybrid. .IP "\fB\-\-binary\-filesystem\fR fat16|fat32|ext2" 4 defines the filesystem to be used in the image type. This only has an effect if the selected binary image type does allow to choose a filesystem. For example, when selection iso the resulting CD/DVD has always the filesystem ISO9660. When building usb-hdd images for usb sticks, this is active. Note that it defaults to fat16 on all architectures except sparc where it defaults to ext2. Also note that if you choose fat16 and your resulting binary image gets bigger than 2GB, the binary filesystem automatically gets switched to fat32. .IP "\fB\-\-binary\-indices\fR true|false|none" 4 -- cgit v1.0