diff options
Diffstat (limited to 'helpers')
-rwxr-xr-x | helpers/lh_binary | 34 | ||||
-rwxr-xr-x | helpers/lh_binary_chroot | 12 | ||||
-rwxr-xr-x | helpers/lh_binary_debian-installer | 31 | ||||
-rwxr-xr-x | helpers/lh_binary_encryption | 39 | ||||
-rwxr-xr-x | helpers/lh_binary_grub | 25 | ||||
-rwxr-xr-x | helpers/lh_binary_includes | 8 | ||||
-rwxr-xr-x | helpers/lh_binary_iso | 33 | ||||
-rwxr-xr-x | helpers/lh_binary_linux-image | 16 | ||||
-rwxr-xr-x | helpers/lh_binary_memtest | 32 | ||||
-rwxr-xr-x | helpers/lh_binary_rootfs | 64 | ||||
-rwxr-xr-x | helpers/lh_binary_syslinux | 51 | ||||
-rwxr-xr-x | helpers/lh_binary_usb-hdd | 6 | ||||
-rwxr-xr-x | helpers/lh_binary_yaboot | 20 | ||||
-rwxr-xr-x | helpers/lh_bootstrap_cache | 4 | ||||
-rwxr-xr-x | helpers/lh_chroot_cache | 4 | ||||
-rwxr-xr-x | helpers/lh_clean | 3 | ||||
-rwxr-xr-x | helpers/lh_config | 5 | ||||
-rwxr-xr-x | helpers/lh_source_debian-live | 2 |
18 files changed, 287 insertions, 102 deletions
diff --git a/helpers/lh_binary b/helpers/lh_binary index c7ab7762e..7a71cbc61 100755 --- a/helpers/lh_binary +++ b/helpers/lh_binary @@ -27,13 +27,16 @@ Arguments "${@}" # Preparing root filesystem lh_binary_chroot ${*} -# Configuring chroot -lh_chroot_proc install ${*} -lh_chroot_sysfs install ${*} -lh_chroot_hosts install ${*} -lh_chroot_resolv install ${*} -lh_chroot_hostname install ${*} -lh_chroot_sources install ${*} +if [ "${LIVE_CHROOT_BUILD}" = "enabled" ] +then + # Configuring chroot + lh_chroot_proc install ${*} + lh_chroot_sysfs install ${*} + lh_chroot_hosts install ${*} + lh_chroot_resolv install ${*} + lh_chroot_hostname install ${*} + lh_chroot_sources install ${*} +fi # Building root filesystem lh_binary_rootfs ${*} @@ -59,10 +62,13 @@ lh_binary_net ${*} lh_binary_tar ${*} lh_binary_usb-hdd ${*} -# Deconfiguring chroot -rm -f .stage/chroot_sources -lh_chroot_hostname remove ${*} -lh_chroot_resolv remove ${*} -lh_chroot_hosts remove ${*} -lh_chroot_sysfs remove ${*} -lh_chroot_proc remove ${*} +if [ "${LIVE_CHROOT_BUILD}" = "enabled" ] +then + # Deconfiguring chroot + rm -f .stage/chroot_sources + lh_chroot_hostname remove ${*} + lh_chroot_resolv remove ${*} + lh_chroot_hosts remove ${*} + lh_chroot_sysfs remove ${*} + lh_chroot_proc remove ${*} +fi diff --git a/helpers/lh_binary_chroot b/helpers/lh_binary_chroot index 55be65c08..6d13bad62 100755 --- a/helpers/lh_binary_chroot +++ b/helpers/lh_binary_chroot @@ -58,17 +58,17 @@ then ${LH_ROOT_COMMAND} umount chroot/sys fi +if [ "${LIVE_CHROOT_BUILD}" = "disabled" ] +then + exit 0 +fi + # Removing old chroot ${LH_ROOT_COMMAND} rm -rf chroot/chroot ${LH_ROOT_COMMAND} rm -rf chroot.tmp # Copying new chroot -#if [ "${LIVE_BINARY_INDICES}" = "enabled" ] -#then - ${LH_ROOT_COMMAND} cp -a chroot chroot.tmp -#else -# ${LH_ROOT_COMMAND} cp -al chroot chroot.tmp -#fi +${LH_ROOT_COMMAND} cp -a chroot chroot.tmp ${LH_ROOT_COMMAND} mv chroot.tmp chroot/chroot if [ -n "${LH_ROOT_COMMAND}" ] diff --git a/helpers/lh_binary_debian-installer b/helpers/lh_binary_debian-installer index 379a0063c..e4466dfb7 100755 --- a/helpers/lh_binary_debian-installer +++ b/helpers/lh_binary_debian-installer @@ -34,13 +34,7 @@ Set_defaults # Setting remote d-i directories case "${LIVE_DEBIAN_INSTALLER}" in - netboot) - DI="netboot/debian-installer/i386" - DI_GTK="netboot/gtk/debian-installer/i386" - DI_KERNEL="linux" - ;; - - cdrom|enabled) + enabled|cdrom|live) DI="cdrom" DI_GTK="${DI}/gtk" DI_KERNEL="vmlinuz" @@ -50,6 +44,12 @@ case "${LIVE_DEBIAN_INSTALLER}" in exit 0 ;; + netboot) + DI="netboot/debian-installer/i386" + DI_GTK="netboot/gtk/debian-installer/i386" + DI_KERNEL="linux" + ;; + *) Echo_error "debian-installer flavor ${LIVE_DEBIAN_INSTALLER} not supported." exit 1 @@ -296,22 +296,11 @@ mkdir -p binary/dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE} cd binary apt-ftparchive packages pool/main > dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages > dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages.gz -#apt-ftparchive sources pool/main > dists/${LIVE_DISTRIBUTION}/main/source/Sources -#gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/source/Sources > dists/${LIVE_DISTRIBUTION}/main/source/Sources cd "${OLDPWD}" # Fetching release wget "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/binary-"${LIVE_ARCHITECTURE}"/Release -O binary/dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Release -#cat > binary/dists/${LIVE_DISTRIBUTION}/main/source/Release << EOF -#Archive: stable -#Version: 4.0r0 -#Component: main -#Origin: Debian -#Label: Debian -#Architecture: source -#EOF - mkdir binary.udeb cd binary.udeb @@ -328,7 +317,7 @@ do if [ -f ../cache/packages_debian-installer.udeb/"`basename ${UDEB}`" ] then # Copying cached udebs - cp -l ../cache/packages_debian-installer.udeb/"`basename ${UDEB}`" ./ + cp ../cache/packages_debian-installer.udeb/"`basename ${UDEB}`" ./ else # Downloading udebs wget "${LIVE_MIRROR_BOOTSTRAP}"/${UDEB} @@ -338,7 +327,7 @@ done # Caching udebs rm -rf ../cache/packages_debian-installer.udeb mkdir -p ../cache/packages_debian-installer.udeb -cp -l *.udeb ../cache/packages_debian-installer.udeb +cp *.udeb ../cache/packages_debian-installer.udeb # Including local udebs if ls ../config/binary_local-udebs/* &> /dev/null @@ -375,7 +364,7 @@ fi # Excluding udebs grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/udeb_exclude > exclude -grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/exclude-udebs > exclude +grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/exclude-udebs >> exclude grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/exclude-udebs-${LIVE_ARCHITECTURE} >> exclude for EXCLUDE in `cat exclude` diff --git a/helpers/lh_binary_encryption b/helpers/lh_binary_encryption index 1a9265a41..06ad2c4cf 100755 --- a/helpers/lh_binary_encryption +++ b/helpers/lh_binary_encryption @@ -80,11 +80,16 @@ esac # Checking depends Check_package chroot/usr/bin/aespipe aespipe +# Restoring cache +Restore_cache cache/packages_binary + # Installing depends Install_package -# Moving image -mv binary/${INITFS}/filesystem.${LIVE_CHROOT_FILESYSTEM} chroot +case "${LIVE_CHROOT_BUILD}" in + enabled) + # Moving image + mv binary/${INITFS}/filesystem.${LIVE_CHROOT_FILESYSTEM} chroot echo "Encrypting binary/${INITFS}/filesystem.${ROOTFS} with ${LIVE_ENCRYPTION}..." @@ -105,11 +110,33 @@ do done EOF -Chroot "sh encrypt.sh" + Chroot "sh encrypt.sh" + + # Move image + mv chroot/filesystem.${LIVE_CHROOT_FILESYSTEM} binary/${INITFS} + rm -f chroot/encrypt.sh + ;; + + disabled) + while true + do + cat binary/${INITFS}/filesystem.${ROOTFS} | aespipe -e ${LIVE_ENCRYPTION} -T > binary/${INITFS}/filesystem.${ROOTFS}.tmp && mv binary/${INITFS}/filesystem.${ROOTFS}.tmp binary/${INITFS}/filesystem.${ROOTFS} && break + + echo -n "Something went wrong... Retry? [YES/no] " + + read ANSWER + + if [ "no" = "${ANSWER}" ] + then + unset ANSWER + break + fi + done + ;; +esac -# Move image -mv chroot/filesystem.${LIVE_CHROOT_FILESYSTEM} binary/${INITFS} -rm -f chroot/encrypt.sh +# Saving cache +Save_cache cache/packages_binary # Removing depends Remove_package diff --git a/helpers/lh_binary_grub b/helpers/lh_binary_grub index b196ad10e..1bcf4abac 100755 --- a/helpers/lh_binary_grub +++ b/helpers/lh_binary_grub @@ -60,6 +60,9 @@ Check_architecture amd64 i386 # Checking depends Check_package chroot/usr/sbin/grub grub +# Restoring cache +Restore_cache cache/packages_binary + # Installing depends Install_package @@ -185,8 +188,8 @@ DEFAULT_FLAVOUR="`echo ${LIVE_LINUX_FLAVOURS} | awk '{ print $1 }'`" DEFAULT_KERNEL="`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`" DEFAULT_INITRD="initrd.img-`echo ${DEFAULT_KERNEL} | sed -e 's/vmlinuz-//'`" -Grub_live_entry "live" "${DEFAULT_KERNEL}" "${DEFAULT_INITRD}" -Grub_live_entry "live (fail-safe mode)" "${DEFAULT_KERNEL}" "${DEFAULT_INITRD}" "${FAILSAFE}" +Grub_live_entry "live" "`basename ${DESTDIR_LIVE}`/${DEFAULT_KERNEL}" "`basename ${DESTDIR_LIVE}`/${DEFAULT_INITRD}" +Grub_live_entry "live (fail-safe mode)" "`basename ${DESTDIR_LIVE}`/${DEFAULT_KERNEL}" "`basename ${DESTDIR_LIVE}`/${DEFAULT_INITRD}" "${FAILSAFE}" for KERNEL in chroot/boot/vmlinuz-* do @@ -234,19 +237,26 @@ fi # Copying templates mkdir -p binary/boot/grub -cp -r "${LIVE_TEMPLATES}"/grub/* binary/boot/grub +cp -r "${TEMPLATES}"/* binary/boot/grub -# Copying grub case ${LIVE_BINARY_IMAGES} in iso) - cp chroot/usr/lib/grub/*/stage2_eltorito binary/boot/grub + FILES="chroot/usr/lib/grub/*/stage2_eltorito" ;; tar|usb-hdd) - cp chroot/usr/lib/grub/*/stage1 chroot/usr/lib/grub/*/e2fs_stage1_5 chroot/usr/lib/grub/*/stage2 binary/boot/grub + FILES="chroot/usr/lib/grub/*/stage1 chroot/usr/lib/grub/*/e2fs_stage1_5 chroot/usr/lib/grub/*/stage2" ;; esac +if [ "${LIVE_CHROOT_BUILD}" = "disabled" ] +then + FILES="`echo ${FILES} | sed -e 's/chroot//g'`" +fi + +# Copying grub +cp ${FILES} binary/boot/grub + # Copying local configuration file if [ -f config/binary_grub/menu.lst ] then @@ -283,6 +293,9 @@ sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/boot/grub/menu.lst sed -i -e 's/\ $//g' binary/boot/grub/menu.lst +# Saving cache +Save_cache cache/packages_binary + # Removing depends Remove_package diff --git a/helpers/lh_binary_includes b/helpers/lh_binary_includes index 14d1206e8..bac2de25f 100755 --- a/helpers/lh_binary_includes +++ b/helpers/lh_binary_includes @@ -160,13 +160,5 @@ then sed -i -e "s#DEBIAN_NAME#${DEBIAN_NAME}#g" -e "s/DEBIAN_DATE/${DEBIAN_DATE}/g" -e "s#DEBIAN_TOOLS#${DEBIAN_TOOLS_TXT}#g" binary/README.txt fi -# Cleaning up includes -if [ -e binary/parameters.txt.${LH_INITRAMFS} ] -then - mv binary/parameters.txt.${LH_INITRAMFS} binary/parameters.txt -fi - -rm -f binary/parameters.txt.* - # Creating stage file Create_stagefile .stage/binary_includes diff --git a/helpers/lh_binary_iso b/helpers/lh_binary_iso index f57b4e511..b39f31e2a 100755 --- a/helpers/lh_binary_iso +++ b/helpers/lh_binary_iso @@ -54,6 +54,9 @@ Create_lockfile .lock # Checking depends Check_package chroot/usr/bin/"${LH_GENISOIMAGE}" ${LH_GENISOIMAGE} +# Restoring cache +Restore_cache cache/packages_binary + # Installing depends Install_package @@ -88,9 +91,6 @@ then GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -V \"${LIVE_ISO_VOLUME}\"" fi -# Moving image -mv binary chroot - # Create image case "${LIVE_BOOTLOADER}" in grub) @@ -128,15 +128,34 @@ case "${LIVE_BOOTLOADER}" in ;; esac +case "${LIVE_CHROOT_BUILD}" in + enabled) + # Moving image + mv binary chroot + cat > chroot/binary.sh << EOF ${LH_GENISOIMAGE} ${GENISOIMAGE_OPTIONS} -o binary.iso -J -l -cache-inodes binary EOF -Chroot "sh binary.sh" + Chroot "sh binary.sh" + + # Move image + mv chroot/binary chroot/binary.iso ./ + rm -f chroot/binary.sh + ;; + + disabled) +cat > binary.sh << EOF +${LH_GENISOIMAGE} ${GENISOIMAGE_OPTIONS} -o binary.iso -J -l -cache-inodes binary +EOF + + sh binary.sh + rm -f binary.sh + ;; +esac -# Move image -mv chroot/binary chroot/binary.iso ./ -rm -f chroot/binary.sh +# Saving cache +Save_cache cache/packages_binary # Removing depends Remove_package diff --git a/helpers/lh_binary_linux-image b/helpers/lh_binary_linux-image index b4cee2eb6..077b4e319 100755 --- a/helpers/lh_binary_linux-image +++ b/helpers/lh_binary_linux-image @@ -98,5 +98,21 @@ mkdir -p "${DESTDIR}" cp chroot/boot/"${LINUX}"-* "${DESTDIR}" cp chroot/boot/initrd.img-* "${DESTDIR}" +# Including boot parameter documentation +if [ "${LIVE_BINARY_IMAGES}" != "net" ] +then + DESTDIR="binary" +fi + +case "${LH_INITRAMFS}" in + casper) + cp "${LH_BASE:-/usr/share/live-helper}"/data/casper/parameters.txt "${DESTDIR}"/parameters.txt + ;; + + live-initramfs) + cp chroot/usr/share/doc/live-initramfs/parameters.txt "${DESTDIR}"/parameters.txt + ;; +esac + # Creating stage file Create_stagefile .stage/binary_linux-image diff --git a/helpers/lh_binary_memtest b/helpers/lh_binary_memtest index 97fa8aba4..586e36251 100755 --- a/helpers/lh_binary_memtest +++ b/helpers/lh_binary_memtest @@ -57,6 +57,17 @@ then exit 0 fi +if [ "${LIVE_CHROOT_BUILD}" = "enabled" ] +then + + if [ -f chroot/usr/sbin/grub ] && [ ! -d chroot/boot/grub ] + then + GRUB="yes" + + mkdir -p chroot/boot/grub + fi +fi + # Checking depends case "${LIVE_MEMTEST}" in memtest86) @@ -68,6 +79,9 @@ case "${LIVE_MEMTEST}" in ;; esac +# Restoring cache +Restore_cache cache/packages_binary + # Installing depends Install_package @@ -114,18 +128,26 @@ Check_multiarchitecture mkdir -p "${DESTDIR}" # Installing memtest -case "${LIVE_MEMTEST}" in - memtest86) - cp -f chroot/boot/memtest86.bin "${DESTDIR}"/memtest +case "${LIVE_CHROOT_BUILD}" in + enabled) + cp chroot/boot/${LIVE_MEMTEST}.bin "${DESTDIR}"/memtest ;; - memtest86+) - cp -f chroot/boot/memtest86+.bin "${DESTDIR}"/memtest + disabled) + cp /boot/${LIVE_MEMTEST}.bin "${DESTDIR}"/memtest ;; esac +# Saving cache +Save_cache cache/packages_binary + # Removing depends Remove_package +if [ "${GRUB}" ] +then + rm -rf chroot/boot/grub +fi + # Creating stage file Create_stagefile .stage/binary_memtest diff --git a/helpers/lh_binary_rootfs b/helpers/lh_binary_rootfs index 148a5fe1e..e8f34c804 100755 --- a/helpers/lh_binary_rootfs +++ b/helpers/lh_binary_rootfs @@ -79,7 +79,7 @@ do # Restoring old cache mkdir -p binary/"${INITFS}" - ${LH_ROOT_COMMAND} cp -al cache/stages_rootfs/filesystem.* binary/"${INITFS}" + ${LH_ROOT_COMMAND} cp -a cache/stages_rootfs/filesystem.* binary/"${INITFS}" if [ -n "${LH_ROOT_COMMAND}" ] then @@ -97,6 +97,9 @@ case "${LIVE_CHROOT_FILESYSTEM}" in # Checking depends Check_package chroot/usr/bin/genext2fs genext2fs + # Restoring cache + Restore_cache cache/packages_binary + # Installing depends Install_package @@ -109,11 +112,22 @@ case "${LIVE_CHROOT_FILESYSTEM}" in DU_DIM="`du -ks chroot/chroot | cut -f1`" REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here... - Chroot "genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root=chroot filesystem.ext2" + case "${LIVE_CHROOT_BUILD}" in + enabled) + Chroot "genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root=chroot filesystem.ext2" + + # Move image + mv chroot/filesystem.ext2 binary/${INITFS} + rm -rf chroot/chroot + ;; - # Move image - mv chroot/filesystem.ext2 binary/${INITFS} - rm -rf chroot/chroot + disabled) + genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root=chroot binary/${INITFS}/filesystem.ext2 + ;; + esac + + # Saving cache + Save_cache cache/packages_binary # Removing depends Remove_package @@ -125,12 +139,23 @@ case "${LIVE_CHROOT_FILESYSTEM}" in rm -rf binary/${INITFS}/filesystem.dir fi - mv chroot/chroot binary/${INITFS}/filesystem.dir + case "${LIVE_CHROOT_BUILD}" in + enabled) + mv chroot/chroot binary/${INITFS}/filesystem.dir + ;; + + disabled) + cp -a chroot binary/${INITFS}/filesystem.dir + ;; + esac ;; squashfs) # Checking depends - Check_package chroot/usr/sbin/mksquashfs squashfs-tools + Check_package chroot/usr/share/doc/squashfs-tools squashfs-tools + + # Restoring cache + Restore_cache cache/packages_binary # Installing depends Install_package @@ -159,21 +184,32 @@ case "${LIVE_CHROOT_FILESYSTEM}" in if [ -f config/binary_rootfs/squashfs.sort ] then MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -sort squashfs.sort" - cp config/binary_rootfs/squashfs.sort chroot + cp config/binary_rootfs/squashfs.sort chroot #FIXME fi - # Create image - Chroot "mksquashfs chroot filesystem.squashfs ${MKSQUASHFS_OPTIONS}" + case "${LIVE_CHROOT_BUILD}" in + enabled) + # Create image + Chroot "mksquashfs chroot filesystem.squashfs ${MKSQUASHFS_OPTIONS}" + + # Move image + ${LH_ROOT_COMMAND} mv chroot/filesystem.squashfs binary/${INITFS} + ${LH_ROOT_COMMAND} rm -rf chroot/chroot chroot/squashfs.sort + ;; - # Move image - ${LH_ROOT_COMMAND} mv chroot/filesystem.squashfs binary/${INITFS} - ${LH_ROOT_COMMAND} rm -rf chroot/chroot chroot/squashfs.sort + disabled) + mksquashfs chroot binary/${INITFS}/filesystem.squashfs ${MKSQUASHFS_OPTIONS} + ;; + esac if [ -n "${LH_ROOT_COMMAND}" ] then ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` binary/${INITFS} fi + # Saving cache + Save_cache cache/packages_binary + # Removing depends Remove_package ;; @@ -187,7 +223,7 @@ do mkdir -p cache/stages_rootfs - ${LH_ROOT_COMMAND} cp -al binary/"${INITFS}"/filesystem.* cache/stages_rootfs + ${LH_ROOT_COMMAND} cp -a binary/"${INITFS}"/filesystem.* cache/stages_rootfs if [ -n "${LH_ROOT_COMMAND}" ] then diff --git a/helpers/lh_binary_syslinux b/helpers/lh_binary_syslinux index 8f8629f8b..88a154bfc 100755 --- a/helpers/lh_binary_syslinux +++ b/helpers/lh_binary_syslinux @@ -60,6 +60,9 @@ Check_architecture amd64 i386 # Checking depends Check_package chroot/usr/bin/syslinux syslinux +# Restoring cache +Restore_cache cache/packages_binary + # Installing depends Install_package @@ -320,8 +323,18 @@ case "${LIVE_BINARY_IMAGES}" in iso) # Copying syslinux mkdir -p binary/isolinux - cp chroot/usr/lib/syslinux/isolinux.bin binary/isolinux - cp -r "${LIVE_TEMPLATES}"/syslinux/* binary/isolinux + + case "${LIVE_CHROOT_BUILD}" in + enabled) + cp chroot/usr/lib/syslinux/isolinux.bin binary/isolinux + ;; + + disabled) + cp /usr/lib/syslinux/isolinux.bin binary/isolinux + ;; + esac + + cp -r "${TEMPLATES}"/* binary/isolinux mv binary/isolinux/syslinux.cfg binary/isolinux/isolinux.cfg # Copying local configuration file @@ -380,9 +393,20 @@ case "${LIVE_BINARY_IMAGES}" in net) # Copying syslinux - cp chroot/usr/lib/syslinux/pxelinux.0 tftpboot + mkdir -p tftpboot + + case "${LIVE_CHROOT_BUILD}" in + enabled) + cp chroot/usr/lib/syslinux/pxelinux.0 tftpboot + ;; + + disabled) + cp /usr/lib/syslinux/pxelinux.0 tftpboot + ;; + esac + mkdir -p tftpboot/pxelinux.cfg - cp -r "${LIVE_TEMPLATES}"/syslinux/* tftpboot/pxelinux.cfg + cp -r "${TEMPLATES}"/* tftpboot/pxelinux.cfg mv tftpboot/pxelinux.cfg/syslinux.cfg tftpboot/pxelinux.cfg/default # Copying local configuration file @@ -439,8 +463,18 @@ case "${LIVE_BINARY_IMAGES}" in # Copying syslinux mkdir -p "${DESTDIR}" - cp chroot/usr/lib/syslinux/isolinux.bin "${DESTDIR}"/syslinux.bin - cp -r "${LIVE_TEMPLATES}"/syslinux/* "${DESTDIR}" + + case "${LIVE_CHROOT_BUILD}" in + enabled) + cp chroot/usr/lib/syslinux/isolinux.bin "${DESTDIR}"/syslinux.bin + ;; + + disabled) + cp /usr/lib/syslinux/isolinux.bin "${DESTDIR}"/syslinux.bin + ;; + esac + + cp -r "${TEMPLATES}"/* "${DESTDIR}" # Copying local configuration file if [ -f config/binary_syslinux/syslinux.cfg ] @@ -472,7 +506,7 @@ case "${LIVE_BINARY_IMAGES}" in sed -i -e "s/LIVE_VERSION/${VERSION}/" "${DESTDIR}"/f10.txt # Workaround for syslinux (<< 3.36) which doesn't support long file/path names - if [ "${LIVE_DISTRIBUTION}" = "etch" ] && [ "`echo ${LIVE_LINUX_FLAVOURS} | wc -w`" -gt "1" ] + if [ "`echo ${LIVE_LINUX_FLAVOURS} | wc -w`" -gt "1" ] then NUMBER="0" @@ -494,6 +528,9 @@ case "${LIVE_BINARY_IMAGES}" in ;; esac +# Saving cache +Save_cache cache/packages_binary + # Removing depends Remove_package diff --git a/helpers/lh_binary_usb-hdd b/helpers/lh_binary_usb-hdd index 71353dae0..7a5055be2 100755 --- a/helpers/lh_binary_usb-hdd +++ b/helpers/lh_binary_usb-hdd @@ -67,6 +67,9 @@ case "${LIVE_BOOTLOADER}" in ;; esac +# Restoring cache +Restore_cache cache/packages_binary + # Installing depends Install_package @@ -161,6 +164,9 @@ fi mv chroot/binary.img ./ +# Saving cache +Save_cache cache/packages_binary + # Removing depends Remove_package diff --git a/helpers/lh_binary_yaboot b/helpers/lh_binary_yaboot index 00bc15f2d..c915e1d63 100755 --- a/helpers/lh_binary_yaboot +++ b/helpers/lh_binary_yaboot @@ -60,6 +60,9 @@ Check_architecture powerpc ppc64 # Checking depends Check_package chroot/usr/lib/yaboot/yaboot yaboot +# Restoring cache +Restore_cache cache/packages_binary + # Installing depends Install_package @@ -239,8 +242,18 @@ case "${LIVE_BINARY_IMAGES}" in iso|usb-hdd) # Copying yaboot mkdir -p binary/yaboot - cp chroot/usr/lib/yaboot/yaboot binary/yaboot - cp -r "${LIVE_TEMPLATES}"/yaboot/* binary/yaboot + + case "${LIVE_CHROOT_BUILD}" in + enabled) + cp chroot/usr/lib/yaboot/yaboot binary/yaboot + ;; + + disabled) + cp /usr/lib/yaboot/yaboot binary/yaboot + ;; + esac + + cp -r "${TEMPLATES}"/* binary/yaboot if [ "${LIVE_BINARY_IMAGES}" = "usb-hdd" ] then @@ -257,6 +270,9 @@ case "${LIVE_BINARY_IMAGES}" in ;; esac +# Saving cache +Save_cache cache/packages_binary + # Removing depends Remove_package diff --git a/helpers/lh_bootstrap_cache b/helpers/lh_bootstrap_cache index a3d05f38a..03ae9040a 100755 --- a/helpers/lh_bootstrap_cache +++ b/helpers/lh_bootstrap_cache @@ -53,7 +53,7 @@ do rm -rf chroot # Restoring old cache - ${LH_ROOT_COMMAND} cp -al cache/stages_bootstrap chroot + ${LH_ROOT_COMMAND} cp -a cache/stages_bootstrap chroot if [ -n "${LH_ROOT_COMMAND}" ] then @@ -83,7 +83,7 @@ do mkdir -p cache - ${LH_ROOT_COMMAND} cp -al chroot cache/stages_bootstrap + ${LH_ROOT_COMMAND} cp -a chroot cache/stages_bootstrap if [ -n "${LH_ROOT_COMMAND}" ] then diff --git a/helpers/lh_chroot_cache b/helpers/lh_chroot_cache index 0e655be3c..2f016a6f7 100755 --- a/helpers/lh_chroot_cache +++ b/helpers/lh_chroot_cache @@ -53,7 +53,7 @@ do rm -rf chroot # Restoring old cache - ${LH_ROOT_COMMAND} cp -al cache/stages_chroot chroot + ${LH_ROOT_COMMAND} cp -a cache/stages_chroot chroot if [ -n "${LH_ROOT_COMMAND}" ] then @@ -83,7 +83,7 @@ do mkdir -p cache - ${LH_ROOT_COMMAND} cp -al chroot cache/stages_chroot + ${LH_ROOT_COMMAND} cp -a chroot cache/stages_chroot if [ -n "${LH_ROOT_COMMAND}" ] then diff --git a/helpers/lh_clean b/helpers/lh_clean index d8439071d..c4174154c 100755 --- a/helpers/lh_clean +++ b/helpers/lh_clean @@ -65,7 +65,7 @@ case "${1}" in if [ "${PURGE}" != "true" ] && [ -d cache/stages_bootstrap ] then - ${LH_ROOT_COMMAND} cp -al cache/stages_bootstrap chroot + ${LH_ROOT_COMMAND} cp -a cache/stages_bootstrap chroot mkdir -p .stage touch .stage/bootstrap fi @@ -79,6 +79,7 @@ case "${1}" in rm -f binary.iso rm -f binary.img rm -f binary*.tar.gz + rm -f binary.sh rm -rf binary rm -rf tftpboot diff --git a/helpers/lh_config b/helpers/lh_config index c9dc615cc..d1015710d 100755 --- a/helpers/lh_config +++ b/helpers/lh_config @@ -321,6 +321,11 @@ LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND}" # (Default: ${LIVE_BOOTLOADER}) LIVE_BOOTLOADER="${LIVE_BOOTLOADER}" +# \${LIVE_CHROOT_BUILD: control if we build binary images chrooted +# (Default: ${LIVE_CHROOT_BUILD}) +# DO NEVER, *NEVER*, *N*E*V*E*R* SET THIS OPTION to disabled. +LIVE_CHROOT_BUILD="${LIVE_CHROOT_BUILD}" + # \$LIVE_DEBIAN_INSTALLER: set debian-installer # (Default: ${LIVE_DEBIAN_INSTALLER}) LIVE_DEBIAN_INSTALLER="${LIVE_DEBIAN_INSTALLER}" diff --git a/helpers/lh_source_debian-live b/helpers/lh_source_debian-live index c51364da6..970e0fd7b 100755 --- a/helpers/lh_source_debian-live +++ b/helpers/lh_source_debian-live @@ -59,7 +59,7 @@ fi # Copy system configuration mkdir -p source/debian-live -cp -al config source/debian-live +cp -a config source/debian-live # Create tarball cd source |