Reworking iso-hybrid as an independent binary image type.

This commit is contained in:
Daniel Baumann 2010-02-18 17:34:29 +01:00
parent 728f74d9b4
commit 77664c045c
13 changed files with 93 additions and 60 deletions

View File

@ -59,8 +59,8 @@ Check_multiarchitecture ()
if [ "$(echo ${LH_ARCHITECTURE} | wc -w)" -gt "1" ] if [ "$(echo ${LH_ARCHITECTURE} | wc -w)" -gt "1" ]
then then
# First, only support multiarch on iso # First, only support multiarch on iso
if [ "${LH_BINARY_IMAGES}" = "iso" ] case "${LH_BINARY_IMAGES}" in
then iso*)
# Assemble multi-arch # Assemble multi-arch
case "${LH_CURRENT_ARCHITECTURE}" in case "${LH_CURRENT_ARCHITECTURE}" in
amd64) amd64)
@ -81,6 +81,7 @@ Check_multiarchitecture ()
DESTDIR_INSTALL="${DESTDIR_INSTALL}.ppc" DESTDIR_INSTALL="${DESTDIR_INSTALL}.ppc"
;; ;;
esac esac
fi ;;
esac
fi fi
} }

View File

@ -669,8 +669,23 @@ Set_defaults ()
esac esac
# Setting image type # Setting image type
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}" LH_BINARY_IMAGES="${LH_BINARY_IMAGES:-iso}"
LH_BINARY_ISO_HYRBID="${LH_BINARY_ISO_HYBRID:-false}" ;;
esac
;;
*)
LH_BINARY_IMAGES="${LH_BINARY_IMAGES:-iso}"
;;
esac
# Setting apt indices # Setting apt indices
if echo ${LH_PACKAGES_LISTS} | grep -qs -E "(stripped|minimal)\b" if echo ${LH_PACKAGES_LISTS} | grep -qs -E "(stripped|minimal)\b"
@ -753,7 +768,7 @@ Set_defaults ()
if [ -n "${LH_DEBIAN_INSTALLER_PRESEEDFILE}" ] if [ -n "${LH_DEBIAN_INSTALLER_PRESEEDFILE}" ]
then then
case "${LH_BINARY_IMAGES}" in case "${LH_BINARY_IMAGES}" in
iso) iso*)
_LH_BOOTAPPEND_PRESEED="file=/cdrom/install/${LH_DEBIAN_INSTALLER_PRESEEDFILE}" _LH_BOOTAPPEND_PRESEED="file=/cdrom/install/${LH_DEBIAN_INSTALLER_PRESEEDFILE}"
;; ;;

View File

@ -24,7 +24,7 @@ Read_conffiles config/all config/common config/bootstrap config/chroot config/bi
Set_defaults Set_defaults
case "${LH_BINARY_IMAGES}" in case "${LH_BINARY_IMAGES}" in
iso|usb*) iso*)
;; ;;
*) *)
exit 0 exit 0

View File

@ -128,7 +128,7 @@ esac
# Setting destination directory # Setting destination directory
case "${LH_BINARY_IMAGES}" in case "${LH_BINARY_IMAGES}" in
iso|tar) iso*|tar)
case "${LH_INITRAMFS}" in case "${LH_INITRAMFS}" in
casper) casper)
DESTDIR_LIVE="binary/casper" DESTDIR_LIVE="binary/casper"
@ -276,7 +276,7 @@ mkdir -p binary/boot/grub
cp -r "${TEMPLATES}"/* binary/boot/grub cp -r "${TEMPLATES}"/* binary/boot/grub
case ${LH_BINARY_IMAGES} in case ${LH_BINARY_IMAGES} in
iso) iso*)
FILES="chroot/usr/lib/grub/*/stage2_eltorito" FILES="chroot/usr/lib/grub/*/stage2_eltorito"
;; ;;

View File

@ -102,7 +102,7 @@ esac
# Setting destination directory # Setting destination directory
case "${LH_BINARY_IMAGES}" in case "${LH_BINARY_IMAGES}" in
iso|tar) iso*|tar)
case "${LH_INITRAMFS}" in case "${LH_INITRAMFS}" in
casper) casper)
DESTDIR_LIVE="binary/casper" DESTDIR_LIVE="binary/casper"
@ -249,7 +249,7 @@ mkdir -p binary/boot/grub
cp -r "${TEMPLATES}"/* binary/boot/grub cp -r "${TEMPLATES}"/* binary/boot/grub
case ${LH_BINARY_IMAGES} in 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" 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"
;; ;;

View File

@ -23,10 +23,19 @@ Arguments "${@}"
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults Set_defaults
if ! In_list iso "${LH_BINARY_IMAGES}" case "${LH_BINARY_IMAGES}" in
then iso)
IMAGE="binary.iso"
;;
iso-hybrid)
IMAGE="binary-hybrid.iso"
;;
*)
exit 0 exit 0
fi ;;
esac
Echo_message "Begin building binary iso image..." Echo_message "Begin building binary iso image..."
@ -45,7 +54,7 @@ Create_lockfile .lock
# Checking depends # Checking depends
Check_package chroot/usr/bin/genisoimage genisoimage Check_package chroot/usr/bin/genisoimage genisoimage
if [ "${LH_BINARY_ISO_HYBRID}" = "true" ] if [ "${LH_BINARY_IMAGES}" = "iso-hybrid" ]
then then
Check_package chroot/usr/bin/isohybrid syslinux-common Check_package chroot/usr/bin/isohybrid syslinux-common
fi fi
@ -57,9 +66,9 @@ Restore_cache cache/packages_binary
Install_package Install_package
# Remove old iso image # Remove old iso image
if [ -f binary.iso ] if [ -f ${IMAGE} ]
then then
rm -f binary.iso rm -f ${IMAGE}
fi fi
# Handle genisoimage generic options # Handle genisoimage generic options
@ -177,15 +186,15 @@ fi
cat >> binary.sh << EOF cat >> binary.sh << EOF
genisoimage ${GENISOIMAGE_OPTIONS} -o binary.iso binary genisoimage ${GENISOIMAGE_OPTIONS} -o ${IMAGE} binary
EOF EOF
if [ "${LH_BINARY_ISO_HYRBID}" = "true" ] if [ "${LH_BINARY_IMAGES}" = "iso-hybrid" ]
then then
cat >> binary.sh << EOF cat >> binary.sh << EOF
isohybrid binary.iso isohybrid ${IMAGE}
EOF EOF
fi fi
@ -199,7 +208,7 @@ case "${LH_CHROOT_BUILD}" in
Chroot chroot "sh binary.sh" Chroot chroot "sh binary.sh"
# Move image # Move image
mv chroot/binary chroot/binary.iso ./ mv chroot/binary chroot/${IMAGE} ./
rm -f chroot/binary.sh rm -f chroot/binary.sh
;; ;;

View File

@ -30,7 +30,7 @@ fi
# Check image type # Check image type
case "${LH_BINARY_IMAGES}" in case "${LH_BINARY_IMAGES}" in
iso|usb*|tar) iso*|usb*|tar)
;; ;;
net) net)
@ -225,7 +225,7 @@ fi
LINUX_INSTALL="$(/bin/echo ${LINUX_INSTALL} | sed -e 's|binary||g' -e 's|//|/|g')" LINUX_INSTALL="$(/bin/echo ${LINUX_INSTALL} | sed -e 's|binary||g' -e 's|//|/|g')"
case "${LH_BINARY_IMAGES}" in case "${LH_BINARY_IMAGES}" in
iso|usb*) iso*|usb*)
# Copying silo # Copying silo
mkdir -p binary/boot mkdir -p binary/boot

View File

@ -90,7 +90,7 @@ Syslinux_live_entry ()
APPEND="${5}" APPEND="${5}"
case "${LH_BINARY_IMAGES}" in case "${LH_BINARY_IMAGES}" in
iso|usb*) iso*|usb*)
NUMBER="$(ls -1 ${KERNEL_PATH} | grep 'vmlinuz[0-9]\+$' | wc -l)" NUMBER="$(ls -1 ${KERNEL_PATH} | grep 'vmlinuz[0-9]\+$' | wc -l)"
NUMBER="$((${NUMBER} +1))" NUMBER="$((${NUMBER} +1))"
@ -363,7 +363,7 @@ esac
# Setting boot method specific variables # Setting boot method specific variables
case "${LH_BINARY_IMAGES}" in case "${LH_BINARY_IMAGES}" in
iso) iso*)
SYSLINUX_PATH="binary/isolinux" SYSLINUX_PATH="binary/isolinux"
KERNEL_PATH="binary/${INITFS}" KERNEL_PATH="binary/${INITFS}"
SCREEN_PATH="${SYSLINUX_PATH}" SCREEN_PATH="${SYSLINUX_PATH}"
@ -581,7 +581,7 @@ Configure_syslinux_templates
# Configure syslinux setup per boot method # Configure syslinux setup per boot method
case "${LH_BINARY_IMAGES}" in case "${LH_BINARY_IMAGES}" in
iso) iso*)
case "${LH_CHROOT_BUILD}" in case "${LH_CHROOT_BUILD}" in
true) true)
cp chroot/usr/lib/syslinux/isolinux.bin ${SCREEN_PATH} cp chroot/usr/lib/syslinux/isolinux.bin ${SCREEN_PATH}

View File

@ -135,7 +135,7 @@ esac
# Setting destination directory # Setting destination directory
case "${LH_BINARY_IMAGES}" in case "${LH_BINARY_IMAGES}" in
iso) iso*)
case "${LH_INITRAMFS}" in case "${LH_INITRAMFS}" in
casper) casper)
DESTDIR_LIVE="binary/casper" DESTDIR_LIVE="binary/casper"
@ -272,7 +272,7 @@ fi
LINUX_INSTALL="$(/bin/echo ${LINUX_INSTALL} | sed -e 's|binary||g' -e 's|//|/|g')" LINUX_INSTALL="$(/bin/echo ${LINUX_INSTALL} | sed -e 's|binary||g' -e 's|//|/|g')"
case "${LH_BINARY_IMAGES}" in case "${LH_BINARY_IMAGES}" in
iso|usb*) iso*|usb*)
# Copying yaboot # Copying yaboot
mkdir -p binary/yaboot mkdir -p binary/yaboot

View File

@ -90,7 +90,7 @@ do
--binary) --binary)
${LH_ROOT_COMMAND} umount -f binary.tmp > /dev/null 2>&1 || true ${LH_ROOT_COMMAND} umount -f binary.tmp > /dev/null 2>&1 || true
rm -rf binary.tmp binary.deb binary.udeb rm -rf binary.tmp binary.deb binary.udeb
rm -f binary.iso rm -f binary*.iso
rm -f binary*.img rm -f binary*.img
rm -f binary*.tar.gz rm -f binary*.tar.gz
rm -f binary.sh rm -f binary.sh
@ -122,7 +122,7 @@ do
;; ;;
--source) --source)
rm -f source.iso rm -f source*.iso
rm -f source*.img rm -f source*.img
rm -f source*.tar rm -f source*.tar
rm -f source*.tar.gz rm -f source*.tar.gz

View File

@ -23,10 +23,14 @@ Arguments "${@}"
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults Set_defaults
if [ "${LH_SOURCE_IMAGES}" != "iso" ] case "${LH_SOURCE_IMAGES}" in
then iso*)
;;
*)
exit 0 exit 0
fi ;;
esac
Echo_message "Begin installing disk information..." Echo_message "Begin installing disk information..."

View File

@ -28,10 +28,14 @@ then
exit 0 exit 0
fi fi
if ! In_list iso "${LH_SOURCE_IMAGES}" case "${LH_SOURCE_IMAGES}" in
then iso*)
;;
*)
exit 0 exit 0
fi ;;
esac
Echo_message "Begin building source iso image..." Echo_message "Begin building source iso image..."

View File

@ -26,7 +26,7 @@ lh_config \- create configuration for live\-helper
.br .br
[\-a|\fB\-\-architecture\fR \fIARCHITECTURE\fR] [\-a|\fB\-\-architecture\fR \fIARCHITECTURE\fR]
.br .br
[\-b|\fB\-\-binary\-images\fR iso|net|tar|usb\-hdd] [\-b|\fB\-\-binary\-images\fR iso|iso-hybrid|net|tar|usb\-hdd]
.br .br
[\fB\-\-binary\-filesystem\fR fat16|fat32|ext2] [\fB\-\-binary\-filesystem\fR fat16|fat32|ext2]
.br .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. defines if apt should check repository signatures. This is true by default.
.IP "\-a|\fB\-\-architecture\fR \fIARCHITECTURE\fR" 4 .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. 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 .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. 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 .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. 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 .IP "\fB\-\-binary\-indices\fR true|false|none" 4