From da353a5231ad925013d01065768864307c70651a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 23 Sep 2007 10:04:49 +0200 Subject: Adding live-helper 1.0~a4-1. --- helpers/lh_binary | 52 ++++---- helpers/lh_binary_grub | 222 +++++++++++++++++++++++++++++++++++ helpers/lh_binary_includes | 12 ++ helpers/lh_binary_iso | 12 +- helpers/lh_binary_linuximage | 2 + helpers/lh_binary_memtest86 | 1 + helpers/lh_binary_net | 2 +- helpers/lh_binary_rootfs | 6 +- helpers/lh_binary_syslinux | 44 ++++--- helpers/lh_binary_usb | 19 ++- helpers/lh_bootstrap | 9 +- helpers/lh_bootstrap_cdebootstrap | 44 +++++++ helpers/lh_bootstrap_debootstrap | 34 ++++++ helpers/lh_build | 13 +- helpers/lh_chroot | 67 +++++------ helpers/lh_chroot_apt | 8 +- helpers/lh_chroot_localhooks | 2 +- helpers/lh_chroot_localpackageslists | 2 +- helpers/lh_chroot_sysfs | 2 +- helpers/lh_clean | 18 ++- helpers/lh_config | 12 +- helpers/lh_source | 30 ++--- helpers/lh_testroot | 2 +- helpers/make-live | 42 +++++-- 24 files changed, 514 insertions(+), 143 deletions(-) create mode 100755 helpers/lh_binary_grub (limited to 'helpers') diff --git a/helpers/lh_binary b/helpers/lh_binary index 7641871eb..d9726252b 100755 --- a/helpers/lh_binary +++ b/helpers/lh_binary @@ -22,43 +22,41 @@ USAGE="${PROGRAM} [--force]" Arguments "${@}" -if [ "${FORCE}" = "true" ] -then - OPTIONS="${OPTIONS} --force" -fi +Echo_debug "Init ${PROGRAM}" # Preparing root filesystem -lh_binary_chroot "${OPTIONS}" +lh_binary_chroot "${@}" # Configuring chroot -lh_chroot_proc install "${OPTIONS}" -lh_chroot_sysfs install "${OPTIONS}" -lh_chroot_hosts install "${OPTIONS}" -lh_chroot_resolv install "${OPTIONS}" -lh_chroot_sources install "${OPTIONS}" +lh_chroot_proc install "${@}" +lh_chroot_sysfs install "${@}" +lh_chroot_hosts install "${@}" +lh_chroot_resolv install "${@}" +lh_chroot_sources install "${@}" # Building root filesystem -lh_binary_rootfs "${OPTIONS}" -lh_binary_manifest "${OPTIONS}" -lh_binary_encryption "${OPTIONS}" +lh_binary_rootfs "${@}" +lh_binary_manifest "${@}" +lh_binary_encryption "${@}" # Prepare images -lh_binary_linuximage "${OPTIONS}" -lh_binary_memtest86 "${OPTIONS}" -lh_binary_syslinux "${OPTIONS}" -lh_binary_includes "${OPTIONS}" -lh_binary_localincludes "${OPTIONS}" -lh_binary_md5sum "${OPTIONS}" +lh_binary_linuximage "${@}" +lh_binary_memtest86 "${@}" +lh_binary_grub "${@}" +lh_binary_syslinux "${@}" +lh_binary_includes "${@}" +lh_binary_localincludes "${@}" +lh_binary_md5sum "${@}" # Building images -lh_binary_hdd "${OPTIONS}" -lh_binary_iso "${OPTIONS}" -lh_binary_net "${OPTIONS}" -lh_binary_usb "${OPTIONS}" +lh_binary_hdd "${@}" +lh_binary_iso "${@}" +lh_binary_net "${@}" +lh_binary_usb "${@}" # Deconfiguring chroot rm -f .stage/chroot_sources -lh_chroot_resolv remove "${OPTIONS}" -lh_chroot_hosts remove "${OPTIONS}" -lh_chroot_sysfs remove "${OPTIONS}" -lh_chroot_proc remove "${OPTIONS}" +lh_chroot_resolv remove "${@}" +lh_chroot_hosts remove "${@}" +lh_chroot_sysfs remove "${@}" +lh_chroot_proc remove "${@}" diff --git a/helpers/lh_binary_grub b/helpers/lh_binary_grub new file mode 100755 index 000000000..2de092d69 --- /dev/null +++ b/helpers/lh_binary_grub @@ -0,0 +1,222 @@ +#!/bin/sh + +# lh_binary_grub(1) - installs grub into binary +# Copyright (C) 2006-2007 Daniel Baumann +# +# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING. +# This is free software, and you are welcome to redistribute it +# under certain conditions; see COPYING for details. + +set -e + +# Source common functions +for FUNCTION in /usr/share/live-helper/functions/*.sh +do + . ${FUNCTION} +done + +# Set static variables +DESCRIPTION="installs grub into binary" +HELP="" +USAGE="${PROGRAM} [--force]" + +Arguments "${@}" + +# Reading configuration files +Read_conffile config/common +Read_conffile config/bootstrap +Read_conffile config/chroot +Read_conffile config/image +Set_defaults + +# Requiring stage file +Require_stagefile .stage/bootstrap + +# Checking lock file +Check_lockfile .lock + +# Creating lock file +Create_lockfile .lock + +# Checking stage file +Check_stagefile .stage/binary_grub + +if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ] +then + echo "W: skipping binary_grub, foreign architecture." + exit 0 +fi + +if [ "${LIVE_BOOTLOADER}" = "grub" ] +then + # Check templates + if [ ! -d "${LIVE_TEMPLATES}" ] + then + if [ -d ../"${LIVE_TEMPLATES}" ] + then + LIVE_TEMPLATES="../${LIVE_TEMPLATES}" + else + Echo_error "user specified templates not accessible in ${LIVE_TEMPLATES}" + exit 1 + 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}" + ;; + + aptitude) + Chroot "aptitude install --assume-yes ${PACKAGES}" + ;; + esac + fi + + # Setting destination directory + case "${LIVE_BINARY_IMAGE}" in + iso|usb|hdd) + DESTDIR="binary/live" + ;; + + net) + Echo_error "not supported, FIXME" + ;; + esac + + # Temporary check for broken syslinux + if [ "${LIVE_BINARY_IMAGE}" = "iso" ] + then + case "${LIVE_ARCHITECTURE}" in + i386) + DESTDIR="${DESTDIR}.386" + ;; + esac + fi + + # Creating directory + if [ ! -d "${DESTDIR}" ] + then + mkdir -p "${DESTDIR}" + fi + + # Setting boot parameters + if [ -n "${LIVE_ENCRYPTION}" ] + then + LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} encryption=${LIVE_ENCRYPTION}" + fi + + if [ -n "${LIVE_USERNAME}" ] + then + LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} username=${LIVE_USERNAME}" + fi + + if [ -n "${LIVE_HOSTNAME}" ] + then + LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} hostname=${LIVE_HOSTNAME}" + fi + + LIVE_BOOTAPPEND="`echo ${LIVE_BOOTAPPEND} | sed -e 's/ //'`" + + # Assembling kernel configuration + if [ "${LIVE_BINARY_IMAGE}" = "iso" ] + then + DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`" + LINUX="title\t\tDebian GNU/Linux - Live\nroot\t\t(cd)\nkernel\t\t/`basename ${DESTDIR}`/`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\ninitrd\t\t/`basename ${DESTDIR}`/initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" + else + DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`" + LINUX="title\t\tDebian GNU/Linux - Live\nroot\t\t(cd)\nkernel\t\t`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\ninitrd\t\tinitrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" + fi + + if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ] + then + for KERNEL in chroot/boot/vmlinuz* + do + if [ -z "${LINUX}" ] + then + if [ "${LIVE_BINARY_IMAGE}" = "iso" ] + then + LINUX="title\t\tDebian GNU/Linux - Live, kernel `basename ${KERNEL} | sed -e 's/vmlinuz-//'`\nroot\t\t(cd)\nkernel\t\t/`basename ${DESTDIR}`/`basename ${KERNEL}`\ninitrd\t\t/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" + else + LINUX="title\t\tDebian GNU/Linux - Live, kernel `basename ${KERNEL} | sed -e 's/vmlinuz-//'`\nroot\t\t(cd)\nkernel\t\t`basename ${KERNEL}`\ninitrd\t\tinitrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" + fi + else + if [ "${LIVE_BINARY_IMAGE}" = "iso" ] + then + LINUX="${LINUX}\n\ntitle\t\tDebian GNU/Linux - Live, kernel `basename ${KERNEL} | sed -e 's/vmlinuz-//'`\nroot\t\t(cd)\nkernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\ninitrd\t\t/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" + else + LINUX="${LINUX}\n\ntitle\t\tDebian GNU/Linux - Live, kernel `basename ${KERNEL} | sed -e 's/vmlinuz-//'`\nroot\t\t(cd)\nkernel `basename ${KERNEL}`\ninitrd\t\tinitrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" + fi + fi + done + fi + + LINUX="`echo ${LINUX} | sed -e 's#//#/#g'`" + + # Assembling memtest configuration + if [ -f "${DESTDIR}"/memtest ] + then + if [ "${LIVE_BINARY_IMAGE}" = "iso" ] + then + MEMTEST="title\t\tMemtest86+\nroot\t\t(cd)\nkernel\t\t/`basename ${DESTDIR}`/memtest" + MEMTEST="`echo ${MEMTEST} | sed -e 's#//#/#g'`" + else + MEMTEST="title\t\tMemtest86+\nroot\t\t(cd)\nkernel\t\tmemtest" + fi + fi + + mkdir -p binary/boot/grub + cp -r "${LIVE_TEMPLATES}"/grub/* binary/boot/grub + + if [ "${LIVE_BINARY_IMAGE}" = "iso" ] + then + cp chroot/usr/lib/grub/i386-pc/stage2_eltorito binary/boot/grub + fi + + # Copying splash screen + if [ -n "${LIVE_GRUB_SPLASH}" ] + then + # FIXME + cp "${LIVE_GRUB_SPLASH}" binary/boot/grub + + LIVE_SPLASH="splashimage /boot/grub/`basename ${LIVE_GRUB_SPLASH}`" + fi + + # Configure grub templates +cat >> binary/boot/grub/menu.lst << EOF +# This is a divider, added to separate the menu items below from the Debian +# ones. +title Other: +root + + +LIVE_MEMTEST +EOF + + sed -i -e "s#LIVE_SPLASH#${LIVE_SPLASH}#" -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 + + # Creating stage file + Create_stagefile .stage/binary_grub +fi diff --git a/helpers/lh_binary_includes b/helpers/lh_binary_includes index 6fbaeed41..aff6fa172 100755 --- a/helpers/lh_binary_includes +++ b/helpers/lh_binary_includes @@ -40,6 +40,18 @@ Create_lockfile .lock # Checking stage file Check_stagefile .stage/binary_includes +# Check includes +if [ ! -d "${LIVE_INCLUDES}" ] +then + if [ -d ../"${LIVE_INCLUDES}" ] + then + LIVE_INCLUDES="../${LIVE_INCLUDES}" + else + Echo_error "user specified includes not accessible in ${LIVE_INCLUDES}" + exit 1 + fi +fi + if ls "${LIVE_INCLUDES}"/common/* &> /dev/null then cd "${LIVE_INCLUDES}"/common diff --git a/helpers/lh_binary_iso b/helpers/lh_binary_iso index be9a51f74..d7328c3a2 100755 --- a/helpers/lh_binary_iso +++ b/helpers/lh_binary_iso @@ -75,8 +75,16 @@ do # Create image if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] then - #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 -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table binary" + 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" + ;; + + 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" + ;; + esac else echo "W: Bootloader on your architecture not yet supported (Continuing in 5 seconds)." sleep 5 diff --git a/helpers/lh_binary_linuximage b/helpers/lh_binary_linuximage index 680b4c9c9..88f789c53 100755 --- a/helpers/lh_binary_linuximage +++ b/helpers/lh_binary_linuximage @@ -24,6 +24,8 @@ Arguments "${@}" # Reading configuration files Read_conffile config/common +Read_conffile config/bootstrap +Read_conffile config/chroot Read_conffile config/image Set_defaults diff --git a/helpers/lh_binary_memtest86 b/helpers/lh_binary_memtest86 index c2231f6d5..5232995d3 100755 --- a/helpers/lh_binary_memtest86 +++ b/helpers/lh_binary_memtest86 @@ -25,6 +25,7 @@ Arguments "${@}" # Reading configuration files Read_conffile config/common Read_conffile config/bootstrap +Read_conffile config/chroot Read_conffile config/image Set_defaults diff --git a/helpers/lh_binary_net b/helpers/lh_binary_net index 4a2a20dd4..2fded51fa 100755 --- a/helpers/lh_binary_net +++ b/helpers/lh_binary_net @@ -54,7 +54,7 @@ do mv binary "`basename ${LIVE_SERVER_PATH}`" cd .. - tar cfz binary-net.tar.gz "${OLDPWD}/`basename ${LIVE_SERVER_PATH}`" "${OLDPWD}/tftpboot" + tar cfz binary-net.tar.gz "`basename ${OLDPWD}`/`basename ${LIVE_SERVER_PATH}`" "`basename ${OLDPWD}`/tftpboot" mv binary-net.tar.gz "${OLDPWD}" cd "${OLDPWD}" diff --git a/helpers/lh_binary_rootfs b/helpers/lh_binary_rootfs index bdc8904b0..20ecdd3a9 100755 --- a/helpers/lh_binary_rootfs +++ b/helpers/lh_binary_rootfs @@ -103,11 +103,7 @@ case "${LIVE_FILESYSTEM}" in rm -rf binary/casper/filesystem.dir fi - cd chroot - find . | cpio -pumd ../binary/casper/filesystem.dir - cd "${OLDPWD}" - - rm -rf chroot/chroot + mv chroot/chroot binary/casper/filesystem.dir ;; squashfs) diff --git a/helpers/lh_binary_syslinux b/helpers/lh_binary_syslinux index 88b02b9d5..b3dc44626 100755 --- a/helpers/lh_binary_syslinux +++ b/helpers/lh_binary_syslinux @@ -47,8 +47,20 @@ then exit 0 fi -if [ "${LIVE_SYSLINUX}" = "enabled" ] +if [ "${LIVE_BOOTLOADER}" = "syslinux" ] then + # Check templates + if [ ! -d "${LIVE_TEMPLATES}" ] + then + if [ -d ../"${LIVE_TEMPLATES}" ] + then + LIVE_TEMPLATES="../${LIVE_TEMPLATES}" + else + Echo_error "user specified templates not accessible in ${LIVE_TEMPLATES}" + exit 1 + fi + fi + if [ ! -f chroot/usr/bin/syslinux ] then PACKAGES="${PACKAGES} syslinux" @@ -121,10 +133,10 @@ then if [ "${LIVE_BINARY_IMAGE}" = "iso" ] then DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`" - LINUX="label linux\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="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" else DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`" - LINUX="label linux\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="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" fi if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ] @@ -135,16 +147,16 @@ then then if [ "${LIVE_BINARY_IMAGE}" = "iso" ] then - LINUX="label linux-`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="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" else - LINUX="label linux-`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="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" fi else if [ "${LIVE_BINARY_IMAGE}" = "iso" ] then - LINUX="${LINUX}\nlabel linux-`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-//'`\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND" else - LINUX="${LINUX}\nlabel linux-`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" fi fi done @@ -178,7 +190,7 @@ then fi # Configure syslinux templates - sed -i -e "s#LIVE_KERNEL#${LINUX}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/isolinux/isolinux.cfg + sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/isolinux/isolinux.cfg sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/isolinux/isolinux.cfg sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" binary/isolinux/f1.txt sed -i -e "s/LIVE_VERSION/${VERSION}/" binary/isolinux/f10.txt @@ -195,12 +207,12 @@ then mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER} mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img - sed -i -e "s/linux.*-${FLAVOUR}/linux${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" binary/isolinux/isolinux.cfg + 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 done else mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img - sed -i -e "s/linux.*-${LIVE_KERNEL_FLAVOUR}/linux/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" binary/isolinux/isolinux.cfg + 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 fi ;; @@ -221,7 +233,7 @@ then fi # Configure syslinux templates - sed -i -e "s#LIVE_KERNEL#${LINUX}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" tftpboot/pxelinux.cfg/default + sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" tftpboot/pxelinux.cfg/default sed -i -e "s/LIVE_SERVER_ADDRESS/${LIVE_SERVER_ADDRESS}/" -e "s#LIVE_SERVER_PATH#${LIVE_SERVER_PATH}#" -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" tftpboot/pxelinux.cfg/default sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" tftpboot/pxelinux.cfg/f1.txt sed -i -e "s/LIVE_VERSION/${VERSION}/" tftpboot/pxelinux.cfg/f10.txt @@ -238,12 +250,12 @@ then mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER} mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img - sed -i -e "s/linux.*-${FLAVOUR}/linux${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" tftpboot/pxelinux.cfg/default + 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 done else mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img - sed -i -e "s/linux.*-${LIVE_KERNEL_FLAVOUR}/linux/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" tftpboot/pxelinux.cfg/default + 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 fi ;; @@ -263,7 +275,7 @@ then fi # Configure syslinux templates - sed -i -e "s#LIVE_KERNEL#${LINUX}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/syslinux.cfg + sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/syslinux.cfg sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/syslinux.cfg sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" binary/f1.txt sed -i -e "s/LIVE_VERSION/${VERSION}/" binary/f10.txt @@ -280,12 +292,12 @@ then mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER} mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img - sed -i -e "s/linux.*-${FLAVOUR}/linux${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" binary/syslinux.cfg + 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 done else mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img - sed -i -e "s/linux.*-${LIVE_KERNEL_FLAVOUR}/linux/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" binary/syslinux.cfg + 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 fi ;; esac diff --git a/helpers/lh_binary_usb b/helpers/lh_binary_usb index 241488e9e..9371f6731 100755 --- a/helpers/lh_binary_usb +++ b/helpers/lh_binary_usb @@ -60,7 +60,12 @@ do PACKAGES="${PACKAGES} parted" fi - if [ ! -f chroot/usr/bin/syslinux ] + if [ "${LIVE_BOOTLOADER}" = "grub" ] && [ ! -f chroot/usr/sbin/grub ] + then + PACKAGES="${PACKAGES} grub" + fi + + if [ "${LIVE_BOOTLOADER}" = "syslinux" ] && [ ! -f chroot/usr/bin/syslinux ] then PACKAGES="${PACKAGES} syslinux" fi @@ -104,7 +109,17 @@ do Chroot "parted -s ${FREELO} mkpartfs primary fat16 0.0 100%" || true Chroot "parted -s ${FREELO} set 1 boot on" || true Chroot "parted -s ${FREELO} set 1 lba off" || true - cat chroot/usr/lib/syslinux/mbr.bin > ${FREELO} + + case "${LIVE_BOOTLOADER}" in + grub) + Chroot "grub-install --no-floppy ${FREELO}" + ;; + + syslinux) + cat chroot/usr/lib/syslinux/mbr.bin > ${FREELO} + ;; + esac + ${LH_LOSETUP} -d ${FREELO} lh_losetup $FREELO binary.img 1 diff --git a/helpers/lh_bootstrap b/helpers/lh_bootstrap index bae8828e6..c3a8dd9c9 100755 --- a/helpers/lh_bootstrap +++ b/helpers/lh_bootstrap @@ -22,14 +22,13 @@ USAGE="${PROGRAM} [--force]" Arguments "${@}" -if [ "${FORCE}" = "true" ] -then - OPTIONS="${OPTIONS} --force" -fi +# Starting helper +Echo_debug "Init ${PROGRAM}" # Reading configuration files Read_conffile config/common Set_defaults # Bootstrapping system -lh_bootstrap_"${LH_BOOTSTRAP}" "${OPTIONS}" +lh_bootstrap_cdebootstrap "${@}" +lh_bootstrap_debootstrap "${@}" diff --git a/helpers/lh_bootstrap_cdebootstrap b/helpers/lh_bootstrap_cdebootstrap index b6ea6b910..2430cc8c5 100755 --- a/helpers/lh_bootstrap_cdebootstrap +++ b/helpers/lh_bootstrap_cdebootstrap @@ -25,11 +25,19 @@ Arguments "${@}" # Ensure that a system is built as root lh_testroot +# Starting helper +Echo_debug "Init ${PROGRAM}" + # Reading configuration files Read_conffile config/common Read_conffile config/bootstrap Set_defaults +if [ "${LH_BOOTSTRAP}" != "cdebootstrap" ] +then + exit 0 +fi + # Checking stage file Check_stagefile .stage/bootstrap @@ -63,11 +71,36 @@ else CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --flavour=minimal" fi +if [ "${DEBUG}" = "true" ] +then + CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --debug" +fi + +if [ "${QUIET}" = "true" ] +then + CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --quiet" +fi + +if [ "${VERBOSE}" = "true" ] +then + CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --verbose" +fi + if [ -x "/usr/bin/cdebootstrap" ] then if [ "${LH_CACHE}" = "enabled" ] then # Restore old cache + if [ -d cache/chroot_bootstrap ] + then + cp -a cache/chroot_bootstrap/* chroot + + # Creating stage file + Create_stagefile .stage/bootstrap + + exit 0 + fi + if [ -d cache/bootstrap ] then mkdir -p chroot/var/cache/bootstrap @@ -107,6 +140,17 @@ then rm -rf chroot/var/cache/bootstrap fi + # Saving new cache + if [ "${LH_CACHE}" = "enabled" ] + then + if [ -d cache/chroot_bootstrap ] + then + rm -rf cache/chroot_bootstrap + fi + + cp -a chroot cache/chroot_bootstrap + fi + # Creating stage file Create_stagefile .stage/bootstrap else diff --git a/helpers/lh_bootstrap_debootstrap b/helpers/lh_bootstrap_debootstrap index ab7ac6b99..87dd30ef6 100755 --- a/helpers/lh_bootstrap_debootstrap +++ b/helpers/lh_bootstrap_debootstrap @@ -25,11 +25,19 @@ Arguments "${@}" # Ensure that a system is built as root lh_testroot +# Starting helper +Echo_debug "Init ${PROGRAM}" + # Reading configuration files Read_conffile config/common Read_conffile config/bootstrap Set_defaults +if [ "${LH_BOOTSTRAP}" != "debootstrap" ] +then + exit 0 +fi + # Checking stage file Check_stagefile .stage/bootstrap @@ -56,11 +64,26 @@ then LIVE_DEBOOTSTRAP_SCRIPT="/usr/lib/debootstrap/scripts/${LIVE_BOOTSTRAP_CONFIG}" fi +if [ "${VERBOSE}" = "true" ] +then + DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --verbose" +fi + if [ -x "/usr/sbin/debootstrap" ] then if [ "${LH_CACHE}" = "enabled" ] then # Restore old cache + if [ -d cache/chroot_bootstrap ] + then + cp -a cache/chroot_bootstrap/* chroot + + # Creating stage file + Create_stagefile .stage/bootstrap + + exit 0 + fi + if [ -d cache/bootstrap ] then mkdir -p chroot/var/cache/apt/archives @@ -91,6 +114,17 @@ then # Removing bootstrap cache rm -rf chroot/var/cache/apt/archives/*.deb + # Saving new cache + if [ "${LH_CACHE}" = "enabled" ] + then + if [ -d cache/chroot_bootstrap ] + then + rm -rf cache/chroot_bootstrap + fi + + cp -a chroot cache/chroot_bootstrap + fi + # Creating stage file Create_stagefile .stage/bootstrap else diff --git a/helpers/lh_build b/helpers/lh_build index bb05c747c..077b05ab0 100755 --- a/helpers/lh_build +++ b/helpers/lh_build @@ -22,19 +22,14 @@ USAGE="${PROGRAM} [--force]" Arguments "${@}" -if [ "${FORCE}" = "true" ] -then - OPTIONS="${OPTIONS} --force" -fi - # Bootstrapping system -lh_bootstrap "${OPTIONS}" +lh_bootstrap "${@}" # Customizing chroot -lh_chroot "${OPTIONS}" +lh_chroot "${@}" # Building binary image -lh_binary "${OPTIONS}" +lh_binary "${@}" # Building source image -lh_source "${OPTIONS}" +lh_source "${@}" diff --git a/helpers/lh_chroot b/helpers/lh_chroot index 045b3ac9f..5e7ad8fd8 100755 --- a/helpers/lh_chroot +++ b/helpers/lh_chroot @@ -22,49 +22,44 @@ USAGE="${PROGRAM} [--force]" Arguments "${@}" -if [ "${FORCE}" = "true" ] -then - OPTIONS="${OPTIONS} --force" -fi - # Reading configuration files Read_conffile config/common Read_conffile config/chroot Set_defaults # Configuring chroot -lh_chroot_proc install "${OPTIONS}" -lh_chroot_sysfs install "${OPTIONS}" -lh_chroot_debianchroot install "${OPTIONS}" -lh_chroot_sysvrc install "${OPTIONS}" -lh_chroot_hosts install "${OPTIONS}" -lh_chroot_resolv install "${OPTIONS}" -lh_chroot_apt install "${OPTIONS}" -lh_chroot_sources install "${OPTIONS}" -lh_chroot_linuximage install "${OPTIONS}" +lh_chroot_proc install "${@}" +lh_chroot_sysfs install "${@}" +lh_chroot_debianchroot install "${@}" +lh_chroot_sysvrc install "${@}" +lh_chroot_hosts install "${@}" +lh_chroot_resolv install "${@}" +lh_chroot_apt install "${@}" +lh_chroot_sources install "${@}" +lh_chroot_linuximage install "${@}" # Customizing chroot -lh_chroot_tasks "${OPTIONS}" -lh_chroot_packageslists "${OPTIONS}" -lh_chroot_packages "${OPTIONS}" -lh_chroot_localpackages "${OPTIONS}" -lh_chroot_localpackageslists "${OPTIONS}" -lh_chroot_localization "${OPTIONS}" -lh_chroot_hacks "${OPTIONS}" -lh_chroot_localincludes "${OPTIONS}" -lh_chroot_sysvinit "${OPTIONS}" -lh_chroot_hooks "${OPTIONS}" -lh_chroot_localhooks "${OPTIONS}" -lh_chroot_symlinks "${OPTIONS}" -lh_chroot_interactive "${OPTIONS}" +lh_chroot_tasks "${@}" +lh_chroot_packageslists "${@}" +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_interactive "${@}" # Deconfiguring chroot -lh_chroot_linuximage remove "${OPTIONS}" -lh_chroot_sources remove "${OPTIONS}" -lh_chroot_apt remove "${OPTIONS}" -lh_chroot_resolv remove "${OPTIONS}" -lh_chroot_hosts remove "${OPTIONS}" -lh_chroot_sysvrc remove "${OPTIONS}" -lh_chroot_debianchroot remove "${OPTIONS}" -lh_chroot_sysfs remove "${OPTIONS}" -lh_chroot_proc remove "${OPTIONS}" +lh_chroot_linuximage remove "${@}" +lh_chroot_sources remove "${@}" +lh_chroot_apt remove "${@}" +lh_chroot_resolv remove "${@}" +lh_chroot_hosts remove "${@}" +lh_chroot_sysvrc remove "${@}" +lh_chroot_debianchroot remove "${@}" +lh_chroot_sysfs remove "${@}" +lh_chroot_proc remove "${@}" diff --git a/helpers/lh_chroot_apt b/helpers/lh_chroot_apt index c80f22ff9..e234c39a0 100755 --- a/helpers/lh_chroot_apt +++ b/helpers/lh_chroot_apt @@ -133,21 +133,21 @@ case "${1}" in then case "${LH_APT}" in apt|apt-get) - echo "APT::Get::AllowUnauthenticated \"0\";" >> chroot/etc/apt/apt.conf + echo "APT::Get::AllowUnauthenticated \"true\";" >> chroot/etc/apt/apt.conf ;; aptitude) - echo "APT::Get::AllowUnauthenticated \"0\";" > chroot/etc/apt/apt.conf.d/secure + echo "APT::Get::AllowUnauthenticated \"true\";" > chroot/etc/apt/apt.conf.d/secure ;; esac else case "${LH_APT}" in apt|apt-get) - echo "APT::Get::AllowUnauthenticated \"1\";" >> chroot/etc/apt/apt.conf + echo "APT::Get::AllowUnauthenticated \"false\";" >> chroot/etc/apt/apt.conf ;; aptitude) - echo "APT::Get::AllowUnauthenticated \"1\";" > chroot/etc/apt/apt.conf.d/secure + echo "APT::Get::AllowUnauthenticated \"false\";" > chroot/etc/apt/apt.conf.d/secure ;; esac fi diff --git a/helpers/lh_chroot_localhooks b/helpers/lh_chroot_localhooks index ddc3af408..94d9684c3 100755 --- a/helpers/lh_chroot_localhooks +++ b/helpers/lh_chroot_localhooks @@ -57,7 +57,7 @@ then Chroot "/root/`basename ${HOOK}`" # Removing hook - rm -f chroot/"`basename ${HOOK}`" + rm -f chroot/root/"`basename ${HOOK}`" done # Creating stage file diff --git a/helpers/lh_chroot_localpackageslists b/helpers/lh_chroot_localpackageslists index e5cc1bcfb..198982654 100755 --- a/helpers/lh_chroot_localpackageslists +++ b/helpers/lh_chroot_localpackageslists @@ -1,6 +1,6 @@ #!/bin/sh -# lh_chroot_localpackageslists(1) - install local packages into chroot +# lh_chroot_localpackageslists(1) - install local packages lists into chroot # Copyright (C) 2006-2007 Daniel Baumann # # live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING. diff --git a/helpers/lh_chroot_sysfs b/helpers/lh_chroot_sysfs index 3d51eef05..d350541df 100755 --- a/helpers/lh_chroot_sysfs +++ b/helpers/lh_chroot_sysfs @@ -48,7 +48,7 @@ case "${1}" in fi # Mounting /sys - mount sys-live -t sysfs chroot/sys + mount sysfs-live -t sysfs chroot/sys # Creating stage file Create_stagefile .stage/chroot_sysfs diff --git a/helpers/lh_clean b/helpers/lh_clean index 1aad87d66..d884ebe9d 100755 --- a/helpers/lh_clean +++ b/helpers/lh_clean @@ -22,9 +22,6 @@ USAGE="${PROGRAM} [all|cache|chroot|binary|lock|purge|stage|source]" Arguments "${@}" -# Ensure that a system is built as root -lh_testroot - # Reading configuration files Read_conffile config/common Set_defaults @@ -36,6 +33,12 @@ case "${1}" in "${0}" lock "${0}" stage "${0}" source + + if [ -d chroot ] + then + mkdir -p .stage + touch .stage/bootstrap + fi ;; cache) @@ -52,6 +55,13 @@ case "${1}" in rm -rf chroot + if [ "${PURGE}" != "true" ] && [ -d cache/chroot_bootstrap ] + then + cp -a cache/chroot_bootstrap chroot + mkdir -p .stage + touch .stage/bootstrap + fi + rm -f .stage/chroot* ;; @@ -72,7 +82,7 @@ case "${1}" in ;; purge) - "${0}" all + PURGE="true" "${0}" all "${0}" cache ;; diff --git a/helpers/lh_config b/helpers/lh_config index b6eccd7eb..398b10254 100755 --- a/helpers/lh_config +++ b/helpers/lh_config @@ -167,7 +167,7 @@ LIVE_DISTRIBUTION_CONFIG="${LIVE_DISTRIBUTION_CONFIG}" # \$LIVE_BOOTSTRAP_FLAVOUR: select the flavour to use # (Default: ${LIVE_BOOTSTRAP_FLAVOUR}) -LIVE_BOOTSTRAP_FLAVOUR="${LIVE_BOOTSTRA_PFLAVOUR}" +LIVE_BOOTSTRAP_FLAVOUR="${LIVE_BOOTSTRAP_FLAVOUR}" # \$LIVE_MIRROR_BUILD: set the mirror to fetch packages from # (Default: ${LIVE_MIRROR_BUILD}) @@ -234,9 +234,13 @@ LIVE_SERVER_PATH="${LIVE_SERVER_PATH}" # (Default: ${LH_SOURCE}) LIVE_SOURCE="${LIVE_SOURCE}" -# \$LIVE_SYSLINUX: set syslinux option -# (Default: ${LIVE_SYSLINUX}) -LIVE_SYSLINUX="${LIVE_SYSLINUX}" +# \$LIVE_BOOTLOADER: set bootloader +# (Default: ${LIVE_BOOTLOADER}) +LIVE_BOOTLOADER="${LIVE_BOOTLOADER}" + +# \$LIVE_GRUB_SPLASH: set custom grub splash +# (Default: empty) +LIVE_GRUB_SPLASH="${LIVE_GRUB_SPLASH}" # \$LIVE_SYSLINUX_SPLASH: set custom syslinux splash # (Default: empty) diff --git a/helpers/lh_source b/helpers/lh_source index 526646f49..6e31cd991 100755 --- a/helpers/lh_source +++ b/helpers/lh_source @@ -22,33 +22,29 @@ USAGE="${PROGRAM} [--force]" Arguments "${@}" -if [ "${FORCE}" = "true" ] -then - OPTIONS="${OPTIONS} --force" -fi - # Reading configuration files Read_conffile config/common Read_conffile config/image Set_defaults # Enabling network in chroot -lh_chroot_hosts install "${OPTIONS}" -lh_chroot_resolv install "${OPTIONS}" -lh_chroot_sources install "${OPTIONS}" +lh_chroot_hosts install "${@}" +lh_chroot_resolv install "${@}" +lh_chroot_sources install "${@}" # Preparing images -lh_source_config "${OPTIONS}" -lh_source_download "${OPTIONS}" -lh_source_md5sum "${OPTIONS}" +lh_source_config "${@}" +lh_source_download "${@}" +lh_source_md5sum "${@}" # Building images -lh_source_generic "${OPTIONS}" -lh_source_iso "${OPTIONS}" -lh_source_net "${OPTIONS}" -lh_source_usb "${OPTIONS}" +lh_source_generic "${@}" +lh_source_hdd "${@}" +lh_source_iso "${@}" +lh_source_net "${@}" +lh_source_usb "${@}" # Deconfiguring chroot rm -f .stage/chroot_sources -lh_chroot_resolv remove "${OPTIONS}" -lh_chroot_hosts remove "${OPTIONS}" +lh_chroot_resolv remove "${@}" +lh_chroot_hosts remove "${@}" diff --git a/helpers/lh_testroot b/helpers/lh_testroot index bda3a4625..f30c65513 100755 --- a/helpers/lh_testroot +++ b/helpers/lh_testroot @@ -27,6 +27,6 @@ set -e # Checking user account if [ "`id -u`" -ne "0" ] then - echo "E: need root privileges" + Echo_error "need root privileges" exit 1 fi diff --git a/helpers/make-live b/helpers/make-live index 741de9754..bab264b46 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] [--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] [--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 PACKAGES] [-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] [--memtest86 enabled|disabled] [--iso-volume STRING] [--server-address HOSTNAME|IP] [--server-path DIRECTORY] [--source enabled|disabled] [--syslinux enabled|disabled] [--syslinux-splash FILE] [-b|--binary-image hdd|iso|usb|net] [-s|--source-image generic|hdd|iso|usb|net] [--includes DIRECTORY] [--templates DIRECTORY] [--force]" +USAGE="${PROGRAM} [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] [--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 PACKAGES] [-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] [--memtest86 enabled|disabled] [--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] [--debug] [--force] [--quiet] [--verbose]" 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 apt:,apt-ftpproxy:,apt-httpproxy:,apt-generic:,apt-pdiffs:,apt-recommends:,apt-secure:,bootstrap:,cache:,debconf-frontend:,debconf-priority:,genisoimage:,losetup:,root:,architecture:,distribution:,distribution-config:,flavour:,mirror-local:,mirror-local-security:,mirror-generic:,mirror-generic-security:,sections:,interactive:,kernel:,kernel-packages:,language:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,bootappend:,encryption:,username:,hostname:,filesystem:,memtest86:,iso-volume:,server-address:,server-path:,source:,syslinux:,syslinux-splash:,binary-image:,binary-source:,includes:,templates:,help,usage,version,force --name=${PROGRAM} --options r:a:d:f:m:k:l:p:e:b:s:huv --shell sh -- "${@}"`" + ARGUMENTS="`getopt --longoptions apt:,apt-ftpproxy:,apt-httpproxy:,apt-generic:,apt-pdiffs:,apt-recommends:,apt-secure:,bootstrap:,cache:,debconf-frontend:,debconf-priority:,genisoimage:,losetup:,root:,architecture:,distribution:,distribution-config:,flavour:,mirror-local:,mirror-local-security:,mirror-generic:,mirror-generic-security:,sections:,interactive:,kernel:,kernel-packages:,language:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,bootappend:,encryption:,username:,hostname:,filesystem:,memtest86:,iso-volume:,server-address:,server-path:,source:,bootloader:,grub-splash:,syslinux-splash:,binary-image:,binary-source:,includes:,templates:,help,usage,version,force,debug,quiet,verbose --name=${PROGRAM} --options r:a:d:f:m:k:l:p:e:b:s:huv --shell sh -- "${@}"`" if [ "${?}" != "0" ] then @@ -232,7 +232,11 @@ Local_arguments () LIVE_SOURCE="${2}"; shift 2 ;; - --syslinux) + --bootloader) + LIVE_BOOTLOADER="${2}"; shift 2 + ;; + + --grub-splash) LIVE_SYSLINUX="${2}"; shift 2 ;; @@ -269,10 +273,22 @@ Local_arguments () Version; shift ;; + --debug) + DEBUG="true"; shift + ;; + --force) FORCE="true"; shift ;; + --quiet) + QUIET="true"; shift + ;; + + --verbose) + VERBOSE="true"; shift + ;; + --) shift; break ;; @@ -304,17 +320,29 @@ Main () Local_arguments "${@}" - # Initializing - lh_testroot - # Configuring (this is really shit!) - 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_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_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_MEMTEST86="${LIVE_MEMTEST86}" LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}" LIVE_SERVER_ADDRESS="${LIVE_SERVER_ADDRESS}" LIVE_SERVER_PATH="${LIVE_SERVER_PATH}" LIVE_SOURCE="${LIVE_SOURCE}" LIVE_SYSLINUX="${LIVE_SYSLINUX}" 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_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_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_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_MEMTEST86="${LIVE_MEMTEST86}" 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 + + if [ "${DEBUG}" = "true" ] + then + OPTIONS="${OPTIONS} --debug" + fi if [ "${FORCE}" = "true" ] then OPTIONS="${OPTIONS} --force" fi + if [ "${QUIET}" = "true" ] + then + OPTIONS="${OPTIONS} --quiet" + fi + + if [ "${VERBOSE}" = "true" ] + then + OPTIONS="${OPTIONS} --verbose" + fi + # Building if [ -z "${CONFIG}" ] then -- cgit v1.2.3