diff options
Diffstat (limited to 'helpers')
28 files changed, 364 insertions, 538 deletions
diff --git a/helpers/lh_binary_chroot b/helpers/lh_binary_chroot index 24ee5f8..58835ad 100755 --- a/helpers/lh_binary_chroot +++ b/helpers/lh_binary_chroot @@ -45,25 +45,30 @@ Check_lockfile .lock # Creating lock file Create_lockfile .lock -# Normally, proc is not mounted here, but people tend to be lazy +# Normally, virtual filesystems are not mounted here, but people tend to be lazy if [ -f chroot/proc/version ] then - umount chroot/proc + ${LH_ROOT_COMMAND} umount chroot/proc fi if [ -d chroot/sys/kernel ] then - umount chroot/sys + ${LH_ROOT_COMMAND} umount chroot/sys fi # Removing old chroot -rm -rf chroot/chroot -rm -rf chroot.tmp +${LH_ROOT_COMMAND} rm -rf chroot/chroot +${LH_ROOT_COMMAND} rm -rf chroot.tmp # Copying new chroot Echo_message "Copying chroot, this can take a while." -cp -a chroot chroot.tmp -mv chroot.tmp chroot/chroot +${LH_ROOT_COMMAND} cp -a chroot chroot.tmp +${LH_ROOT_COMMAND} mv chroot.tmp chroot/chroot + +if [ -n "${LH_ROOT_COMMAND}" ] +then + ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` chroot +fi # Creating stage file Create_stagefile .stage/binary_chroot diff --git a/helpers/lh_binary_encryption b/helpers/lh_binary_encryption index c10ba9a..d660b52 100755 --- a/helpers/lh_binary_encryption +++ b/helpers/lh_binary_encryption @@ -66,24 +66,11 @@ case "${LIVE_FILESYSTEM}" in ;; esac -if [ ! -f chroot/usr/bin/aespipe ] -then - PACKAGES="${PACKAGES} aespipe" -fi +# Checking depends +Check_package chroot/usr/bin/aespipe aespipe -if [ -n "${PACKAGES}" ] -then - # Installing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude install --assume-yes ${PACKAGES}" - ;; - esac -fi +# Installing depends +Install_package # Moving image mv binary/casper/filesystem.${LIVE_FILESYSTEM} chroot @@ -113,18 +100,8 @@ Chroot "sh encrypt" mv chroot/filesystem.${LIVE_FILESYSTEM} binary/casper rm -f chroot/encrypt -# Removing packages -if [ -n "${PACKAGES}" ] -then - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes ${PACKAGES}" - ;; - aptitude) - Chroot "aptitude purge --assume-yes ${PACKAGES}" - ;; - esac -fi +# Removing depends +Remove_package # Creating stage file Create_stagefile .stage/binary_encryption diff --git a/helpers/lh_binary_grub b/helpers/lh_binary_grub index 3b652af..894815e 100755 --- a/helpers/lh_binary_grub +++ b/helpers/lh_binary_grub @@ -68,24 +68,11 @@ then fi fi -if [ ! -f chroot/usr/sbin/grub ] -then - PACKAGES="${PACKAGES} grub" -fi - -if [ -n "${PACKAGES}" ] -then - # Installing symlinks - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; +# Checking depends +Check_package chroot/usr/sbin/grub grub - aptitude) - Chroot "aptitude install --assume-yes ${PACKAGES}" - ;; - esac -fi +# Installing depends +Install_package # Setting destination directory case "${LIVE_BINARY_IMAGE}" in @@ -176,15 +163,20 @@ cp -r "${LIVE_TEMPLATES}"/grub/* binary/boot/grub # Copyring grub case ${LIVE_BINARY_IMAGE} in iso) - cp chroot/usr/lib/grub/i386-pc/stage2_eltorito binary/boot/grub + cp chroot/usr/lib/grub/*/stage2_eltorito binary/boot/grub ;; usb|hdd) - cp chroot/usr/lib/grub/i386-pc/stage1 chroot/usr/lib/grub/i386-pc/stage2 binary/boot/grub + cp chroot/usr/lib/grub/*/stage1 chroot/usr/lib/grub/*/stage2 binary/boot/grub ;; esac # Copying splash screen +if [ -f config/binary_grub/splash.xpm.gz ] +then + LIVE_GRUB_SPLASH="config/binary_grub/splash.xpm.gz" +fi + if [ -n "${LIVE_GRUB_SPLASH}" ] then if [ "${LIVE_GRUB_SPLASH}" = "none" ] @@ -213,19 +205,8 @@ EOF sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/boot/grub/menu.lst sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/boot/grub/menu.lst -if [ -n "${PACKAGES}" ] -then - # Removing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude purge --assume-yes ${PACKAGES}" - ;; -esac -fi +# Removing depends +Remove_package # Creating stage file Create_stagefile .stage/binary_grub diff --git a/helpers/lh_binary_iso b/helpers/lh_binary_iso index 63156aa..b22b3b4 100755 --- a/helpers/lh_binary_iso +++ b/helpers/lh_binary_iso @@ -49,24 +49,11 @@ do # Creating lock file Create_lockfile .lock - if [ ! -f chroot/usr/bin/"${LH_GENISOIMAGE}" ] - then - PACKAGES="${PACKAGES} ${LH_GENISOIMAGE}" - fi + # Checking depends + Check_package chroot/usr/bin/"${LH_GENISOIMAGE}" ${LH_GENISOIMAGE} - if [ -n "${PACKAGES}" ] - then - # Installing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude install --assume-yes ${PACKAGES}" - ;; - esac - fi + # Installing depends + Install_package # Remove old iso image if [ -f binary.iso ] @@ -74,6 +61,11 @@ do rm -f binary.iso fi + if [ "${LH_VERBOSE}" = "enabled" ] + then + GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -i" + fi + # Moving image mv binary chroot @@ -82,37 +74,26 @@ do then case "${LIVE_BOOTLOADER}" in grub) - Chroot "${LH_GENISOIMAGE} -o binary.iso -r -J -l -b boot/grub/stage2_eltorito -m boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table binary" + Chroot "${LH_GENISOIMAGE} ${GENISOIMAGE_OPTIONS} -o binary.iso -r -J -l -b boot/grub/stage2_eltorito -m boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table binary" ;; syslinux) #Chroot "${LH_GENISOIMAGE} -A \"Debian Live\" -p \"Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org\" -publisher \"Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org\" -o binary.iso -r -J -l -V \"${LIVE_ISO_VOLUME}\" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table binary" - Chroot "${LH_GENISOIMAGE} -o binary.iso -r -J -l -b isolinux/isolinux.bin -m isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table binary" + Chroot "${LH_GENISOIMAGE} ${GENISOIMAGE_OPTIONS} -o binary.iso -r -J -l -b isolinux/isolinux.bin -m isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table binary" ;; esac else Echo_warning "Bootloader on your architecture not yet supported (Continuing in 5 seconds)." sleep 5 #Chroot "${LH_GENISOIMAGE} -A 'Debian Live' -p 'Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org' -publisher 'Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org' -o binary.iso -r -J -l -V \"${LIVE_ISO_VOLUME}\" binary" - Chroot "${LH_GENISOIMAGE} -o binary.iso -r -J -l binary" + Chroot "${LH_GENISOIMAGE} ${GENISOIMAGE} -o binary.iso -r -J -l binary" fi # Move image mv chroot/binary chroot/binary.iso ./ - # Removing packages - if [ -n "${PACKAGES}" ] - then - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude purge --assume-yes ${PACKAGES}" - ;; - esac - fi + # Removing depends + Remove_package # Creating stage file Create_stagefile .stage/binary_iso diff --git a/helpers/lh_binary_memtest b/helpers/lh_binary_memtest index 48c8001..ea07422 100755 --- a/helpers/lh_binary_memtest +++ b/helpers/lh_binary_memtest @@ -56,35 +56,19 @@ then exit 0 fi +# Checking depends case "${LIVE_MEMTEST}" in memtest86) - if [ ! -f chroot/boot/memtest86.bin ] - then - PACKAGES="${PACKAGES} memtest86" - fi + Check_package chroot/boot/memtest86.bin memtest86 ;; memtest86+) - if [ ! -f chroot/boot/memtest86+.bin ] - then - PACKAGES="${PACKAGES} memtest86+" - fi + Check_package chroot/boot/memtest86+.bin memtest86+ ;; esac -if [ -n "${PACKAGES}" ] -then - # Installing symlinks - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude install --assume-yes ${PACKAGES}" - ;; - esac -fi +# Installing depends +Install_package # Setting destination directory case "${LIVE_BINARY_IMAGE}" in @@ -132,19 +116,8 @@ case "${LIVE_MEMTEST}" in ;; esac -if [ -n "${PACKAGES}" ] -then - # Removing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude purge --assume-yes ${PACKAGES}" - ;; - esac -fi +# Removing depends +Remove_package # Creating stage file Create_stagefile .stage/binary_memtest diff --git a/helpers/lh_binary_rootfs b/helpers/lh_binary_rootfs index daacaea..12ac0bb 100755 --- a/helpers/lh_binary_rootfs +++ b/helpers/lh_binary_rootfs @@ -54,24 +54,11 @@ fi case "${LIVE_FILESYSTEM}" in ext2) - if [ ! -f chroot/usr/bin/genext2fs ] - then - PACKAGES="${PACKAGES} genext2fs" - fi + # Checking depends + Check_package chroot/usr/bin/genext2fs genext2fs - if [ -n "${PACKAGES}" ] - then - # Installing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude install --assume-yes ${PACKAGES}" - ;; - esac - fi + # Installing depends + Install_package # Remove old ext2 image if [ -f binary/casper/filesystem.ext2 ] @@ -88,19 +75,8 @@ case "${LIVE_FILESYSTEM}" in mv chroot/filesystem.ext2 binary/casper rm -rf chroot/chroot - # Removing packages - if [ -n "${PACKAGES}" ] - then - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude purge --assume-yes ${PACKAGES}" - ;; - esac - fi + # Removing depends + Remove_package ;; plain) @@ -113,56 +89,47 @@ case "${LIVE_FILESYSTEM}" in ;; squashfs) - if [ ! -f chroot/usr/sbin/mksquashfs ] + # Checking depends + Check_package chroot/usr/sbin/mksquashfs squashfs-tools + + # Installing depends + Install_package + + # Remove old squashfs image + if [ -f binary/casper/filesystem.squashfs ] then - PACKAGES="${PACKAGES} squashfs-tools" + rm -f binary/casper/filesystem.squashfs fi - if [ -n "${PACKAGES}" ] + if [ "${LH_QUIET}" = "enabled" ] then - # Installing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude install --assume-yes ${PACKAGES}" - ;; - esac + MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -no-progress" fi - # Remove old squashfs image - if [ -f binary/casper/filesystem.squashfs ] + if [ "${LH_VERBOSE}" = "enabled" ] then - rm -f binary/casper/filesystem.squashfs + MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -i" fi # Create image if [ "${LIVE_PACKAGES_LISTS}" != "minimal" ] && [ "${LIVE_PACKAGES_LISTS}" != "mini" ] then - Chroot "mksquashfs chroot filesystem.squashfs" + Chroot "mksquashfs ${MKSQUASHFS_OPTIONS} chroot filesystem.squashfs" else - Chroot "mksquashfs chroot filesystem.squashfs -e chroot/boot/vmlinuz* chroot/boot/initrd.img* chroot/vmlinuz* chroot/initrd.img* chroot/boot/config-* chroot/boot/System.map-*" + Chroot "mksquashfs ${MKSQUASHFS_OPTIONS} chroot filesystem.squashfs -e chroot/boot/vmlinuz* chroot/boot/initrd.img* chroot/vmlinuz* chroot/initrd.img* chroot/boot/config-* chroot/boot/System.map-*" fi # Move image - mv chroot/filesystem.squashfs binary/casper - rm -rf chroot/chroot + ${LH_ROOT_COMMAND} mv chroot/filesystem.squashfs binary/casper + ${LH_ROOT_COMMAND} rm -rf chroot/chroot - # Removing packages - if [ -n "${PACKAGES}" ] + if [ -n "${LH_ROOT_COMMAND}" ] then - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude purge --assume-yes ${PACKAGES}" - ;; - esac + ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` binary/casper fi + + # Removing depends + Remove_package ;; esac diff --git a/helpers/lh_binary_syslinux b/helpers/lh_binary_syslinux index dff16f4..6864f32 100755 --- a/helpers/lh_binary_syslinux +++ b/helpers/lh_binary_syslinux @@ -56,7 +56,7 @@ then exit 0 fi -# Check templates +# Checking templates if [ ! -d "${LIVE_TEMPLATES}" ] then if [ -d ../"${LIVE_TEMPLATES}" ] @@ -68,24 +68,11 @@ then fi fi -if [ ! -f chroot/usr/bin/syslinux ] -then - PACKAGES="${PACKAGES} syslinux" -fi +# Checking depends +Check_package chroot/usr/bin/syslinux syslinux -if [ -n "${PACKAGES}" ] -then - # Installing symlinks - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude install --assume-yes ${PACKAGES}" - ;; - esac -fi +# Installing depends +Install_package # Setting destination directory case "${LIVE_BINARY_IMAGE}" in @@ -147,12 +134,12 @@ FAILSAFE="noapic noapm nodma nomce nolapic nosmp vga=normal" if [ "${LIVE_BINARY_IMAGE}" = "iso" ] then DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`" - LINUX="label LIVE\n kernel /`basename ${DESTDIR}`/`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" - LINUX="${LINUX}\nlabel LIVE-failsafe\n kernel /`basename ${DESTDIR}`/`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}" + LINUX="label live\n kernel /`basename ${DESTDIR}`/`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" + LINUX="${LINUX}\n\nlabel live-failsafe\n kernel /`basename ${DESTDIR}`/`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}" else DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`" - LINUX="label LIVE\n kernel `basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" - LINUX="${LINUX}\nlabel LIVE-failsafe\n kernel `basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}" + LINUX="label live\n kernel `basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" + LINUX="${LINUX}\n\nlabel live-failsafe\n kernel `basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}" fi if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ] @@ -163,25 +150,26 @@ then then if [ "${LIVE_BINARY_IMAGE}" = "iso" ] then - LINUX="label LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" - LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`-failsafe\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}" - else - LINUX="label LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" - LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}" + LINUX="label live-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" + LINUX="${LINUX}\n\nlabel live-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`-failsafe\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}" + else + LINUX="label live-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper live_BOOTAPPEND" + LINUX="${LINUX}\n\nlabel live-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}" fi else if [ "${LIVE_BINARY_IMAGE}" = "iso" ] then - LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" - LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`-failsafe\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}" + LINUX="${LINUX}\n\nlabel live-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" + LINUX="${LINUX}\n\nlabel live-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`-failsafe\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}" else - LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" - LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}" + LINUX="${LINUX}\n\nlabel live-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" + LINUX="${LINUX}\n\nlabel live-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}" fi fi done fi +# Removing '//' LINUX="`echo ${LINUX} | sed -e 's#//#/#g'`" # Assembling memtest configuration @@ -204,6 +192,11 @@ case "${LIVE_BINARY_IMAGE}" in cp -r "${LIVE_TEMPLATES}"/syslinux/* binary/isolinux # Copying splash screen + if [ -f config/binary_syslinux/splash.rle ] + then + LIVE_SYSLINUX_SPLASH="config/binary_syslinux/splash.rle" + fi + if [ -n "${LIVE_SYSLINUX_SPLASH}" ] then if [ "${LIVE_SYSLINUX_SPLASH}" = "none" ] @@ -233,12 +226,12 @@ case "${LIVE_BINARY_IMAGE}" in mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER} mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img - sed -i -e "s/LIVE.*-${FLAVOUR}/live${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" -e "s/LIVE/live/" binary/isolinux/isolinux.cfg + sed -i -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" binary/isolinux/isolinux.cfg done else mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img - sed -i -e "s/LIVE.*-${LIVE_KERNEL_FLAVOUR}/live/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" -e "s/LIVE/live/" binary/isolinux/isolinux.cfg + sed -i -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" binary/isolinux/isolinux.cfg fi ;; @@ -253,6 +246,11 @@ case "${LIVE_BINARY_IMAGE}" in sed -i -e 's#splash.rle#pxelinux.cfg/splash.rle#' tftpboot/pxelinux.cfg/isolinux.txt # Copying splash screen + if [ -f config/binary_syslinux/splash.rle ] + then + LIVE_SYSLINUX_SPLASH="config/binary_syslinux/splash.rle" + fi + if [ -n "${LIVE_SYSLINUX_SPLASH}" ] then if [ "${LIVE_SYSLINUX_SPLASH}" = "none" ] @@ -282,12 +280,12 @@ case "${LIVE_BINARY_IMAGE}" in mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER} mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img - sed -i -e "s/LIVE.*-${FLAVOUR}/live${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" -e "s/LIVE/live/" tftpboot/pxelive.cfg/default + sed -i -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" binary/isolinux/isolinux.cfg done else mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img - sed -i -e "s/LIVE.*-${LIVE_KERNEL_FLAVOUR}/live/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" -e "s/LIVE/live/" tftpboot/pxelinux.cfg/default + sed -i -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" binary/isolinux/isolinux.cfg fi ;; @@ -301,6 +299,11 @@ case "${LIVE_BINARY_IMAGE}" in sed -i -e "s/isolinux.txt/syslinux.txt/" binary/syslinux.cfg # Copying splash screen + if [ -f config/binary_syslinux/splash.rle ] + then + LIVE_SYSLINUX_SPLASH="config/binary_syslinux/splash.rle" + fi + if [ -n "${LIVE_SYSLINUX_SPLASH}" ] then if [ "${LIVE_SYSLINUX_SPLASH}" = "none" ] @@ -330,29 +333,18 @@ case "${LIVE_BINARY_IMAGE}" in mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER} mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img - sed -i -e "s/LIVE.*-${FLAVOUR}/live${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" -e "s/LIVE/live/" binary/syslinux.cfg + sed -i -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" binary/syslinux.cfg done else mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img - sed -i -e "s/LIVE.*-${LIVE_KERNEL_FLAVOUR}/live/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" -e "s/LIVE/live/" binary/syslinux.cfg + sed -i -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" binary/syslinux.cfg fi ;; esac -if [ -n "${PACKAGES}" ] -then - # Removing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude purge --assume-yes ${PACKAGES}" - ;; - esac -fi +# Removing depends +Remove_package # Creating stage file Create_stagefile .stage/binary_syslinux diff --git a/helpers/lh_binary_usb b/helpers/lh_binary_usb index 291f877..e0c0193 100755 --- a/helpers/lh_binary_usb +++ b/helpers/lh_binary_usb @@ -50,50 +50,23 @@ do # Creating lock file Create_lockfile .lock - if [ ! -f chroot/sbin/mkdosfs ] - then - PACKAGES="${PACKAGES} dosfstools" - fi - - if [ ! -f chroot/usr/bin/mtools ] - then - PACKAGES="${PACKAGES} mtools" - fi - - if [ ! -f chroot/sbin/parted ] - then - PACKAGES="${PACKAGES} parted" - fi + # Checking depends + Check_package chroot/sbin/mkdosfs dosfstools + Check_package chroot/usr/sbin/mtools mtools + Check_package chroot/sbin/parted parted case "${LIVE_BOOTLOADER}" in grub) - if [ ! -f chroot/usr/sbin/grub ] - then - PACKAGES="${PACKAGES} grub" - fi + Check_package chroot/usr/sbin/grub grub ;; syslinux) - if [ ! -f chroot/usr/bin/syslinux ] - then - PACKAGES="${PACKAGES} syslinux" - fi + Check_package chroot/usr/bin/syslinux syslinux ;; esac - if [ -n "${PACKAGES}" ] - then - # Installing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude install --assume-yes ${PACKAGES}" - ;; - esac - fi + # Installing depends + Install_package # Remove old binary if [ -f binary.img ] @@ -145,9 +118,9 @@ do lh_losetup $FREELO binary.img 1 Chroot "mkfs.msdos -n DEBIAN_LIVE ${FREELO}" mkdir -p binary.tmp - mount ${FREELO} binary.tmp + ${LH_ROOT_COMMAND} mount ${FREELO} binary.tmp cp -r binary/* binary.tmp - umount binary.tmp + ${LH_ROOT_COMMAND} umount binary.tmp rmdir binary.tmp if [ "${LIVE_BOOTLOADER}" = "syslinux" ] @@ -175,19 +148,8 @@ do mv chroot/dev.tmp chroot/dev fi - if [ -n "${PACKAGES}" ] - then - # Removing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude purge --assume-yes ${PACKAGES}" - ;; - esac - fi + # Removing depends + Remove_package # Creating stage file Create_stagefile .stage/binary_usb diff --git a/helpers/lh_binary_yaboot b/helpers/lh_binary_yaboot index f891927..e4a1b65 100755 --- a/helpers/lh_binary_yaboot +++ b/helpers/lh_binary_yaboot @@ -68,24 +68,11 @@ then fi fi -if [ ! -f chroot/usr/lib/yaboot/yaboot ] -then - PACKAGES="${PACKAGES} yaboot" -fi +# Checking depends +Check_package chroot/usr/lib/yaboot/yaboot yaboot -if [ -n "${PACKAGES}" ] -then - # Installing symlinks - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude install --assume-yes ${PACKAGES}" - ;; - esac -fi +# Installing depends +Install_package # Setting destination directory case "${LIVE_BINARY_IMAGE}" in @@ -199,19 +186,8 @@ case "${LIVE_BINARY_IMAGE}" in ;; esac -if [ -n "${PACKAGES}" ] -then - # Removing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude purge --assume-yes ${PACKAGES}" - ;; - esac -fi +# Removing depends +Remove_package # Creating stage file Create_stagefile .stage/binary_yaboot diff --git a/helpers/lh_bootstrap_cdebootstrap b/helpers/lh_bootstrap_cdebootstrap index 5453d02..7aa2ea4 100755 --- a/helpers/lh_bootstrap_cdebootstrap +++ b/helpers/lh_bootstrap_cdebootstrap @@ -96,7 +96,12 @@ then # Restore old cache if [ -d cache/chroot_bootstrap ] then - cp -a cache/chroot_bootstrap/* chroot + ${LH_ROOT_COMMAND} cp -a cache/chroot_bootstrap/* chroot + + if [ -n "${LH_ROOT_COMMAND}" ] + then + ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` chroot + fi # Creating stage file Create_stagefile .stage/bootstrap @@ -111,7 +116,12 @@ then fi # Executing cdebootstrap (download-only) - cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BUILD}" + ${LH_ROOT_COMMAND} cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BUILD}" + + if [ -n "${LH_ROOT_COMMAND}" ] + then + ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` chroot + fi # Removing old cache if [ -d cache/bootstrap ] @@ -129,7 +139,12 @@ then fi # Executing cdebootstrap (regular run) - cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BUILD}" + ${LH_ROOT_COMMAND} cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BUILD}" + + if [ -n "${LH_ROOT_COMMAND}" ] + then + ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` chroot + fi # Remove cdebootstrap-helper-diverts (needed at least for minimal flavours) if [ "${LIVE_BOOTSTRAP_FLAVOUR}" = "minimal" ] || [ "${LIVE_BOOTSTRAP_FLAVOUR}" = "mini" ] @@ -156,7 +171,12 @@ then rm -rf cache/chroot_bootstrap fi - cp -a chroot cache/chroot_bootstrap + ${LH_ROOT_COMMAND} cp -a chroot cache/chroot_bootstrap + + if [ -n "${LH_ROOT_COMMAND}" ] + then + ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` cache/chroot_bootstrap + fi fi # Creating stage file diff --git a/helpers/lh_bootstrap_debootstrap b/helpers/lh_bootstrap_debootstrap index d7b807f..43fdd96 100755 --- a/helpers/lh_bootstrap_debootstrap +++ b/helpers/lh_bootstrap_debootstrap @@ -79,7 +79,12 @@ then # Restore old cache if [ -d cache/chroot_bootstrap ] then - cp -a cache/chroot_bootstrap/* chroot + ${LH_ROOT_COMMAND} cp -a cache/chroot_bootstrap/* chroot + + if [ -n "${LH_ROOT_COMMAND}" ] + then + ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` chroot + fi # Creating stage file Create_stagefile .stage/bootstrap @@ -94,7 +99,12 @@ then fi # Executing debootstrap (download-only) - debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BUILD}" "${LIVE_DEBOOTSTRAP_SCRIPT}" + ${LH_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BUILD}" "${LIVE_DEBOOTSTRAP_SCRIPT}" + + if [ -n "${LH_ROOT_COMMAND}" ] + then + ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` chroot + fi # Removing old cache if [ -d cache/bootstrap ] @@ -112,7 +122,12 @@ then fi # Executing debootstrap (regular run) - debootstrap ${DEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BUILD}" "${LIVE_DEBOOTSTRAP_SCRIPT}" + ${LH_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BUILD}" "${LIVE_DEBOOTSTRAP_SCRIPT}" + + if [ -n "${LH_ROOT_COMMAND}" ] + then + ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` chroot + fi # Removing bootstrap cache rm -rf chroot/var/cache/apt/archives/*.deb @@ -125,7 +140,12 @@ then rm -rf cache/chroot_bootstrap fi - cp -a chroot cache/chroot_bootstrap + ${LH_ROOT_COMMAND} cp -a chroot cache/chroot_bootstrap + + if [ -n "${LH_ROOT_COMMAND}" ] + then + ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` cache/chroot_bootstrap + fi fi # Creating stage file diff --git a/helpers/lh_chroot b/helpers/lh_chroot index 670c410..ab2dd8e 100755 --- a/helpers/lh_chroot +++ b/helpers/lh_chroot @@ -51,12 +51,12 @@ lh_chroot_packages "${@}" lh_chroot_localpackages "${@}" lh_chroot_localpackageslists "${@}" lh_chroot_localization "${@}" -lh_chroot_hacks "${@}" lh_chroot_localincludes "${@}" lh_chroot_sysvinit "${@}" lh_chroot_hooks "${@}" lh_chroot_localhooks "${@}" lh_chroot_symlinks "${@}" +lh_chroot_hacks "${@}" lh_chroot_interactive "${@}" # Deconfiguring chroot diff --git a/helpers/lh_chroot_hacks b/helpers/lh_chroot_hacks index bc6b0d4..ec367fb 100755 --- a/helpers/lh_chroot_hacks +++ b/helpers/lh_chroot_hacks @@ -46,7 +46,7 @@ Check_lockfile .lock Create_lockfile .lock # Removing udev mac caching rule -rm -f chroot/etc/udev/rules.d/z25_persistent-net.rules +Chroot "rm -f /etc/udev/rules.d/z25_persistent-net.rules" case "${LIVE_BINARY_IMAGE}" in net) @@ -82,5 +82,10 @@ esac # Update initramfs Chroot "update-initramfs -k all -t -u" +if [ -n "${LH_ROOT_COMMAND}" ] +then + ${LH_ROOT_COMMAND} chown -R --quiet `whoami`:`whoami` chroot +fi + # Creating stage file Create_stagefile .stage/chroot_hacks diff --git a/helpers/lh_chroot_hooks b/helpers/lh_chroot_hooks index d2fac35..7963193 100755 --- a/helpers/lh_chroot_hooks +++ b/helpers/lh_chroot_hooks @@ -46,26 +46,29 @@ Check_lockfile .lock Create_lockfile .lock # Processing hooks -if [ -n "${LIVE_PACKAGES_LISTS}" ] && [ -f /usr/share/live-helper/hooks/"${LIVE_PACKAGES_LISTS}" ] -then - # Copying hook - cp /usr/share/live-helper/hooks/"${LIVE_PACKAGES_LISTS}" chroot/root - - # Making hook executable - if [ ! -x chroot/root/${LIVE_PACKAGES_LISTS} ] +for HOOK in ${LIVE_PACKAGES_LISTS} ${LIVE_TASKS} +do + if [ -f /usr/share/live-helper/hooks/"${HOOK}" ] then - chmod +x chroot/root/${LIVE_PACKAGES_LISTS} - fi + # Copying hook + cp /usr/share/live-helper/hooks/"${HOOK}" chroot/root - # Executing hook - Chroot "/root/${LIVE_PACKAGES_LISTS}" + # Making hook executable + if [ ! -x chroot/root/"${HOOK}" ] + then + chmod +x chroot/root/"${HOOK}" + fi - # Removing hook - rm -f chroot/root/"${LIVE_PACKAGE_LIST}" + # Executing hook + Chroot "/root/${HOOK}" - # Creating stage file - Create_stagefile .stage/chroot_hooks -fi + # Removing hook + rm -f chroot/root/"${HOOK}" + + # Creating stage file + Create_stagefile .stage/chroot_hooks + fi +done if [ -n "${LIVE_HOOKS}" ] then diff --git a/helpers/lh_chroot_localization b/helpers/lh_chroot_localization index 4abaf2d..f81661d 100755 --- a/helpers/lh_chroot_localization +++ b/helpers/lh_chroot_localization @@ -635,45 +635,27 @@ then do case "${LOCALZATION}" in iceape) - if [ -f chroot/usr/bin/iceape ] - then - PACKAGES="${PACKAGES} iceweasel-l10n-${ICEAPE}" - fi + Check_package chroot/usr/bin/iceape iceweasel-l10n-"${ICEAPE}" ;; icedove) - if [ -f chroot/usr/bin/icedove ] - then - PACKAGES="${PACKAGES} icedove-locale-${ICEDOVE}" - fi + Check_package chroot/usr/bin/icedove icedove-locale-"${ICEDOVE}" ;; iceweasel) - if [ -f chroot/usr/bin/iceweasel ] - then - PACKAGES="${PACKAGES} iceweasel-l10n-${ICEWEASEL}" - fi + Check_package chroot/usr/bin/iceweasel iceweasel-l10n-"${ICEWEASEL}" ;; kde) - if [ -f chroot/usr/bin/kstart ] - then - PACKAGES="${PACKAGES} kde-i18n-${KDE}" - fi + Check_package chroot/usr/bin/kstart kde-i18n-"${KDE}" ;; koffice) - if [ -f chroot/usr/bin/usr/bin/koconverter ] - then - PACKAGES="${PACKAGES} koffice-i18n-${KOFFICE}" - fi + Check_package chroot/usr/bin/usr/bin/koconverter koffice-i18n-"${KOFFICE}" ;; openoffice) - if [ -f chroot/usr/bin/ooffice ] - then - PACKAGES="${PACKAGES} openoffice.org-l10n-${OPENOFFICE}" - fi + Check_package chroot/usr/bin/ooffice openoffice.org-l10n-"${OPENOFFICE}" ;; esac done @@ -682,15 +664,7 @@ then Restore_cache cache/chroot_localization # Installing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "apt-get install --assume-yes ${PACKAGES}" - ;; - esac + Install_package # Saving cache Save_cache cache/chroot_localization diff --git a/helpers/lh_chroot_proc b/helpers/lh_chroot_proc index 42a7feb..6eeec9d 100755 --- a/helpers/lh_chroot_proc +++ b/helpers/lh_chroot_proc @@ -57,7 +57,7 @@ case "${1}" in fi # Mounting /proc - mount proc-live -t proc chroot/proc + ${LH_ROOT_COMMAND} mount proc-live -t proc chroot/proc # Creating stage file Create_stagefile .stage/chroot_proc @@ -71,14 +71,14 @@ case "${1}" in Create_lockfile .lock # Workaround binfmt-support /proc locking - if [ -e chroot/proc/sys/fs/binftm_misc/status ] + if [ -e chroot/proc/sys/fs/binfmt_misc/status ] then - umount chroot/proc/sys/fs/binfmt_misc + ${LH_ROOT_COMMAND} umount chroot/proc/sys/fs/binfmt_misc fi # Unmounting /proc #fuser -km chroot/proc - umount chroot/proc > /dev/null 2>&1 + ${LH_ROOT_COMMAND} umount chroot/proc > /dev/null 2>&1 # Removing stage file rm -f .stage/chroot_proc diff --git a/helpers/lh_chroot_sources b/helpers/lh_chroot_sources index c4a3a51..7d0980d 100755 --- a/helpers/lh_chroot_sources +++ b/helpers/lh_chroot_sources @@ -57,15 +57,28 @@ case "${1}" in if [ "${LIVE_SECURITY}" = "enabled" ] then - if [ "${LIVE_DISTRIBUTION}" != "sid" ] && [ "${LIVE_DISTRIBUTION}" != "unstable" ] - then - echo "deb ${LIVE_MIRROR_BUILD_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + case "${LH_MODE}" in + debian) + if [ "${LIVE_DISTRIBUTION}" != "sid" ] && [ "${LIVE_DISTRIBUTION}" != "unstable" ] + then + echo "deb ${LIVE_MIRROR_BUILD_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list - if [ "${LIVE_SOURCE}" = "yes" ] - then - echo "deb-src ${LIVE_MIRROR_BUILD_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list - fi - fi + if [ "${LIVE_SOURCE}" = "enabled" ] + then + echo "deb-src ${LIVE_MIRROR_BUILD_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + fi + fi + ;; + + ubuntu) + echo "deb ${LIVE_MIRROR_BUILD_SECURITY} ${LIVE_DISTRIBUTION}-security ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + + if [ "${LIVE_SOURCE}" = "enabled" ] + then + echo "deb-src ${LIVE_MIRROR_BUILD_SECURITY} ${LIVE_DISTRIBUTION}-security ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + fi + ;; + esac fi # Check local sources.list @@ -158,15 +171,28 @@ case "${1}" in if [ "${LIVE_SECURITY}" = "enabled" ] then - if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "testing" ] - then - echo "deb ${LIVE_MIRROR_IMAGE_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list - - if [ "${LIVE_SOURCE}" = "yes" ] - then - echo "deb-src ${LIVE_MIRROR_IMAGE_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list - fi - fi + case "${LH_MODE}" in + debian) + if [ "${LIVE_DISTRIBUTION}" != "sid" ] && [ "${LIVE_DISTRIBUTION}" != "unstable" ] + then + echo "deb ${LIVE_MIRROR_IMAGE_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + + if [ "${LIVE_SOURCE}" = "enabled" ] + then + echo "deb-src ${LIVE_MIRROR_IMAGE_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + fi + fi + ;; + + ubuntu) + echo "deb ${LIVE_MIRROR_IMAGE_SECURITY} ${LIVE_DISTRIBUTION}-security ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + + if [ "${LIVE_SOURCE}" = "enabled" ] + then + echo "deb-src ${LIVE_MIRROR_IMAGE_SECURITY} ${LIVE_DISTRIBUTION}-security ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + fi + ;; + esac fi # Check local sources.list @@ -175,7 +201,7 @@ case "${1}" in echo "" >> chroot/etc/apt/sources.list echo "# Custom repositories" >> chroot/etc/apt/sources.list - for FILE in config/chroot_sources/*.build + for FILE in config/chroot_sources/*.image do cat ${FILE} | grep -v "^##" >> chroot/etc/apt/sources.list done diff --git a/helpers/lh_chroot_symlinks b/helpers/lh_chroot_symlinks index e574480..2aef0df 100755 --- a/helpers/lh_chroot_symlinks +++ b/helpers/lh_chroot_symlinks @@ -47,41 +47,17 @@ Create_lockfile .lock if [ "${LIVE_SYMLINKS}" = "enabled" ] then - if [ -f chroot/usr/bin/symlinks ] - then - SYMLINKS="true" - fi - - if [ -n "${SYMLINKS}" ] - then - # Installing symlinks - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes symlinks" - ;; - - aptitude) - Chroot "aptitude install --assume-yes symlinks" - ;; - esac - fi + # Checking depends + Check_package chroot/usr/bin/symlinks symlinks + + # Installing depends + Install_package # Converting symlinks Chroot "symlinks -c -r -s /" - if [ -n "${SYMLINKS}" ] - then - # Removing symlinks - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes symlinks" - ;; - - aptitude) - Chroot "aptitude purge --assume-yes symlinks" - ;; - esac - fi + # Removing depends + Remove_package # Creating stage file Create_stagefile .stage/chroot_symlinks diff --git a/helpers/lh_chroot_sysfs b/helpers/lh_chroot_sysfs index 539a793..5cf50c3 100755 --- a/helpers/lh_chroot_sysfs +++ b/helpers/lh_chroot_sysfs @@ -57,7 +57,7 @@ case "${1}" in fi # Mounting /sys - mount sysfs-live -t sysfs chroot/sys + ${LH_ROOT_COMMAND} mount sysfs-live -t sysfs chroot/sys # Creating stage file Create_stagefile .stage/chroot_sysfs @@ -72,7 +72,7 @@ case "${1}" in # Unmounting /sys #fuser -km chroot/sys - umount chroot/sys > /dev/null 2>&1 + ${LH_ROOT_COMMAND} umount chroot/sys > /dev/null 2>&1 # Removing stage file rm -f .stage/chroot_sysfs diff --git a/helpers/lh_chroot_tasks b/helpers/lh_chroot_tasks index 7427e97..64cd47f 100755 --- a/helpers/lh_chroot_tasks +++ b/helpers/lh_chroot_tasks @@ -50,48 +50,36 @@ then # Restoring cache Restore_cache cache/chroot_tasks - if [ ! -f chroot/usr/bin/aptitude ] - then - PACKAGES="${PACKAGES} aptitude" - fi - - if [ ! -f chroot/usr/bin/tasksel ] - then - PACKAGES="${PACKAGES} tasksel" - fi - - if [ -n "${PACKAGES}" ] - then - # Installing symlinks - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude install --assume-yes ${PACKAGES}" - ;; - esac - fi - - for TASK in ${LIVE_TASKS} - do - Chroot "tasksel --debconf-apt-progress --logstderr install ${TASK}" - done - - if [ -n "${PACKAGES}" ] - then - # Removing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude purge --assume-yes ${PACKAGES}" - ;; - esac - fi + # Checking depends + case "${LH_TASKSEL}" in + aptitude) + Check_package chroot/usr/bin/aptitude aptitude + ;; + + tasksel) + Check_package chroot/usr/bin/tasksel tasksel + ;; + esac + + # Installing depends + Install_package + + # Installing tasks + case "${LH_TASKSEL}" in + aptitude) + Chroot "aptitude install --assume-yes ${LIVE_TASKS}" + ;; + + tasksel) + for TASK in ${LIVE_TASKS} + do + Chroot "tasksel --debconf-apt-progress --logstderr install ${TASK}" + done + ;; + esac + + # Removing depends + Remove_package # Saving cache Save_cache cache/chroot_tasks diff --git a/helpers/lh_clean b/helpers/lh_clean index 10118f5..24a65e3 100755 --- a/helpers/lh_clean +++ b/helpers/lh_clean @@ -47,22 +47,22 @@ case "${1}" in ;; cache) - rm -rf cache + ${LH_ROOT_COMMAND} rm -rf cache ;; chroot) - umount -f chroot/sys > /dev/null 2>&1 || true - umount -f chroot/proc > /dev/null 2>&1 || true - umount -f chroot/lib/init/rw > /dev/null 2>&1 || true - umount -f chroot/dev/shm > /dev/null 2>&1 || true - umount -f chroot/dev/pts > /dev/null 2>&1 || true - umount -f chroot/dev > /dev/null 2>&1 || true + ${LH_ROOT_COMMAND} umount -f chroot/sys > /dev/null 2>&1 || true + ${LH_ROOT_COMMAND} umount -f chroot/proc > /dev/null 2>&1 || true + ${LH_ROOT_COMMAND} umount -f chroot/lib/init/rw > /dev/null 2>&1 || true + ${LH_ROOT_COMMAND} umount -f chroot/dev/shm > /dev/null 2>&1 || true + ${LH_ROOT_COMMAND} umount -f chroot/dev/pts > /dev/null 2>&1 || true + ${LH_ROOT_COMMAND} umount -f chroot/dev > /dev/null 2>&1 || true - rm -rf chroot chroot.tmp + ${LH_ROOT_COMMAND} rm -rf chroot chroot.tmp if [ "${PURGE}" != "true" ] && [ -d cache/chroot_bootstrap ] then - cp -a cache/chroot_bootstrap chroot + ${LH_ROOT_COMMAND} cp -a cache/chroot_bootstrap chroot mkdir -p .stage touch .stage/bootstrap fi diff --git a/helpers/lh_config b/helpers/lh_config index 13c1835..4f3e844 100755 --- a/helpers/lh_config +++ b/helpers/lh_config @@ -121,12 +121,20 @@ LH_GENISOIMAGE="${LH_GENISOIMAGE}" # (Default: autodetected) LH_LOSETUP="${LH_LOSETUP}" +# \$LH_TASKSEL: set the tasksel program +# (Default: ${LH_TASKSEL}) +LH_TASKSEL="${LH_TASKSEL}" + # \$LIVE_ROOT: set the root directory # (Default: ${LIVE_ROOT}) LIVE_ROOT="${LIVE_ROOT}" # Live-helper options +# \$LH_ROOT_COMMAND: use sudo or equivalent +# (Default: empty) +#LH_ROOT_COMMAND="sudo" + # \$LH_BREAKPOINTS: enable breakpoints # (Default: ${LH_BREAKPOINTS}) LH_BREAKPOINTS="${LH_BREAKPOINTS}" @@ -323,4 +331,6 @@ LIVE_TEMPLATES="${LIVE_TEMPLATES}" EOF # Creating lh_binary_* directories +mkdir -p "${LIVE_ROOT}"/config/binary_grub mkdir -p "${LIVE_ROOT}"/config/binary_localincludes +mkdir -p "${LIVE_ROOT}"/config/binary_syslinux diff --git a/helpers/lh_losetup b/helpers/lh_losetup index e3b7148..47c8f34 100755 --- a/helpers/lh_losetup +++ b/helpers/lh_losetup @@ -35,7 +35,7 @@ Breakpoint "losetup: Init" if [ -z "${1}" ] then - DEVICE="`${LH_LOSETUP} -f`" + DEVICE="`${LH_ROOT_COMMAND} ${LH_LOSETUP} -f`" else DEVICE="${1}" fi @@ -43,9 +43,9 @@ fi FILE="${2}" PARTITION="${3}" -${LH_LOSETUP} "${DEVICE}" "${FILE}" +${LH_ROOT_COMMAND} ${LH_LOSETUP} "${DEVICE}" "${FILE}" FDISK_OUT="`fdisk -l -u ${DEVICE} 2>&1`" -${LH_LOSETUP} -d "${DEVICE}" +${LH_ROOT_COMMAND} ${LH_LOSETUP} -d "${DEVICE}" LOOPDEVICE="`echo ${DEVICE}p${PARTITION:=1}`" CYL=`echo "$FDISK_OUT" | sed -ne "s_^$LOOPDEVICE[ *]*\([0-9]*\).*_\1_p"` @@ -56,7 +56,7 @@ echo loop $DEVICE at offset $OFFSET if [ "${PARTITION}" = "0" ] then - ${LH_LOSETUP} "${DEVICE}" "${FILE}" + ${LH_ROOT_COMMAND} ${LH_LOSETUP} "${DEVICE}" "${FILE}" else - ${LH_LOSETUP} -o "${OFFSET}" "${DEVICE}" "${FILE}" + ${LH_ROOT_COMMAND} ${LH_LOSETUP} -o "${OFFSET}" "${DEVICE}" "${FILE}" fi diff --git a/helpers/lh_source_generic b/helpers/lh_source_generic index 0ffa9fc..d3e8009 100755 --- a/helpers/lh_source_generic +++ b/helpers/lh_source_generic @@ -61,6 +61,7 @@ do fi # Create tarball + Echo_message "Creating tarball, this can take a while." tar cf source.tar source # Creating stage file diff --git a/helpers/lh_source_hdd b/helpers/lh_source_hdd index 1c8c88b..498a18b 100755 --- a/helpers/lh_source_hdd +++ b/helpers/lh_source_hdd @@ -61,6 +61,7 @@ do fi # Create tarball + Echo_message "Creating tarball, this can take a while." tar cfz source-hdd.tar.gz source # Creating stage file diff --git a/helpers/lh_source_usb b/helpers/lh_source_usb index 178a558..91207de 100755 --- a/helpers/lh_source_usb +++ b/helpers/lh_source_usb @@ -54,29 +54,12 @@ do # Creating lock file Create_lockfile .lock - if [ ! -f chroot/sbin/mkdosfs ] - then - PACKAGES="${PACKAGES} dosfstools" - fi + # Checking depends + Check_package chroot/sbin/mkdosfs dosfstools + Check_package chroot/sbin/parted parted - if [ ! -f chroot/sbin/parted ] - then - PACKAGES="${PACKAGES} parted" - fi - - if [ -n "${PACKAGES}" ] - then - # Installing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get install --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude install --assume-yes ${PACKAGES}" - ;; - esac - fi + # Installing depends + Install_package # Remove old source if [ -f source.img ] @@ -107,9 +90,9 @@ do lh_losetup $FREELO source.img 1 Chroot "mkfs.msdos -n DEBIAN_LIVE ${FREELO}" mkdir -p source.tmp - mount ${FREELO} source.tmp + ${LH_ROOT_COMMAND} mount ${FREELO} source.tmp cp -r source/* source.tmp - umount source.tmp + ${LH_ROOT_COMMAND} umount source.tmp rmdir source.tmp ${LH_LOSETUP} -d ${FREELO} echo "!!! The above error/warning messages can be ignored !!!" @@ -120,19 +103,8 @@ do mv chroot/dev.tmp chroot/dev fi - if [ -n "${PACKAGES}" ] - then - # Removing packages - case "${LH_APT}" in - apt|apt-get) - Chroot "apt-get remove --purge --yes ${PACKAGES}" - ;; - - aptitude) - Chroot "aptitude purge --assume-yes ${PACKAGES}" - ;; - esac - fi + # Removing depends + Remove_package # Creating stage file Create_stagefile .stage/source_usb diff --git a/helpers/lh_testroot b/helpers/lh_testroot index e694529..bb5592e 100755 --- a/helpers/lh_testroot +++ b/helpers/lh_testroot @@ -22,10 +22,14 @@ USAGE="${PROGRAM} [--force]" Arguments "${@}" +# Reading configuration files +Read_conffile config/common +Set_defaults + Echo_debug "Init ${PROGRAM}" # Checking user account -if [ "`id -u`" -ne "0" ] +if [ "`${LH_ROOT_COMMAND} id -u`" -ne "0" ] then Echo_error "need root privileges" exit 1 diff --git a/helpers/make-live b/helpers/make-live index 29a6067..35ae73c 100755 --- a/helpers/make-live +++ b/helpers/make-live @@ -31,13 +31,13 @@ done # Set static variables PROGRAM="`basename ${0}`" DESCRIPTION="utility to build Debian Live systems" -USAGE="${PROGRAM} [config] [--mode MODE] [--config CONFIG] [--apt apt|aptitude] [--apt-ftpproxy URL] [--apt-httpproxy URL] [--apt-generic enabled|disabled] [--apt-pdiffs enabled|disabled] [--apt-recommends enabled|disabled] [--apt-secure enabled|disabled] [--bootstrap cdebootstrap|deboostrap] [--cache enabled|disabled] [--debconf-frontend dialog|readline|noninteractive] [--debconf-priority low|medium|high|critical] [--debconf-nowarnings yes|no] [--genisoimage genisoimage|mkisofs] [--losetup losetup|losetup.org] [-r|--root DIRECTORY] [-a|--architecture ARCHITECTURE] [-d|--distribution testing|unstable|etch|sid] [--distribution-config DIRECTORY] [-f|--bootstrap-flavour minimal|standard] [-m|--mirror-build URL] [--mirror-build-security URL] [--mirror-image URL] [--mirror-image-security URL] [--sections SECTION|\"SECTIONS\"] [--interactive shell|x11|xnest] [-k|--kernel-flavour FLAVOUR] [--kernel-packages PACKAGE|\"PACKAGES\"] [--keyring-packages PACKAGE|\"PACKAGES\"] [--hooks \"COMMAND\"|\"COMMANDS\"] [-l|--language LANGUAGE] [--packages PACKAGE|\"PACKAGES\"] [-p|--packages-lists LIST|\"LISTS\"] [--tasks TASK|\"TASKS\"] [--security enabled|disabled] [--symlinks enabled|disabled] [--sysvinit enabled|disabled] [--bootappend KERNEL_PARAMETER|\"KERNEL_PARAMETERS\"] [-e|--encryption ALGORITHM] [--username NAME] [--hostname NAME] [--filesystem ext2|plain|squashfs] [--memtest memtest86|memtest86+] [--iso-volume STRING] [--server-address HOSTNAME|IP] [--server-path DIRECTORY] [--source enabled|disabled] [--bootloader grub|syslinux] [--grub-splash FILE] [--syslinux-splash FILE] [-b|--binary-image hdd|iso|usb|net] [-s|--source-image generic|hdd|iso|usb|net] [--includes PATH] [--templates PATH] [--breakpoints] [--debug] [--force] [--quiet] [--verbose]" +USAGE="${PROGRAM} [config] [--mode MODE] [--config CONFIG] [--apt apt|aptitude] [--apt-ftpproxy URL] [--apt-httpproxy URL] [--apt-generic enabled|disabled] [--apt-pdiffs enabled|disabled] [--apt-recommends enabled|disabled] [--apt-secure enabled|disabled] [--bootstrap cdebootstrap|deboostrap] [--cache enabled|disabled] [--debconf-frontend dialog|readline|noninteractive] [--debconf-priority low|medium|high|critical] [--debconf-nowarnings yes|no] [--genisoimage genisoimage|mkisofs] [--losetup losetup|losetup.org] [--tasksel aptitude|tasksel] [-r|--root DIRECTORY] [-a|--architecture ARCHITECTURE] [-d|--distribution stable|testing|unstable|etch|lenny|sid] [--distribution-config DIRECTORY] [-f|--bootstrap-flavour minimal|standard] [-m|--mirror-build URL] [--mirror-build-security URL] [--mirror-image URL] [--mirror-image-security URL] [--sections SECTION|\"SECTIONS\"] [--interactive shell|x11|xnest] [-k|--kernel-flavour FLAVOUR] [--kernel-packages PACKAGE|\"PACKAGES\"] [--keyring-packages PACKAGE|\"PACKAGES\"] [--hooks \"COMMAND\"|\"COMMANDS\"] [-l|--language LANGUAGE] [--packages PACKAGE|\"PACKAGES\"] [-p|--packages-lists LIST|\"LISTS\"] [--tasks TASK|\"TASKS\"] [--security enabled|disabled] [--symlinks enabled|disabled] [--sysvinit enabled|disabled] [--bootappend KERNEL_PARAMETER|\"KERNEL_PARAMETERS\"] [-e|--encryption ALGORITHM] [--username NAME] [--hostname NAME] [--filesystem ext2|plain|squashfs] [--memtest memtest86|memtest86+] [--iso-volume STRING] [--server-address HOSTNAME|IP] [--server-path DIRECTORY] [--source enabled|disabled] [--bootloader grub|syslinux] [--grub-splash FILE] [--syslinux-splash FILE] [-b|--binary-image hdd|iso|usb|net] [-s|--source-image generic|hdd|iso|usb|net] [--includes PATH] [--templates PATH] [--breakpoints] [--debug] [--force] [--quiet] [--verbose] [--root-command sudo]" HELP="Lists: gnome, gnome-core, gnome-desktop, gnome-full, gnome-junior, gnustep, kde, kde-core, kde-desktop, kde-extra, kde-full, kde-junior, mini, minimal, minimal-net, rescue, standard, standard-x11, xfce, xfce-desktop, xfce-junior" Local_arguments () { - ARGUMENTS="`getopt --longoptions mode:,config:,apt:,apt-ftpproxy:,apt-httpproxy:,apt-generic:,apt-pdiffs:,apt-recommends:,apt-secure:,bootstrap:,cache:,debconf-frontend:,debconf-priority:,debconf-nowarnings:,genisoimage:,losetup:,root:,architecture:,distribution:,distribution-config:,flavour:,mirror-build:,mirror-build-security:,mirror-image:,mirror-image-security:,sections:,interactive:,kernel:,kernel-packages:,keyring-packages:,hooks:,language:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,bootappend:,encryption:,username:,hostname:,filesystem:,memtest:,iso-volume:,server-address:,server-path:,source:,bootloader:,grub-splash:,syslinux-splash:,binary-image:,binary-source:,includes:,templates:,help,usage,version,force,breakpoints,debug,quiet,verbose --name=${PROGRAM} --options r:a:d:f:m:k:l:p:e:b:s:huv --shell sh -- "${@}"`" + ARGUMENTS="`getopt --longoptions mode:,config:,apt:,apt-ftpproxy:,apt-httpproxy:,apt-generic:,apt-pdiffs:,apt-recommends:,apt-secure:,bootstrap:,cache:,debconf-frontend:,debconf-priority:,debconf-nowarnings:,genisoimage:,losetup:,tasksel:,root:,architecture:,distribution:,distribution-config:,flavour:,mirror-build:,mirror-build-security:,mirror-image:,mirror-image-security:,sections:,interactive:,kernel:,kernel-packages:,keyring-packages:,hooks:,language:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,bootappend:,encryption:,username:,hostname:,filesystem:,memtest:,iso-volume:,server-address:,server-path:,source:,bootloader:,grub-splash:,syslinux-splash:,binary-image:,binary-source:,includes:,templates:,help,usage,version,force,breakpoints,debug,quiet,verbose,root-command: --name=${PROGRAM} --options r:a:d:f:m:k:l:p:e:b:s:huv --shell sh -- "${@}"`" if [ "${?}" != "0" ] then @@ -120,10 +120,18 @@ Local_arguments () LH_LOSETUP="${2}"; shift 2 ;; + --tasksel) + LH_TASKSEL="${2}"; shift 2 + ;; + -r|--root) LIVE_ROOT="${2}"; shift 2 ;; + --root-command) + LIVE_ROOT_COMMAND="${2}"; shift 2 + ;; + # bootstrap -a|--architecture) LIVE_ARCHITECTURE="${2}"; shift 2 @@ -257,7 +265,7 @@ Local_arguments () ;; --grub-splash) - LIVE_SYSLINUX="${2}"; shift 2 + LIVE_GRUB_SPLASH="${2}"; shift 2 ;; --syslinux-splash) @@ -345,7 +353,7 @@ Main () Local_arguments "${@}" # Configuring (this is really shit!) - LH_MODE="${LH_MODE}" LH_CONFIG="${LH_CONFIG}" LH_APT="${LH_APT}" LH_APT_FTPPROXY="${LH_APT_FTPPROXY}" LH_APT_HTTPPROXY="${LH_APT_HTTPPROXY}" LH_APT_GENERIC="${LH_APT_GENERIC}" LH_APT_PDIFFS="${LH_APT_PDIFFS}" LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS}" LH_APT_SECURE="${LH_APT_SECURE}" LH_BOOTSTRAP="${LH_BOOTSTRAP}" LH_CACHE="${LH_CACHE}" LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}" LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}" LH_DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}" LH_GENISOIMAGE="${LH_GENISOIMAGE}" LIVE_ROOT="${LIVE_ROOT}" LIVE_ARCHITECTURE="${LIVE_ARCHITECTURE}" LIVE_DISTRIBUTION="${LIVE_DISTRIBUTION}" LIVE_DISTRIBUTION_CONFIG="${LIVE_DISTRIBUTION_CONFIG}" LIVE_BOOTSTRAP_FLAVOUR="${LIVE_BOOTSTRAP_FLAVOUR}" LIVE_MIRROR_BUILD="${LIVE_MIRROR_BUILD}" LIVE_MIRROR_BUILD_SECURITY="${LIVE_MIRROR_BUILD_SECURITY}" LIVE_MIRROR_IMAGE="${LIVE_MIRROR_IMAGE}" LIVE_MIRROR_IMAGE_SECURITY="${LIVE_MIRROR_IMAGE_SECURITY}" LIVE_SECTIONS="${LIVE_SECTIONS}" LIVE_INTERACTIVE="${LIVE_INTERACTIVE}" LIVE_KERNEL_FLAVOUR="${LIVE_KERNEL_FLAVOUR}" LIVE_KERNEL_PACKAGES="${LIVE_KERNEL_PACKAGES}" LIVE_KEYRING_PACKAGES="${LIVE_KEYRING_PACKAGES}" LIVE_HOOKS="${LIVE_HOOKS}" LIVE_LANGUAGE="${LIVE_LANGUAGE}" LIVE_PACKAGES="${LIVE_PACKAGES}" LIVE_PACKAGES_LISTS="${LIVE_PACKAGES_LISTS}" LIVE_TASKS="${LIVE_TASKS}" LIVE_SECURITY="${LIVE_SECURITY}" LIVE_SYMLINKS="${LIVE_SYMLINKS}" LIVE_SYSVINIT="${LIVE_SYSVINIT}" LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND}" LIVE_ENCRYPTION="${LIVE_ENCRYPTION}" LIVE_USERNAME="${LIVE_USERNAME}" LIVE_HOSTNAME="${LIVE_HOSTNAME}" LIVE_FILESYSTEM="${LIVE_FILESYSTEM}" LIVE_MEMTEST="${LIVE_MEMTEST}" LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}" LIVE_SERVER_ADDRESS="${LIVE_SERVER_ADDRESS}" LIVE_SERVER_PATH="${LIVE_SERVER_PATH}" LIVE_SOURCE="${LIVE_SOURCE}" LIVE_BOOTLOADER="${LIVE_BOOTLOADER}" LIVE_GRUB_SPLASH="${LIVE_GRUB_SPLASH}" LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}" LIVE_BINARY_IMAGE="${LIVE_BINARY_IMAGE}" LIVE_SOURCE_IMAGE="${LIVE_SOURCE_IMAGE}" LIVE_INCLUDES="${LIVE_INCLUDES}" LIVE_TEMPLATES="${LIVE_TEMPLATES}" lh_config newconfig + LH_MODE="${LH_MODE}" LH_CONFIG="${LH_CONFIG}" LH_APT="${LH_APT}" LH_APT_FTPPROXY="${LH_APT_FTPPROXY}" LH_APT_HTTPPROXY="${LH_APT_HTTPPROXY}" LH_APT_GENERIC="${LH_APT_GENERIC}" LH_APT_PDIFFS="${LH_APT_PDIFFS}" LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS}" LH_APT_SECURE="${LH_APT_SECURE}" LH_BOOTSTRAP="${LH_BOOTSTRAP}" LH_CACHE="${LH_CACHE}" LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}" LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}" LH_DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}" LH_GENISOIMAGE="${LH_GENISOIMAGE}" LH_LOSETUP="${LH_LOSETUP}" LH_TASKSEL="${LH_TASKSEL}" LIVE_ROOT="${LIVE_ROOT}" LIVE_ARCHITECTURE="${LIVE_ARCHITECTURE}" LIVE_DISTRIBUTION="${LIVE_DISTRIBUTION}" LIVE_DISTRIBUTION_CONFIG="${LIVE_DISTRIBUTION_CONFIG}" LIVE_BOOTSTRAP_FLAVOUR="${LIVE_BOOTSTRAP_FLAVOUR}" LIVE_MIRROR_BUILD="${LIVE_MIRROR_BUILD}" LIVE_MIRROR_BUILD_SECURITY="${LIVE_MIRROR_BUILD_SECURITY}" LIVE_MIRROR_IMAGE="${LIVE_MIRROR_IMAGE}" LIVE_MIRROR_IMAGE_SECURITY="${LIVE_MIRROR_IMAGE_SECURITY}" LIVE_SECTIONS="${LIVE_SECTIONS}" LIVE_INTERACTIVE="${LIVE_INTERACTIVE}" LIVE_KERNEL_FLAVOUR="${LIVE_KERNEL_FLAVOUR}" LIVE_KERNEL_PACKAGES="${LIVE_KERNEL_PACKAGES}" LIVE_KEYRING_PACKAGES="${LIVE_KEYRING_PACKAGES}" LIVE_HOOKS="${LIVE_HOOKS}" LIVE_LANGUAGE="${LIVE_LANGUAGE}" LIVE_PACKAGES="${LIVE_PACKAGES}" LIVE_PACKAGES_LISTS="${LIVE_PACKAGES_LISTS}" LIVE_TASKS="${LIVE_TASKS}" LIVE_SECURITY="${LIVE_SECURITY}" LIVE_SYMLINKS="${LIVE_SYMLINKS}" LIVE_SYSVINIT="${LIVE_SYSVINIT}" LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND}" LIVE_ENCRYPTION="${LIVE_ENCRYPTION}" LIVE_USERNAME="${LIVE_USERNAME}" LIVE_HOSTNAME="${LIVE_HOSTNAME}" LIVE_FILESYSTEM="${LIVE_FILESYSTEM}" LIVE_MEMTEST="${LIVE_MEMTEST}" LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}" LIVE_SERVER_ADDRESS="${LIVE_SERVER_ADDRESS}" LIVE_SERVER_PATH="${LIVE_SERVER_PATH}" LIVE_SOURCE="${LIVE_SOURCE}" LIVE_BOOTLOADER="${LIVE_BOOTLOADER}" LIVE_GRUB_SPLASH="${LIVE_GRUB_SPLASH}" LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}" LIVE_BINARY_IMAGE="${LIVE_BINARY_IMAGE}" LIVE_SOURCE_IMAGE="${LIVE_SOURCE_IMAGE}" LIVE_INCLUDES="${LIVE_INCLUDES}" LIVE_TEMPLATES="${LIVE_TEMPLATES}" LH_ROOT_COMMAND="${LH_ROOT_COMMAND}" lh_config newconfig if [ "${LH_BREAKPOINTS}" = "enabled" ] then @@ -379,4 +387,8 @@ Main () fi } +trap "if [ -f ${ROOT}/chroot/proc/version ]; then umount ${ROOT}/chroot/proc; fi; \ + if [ -f ${ROOT}/chroot/sys/kernel ]; then umount ${ROOT}/chroot/sys; fi; exit" \ + 0 1 2 3 9 15 + Main "${@}" |