diff options
Diffstat (limited to 'helpers')
44 files changed, 1098 insertions, 1014 deletions
diff --git a/helpers/lh_binary b/helpers/lh_binary index c178309f2..4a1577dac 100755 --- a/helpers/lh_binary +++ b/helpers/lh_binary @@ -35,7 +35,7 @@ Set_defaults # Preparing root filesystem lh_binary_chroot ${*} -if [ "${LIVE_CHROOT_BUILD}" = "enabled" ] +if [ "${LH_CHROOT_BUILD}" = "enabled" ] then # Configuring chroot lh_chroot_proc install ${*} @@ -70,7 +70,7 @@ lh_binary_net ${*} lh_binary_tar ${*} lh_binary_usb-hdd ${*} -if [ "${LIVE_CHROOT_BUILD}" = "enabled" ] +if [ "${LH_CHROOT_BUILD}" = "enabled" ] then # Deconfiguring chroot rm -f .stage/chroot_sources diff --git a/helpers/lh_binary_chroot b/helpers/lh_binary_chroot index 8bf612509..150d6b1ef 100755 --- a/helpers/lh_binary_chroot +++ b/helpers/lh_binary_chroot @@ -57,7 +57,12 @@ then ${LH_ROOT_COMMAND} umount chroot/sys fi -if [ "${LIVE_CHROOT_BUILD}" = "disabled" ] +if [ "${LH_CHROOT_BUILD}" = "disabled" ] +then + exit 0 +fi + +if [ "${LH_CACHE}" = "enabled" ] && ls cache/stages_rootfs/filesystem* > /dev/null 2>&1 then exit 0 fi diff --git a/helpers/lh_binary_debian-installer b/helpers/lh_binary_debian-installer index e4466dfb7..6ae67cd2a 100755 --- a/helpers/lh_binary_debian-installer +++ b/helpers/lh_binary_debian-installer @@ -33,7 +33,7 @@ Read_conffile config/source Set_defaults # Setting remote d-i directories -case "${LIVE_DEBIAN_INSTALLER}" in +case "${LH_DEBIAN_INSTALLER}" in enabled|cdrom|live) DI="cdrom" DI_GTK="${DI}/gtk" @@ -51,7 +51,7 @@ case "${LIVE_DEBIAN_INSTALLER}" in ;; *) - Echo_error "debian-installer flavor ${LIVE_DEBIAN_INSTALLER} not supported." + Echo_error "debian-installer flavor ${LH_DEBIAN_INSTALLER} not supported." exit 1 ;; esac @@ -71,7 +71,7 @@ Check_lockfile .lock Create_lockfile .lock # Setting destination directory -case "${LIVE_BINARY_IMAGES}" in +case "${LH_BINARY_IMAGES}" in iso) DESTDIR="binary/install" ;; @@ -88,7 +88,7 @@ case "${LIVE_BINARY_IMAGES}" in DESTDIR="binary/install" # Workaround for syslinux (<< 3.36) which doesn't support long file/path names - if [ "${LIVE_DISTRIBUTION}" = "etch" ] && [ "${LIVE_BOOTLOADER}" = "syslinux" ] + if [ "${LH_DISTRIBUTION}" = "etch" ] && [ "${LH_BOOTLOADER}" = "syslinux" ] then DESTDIR="binary" fi @@ -106,9 +106,9 @@ INITRD_GI="gtk/initrd.gz" DESTDIR_GI="${DESTDIR}/gtk" # Workaround for syslinux (<< 3.36) which doesn't support long file/path names -if [ "${LIVE_DISTRIBUTION}" = "etch" ] +if [ "${LH_DISTRIBUTION}" = "etch" ] then - if [ "${LIVE_BINARY_IMAGES}" = "tar" ] || [ "${LIVE_BINARY_IMAGES}" = "usb-hdd" ] + if [ "${LH_BINARY_IMAGES}" = "tar" ] || [ "${LH_BINARY_IMAGES}" = "usb-hdd" ] then VMLINUZ_DI="vmlinuz.di" INITRD_DI="initrddi.gz" @@ -121,7 +121,7 @@ then fi # Debian Installer daily builds -case "${LIVE_ARCHITECTURE}" in +case "${LH_ARCHITECTURE}" in alpha) URL="http://people.debian.org/~vorlon/d-i/alpha/daily/" ;; @@ -179,37 +179,37 @@ esac # Downloading debian-installer mkdir -p "${DESTDIR_DI}" -if [ "${LIVE_DISTRIBUTION}" = "sid" ] +if [ "${LH_DISTRIBUTION}" = "sid" ] then wget --no-clobber -O "${DESTDIR}"/"${VMLINUZ_DI}" ${URL}/${DI}/${DI_KERNEL} wget --no-clobber -O "${DESTDIR}"/"${INITRD_DI}" ${URL}/${DI}/initrd.gz else - wget --no-clobber -O "${DESTDIR}"/"${VMLINUZ_DI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/"${DI_KERNEL}" - wget --no-clobber -O "${DESTDIR}"/"${INITRD_DI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/initrd.gz + wget --no-clobber -O "${DESTDIR}"/"${VMLINUZ_DI}" "${LH_MIRROR_BOOTSTRAP}"/dists/"${LH_DISTRIBUTION}"/main/installer-"${LH_ARCHITECTURE}"/current/images/"${DI}"/"${DI_KERNEL}" + wget --no-clobber -O "${DESTDIR}"/"${INITRD_DI}" "${LH_MIRROR_BOOTSTRAP}"/dists/"${LH_DISTRIBUTION}"/main/installer-"${LH_ARCHITECTURE}"/current/images/"${DI}"/initrd.gz fi # Downloading graphical-installer -if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ] +if [ "${LH_ARCHITECTURE}" = "amd64" ] || [ "${LH_ARCHITECTURE}" = "i386" ] || [ "${LH_ARCHITECTURE}" = "powerpc" ] then mkdir -p "${DESTDIR_GI}" - if [ "${LIVE_DISTRIBUTION}" = "sid" ] + if [ "${LH_DISTRIBUTION}" = "sid" ] then wget --no-clobber -O "${DESTDIR}"/"${VMLINUZ_GI}" ${URL}/${DI_GTK}/${DI_KERNEL} wget --no-clobber -O "${DESTDIR}"/"${INITRD_GI}" ${URL}/${DI_GTK}/initrd.gz else - wget --no-clobber -O "${DESTDIR}"/"${VMLINUZ_GI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI_GTK}"/"${DI_KERNEL}" - wget --no-clobber -O "${DESTDIR}"/"${INITRD_GI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI_GTK}"/initrd.gz + wget --no-clobber -O "${DESTDIR}"/"${VMLINUZ_GI}" "${LH_MIRROR_BOOTSTRAP}"/dists/"${LH_DISTRIBUTION}"/main/installer-"${LH_ARCHITECTURE}"/current/images/"${DI_GTK}"/"${DI_KERNEL}" + wget --no-clobber -O "${DESTDIR}"/"${INITRD_GI}" "${LH_MIRROR_BOOTSTRAP}"/dists/"${LH_DISTRIBUTION}"/main/installer-"${LH_ARCHITECTURE}"/current/images/"${DI_GTK}"/initrd.gz fi fi -if [ "${LIVE_DEBIAN_INSTALLER}" != "netboot" ]; then +if [ "${LH_DEBIAN_INSTALLER}" != "netboot" ]; then # Downloading additional packages mkdir -p chroot/binary.deb/archives/partial mv chroot/var/lib/dpkg/status chroot/var/lib/dpkg/status.tmp touch chroot/var/lib/dpkg/status - case "${LIVE_ARCHITECTURE}" in + case "${LH_ARCHITECTURE}" in amd64) DI_PACKAGES="linux-image-2.6-amd64 lilo grub" ;; @@ -261,7 +261,7 @@ then fi # Including local debs -if ls ../config/binary_local-debs/* &> /dev/null +if ls ../config/binary_local-debs/* > /dev/null 2>&1 then for FILE in ../config/binary_local-debs/*.deb do @@ -291,21 +291,21 @@ then fi # Generating deb indices -mkdir -p binary/dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE} +mkdir -p binary/dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE} cd binary -apt-ftparchive packages pool/main > dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages -gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages > dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages.gz +apt-ftparchive packages pool/main > dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Packages +gzip -9 -c dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Packages > dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Packages.gz cd "${OLDPWD}" # Fetching release -wget "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/binary-"${LIVE_ARCHITECTURE}"/Release -O binary/dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Release +wget "${LH_MIRROR_BOOTSTRAP}"/dists/"${LH_DISTRIBUTION}"/main/binary-"${LH_ARCHITECTURE}"/Release -O binary/dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Release mkdir binary.udeb cd binary.udeb # Downloading udeb indices -wget "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"/Packages.gz +wget "${LH_MIRROR_BOOTSTRAP}"/dists/"${LH_DISTRIBUTION}"/main/debian-installer/binary-"${LH_ARCHITECTURE}"/Packages.gz gunzip -c Packages.gz > Packages # Sorting udebs @@ -320,7 +320,7 @@ do cp ../cache/packages_debian-installer.udeb/"`basename ${UDEB}`" ./ else # Downloading udebs - wget "${LIVE_MIRROR_BOOTSTRAP}"/${UDEB} + wget "${LH_MIRROR_BOOTSTRAP}"/${UDEB} fi done @@ -330,7 +330,7 @@ mkdir -p ../cache/packages_debian-installer.udeb cp *.udeb ../cache/packages_debian-installer.udeb # Including local udebs -if ls ../config/binary_local-udebs/* &> /dev/null +if ls ../config/binary_local-udebs/* > /dev/null 2>&1 then for FILE in ../config/binary_local-udebs/*.udeb do @@ -363,9 +363,9 @@ then fi # Excluding udebs -grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/udeb_exclude > exclude -grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/exclude-udebs >> exclude -grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/exclude-udebs-${LIVE_ARCHITECTURE} >> exclude +grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LH_DISTRIBUTION}"/udeb_exclude > exclude +grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LH_DISTRIBUTION}"/exclude-udebs >> exclude +grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LH_DISTRIBUTION}"/exclude-udebs-${LH_ARCHITECTURE} >> exclude for EXCLUDE in `cat exclude` do @@ -383,9 +383,9 @@ do done # Creating udeb indices -mkdir -p dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}" -apt-ftparchive packages pool/main > dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"/Packages -gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/debian-installer/binary-${LIVE_ARCHITECTURE}/Packages > dists/${LIVE_DISTRIBUTION}/main/debian-installer/binary-${LIVE_ARCHITECTURE}/Packages.gz +mkdir -p dists/"${LH_DISTRIBUTION}"/main/debian-installer/binary-"${LH_ARCHITECTURE}" +apt-ftparchive packages pool/main > dists/"${LH_DISTRIBUTION}"/main/debian-installer/binary-"${LH_ARCHITECTURE}"/Packages +gzip -9 -c dists/${LH_DISTRIBUTION}/main/debian-installer/binary-${LH_ARCHITECTURE}/Packages > dists/${LH_DISTRIBUTION}/main/debian-installer/binary-${LH_ARCHITECTURE}/Packages.gz rm -f Packages* exclude find . | cpio -dmpu "${OLDPWD}"/binary @@ -398,19 +398,19 @@ rm -rf binary.deb apt-ftparchive \ -o APT::FTPArchive::Release::Origin="Debian" \ -o APT::FTPArchive::Release::Label="Debian" \ - -o APT::FTPArchive::Release::Suite="${LIVE_DISTRIBUTION}" \ + -o APT::FTPArchive::Release::Suite="${LH_DISTRIBUTION}" \ -o APT::FTPArchive::Release::Version="4.0" \ - -o APT::FTPArchive::Release::Codename="${LIVE_DISTRIBUTION}" \ + -o APT::FTPArchive::Release::Codename="${LH_DISTRIBUTION}" \ -o APT::FTPArchive::Release::Date="`date -R`" \ - -o APT::FTPArchive::Release::Architectures="${LIVE_ARCHITECTURE}" \ + -o APT::FTPArchive::Release::Architectures="${LH_ARCHITECTURE}" \ -o APT::FTPArchive::Release::Components="main" \ -o APT::FTPArchive::Release::Description="Last updated: `date -R`" \ -release binary/dists/${LIVE_DISTRIBUTION} > binary/dists/${LIVE_DISTRIBUTION}/Release +release binary/dists/${LH_DISTRIBUTION} > binary/dists/${LH_DISTRIBUTION}/Release # Creating dist symlinks for DISTRIBUTION in frozen stable testing unstable do - ln -s ${LIVE_DISTRIBUTION} binary/dists/${DISTRIBUTION} + ln -s ${LH_DISTRIBUTION} binary/dists/${DISTRIBUTION} done ln -s . binary/debian diff --git a/helpers/lh_binary_disk b/helpers/lh_binary_disk index 3bc123046..5543949d2 100755 --- a/helpers/lh_binary_disk +++ b/helpers/lh_binary_disk @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_BINARY_IMAGES}" != "iso" ] +if [ "${LH_BINARY_IMAGES}" != "iso" ] then exit 0 fi @@ -53,10 +53,10 @@ Create_lockfile .lock mkdir -p binary/.disk -ARCHITECTURE="`echo ${LIVE_ARCHITECTURE} | sed -e 's# #/#g'`" -DISTRIBUTION="`echo ${LIVE_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]'`" -DISTRIBUTION="${DISTRIBUTION}`echo ${LIVE_DISTRIBUTION} | cut -b 2-`" -eval VERSION="$`echo VERSION_${LIVE_DISTRIBUTION}`" +ARCHITECTURE="`echo ${LH_ARCHITECTURE} | sed -e 's# #/#g'`" +DISTRIBUTION="`echo ${LH_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]'`" +DISTRIBUTION="${DISTRIBUTION}`echo ${LH_DISTRIBUTION} | cut -b 2-`" +eval VERSION="$`echo VERSION_${LH_DISTRIBUTION}`" case "${LH_MODE}" in debian) @@ -81,7 +81,7 @@ case "${LH_MODE}" in ;; esac -if [ "${LIVE_DEBIAN_INSTALLER}" != "disabled" ] +if [ "${LH_DEBIAN_INSTALLER}" != "disabled" ] then echo "main" > binary/.disk/base_components diff --git a/helpers/lh_binary_encryption b/helpers/lh_binary_encryption index 06ad2c4cf..0fb9b7efc 100755 --- a/helpers/lh_binary_encryption +++ b/helpers/lh_binary_encryption @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ -z "${LIVE_ENCRYPTION}" ] +if [ -z "${LH_ENCRYPTION}" ] then exit 0 fi @@ -62,7 +62,7 @@ case "${LH_INITRAMFS}" in ;; esac -case "${LIVE_CHROOT_FILESYSTEM}" in +case "${LH_CHROOT_FILESYSTEM}" in ext2) ROOTFS="ext2" ;; @@ -86,17 +86,17 @@ Restore_cache cache/packages_binary # Installing depends Install_package -case "${LIVE_CHROOT_BUILD}" in +case "${LH_CHROOT_BUILD}" in enabled) # Moving image - mv binary/${INITFS}/filesystem.${LIVE_CHROOT_FILESYSTEM} chroot + mv binary/${INITFS}/filesystem.${LH_CHROOT_FILESYSTEM} chroot -echo "Encrypting binary/${INITFS}/filesystem.${ROOTFS} with ${LIVE_ENCRYPTION}..." +echo "Encrypting binary/${INITFS}/filesystem.${ROOTFS} with ${LH_ENCRYPTION}..." cat >> chroot/encrypt.sh << EOF while true do - cat filesystem.${ROOTFS} | aespipe -e ${LIVE_ENCRYPTION} -T > filesystem.${ROOTFS}.tmp && mv filesystem.${ROOTFS}.tmp filesystem.${ROOTFS} && break + cat filesystem.${ROOTFS} | aespipe -e ${LH_ENCRYPTION} -T > filesystem.${ROOTFS}.tmp && mv filesystem.${ROOTFS}.tmp filesystem.${ROOTFS} && break echo -n "Something went wrong... Retry? [YES/no] " @@ -113,14 +113,14 @@ EOF Chroot "sh encrypt.sh" # Move image - mv chroot/filesystem.${LIVE_CHROOT_FILESYSTEM} binary/${INITFS} + mv chroot/filesystem.${LH_CHROOT_FILESYSTEM} binary/${INITFS} rm -f chroot/encrypt.sh ;; disabled) while true do - cat binary/${INITFS}/filesystem.${ROOTFS} | aespipe -e ${LIVE_ENCRYPTION} -T > binary/${INITFS}/filesystem.${ROOTFS}.tmp && mv binary/${INITFS}/filesystem.${ROOTFS}.tmp binary/${INITFS}/filesystem.${ROOTFS} && break + cat binary/${INITFS}/filesystem.${ROOTFS} | aespipe -e ${LH_ENCRYPTION} -T > binary/${INITFS}/filesystem.${ROOTFS}.tmp && mv binary/${INITFS}/filesystem.${ROOTFS}.tmp binary/${INITFS}/filesystem.${ROOTFS} && break echo -n "Something went wrong... Retry? [YES/no] " diff --git a/helpers/lh_binary_grub b/helpers/lh_binary_grub index 1bcf4abac..ccb7153b1 100755 --- a/helpers/lh_binary_grub +++ b/helpers/lh_binary_grub @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_BOOTLOADER}" != "grub" ] +if [ "${LH_BOOTLOADER}" != "grub" ] then exit 0 fi @@ -75,7 +75,7 @@ Grub_live_entry () APPEND="${4}" LINUX_LIVE="${LINUX_LIVE}\ntitle\t\tDebian GNU/Linux - ${LABEL}" - LINUX_LIVE="${LINUX_LIVE}\nkernel\t\t/${KERNEL} boot=${INITFS} LIVE_BOOTAPPEND ${APPEND}" + LINUX_LIVE="${LINUX_LIVE}\nkernel\t\t/${KERNEL} boot=${INITFS} LH_BOOTAPPEND ${APPEND}" LINUX_LIVE="${LINUX_LIVE}\ninitrd\t\t/${INITRD}" } @@ -86,7 +86,7 @@ Grub_install_entry () INITRD="${3}" APPEND="${4}" - if [ "${LIVE_DISTRIBUTION}" != "etch" ] && [ "${LABEL}" != "rescue" ] && [ "${LABEL}" != "rescuegui" ] + if [ "${LH_DISTRIBUTION}" != "etch" ] && [ "${LABEL}" != "rescue" ] && [ "${LABEL}" != "rescuegui" ] then APPEND="${APPEND} quiet" fi @@ -107,7 +107,7 @@ case "${LH_INITRAMFS}" in esac # Setting destination directory -case "${LIVE_BINARY_IMAGES}" in +case "${LH_BINARY_IMAGES}" in iso|tar) case "${LH_INITRAMFS}" in casper) @@ -134,49 +134,49 @@ Check_multiarchitecture mkdir -p "${DESTDIR_LIVE}" # Setting boot parameters -if [ -n "${LIVE_ENCRYPTION}" ] +if [ -n "${LH_ENCRYPTION}" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} encryption=${LIVE_ENCRYPTION}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} encryption=${LH_ENCRYPTION}" fi -if [ -n "${LIVE_USERNAME}" ] +if [ -n "${LH_USERNAME}" ] then case "${LH_INITRAMFS}" in casper) - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} username=${LIVE_USERNAME}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} username=${LH_USERNAME}" ;; live-initramfs) - if [ "${LIVE_USERNAME}" != "user" ] + if [ "${LH_USERNAME}" != "user" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} username=${LIVE_USERNAME}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} username=${LH_USERNAME}" fi ;; esac fi -if [ -n "${LIVE_HOSTNAME}" ] +if [ -n "${LH_HOSTNAME}" ] then case "${LH_INITRAMFS}" in casper) - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} hostname=${LIVE_HOSTNAME}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} hostname=${LH_HOSTNAME}" ;; live-initramfs) - if [ "${LIVE_HOSTNAME}" != "debian" ] + if [ "${LH_HOSTNAME}" != "debian" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} hostname=${LIVE_HOSTNAME}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} hostname=${LH_HOSTNAME}" fi ;; esac fi -if [ "${LIVE_UNION_FILESYSTEM}" != "unionfs" ] +if [ "${LH_UNION_FILESYSTEM}" != "unionfs" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} union=${LIVE_UNION_FILESYSTEM}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} union=${LH_UNION_FILESYSTEM}" fi -LIVE_BOOTAPPEND="`echo ${LIVE_BOOTAPPEND} | sed -e 's/ //'`" +LH_BOOTAPPEND="`echo ${LH_BOOTAPPEND} | sed -e 's/ //'`" # Parameters are listed at: linux/Documentation/kernel-parameters.txt FAILSAFE="noapic noapm nodma nomce nolapic nosmp vga=normal" @@ -184,7 +184,7 @@ FAILSAFE="noapic noapm nodma nomce nolapic nosmp vga=normal" # Assembling kernel configuration # Default entries -DEFAULT_FLAVOUR="`echo ${LIVE_LINUX_FLAVOURS} | awk '{ print $1 }'`" +DEFAULT_FLAVOUR="`echo ${LH_LINUX_FLAVOURS} | awk '{ print $1 }'`" DEFAULT_KERNEL="`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`" DEFAULT_INITRD="initrd.img-`echo ${DEFAULT_KERNEL} | sed -e 's/vmlinuz-//'`" @@ -199,10 +199,10 @@ do Grub_live_entry "live, kernel ${VERSION} (fail-safe mode)" "`basename ${DESTDIR_LIVE}`/`basename ${KERNEL}`" "`basename ${DESTDIR_LIVE}`/initrd.img-${VERSION}" "${FAILSAFE}" done -LINUX_LIVE="`echo ${LINUX_LIVE} | sed -e 's/binary//g' -e 's#//#/#g'`" +LINUX_LIVE="`/bin/echo ${LINUX_LIVE} | sed -e 's/binary//g' -e 's#//#/#g'`" # Assembling debian-installer configuration -if [ "${LIVE_DEBIAN_INSTALLER}" != "disabled" ] +if [ "${LH_DEBIAN_INSTALLER}" != "disabled" ] then LINUX_LIVE="title\t\tLive:\nroot\n\n${LINUX_LIVE}" LINUX_INSTALL="title\t\tInstaller:\nroot" @@ -225,21 +225,21 @@ then Grub_install_entry "autogui" "${VMLINUZ_GI}" "${INITRD_GI}" "auto=true priority=critical ${APPEND_GI}" fi -LINUX_INSTALL="`echo ${LINUX_INSTALL} | sed -e 's/binary//g' -e 's#//#/#g'`" +LINUX_INSTALL="`/bin/echo ${LINUX_INSTALL} | sed -e 's/binary//g' -e 's#//#/#g'`" # Assembling memtest configuration if [ -f "${DESTDIR_LIVE}"/memtest ] then MEMTEST="title\t\tOther:\nroot" - MEMTEST="${MEMTEST}\n\ntitle\t\t${LIVE_MEMTEST}\nkernel\t\t/`basename ${DESTDIR_LIVE}`/memtest" - MEMTEST="`echo ${MEMTEST} | sed -e 's#//#/#g'`" + MEMTEST="${MEMTEST}\n\ntitle\t\t${LH_MEMTEST}\nkernel\t\t/`basename ${DESTDIR_LIVE}`/memtest" + MEMTEST="`/bin/echo ${MEMTEST} | sed -e 's#//#/#g'`" fi # Copying templates mkdir -p binary/boot/grub cp -r "${TEMPLATES}"/* binary/boot/grub -case ${LIVE_BINARY_IMAGES} in +case ${LH_BINARY_IMAGES} in iso) FILES="chroot/usr/lib/grub/*/stage2_eltorito" ;; @@ -249,7 +249,7 @@ case ${LIVE_BINARY_IMAGES} in ;; esac -if [ "${LIVE_CHROOT_BUILD}" = "disabled" ] +if [ "${LH_CHROOT_BUILD}" = "disabled" ] then FILES="`echo ${FILES} | sed -e 's/chroot//g'`" fi @@ -266,15 +266,15 @@ fi # Copying splash screen if [ -f config/binary_grub/splash.xpm.gz ] then - LIVE_GRUB_SPLASH="config/binary_grub/splash.xpm.gz" + LH_GRUB_SPLASH="config/binary_grub/splash.xpm.gz" elif [ -f config/binary_grub/splash.xpm ] then - LIVE_GRUB_SPLASH="config/binary_grub/splash.xpm" + LH_GRUB_SPLASH="config/binary_grub/splash.xpm" fi -if [ -n "${LIVE_GRUB_SPLASH}" ] +if [ -n "${LH_GRUB_SPLASH}" ] then - if [ "${LIVE_GRUB_SPLASH}" = "none" ] + if [ "${LH_GRUB_SPLASH}" = "none" ] then # Removing splash file rm -f binary/boot/grub/splash.xpm.gz @@ -283,13 +283,13 @@ then sed -i -e "s/splashimage.*//" binary/boot/grub/menu.lst else # Overwriting splash file - cp -f "${LIVE_GRUB_SPLASH}" binary/boot/grub - sed -i -e "s#splashimage.*#splashimage /boot/grub/`basename ${LIVE_GRUB_SPLASH}`#" binary/boot/grub/menu.lst + cp -f "${LH_GRUB_SPLASH}" binary/boot/grub + sed -i -e "s#splashimage.*#splashimage /boot/grub/`basename ${LH_GRUB_SPLASH}`#" binary/boot/grub/menu.lst fi fi sed -i -e "s#LINUX_LIVE#${LINUX_LIVE}#" -e "s#LINUX_INSTALL#${LINUX_INSTALL}#" -e "s#MEMTEST#${MEMTEST}#" binary/boot/grub/menu.lst -sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/boot/grub/menu.lst +sed -i -e "s#LH_BOOTAPPEND#${LH_BOOTAPPEND}#" binary/boot/grub/menu.lst sed -i -e 's/\ $//g' binary/boot/grub/menu.lst diff --git a/helpers/lh_binary_includes b/helpers/lh_binary_includes index bac2de25f..b426a6856 100755 --- a/helpers/lh_binary_includes +++ b/helpers/lh_binary_includes @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_INCLUDES}" = "none" ] +if [ "${LH_INCLUDES}" = "none" ] then exit 0 fi @@ -52,25 +52,25 @@ Check_lockfile .lock Create_lockfile .lock # Check user includes -if [ ! -d "${LIVE_INCLUDES}" ] +if [ ! -d "${LH_INCLUDES}" ] then - if [ -d ../"${LIVE_INCLUDES}" ] + if [ -d ../"${LH_INCLUDES}" ] then - LIVE_INCLUDES="../${LIVE_INCLUDES}" + LH_INCLUDES="../${LH_INCLUDES}" else - Echo_error "user specified includes not accessible in ${LIVE_INCLUDES}" + Echo_error "user specified includes not accessible in ${LH_INCLUDES}" exit 1 fi fi # Checking local includes -if [ -d config/includes/"${LIVE_DISTRIBUTION}" ] +if [ -d config/includes/"${LH_DISTRIBUTION}" ] then - LIVE_INCLUDES="config/includes" + LH_INCLUDES="config/includes" fi # Assemble architecture -case "${LIVE_ARCHITECTURE}" in +case "${LH_ARCHITECTURE}" in amd64) ARCH="amd" ;; @@ -85,57 +85,57 @@ case "${LIVE_ARCHITECTURE}" in esac # Working arround vfat limitations -if [ "${LIVE_BINARY_IMAGE}" = "usb-hdd" ] +if [ "${LH_BINARY_IMAGE}" = "usb-hdd" ] then CP_OPTIONS="-L" fi # Copying common templates -if [ -d "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/common ] && \ -ls "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/common/* &> /dev/null +if [ -d "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/common ] && \ +ls "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/common/* > /dev/null 2>&1 then - cp -r ${CP_OPTIONS} "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/common/* binary + cp -r ${CP_OPTIONS} "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/common/* binary fi -if [ -d "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/common."${ARCH}" ] && \ -ls "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/common."${ARCH}"/* &> /dev/null +if [ -d "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/common."${ARCH}" ] && \ +ls "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/common."${ARCH}"/* > /dev/null 2>&1 then - cp -r ${CP_OPTIONS} "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/common."${ARCH}"/* binary + cp -r ${CP_OPTIONS} "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/common."${ARCH}"/* binary fi # Copying live templates -if [ -d "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/live ] && \ -ls "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/live/* &> /dev/null +if [ -d "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/live ] && \ +ls "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/live/* > /dev/null 2>&1 then - cp -r ${CP_OPTIONS} "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/live/* binary + cp -r ${CP_OPTIONS} "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/live/* binary fi -if [ -d "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/live."${ARCH}" ] && \ -ls "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/live."${ARCH}"/* &> /dev/null +if [ -d "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/live."${ARCH}" ] && \ +ls "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/live."${ARCH}"/* > /dev/null 2>&1 then - cp -r ${CP_OPTIONS} "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/live."${ARCH}"/* binary + cp -r ${CP_OPTIONS} "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/live."${ARCH}"/* binary fi -if [ "${LIVE_DEBIAN_INSTALLER}" != "disabled" ] +if [ "${LH_DEBIAN_INSTALLER}" != "disabled" ] then # Copying install templates - if [ -d "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install ] && \ - ls "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install/* &> /dev/null + if [ -d "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/install ] && \ + ls "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/install/* > /dev/null 2>&1 then - cp -r ${CP_OPTIONS} "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install/* binary + cp -r ${CP_OPTIONS} "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/install/* binary fi - if [ -d "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install."${ARCH}" ] && \ - ls "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install."${ARCH}"/* &> /dev/null + if [ -d "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/install."${ARCH}" ] && \ + ls "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/install."${ARCH}"/* > /dev/null 2>&1 then - cp -r ${CP_OPTIONS} "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install."${ARCH}"/* binary + cp -r ${CP_OPTIONS} "${LH_INCLUDES}"/"${LH_DISTRIBUTION}"/install."${ARCH}"/* binary fi # Adjusting install templates - ARCHITECTURE="`echo ${LIVE_ARCHITECTURE} | sed -e 's# #/#g'`" - DISTRIBUTION="`echo ${LIVE_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]'`" - DISTRIBUTION="${DISTRIBUTION}`echo ${LIVE_DISTRIBUTION} | cut -b 2-`" - eval VERSION="$`echo VERSION_${LIVE_DISTRIBUTION}`" + ARCHITECTURE="`echo ${LH_ARCHITECTURE} | sed -e 's# #/#g'`" + DISTRIBUTION="`echo ${LH_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]'`" + DISTRIBUTION="${DISTRIBUTION}`echo ${LH_DISTRIBUTION} | cut -b 2-`" + eval VERSION="$`echo VERSION_${LH_DISTRIBUTION}`" if [ -d binary/pool/main/l/live-installer ] then @@ -147,7 +147,7 @@ then DEBIAN_NAME="Debian GNU/Linux ${VERSION} \"${DISTRIBUTION}\" - Official ${ARCHITECTURE} ${TYPE} Binary `date +%Y%m%d-%H:%M`" DEBIAN_DATE="`date +%Y%m%d-%H:%M`" - if [ "${LIVE_ARCHITECTURE}" = "i386" ] + if [ "${LH_ARCHITECTURE}" = "i386" ] then DEBIAN_TOOLS_HTML=" <P>\n <tt> \n <A href="tools/">/tools/</a>\n </tt>\n\n and\n <tt> \n <A href="install/floppy/">/install/floppy/</a>\n </tt>" DEBIAN_TOOLS_TXT="/tools/ and /install/floppy/" diff --git a/helpers/lh_binary_iso b/helpers/lh_binary_iso index b39f31e2a..7da3da809 100755 --- a/helpers/lh_binary_iso +++ b/helpers/lh_binary_iso @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if ! echo "${LIVE_BINARY_IMAGES}" | grep -qs iso +if ! echo "${LH_BINARY_IMAGES}" | grep -qs iso then exit 0 fi @@ -71,33 +71,33 @@ then GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -v" fi -if [ -n "${LIVE_ISO_APPLICATION}" ] && [ "${LIVE_ISO_APPLICATION}" != "none" ] +if [ -n "${LH_ISO_APPLICATION}" ] && [ "${LH_ISO_APPLICATION}" != "none" ] then - GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -A \"${LIVE_ISO_APPLICATION}\"" + GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -A \"${LH_ISO_APPLICATION}\"" fi -if [ -n "${LIVE_ISO_PREPARER}" ] && [ "${LIVE_ISO_PREPARER}" != "none" ] +if [ -n "${LH_ISO_PREPARER}" ] && [ "${LH_ISO_PREPARER}" != "none" ] then - GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -p \"${LIVE_ISO_PREPARER}\"" + GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -p \"${LH_ISO_PREPARER}\"" fi -if [ -n "${LIVE_ISO_PUBLISHER}" ] && [ "${LIVE_ISO_PUBLISHER}" != "none" ] +if [ -n "${LH_ISO_PUBLISHER}" ] && [ "${LH_ISO_PUBLISHER}" != "none" ] then - GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -publisher \"${LIVE_ISO_PUBLISHER}\"" + GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -publisher \"${LH_ISO_PUBLISHER}\"" fi -if [ -n "${LIVE_ISO_VOLUME}" ] && [ "${LIVE_ISO_VOLUME}" != "none" ] +if [ -n "${LH_ISO_VOLUME}" ] && [ "${LH_ISO_VOLUME}" != "none" ] then - GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -V \"${LIVE_ISO_VOLUME}\"" + GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -V \"${LH_ISO_VOLUME}\"" fi # Create image -case "${LIVE_BOOTLOADER}" in +case "${LH_BOOTLOADER}" in grub) GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table" GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -r -b boot/grub/stage2_eltorito" - if [ "${LIVE_PACKAGES_LISTS}" = "mini" ] || [ "${LIVE_PACKAGES_LISTS}" = "minimal" ] + if [ "${LH_PACKAGES_LISTS}" = "mini" ] || [ "${LH_PACKAGES_LISTS}" = "minimal" ] then GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -m boot/grub/stage2_eltorito" fi @@ -107,7 +107,7 @@ case "${LIVE_BOOTLOADER}" in GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table" GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -r -b isolinux/isolinux.bin -c isolinux/boot.cat" - if [ "${LIVE_PACKAGES_LISTS}" = "mini" ] || [ "${LIVE_PACKAGES_LISTS}" = "minimal" ] + if [ "${LH_PACKAGES_LISTS}" = "mini" ] || [ "${LH_PACKAGES_LISTS}" = "minimal" ] then GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -m isolinux/isolinux.bin" fi @@ -116,7 +116,7 @@ case "${LIVE_BOOTLOADER}" in yaboot) GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -r --iso-level 2 --netatalk -hfs -probe -map binary/yaboot/hfs.map --chrp-boot -part -no-desktop -hfs-bless binary/yaboot -hfs-volid Debian/Live_powerpc" - if [ "${LIVE_PACKAGES_LISTS}" = "mini" ] || [ "${LIVE_PACKAGES_LISTS}" = "minimal" ] + if [ "${LH_PACKAGES_LISTS}" = "mini" ] || [ "${LH_PACKAGES_LISTS}" = "minimal" ] then GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -m yaboot/hfs.map" fi @@ -128,7 +128,7 @@ case "${LIVE_BOOTLOADER}" in ;; esac -case "${LIVE_CHROOT_BUILD}" in +case "${LH_CHROOT_BUILD}" in enabled) # Moving image mv binary chroot diff --git a/helpers/lh_binary_linux-image b/helpers/lh_binary_linux-image index 9e4d74c9c..fb5ab98e5 100755 --- a/helpers/lh_binary_linux-image +++ b/helpers/lh_binary_linux-image @@ -47,7 +47,7 @@ Check_lockfile .lock Create_lockfile .lock # Setting destination directory -case "${LIVE_BINARY_IMAGES}" in +case "${LH_BINARY_IMAGES}" in iso) case "${LH_INITRAMFS}" in casper) @@ -68,14 +68,14 @@ case "${LIVE_BINARY_IMAGES}" in DESTDIR="binary/live" # Workaround for syslinux (<< 3.36) which doesn't support long file/path names - if [ "${LIVE_DISTRIBUTION}" = "etch" ] && [ "${LIVE_BOOTLOADER}" = "syslinux" ] + if [ "${LH_DISTRIBUTION}" = "etch" ] && [ "${LH_BOOTLOADER}" = "syslinux" ] then DESTDIR="binary" fi ;; esac -case "${LIVE_ARCHITECTURE}" in +case "${LH_ARCHITECTURE}" in amd64) LINUX="vmlinuz" ;; @@ -99,7 +99,7 @@ cp chroot/boot/"${LINUX}"-* "${DESTDIR}" cp chroot/boot/initrd.img-* "${DESTDIR}" # Including boot parameter documentation -if [ "${LIVE_BINARY_IMAGES}" != "net" ] +if [ "${LH_BINARY_IMAGES}" != "net" ] then DESTDIR="binary" fi diff --git a/helpers/lh_binary_local-includes b/helpers/lh_binary_local-includes index 862aea433..84434c58c 100755 --- a/helpers/lh_binary_local-includes +++ b/helpers/lh_binary_local-includes @@ -54,7 +54,7 @@ then cd "${OLDPWD}" # Removing symlinks - if [ "${LIVE_BINARY_IMAGES}" = "usb-hdd" ] + if [ "${LH_BINARY_IMAGES}" = "usb-hdd" ] then find binary -type l | xargs rm -f fi diff --git a/helpers/lh_binary_memtest b/helpers/lh_binary_memtest index 586e36251..28621f68a 100755 --- a/helpers/lh_binary_memtest +++ b/helpers/lh_binary_memtest @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_MEMTEST}" = "disabled" ] +if [ "${LH_MEMTEST}" = "disabled" ] then exit 0 fi @@ -51,13 +51,13 @@ Check_lockfile .lock # Creating lock file Create_lockfile .lock -if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ] +if [ "${LH_ARCHITECTURE}" != "amd64" ] && [ "${LH_ARCHITECTURE}" != "i386" ] then Echo_warning "skipping binary_memtest, foreign architecture." exit 0 fi -if [ "${LIVE_CHROOT_BUILD}" = "enabled" ] +if [ "${LH_CHROOT_BUILD}" = "enabled" ] then if [ -f chroot/usr/sbin/grub ] && [ ! -d chroot/boot/grub ] @@ -69,7 +69,7 @@ then fi # Checking depends -case "${LIVE_MEMTEST}" in +case "${LH_MEMTEST}" in memtest86) Check_package chroot/boot/memtest86.bin memtest86 ;; @@ -86,7 +86,7 @@ Restore_cache cache/packages_binary Install_package # Setting destination directory -case "${LIVE_BINARY_IMAGES}" in +case "${LH_BINARY_IMAGES}" in iso) case "${LH_INITRAMFS}" in casper) @@ -115,7 +115,7 @@ case "${LIVE_BINARY_IMAGES}" in esac # Workaround for syslinux (<< 3.36) which doesn't support long file/path names - if [ "${LIVE_DISTRIBUTION}" = "etch" ] && [ "${LIVE_BOOTLOADER}" = "syslinux" ] + if [ "${LH_DISTRIBUTION}" = "etch" ] && [ "${LH_BOOTLOADER}" = "syslinux" ] then DESTDIR="binary" fi @@ -128,13 +128,13 @@ Check_multiarchitecture mkdir -p "${DESTDIR}" # Installing memtest -case "${LIVE_CHROOT_BUILD}" in +case "${LH_CHROOT_BUILD}" in enabled) - cp chroot/boot/${LIVE_MEMTEST}.bin "${DESTDIR}"/memtest + cp chroot/boot/${LH_MEMTEST}.bin "${DESTDIR}"/memtest ;; disabled) - cp /boot/${LIVE_MEMTEST}.bin "${DESTDIR}"/memtest + cp /boot/${LH_MEMTEST}.bin "${DESTDIR}"/memtest ;; esac diff --git a/helpers/lh_binary_net b/helpers/lh_binary_net index 03476630f..40286d4af 100755 --- a/helpers/lh_binary_net +++ b/helpers/lh_binary_net @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if ! echo "${LIVE_BINARY_IMAGES}" | grep -qs net +if ! echo "${LH_BINARY_IMAGES}" | grep -qs net then exit 0 fi @@ -58,21 +58,21 @@ then fi # Creating image file -if [ "`basename ${LIVE_NET_PATH}`" = "chroot" ] +if [ "`basename ${LH_NET_PATH}`" = "chroot" ] then mv chroot chroot.tmp fi -mv binary "`basename ${LIVE_NET_PATH}`" +mv binary "`basename ${LH_NET_PATH}`" cd .. -tar cfz binary-net.tar.gz "`basename ${OLDPWD}`/`basename ${LIVE_NET_PATH}`" "`basename ${OLDPWD}`/tftpboot" +tar cfz binary-net.tar.gz "`basename ${OLDPWD}`/`basename ${LH_NET_PATH}`" "`basename ${OLDPWD}`/tftpboot" mv binary-net.tar.gz "${OLDPWD}" cd "${OLDPWD}" -mv "`basename ${LIVE_NET_PATH}`" binary +mv "`basename ${LH_NET_PATH}`" binary -if [ "`basename ${LIVE_NET_PATH}`" = "chroot" ] +if [ "`basename ${LH_NET_PATH}`" = "chroot" ] then mv chroot.tmp chroot fi diff --git a/helpers/lh_binary_rootfs b/helpers/lh_binary_rootfs index e8f34c804..15feb5f73 100755 --- a/helpers/lh_binary_rootfs +++ b/helpers/lh_binary_rootfs @@ -47,7 +47,7 @@ Check_lockfile .lock # Creating lock file Create_lockfile .lock -case "${LIVE_ARCHITECTURE}" in +case "${LH_ARCHITECTURE}" in amd64|i386) LINUX="vmlinuz" ;; @@ -92,7 +92,7 @@ do fi done -case "${LIVE_CHROOT_FILESYSTEM}" in +case "${LH_CHROOT_FILESYSTEM}" in ext2) # Checking depends Check_package chroot/usr/bin/genext2fs genext2fs @@ -112,7 +112,7 @@ case "${LIVE_CHROOT_FILESYSTEM}" in DU_DIM="`du -ks chroot/chroot | cut -f1`" REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here... - case "${LIVE_CHROOT_BUILD}" in + case "${LH_CHROOT_BUILD}" in enabled) Chroot "genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root=chroot filesystem.ext2" @@ -139,7 +139,7 @@ case "${LIVE_CHROOT_FILESYSTEM}" in rm -rf binary/${INITFS}/filesystem.dir fi - case "${LIVE_CHROOT_BUILD}" in + case "${LH_CHROOT_BUILD}" in enabled) mv chroot/chroot binary/${INITFS}/filesystem.dir ;; @@ -166,7 +166,7 @@ case "${LIVE_CHROOT_FILESYSTEM}" in rm -f binary/${INITFS}/filesystem.squashfs fi - if [ "${LH_QUIET}" = "enabled" ] && [ "${LIVE_DISTRIBUTION}" != "etch" ] && [ "${LIVE_DISTRIBUTION}" != "testing" ] + if [ "${LH_QUIET}" = "enabled" ] && [ "${LH_DISTRIBUTION}" != "etch" ] && [ "${LH_DISTRIBUTION}" != "testing" ] then MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -no-progress" fi @@ -176,7 +176,7 @@ case "${LIVE_CHROOT_FILESYSTEM}" in MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -info" fi - if [ "${LIVE_PACKAGES_LISTS}" = "minimal" ] || [ "${LIVE_PACKAGES_LISTS}" = "mini" ] + if [ "${LH_PACKAGES_LISTS}" = "minimal" ] || [ "${LH_PACKAGES_LISTS}" = "mini" ] then MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -e `ls chroot/boot/${LINUX}* chroot/boot/initrd.img* chroot/${LINUX}* chroot/initrd.img* | sed 's,chroot/,,g'`" fi @@ -187,7 +187,7 @@ case "${LIVE_CHROOT_FILESYSTEM}" in cp config/binary_rootfs/squashfs.sort chroot #FIXME fi - case "${LIVE_CHROOT_BUILD}" in + case "${LH_CHROOT_BUILD}" in enabled) # Create image Chroot "mksquashfs chroot filesystem.squashfs ${MKSQUASHFS_OPTIONS}" diff --git a/helpers/lh_binary_syslinux b/helpers/lh_binary_syslinux index fd6d1cdc2..0568de9fc 100755 --- a/helpers/lh_binary_syslinux +++ b/helpers/lh_binary_syslinux @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_BOOTLOADER}" != "syslinux" ] +if [ "${LH_BOOTLOADER}" != "syslinux" ] then exit 0 fi @@ -75,7 +75,7 @@ Syslinux_live_entry () APPEND="${4}" # syslinux << 3.36 lacks support to file/path - if [ "${LIVE_BINARY_IMAGES}" != "net" ] && [ "`basename ${DESTDIR_LIVE}`" != "binary" ] + if [ "${LH_BINARY_IMAGES}" != "net" ] && [ "`basename ${DESTDIR_LIVE}`" != "binary" ] then DIRECTORY="`basename ${DESTDIR_LIVE}`" KERNEL="${DIRECTORY}/${KERNEL}" @@ -84,7 +84,7 @@ Syslinux_live_entry () LINUX_LIVE="${LINUX_LIVE}\nLABEL ${LABEL}\n" LINUX_LIVE="${LINUX_LIVE}\tkernel /${KERNEL}\n" - LINUX_LIVE="${LINUX_LIVE}\tappend initrd=/${INITRD} boot=${INITFS} LIVE_BOOTAPPEND ${APPEND}\n" + LINUX_LIVE="${LINUX_LIVE}\tappend initrd=/${INITRD} boot=${INITFS} LH_BOOTAPPEND ${APPEND}\n" } Syslinux_install_entry () @@ -95,7 +95,7 @@ Syslinux_install_entry () APPEND="${4}" # syslinux << 3.36 lacks support to file/path - if [ "${LIVE_BINARY_IMAGES}" != "net" ] && [ "`basename ${DESTDIR_INSTALL}`" != "binary" ] + if [ "${LH_BINARY_IMAGES}" != "net" ] && [ "`basename ${DESTDIR_INSTALL}`" != "binary" ] then DIRECTORY="`basename ${DESTDIR_INSTALL}`" KERNEL="${DIRECTORY}/${KERNEL}" @@ -103,7 +103,7 @@ Syslinux_install_entry () fi # Boot in quiet mode - if [ "${LIVE_DISTRIBUTION}" != "etch" ] && [ "${LABEL}" != "rescue" ] && [ "${LABEL}" != "rescuegui" ] + if [ "${LH_DISTRIBUTION}" != "etch" ] && [ "${LABEL}" != "rescue" ] && [ "${LABEL}" != "rescuegui" ] then APPEND="${APPEND} quiet" fi @@ -124,7 +124,7 @@ case "${LH_INITRAMFS}" in esac # Setting destination directory -case "${LIVE_BINARY_IMAGES}" in +case "${LH_BINARY_IMAGES}" in iso) case "${LH_INITRAMFS}" in casper) @@ -158,7 +158,7 @@ case "${LIVE_BINARY_IMAGES}" in DESTDIR_INSTALL="binary/install" # syslinux << 3.36 lacks support for long file/path - if [ "${LIVE_DISTRIBUTION}" = "etch" ] + if [ "${LH_DISTRIBUTION}" = "etch" ] then DESTDIR_LIVE="binary" DESTDIR_INSTALL="binary" @@ -172,57 +172,57 @@ Check_multiarchitecture mkdir -p "${DESTDIR_LIVE}" # Setting boot parameters -if [ -n "${LIVE_ENCRYPTION}" ] +if [ -n "${LH_ENCRYPTION}" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} encryption=${LIVE_ENCRYPTION}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} encryption=${LH_ENCRYPTION}" fi -if [ -n "${LIVE_USERNAME}" ] +if [ -n "${LH_USERNAME}" ] then case "${LH_INITRAMFS}" in casper) - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} username=${LIVE_USERNAME}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} username=${LH_USERNAME}" ;; live-initramfs) - if [ "${LIVE_USERNAME}" != "user" ] + if [ "${LH_USERNAME}" != "user" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} username=${LIVE_USERNAME}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} username=${LH_USERNAME}" fi ;; esac fi -if [ -n "${LIVE_HOSTNAME}" ] +if [ -n "${LH_HOSTNAME}" ] then case "${LH_INITRAMFS}" in casper) - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} hostname=${LIVE_HOSTNAME}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} hostname=${LH_HOSTNAME}" ;; live-initramfs) - if [ "${LIVE_HOSTNAME}" != "debian" ] + if [ "${LH_HOSTNAME}" != "debian" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} hostname=${LIVE_HOSTNAME}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} hostname=${LH_HOSTNAME}" fi ;; esac fi -if [ "${LIVE_UNION_FILESYSTEM}" != "unionfs" ] +if [ "${LH_UNION_FILESYSTEM}" != "unionfs" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} union=${LIVE_UNION_FILESYSTEM}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} union=${LH_UNION_FILESYSTEM}" fi -if [ "${LIVE_BINARY_IMAGES}" = "net" ] +if [ "${LH_BINARY_IMAGES}" = "net" ] then - case "${LIVE_NET_FILESYSTEM}" in + case "${LH_NET_FILESYSTEM}" in nfs) - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} netboot=nfs nfsroot=LIVE_NET_SERVER:LIVE_NET_PATH" + LH_BOOTAPPEND="${LH_BOOTAPPEND} netboot=nfs nfsroot=LH_NET_SERVER:LH_NET_PATH" ;; cifs) - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} netboot=cifs nfsroot=//LIVE_NET_SERVERLIVE_NET_PATH" + LH_BOOTAPPEND="${LH_BOOTAPPEND} netboot=cifs nfsroot=//LH_NET_SERVERLH_NET_PATH" ;; *) @@ -231,13 +231,13 @@ then ;; esac - if [ -n "${LIVE_NET_MOUNTOPTIONS}" ] + if [ -n "${LH_NET_MOUNTOPTIONS}" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} nfsopts=${LIVE_NET_MOUNTOPTIONS}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} nfsopts=${LH_NET_MOUNTOPTIONS}" fi fi -LIVE_BOOTAPPEND="`echo ${LIVE_BOOTAPPEND} | sed -e 's/ //'`" +LH_BOOTAPPEND="`echo ${LH_BOOTAPPEND} | sed -e 's/ //'`" # Parameters are listed at: linux/Documentation/kernel-parameters.txt FAILSAFE="noapic noapm nodma nomce nolapic nosmp vga=normal" @@ -245,14 +245,14 @@ FAILSAFE="noapic noapm nodma nomce nolapic nosmp vga=normal" # Assembling kernel configuration # Default entries -DEFAULT_FLAVOUR="`echo ${LIVE_LINUX_FLAVOURS} | awk '{ print $1 }'`" +DEFAULT_FLAVOUR="`echo ${LH_LINUX_FLAVOURS} | awk '{ print $1 }'`" DEFAULT_KERNEL="`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`" DEFAULT_INITRD="initrd.img-`echo ${DEFAULT_KERNEL} | sed -e 's/vmlinuz-//'`" Syslinux_live_entry "live" "${DEFAULT_KERNEL}" "${DEFAULT_INITRD}" Syslinux_live_entry "live-failsafe" "${DEFAULT_KERNEL}" "${DEFAULT_INITRD}" "${FAILSAFE}" -if [ "`echo ${LIVE_LINUX_FLAVOURS} | wc -w`" -gt "1" ] +if [ "`echo ${LH_LINUX_FLAVOURS} | wc -w`" -gt "1" ] then for KERNEL in chroot/boot/vmlinuz-* do @@ -265,10 +265,10 @@ then done fi -LINUX_LIVE="`echo ${LINUX_LIVE} | sed -e 's/binary//g' -e 's#//#/#g'`" +LINUX_LIVE="`/bin/echo ${LINUX_LIVE} | sed -e 's/binary//g' -e 's#//#/#g'`" # Assembling debian-installer configuration -if [ "${LIVE_DEBIAN_INSTALLER}" != "disabled" ] +if [ "${LH_DEBIAN_INSTALLER}" != "disabled" ] then VMLINUZ_DI="vmlinuz" INITRD_DI="initrd.gz" @@ -279,9 +279,9 @@ then APPEND_GI="video=vesa:ywrap,mtrr vga=788" # Workaround for syslinux (<< 3.36) which doesn't support long file/path names - if [ "${LIVE_DISTRIBUTION}" = "etch" ] + if [ "${LH_DISTRIBUTION}" = "etch" ] then - if [ "${LIVE_BINARY_IMAGES}" = "tar" ] || [ "${LIVE_BINARY_IMAGES}" = "usb-hdd" ] + if [ "${LH_BINARY_IMAGES}" = "tar" ] || [ "${LH_BINARY_IMAGES}" = "usb-hdd" ] then VMLINUZ_DI="vmlinuz.di" INITRD_DI="initrddi.gz" @@ -302,7 +302,7 @@ then Syslinux_install_entry "autogui" "${VMLINUZ_GI}" "${INITRD_GI}" "auto=true priority=critical ${APPEND_GI}" fi -LINUX_INSTALL="`echo ${LINUX_INSTALL} | sed -e 's/binary//g' -e 's#//#/#g'`" +LINUX_INSTALL="`/bin/echo ${LINUX_INSTALL} | sed -e 's/binary//g' -e 's#//#/#g'`" # Assembling memtest configuration if [ -f "${DESTDIR_LIVE}"/memtest ] @@ -316,15 +316,15 @@ then fi MEMTEST="LABEL memtest\n\tkernel ${KERNEL_PATH}memtest" - MEMTEST="`echo ${MEMTEST} | sed -e 's#//#/#g'`" + MEMTEST="`/bin/echo ${MEMTEST} | sed -e 's#//#/#g'`" fi -case "${LIVE_BINARY_IMAGES}" in +case "${LH_BINARY_IMAGES}" in iso) # Copying syslinux mkdir -p binary/isolinux - case "${LIVE_CHROOT_BUILD}" in + case "${LH_CHROOT_BUILD}" in enabled) cp chroot/usr/lib/syslinux/isolinux.bin binary/isolinux ;; @@ -341,14 +341,14 @@ case "${LIVE_BINARY_IMAGES}" in mv ${FILE} `dirname ${FILE}`/`basename ${FILE} .live` done - if [ "${LIVE_DEBIAN_INSTALLER}" != "disabled" ] + if [ "${LH_DEBIAN_INSTALLER}" != "disabled" ] then for FILE in binary/isolinux/*.install do mv ${FILE} `dirname ${FILE}`/`basename ${FILE} .install` done - if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ] + if [ "${LH_ARCHITECTURE}" = "amd64" ] || [ "${LH_ARCHITECTURE}" = "i386" ] || [ "${LH_ARCHITECTURE}" = "powerpc" ] then for FILE in binary/isolinux/*.install.g-i do @@ -372,35 +372,35 @@ case "${LIVE_BINARY_IMAGES}" in # Copying splash screen if [ -f config/binary_syslinux/splash.rle ] then - LIVE_SYSLINUX_SPLASH="config/binary_syslinux/splash.rle" + LH_SYSLINUX_SPLASH="config/binary_syslinux/splash.rle" fi - if [ -n "${LIVE_SYSLINUX_SPLASH}" ] + if [ -n "${LH_SYSLINUX_SPLASH}" ] then - if [ "${LIVE_SYSLINUX_SPLASH}" = "none" ] + if [ "${LH_SYSLINUX_SPLASH}" = "none" ] then rm -f binary/isolinux/splash.rle sed -e "s/.*splash.*//" binary/isolinux/boot.txt else - cp -f "${LIVE_SYSLINUX_SPLASH}" binary/isolinux/splash.rle + cp -f "${LH_SYSLINUX_SPLASH}" binary/isolinux/splash.rle fi fi # Configure syslinux templates sed -i -e "s@LINUX_LIVE@${LINUX_LIVE}@" -e "s@LINUX_INSTALL@${LINUX_INSTALL}@" -e "s@MEMTEST@${MEMTEST}@" binary/isolinux/isolinux.cfg - sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/isolinux/isolinux.cfg - sed -i -e "s/LIVE_DISTRIBUTION/${LIVE_DISTRIBUTION}/" -e "s/LIVE_DATE/`date +%Y%m%d`/" -e "s/LIVE_MEDIA/CD-ROM/" binary/isolinux/f1.txt - sed -i -e "s/LIVE_MEDIA/CD-ROM/" binary/isolinux/f3.txt - sed -i -e "s/LIVE_VERSION/${VERSION}/" binary/isolinux/f10.txt + sed -i -e "s#LH_BOOTAPPEND#${LH_BOOTAPPEND}#" binary/isolinux/isolinux.cfg + sed -i -e "s/LH_DISTRIBUTION/${LH_DISTRIBUTION}/" -e "s/LH_DATE/`date +%Y%m%d`/" -e "s/LH_MEDIA/CD-ROM/" binary/isolinux/f1.txt + sed -i -e "s/LH_MEDIA/CD-ROM/" binary/isolinux/f3.txt + sed -i -e "s/LH_VERSION/${VERSION}/" binary/isolinux/f10.txt # Working arround syslinux 8.3 limitation - if [ "`echo ${LIVE_LINUX_FLAVOURS} | wc -w`" -gt "1" ] + if [ "`echo ${LH_LINUX_FLAVOURS} | wc -w`" -gt "1" ] then NUMBER="0" # FIXME: This has a bug *iff* flavours = 686 686-bigmem (note the order). - for FLAVOUR in ${LIVE_LINUX_FLAVOURS} + for FLAVOUR in ${LH_LINUX_FLAVOURS} do NUMBER="$(($NUMBER + 1))" @@ -409,11 +409,13 @@ case "${LIVE_BINARY_IMAGES}" in 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_LIVE}"/vmlinuz-*-${LIVE_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/vmlinuz - mv "${DESTDIR_LIVE}"/initrd.img-*-${LIVE_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/initrd.img - sed -i -e "s/vmlinuz-.*-${LIVE_LINUX_FLAVOURS}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_LINUX_FLAVOURS}/initrd.img/g" binary/isolinux/isolinux.cfg + mv "${DESTDIR_LIVE}"/vmlinuz-*-${LH_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/vmlinuz + mv "${DESTDIR_LIVE}"/initrd.img-*-${LH_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/initrd.img + sed -i -e "s/vmlinuz-.*-${LH_LINUX_FLAVOURS}/vmlinuz/g" -e "s/initrd.img-.*-${LH_LINUX_FLAVOURS}/initrd.img/g" binary/isolinux/isolinux.cfg fi + sed -i -e "s/LINUX_TIMEOUT/${LH_SYSLINUX_TIMEOUT}/" binary/isolinux/isolinux.cfg + # Remove whitespaces sed -i -e 's/\ $//g' binary/isolinux/isolinux.cfg ;; @@ -422,7 +424,7 @@ case "${LIVE_BINARY_IMAGES}" in # Copying syslinux mkdir -p tftpboot - case "${LIVE_CHROOT_BUILD}" in + case "${LH_CHROOT_BUILD}" in enabled) cp chroot/usr/lib/syslinux/pxelinux.0 tftpboot ;; @@ -440,14 +442,14 @@ case "${LIVE_BINARY_IMAGES}" in mv ${FILE} `dirname ${FILE}`/`basename ${FILE} .live` done - if [ "${LIVE_DEBIAN_INSTALLER}" != "disabled" ] + if [ "${LH_DEBIAN_INSTALLER}" != "disabled" ] then for FILE in tftpboot/pxelinux.cfg/*.install do mv ${FILE} `dirname ${FILE}`/`basename ${FILE} .install` done - if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ] + if [ "${LH_ARCHITECTURE}" = "amd64" ] || [ "${LH_ARCHITECTURE}" = "i386" ] || [ "${LH_ARCHITECTURE}" = "powerpc" ] then for FILE in tftpboot/pxelinux.cfg/*.install.g-i do @@ -473,42 +475,44 @@ case "${LIVE_BINARY_IMAGES}" in # Copying splash screen if [ -f config/binary_syslinux/splash.rle ] then - LIVE_SYSLINUX_SPLASH="config/binary_syslinux/splash.rle" + LH_SYSLINUX_SPLASH="config/binary_syslinux/splash.rle" fi - if [ -n "${LIVE_SYSLINUX_SPLASH}" ] + if [ -n "${LH_SYSLINUX_SPLASH}" ] then - if [ "${LIVE_SYSLINUX_SPLASH}" = "none" ] + if [ "${LH_SYSLINUX_SPLASH}" = "none" ] then rm -f tftpboot/pxelinux.cfg/splash.rle sed -e "s/.*splash.*//" tftpboot/pxelinux.cfg/boot.txt else - cp -f "${LIVE_SYSLINUX_SPLASH}" tftpboot/pxelinux.cfg/splash.rle + cp -f "${LH_SYSLINUX_SPLASH}" tftpboot/pxelinux.cfg/splash.rle fi fi # Configure syslinux templates sed -i -e "s@LINUX_LIVE@${LINUX_LIVE}@" -e "s@LINUX_INSTALL@${LINUX_INSTALL}@" -e "s@MEMTEST@${MEMTEST}@" tftpboot/pxelinux.cfg/default - sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" -e "s/LIVE_NET_SERVER/${LIVE_NET_SERVER}/" -e "s#LIVE_NET_PATH#${LIVE_NET_PATH}#" tftpboot/pxelinux.cfg/default - sed -i -e "s/LIVE_DISTRIBUTION/${LIVE_DISTRIBUTION}/" -e "s/LIVE_DATE/`date +%Y%m%d`/" -e "s/LIVE_MEDIA/netboot/" tftpboot/pxelinux.cfg/f1.txt - sed -i -e "s/LIVE_MEDIA/netboot/" tftpboot/pxelinux.cfg/f3.txt - sed -i -e "s/LIVE_VERSION/${VERSION}/" tftpboot/pxelinux.cfg/f10.txt + sed -i -e "s#LH_BOOTAPPEND#${LH_BOOTAPPEND}#" -e "s/LH_NET_SERVER/${LH_NET_SERVER}/" -e "s#LH_NET_PATH#${LH_NET_PATH}#" tftpboot/pxelinux.cfg/default + sed -i -e "s/LH_DISTRIBUTION/${LH_DISTRIBUTION}/" -e "s/LH_DATE/`date +%Y%m%d`/" -e "s/LH_MEDIA/netboot/" tftpboot/pxelinux.cfg/f1.txt + sed -i -e "s/LH_MEDIA/netboot/" tftpboot/pxelinux.cfg/f3.txt + sed -i -e "s/LH_VERSION/${VERSION}/" tftpboot/pxelinux.cfg/f10.txt # Working arround syslinux 8.3 limitation - if [ "`echo ${LIVE_LINUX_FLAVOURS} | wc -w`" -eq "1" ] + if [ "`echo ${LH_LINUX_FLAVOURS} | wc -w`" -eq "1" ] then - mv "${DESTDIR_LIVE}"/vmlinuz-*-${LIVE_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/vmlinuz - mv "${DESTDIR_LIVE}"/initrd.img-*-${LIVE_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/initrd.img - sed -i -e "s/vmlinuz-.*-${LIVE_LINUX_FLAVOURS}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_LINUX_FLAVOURS}/initrd.img/g" tftpboot/pxelinux.cfg/default + mv "${DESTDIR_LIVE}"/vmlinuz-*-${LH_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/vmlinuz + mv "${DESTDIR_LIVE}"/initrd.img-*-${LH_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/initrd.img + sed -i -e "s/vmlinuz-.*-${LH_LINUX_FLAVOURS}/vmlinuz/g" -e "s/initrd.img-.*-${LH_LINUX_FLAVOURS}/initrd.img/g" tftpboot/pxelinux.cfg/default fi + sed -i -e "s/LINUX_TIMEOUT/${LH_SYSLINUX_TIMEOUT}/" tftpboot/pxelinux.cfg/default + # Remove whitespaces sed -i -e 's/\ $//g' tftpboot/pxelinux.cfg/default ;; tar|usb-hdd) # Workaround for syslinux (<< 3.36) which doesn't support dedicated directory - if [ "${LIVE_DISTRIBUTION}" = "etch" ] + if [ "${LH_DISTRIBUTION}" = "etch" ] then DESTDIR="binary" else @@ -518,7 +522,7 @@ case "${LIVE_BINARY_IMAGES}" in # Copying syslinux mkdir -p "${DESTDIR}" - case "${LIVE_CHROOT_BUILD}" in + case "${LH_CHROOT_BUILD}" in enabled) cp chroot/usr/lib/syslinux/isolinux.bin "${DESTDIR}"/syslinux.bin ;; @@ -535,14 +539,14 @@ case "${LIVE_BINARY_IMAGES}" in mv ${FILE} `dirname ${FILE}`/`basename ${FILE} .live` done - if [ "${LIVE_DEBIAN_INSTALLER}" != "disabled" ] + if [ "${LH_DEBIAN_INSTALLER}" != "disabled" ] then for FILE in "${DESTDIR}"/*.install do mv ${FILE} `dirname ${FILE}`/`basename ${FILE} .install` done - if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ] + if [ "${LH_ARCHITECTURE}" = "amd64" ] || [ "${LH_ARCHITECTURE}" = "i386" ] || [ "${LH_ARCHITECTURE}" = "powerpc" ] then for FILE in "${DESTDIR}"/*.install.g-i do @@ -564,33 +568,33 @@ case "${LIVE_BINARY_IMAGES}" in # Copying splash screen if [ -f config/binary_syslinux/splash.rle ] then - LIVE_SYSLINUX_SPLASH="config/binary_syslinux/splash.rle" + LH_SYSLINUX_SPLASH="config/binary_syslinux/splash.rle" fi - if [ -n "${LIVE_SYSLINUX_SPLASH}" ] + if [ -n "${LH_SYSLINUX_SPLASH}" ] then - if [ "${LIVE_SYSLINUX_SPLASH}" = "none" ] + if [ "${LH_SYSLINUX_SPLASH}" = "none" ] then rm -f "${DESTDIR}"/splash.rle sed -e "s/.*splash.*//" "${DESTDIR}"/boot.txt else - cp -f "${LIVE_SYSLINUX_SPLASH}" "${DESTDIR}"/splash.rle + cp -f "${LH_SYSLINUX_SPLASH}" "${DESTDIR}"/splash.rle fi fi # Configure syslinux templates sed -i -e "s@LINUX_LIVE@${LINUX_LIVE}@" -e "s@LINUX_INSTALL@${LINUX_INSTALL}@" -e "s@MEMTEST@${MEMTEST}@" "${DESTDIR}"/syslinux.cfg - sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${DESTDIR}"/syslinux.cfg - sed -i -e "s/LIVE_DISTRIBUTION/${LIVE_DISTRIBUTION}/" -e "s/LIVE_DATE/`date +%Y%m%d`/" -e "s/LIVE_MEDIA/hd-media/" "${DESTDIR}"/f1.txt #FIXME - sed -i -e "s/LIVE_MEDIA/hd-media/" "${DESTDIR}"/f3.txt #FIXME - sed -i -e "s/LIVE_VERSION/${VERSION}/" "${DESTDIR}"/f10.txt + sed -i -e "s#LH_BOOTAPPEND#${LH_BOOTAPPEND}#" "${DESTDIR}"/syslinux.cfg + sed -i -e "s/LH_DISTRIBUTION/${LH_DISTRIBUTION}/" -e "s/LH_DATE/`date +%Y%m%d`/" -e "s/LH_MEDIA/hd-media/" "${DESTDIR}"/f1.txt #FIXME + sed -i -e "s/LH_MEDIA/hd-media/" "${DESTDIR}"/f3.txt #FIXME + sed -i -e "s/LH_VERSION/${VERSION}/" "${DESTDIR}"/f10.txt # Workaround for syslinux (<< 3.36) which doesn't support long file/path names - if [ "`echo ${LIVE_LINUX_FLAVOURS} | wc -w`" -gt "1" ] + if [ "`echo ${LH_LINUX_FLAVOURS} | wc -w`" -gt "1" ] then NUMBER="0" - for FLAVOUR in ${LIVE_LINUX_FLAVOURS} + for FLAVOUR in ${LH_LINUX_FLAVOURS} do NUMBER="$(($NUMBER + 1))" mv "${DESTDIR_LIVE}"/vmlinuz-*-${FLAVOUR} "${DESTDIR_LIVE}"/vmlinuz${NUMBER} @@ -598,9 +602,10 @@ case "${LIVE_BINARY_IMAGES}" in sed -i -e "s/vmlinuz-.*-${FLAVOUR}$/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR} /initrd${NUMBER}.img /g" "${DESTDIR}"/syslinux.cfg done else - mv "${DESTDIR_LIVE}"/vmlinuz-*-${LIVE_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/vmlinuz - mv "${DESTDIR_LIVE}"/initrd.img-*-${LIVE_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/initrd.img - sed -i -e "s/vmlinuz-.*-${LIVE_LINUX_FLAVOURS}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_LINUX_FLAVOURS}/initrd.img/g" "${DESTDIR}"/syslinux.cfg + mv "${DESTDIR_LIVE}"/vmlinuz-*-${LH_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/vmlinuz + mv "${DESTDIR_LIVE}"/initrd.img-*-${LH_LINUX_FLAVOURS} "${DESTDIR_LIVE}"/initrd.img + sed -i -e "s/vmlinuz-.*-${LH_LINUX_FLAVOURS}/vmlinuz/g" -e "s/initrd.img-.*-${LH_LINUX_FLAVOURS}/initrd.img/g" "${DESTDIR}"/syslinux.cfg + sed -i -e "s/LINUX_TIMEOUT/${LH_SYSLINUX_TIMEOUT}/" "${DESTDIR}"/syslinux.cfg # Remove whitespaces sed -i -e 's/\ $//g' "${DESTDIR}"/syslinux.cfg diff --git a/helpers/lh_binary_tar b/helpers/lh_binary_tar index e3ef16758..34359350e 100755 --- a/helpers/lh_binary_tar +++ b/helpers/lh_binary_tar @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if ! echo "${LIVE_BINARY_IMAGES}" | grep -qs tar +if ! echo "${LH_BINARY_IMAGES}" | grep -qs tar then exit 0 fi diff --git a/helpers/lh_binary_usb-hdd b/helpers/lh_binary_usb-hdd index af4048c9a..f13896c88 100755 --- a/helpers/lh_binary_usb-hdd +++ b/helpers/lh_binary_usb-hdd @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if ! echo "${LIVE_BINARY_IMAGES}" | grep -qs usb-hdd +if ! echo "${LH_BINARY_IMAGES}" | grep -qs usb-hdd then exit 0 fi @@ -57,7 +57,7 @@ Check_package chroot/sbin/mkdosfs dosfstools Check_package chroot/usr/share/doc/mtools mtools Check_package chroot/sbin/parted parted -case "${LIVE_BOOTLOADER}" in +case "${LH_BOOTLOADER}" in grub) Check_package chroot/usr/sbin/grub grub ;; @@ -95,14 +95,14 @@ fi echo "!!! The following error/warning messages can be ignored !!!" lh_losetup $FREELO chroot/binary.img 0 -case "${LIVE_CHROOT_BUILD}" in +case "${LH_CHROOT_BUILD}" in enabled) Chroot "parted -s ${FREELO} mklabel msdos" || true 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 - if [ "${LIVE_BOOTLOADER}" = "syslinux" ] + if [ "${LH_BOOTLOADER}" = "syslinux" ] then cat chroot/usr/lib/syslinux/mbr.bin > ${FREELO} fi @@ -114,7 +114,7 @@ case "${LIVE_CHROOT_BUILD}" in parted -s ${FREELO} set 1 boot on || true parted -s ${FREELO} set 1 lba off || true - if [ "${LIVE_BOOTLOADER}" = "syslinux" ] + if [ "${LH_BOOTLOADER}" = "syslinux" ] then cat /usr/lib/syslinux/mbr.bin > ${FREELO} fi @@ -126,7 +126,7 @@ ${LH_LOSETUP} -d ${FREELO} FREELO="`${LH_LOSETUP} -f`" lh_losetup $FREELO chroot/binary.img 1 -case "${LIVE_CHROOT_BUILD}" in +case "${LH_CHROOT_BUILD}" in enabled) Chroot "mkfs.vfat -F 16 -n DEBIAN_LIVE ${FREELO}" ;; @@ -142,7 +142,7 @@ cp -rL binary/* chroot/binary.tmp FIXME() { -if [ "${LIVE_BOOTLOADER}" = "grub" ] +if [ "${LH_BOOTLOADER}" = "grub" ] then cat > chroot/grub.sh << EOF @@ -174,9 +174,9 @@ fi ${LH_ROOT_COMMAND} umount chroot/binary.tmp rmdir chroot/binary.tmp -if [ "${LIVE_BOOTLOADER}" = "syslinux" ] +if [ "${LH_BOOTLOADER}" = "syslinux" ] then - case "${LIVE_CHROOT_BUILD}" in + case "${LH_CHROOT_BUILD}" in enabled) Chroot "syslinux ${FREELO}" ;; diff --git a/helpers/lh_binary_yaboot b/helpers/lh_binary_yaboot index c915e1d63..dcdb839f5 100755 --- a/helpers/lh_binary_yaboot +++ b/helpers/lh_binary_yaboot @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_BOOTLOADER}" != "yaboot" ] +if [ "${LH_BOOTLOADER}" != "yaboot" ] then exit 0 fi @@ -79,7 +79,7 @@ Yaboot_live_entry () LINUX_LIVE="${LINUX_LIVE}\nimage=${DIRECTORY}/${KERNEL}\n" LINUX_LIVE="${LINUX_LIVE}\tlabel=${LABEL}\n" LINUX_LIVE="${LINUX_LIVE}\tinitrd=${DIRECTORY}/${INITRD}\n" - LINUX_LIVE="${LINUX_LIVE}\tappend=\"boot=${INITFS} LIVE_BOOTAPPEND ${APPEND}\"\n" + LINUX_LIVE="${LINUX_LIVE}\tappend=\"boot=${INITFS} LH_BOOTAPPEND ${APPEND}\"\n" LINUX_LIVE="${LINUX_LIVE}\tinitrd-size=10240\n" } @@ -92,7 +92,7 @@ Yaboot_install_entry () DIRECTORY="/`basename ${DESTDIR_LIVE}`" - if [ "${LIVE_DISTRIBUTION}" != "etch" ] && [ "${LABEL}" != "rescue" ] && [ "${LABEL}" != "rescuegui" ] + if [ "${LH_DISTRIBUTION}" != "etch" ] && [ "${LABEL}" != "rescue" ] && [ "${LABEL}" != "rescuegui" ] then APPEND="${APPEND} quiet" fi @@ -100,7 +100,7 @@ Yaboot_install_entry () LINUX_INSTALL="${LINUX_INSTALL}\nimage=${DIRECTORY}/${KERNEL}\n" LINUX_INSTALL="${LINUX_INSTALL}\tlabel=${LABEL}\n" LINUX_INSTALL="${LINUX_INSTALL}\tinitrd=${DIRECTORY}/${INITRD}\n" - LINUX_INSTALL="${LINUX_INSTALL}\tappend=\"LIVE_BOOTAPPEND ${APPEND} --\"\n" + LINUX_INSTALL="${LINUX_INSTALL}\tappend=\"LH_BOOTAPPEND ${APPEND} --\"\n" LINUX_INSTALL="${LINUX_INSTALL}\tinitrd-size=10240\n" } @@ -115,7 +115,7 @@ case "${LH_INITRAMFS}" in esac # Setting destination directory -case "${LIVE_BINARY_IMAGES}" in +case "${LH_BINARY_IMAGES}" in iso) case "${LH_INITRAMFS}" in casper) @@ -142,49 +142,49 @@ Check_multiarchitecture mkdir -p "${DESTDIR_LIVE}" # Setting boot parameters -if [ -n "${LIVE_ENCRYPTION}" ] +if [ -n "${LH_ENCRYPTION}" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} encryption=${LIVE_ENCRYPTION}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} encryption=${LH_ENCRYPTION}" fi -if [ -n "${LIVE_USERNAME}" ] +if [ -n "${LH_USERNAME}" ] then case "${LH_INITRAMFS}" in casper) - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} username=${LIVE_USERNAME}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} username=${LH_USERNAME}" ;; live-initramfs) - if [ "${LIVE_USERNAME}" != "user" ] + if [ "${LH_USERNAME}" != "user" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} username=${LIVE_USERNAME}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} username=${LH_USERNAME}" fi ;; esac fi -if [ -n "${LIVE_HOSTNAME}" ] +if [ -n "${LH_HOSTNAME}" ] then case "${LH_INITRAMFS}" in casper) - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} hostname=${LIVE_HOSTNAME}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} hostname=${LH_HOSTNAME}" ;; live-initramfs) - if [ "${LIVE_HOSTNAME}" != "debian" ] + if [ "${LH_HOSTNAME}" != "debian" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} hostname=${LIVE_HOSTNAME}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} hostname=${LH_HOSTNAME}" fi ;; esac fi -if [ "${LIVE_UNION_FILESYSTEM}" != "unionfs" ] +if [ "${LH_UNION_FILESYSTEM}" != "unionfs" ] then - LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} union=${LIVE_UNION_FILESYSTEM}" + LH_BOOTAPPEND="${LH_BOOTAPPEND} union=${LH_UNION_FILESYSTEM}" fi -LIVE_BOOTAPPEND="`echo ${LIVE_BOOTAPPEND} | sed -e 's/ //'`" +LH_BOOTAPPEND="`echo ${LH_BOOTAPPEND} | sed -e 's/ //'`" # Parameters are listed at: linux/Documentation/kernel-parameters.txt FAILSAFE="noapic noapm nodma nomce nolapic nosmp vga=ofonly" @@ -192,14 +192,14 @@ FAILSAFE="noapic noapm nodma nomce nolapic nosmp vga=ofonly" # Assembling kernel configuration # Default entries -DEFAULT_FLAVOUR="`echo ${LIVE_LINUX_FLAVOURS} | awk '{ print $1 }'`" +DEFAULT_FLAVOUR="`echo ${LH_LINUX_FLAVOURS} | awk '{ print $1 }'`" DEFAULT_KERNEL="`basename chroot/boot/vmlinux-*${DEFAULT_FLAVOUR}`" DEFAULT_INITRD="initrd.img-`echo ${DEFAULT_KERNEL} | sed -e 's/vmlinux-//'`" Yaboot_live_entry "live" "${DEFAULT_KERNEL}" "${DEFAULT_INITRD}" Yaboot_live_entry "live-failsafe" "${DEFAULT_KERNEL}" "${DEFAULT_INITRD}" "${FAILSAFE}" -if [ "`echo ${LIVE_LINUX_FLAVOURS} | wc -w`" -gt "1" ] +if [ "`echo ${LH_LINUX_FLAVOURS} | wc -w`" -gt "1" ] then for KERNEL in chroot/boot/vmlinux-* do @@ -212,10 +212,10 @@ then done fi -LINUX_LIVE="`echo ${LINUX_LIVE} | sed -e 's/binary//g' -e 's#//#/#g'`" +LINUX_LIVE="`/bin/echo ${LINUX_LIVE} | sed -e 's/binary//g' -e 's#//#/#g'`" # Assembling debian-installer configuration -if [ "${LIVE_DEBIAN_INSTALLER}" != "disabled" ] +if [ "${LH_DEBIAN_INSTALLER}" != "disabled" ] then VMLINUZ_DI="vmlinuz" INITRD_DI="initrd.gz" @@ -236,14 +236,14 @@ then Yaboot_install_entry "autogui" "${VMLINUZ_GI}" "${INITRD_GI}" "auto=true priority=critical ${APPEND_GI}" fi -LINUX_INSTALL="`echo ${LINUX_INSTALL} | sed -e 's/binary//g' -e 's#//#/#g'`" +LINUX_INSTALL="`/bin/echo ${LINUX_INSTALL} | sed -e 's/binary//g' -e 's#//#/#g'`" -case "${LIVE_BINARY_IMAGES}" in +case "${LH_BINARY_IMAGES}" in iso|usb-hdd) # Copying yaboot mkdir -p binary/yaboot - case "${LIVE_CHROOT_BUILD}" in + case "${LH_CHROOT_BUILD}" in enabled) cp chroot/usr/lib/yaboot/yaboot binary/yaboot ;; @@ -255,7 +255,7 @@ case "${LIVE_BINARY_IMAGES}" in cp -r "${TEMPLATES}"/* binary/yaboot - if [ "${LIVE_BINARY_IMAGES}" = "usb-hdd" ] + if [ "${LH_BINARY_IMAGES}" = "usb-hdd" ] then mv binary/yaboot/yaboot.conf binary/yaboot/yaboot.conf.tmp echo "root=/dev/ram" > binary/yaboot/yaboot.conf @@ -265,8 +265,8 @@ case "${LIVE_BINARY_IMAGES}" in # Configure yaboot templates sed -i -e "s#LINUX_LIVE#${LINUX_LIVE}#" -e "s#LINUX_INSTALL#${LINUX_INSTALL}#" binary/yaboot/yaboot.conf - sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/yaboot/yaboot.conf - sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" -e "s/LIVE_VERSION/${VERSION}/" binary/yaboot/boot.msg + sed -i -e "s#LH_BOOTAPPEND#${LH_BOOTAPPEND}#" binary/yaboot/yaboot.conf + sed -i -e "s/LH_DATE/`date +%Y%m%d`/" -e "s/LH_VERSION/${VERSION}/" binary/yaboot/boot.msg ;; esac diff --git a/helpers/lh_bootstrap_cdebootstrap b/helpers/lh_bootstrap_cdebootstrap index 31ffc7764..37c8c79a2 100755 --- a/helpers/lh_bootstrap_cdebootstrap +++ b/helpers/lh_bootstrap_cdebootstrap @@ -58,22 +58,22 @@ Create_lockfile .lock mkdir -p chroot # Setting cdebootstrap options -if [ -n "${LIVE_ARCHITECTURE}" ] +if [ -n "${LH_ARCHITECTURE}" ] then - CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --arch=${LIVE_ARCHITECTURE}" + CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --arch=${LH_ARCHITECTURE}" fi -if [ -n "${LIVE_BOOTSTRAP_CONFIG}" ] +if [ -n "${LH_BOOTSTRAP_CONFIG}" ] then - CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --suite-config=${LIVE_BOOTSTRAP_CONFIG}" + CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --suite-config=${LH_BOOTSTRAP_CONFIG}" fi -if [ -n "${LIVE_BOOTSTRAP_KEYRING}" ] +if [ -n "${LH_BOOTSTRAP_KEYRING}" ] then - CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --keyring=${LIVE_BOOTSTRAP_KEYRING}" + CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --keyring=${LH_BOOTSTRAP_KEYRING}" fi -if [ "${LIVE_PACKAGES_LISTS}" != "minimal" ] && [ "${LIVE_PACKAGES_LISTS}" != "mini" ] +if [ "${LH_PACKAGES_LISTS}" != "minimal" ] && [ "${LH_PACKAGES_LISTS}" != "mini" ] then CDEBOOTSTRAP_OPTIONS="${CDEBOOTSTRAP_OPTIONS} --flavour=standard" else @@ -106,7 +106,7 @@ then fi # Executing cdebootstrap (download-only) - ${LH_ROOT_COMMAND} cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BOOTSTRAP}" + ${LH_ROOT_COMMAND} cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LH_DISTRIBUTION}" chroot "${LH_MIRROR_BOOTSTRAP}" if [ -n "${LH_ROOT_COMMAND}" ] then @@ -126,7 +126,7 @@ then fi # Executing cdebootstrap (regular run) - ${LH_ROOT_COMMAND} cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BOOTSTRAP}" + ${LH_ROOT_COMMAND} cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LH_DISTRIBUTION}" chroot "${LH_MIRROR_BOOTSTRAP}" if [ -n "${LH_ROOT_COMMAND}" ] then @@ -134,7 +134,7 @@ then fi # Remove cdebootstrap-helper-diverts (needed at least for minimal flavours) - if [ "${LIVE_BOOTSTRAP_FLAVOUR}" = "minimal" ] || [ "${LIVE_BOOTSTRAP_FLAVOUR}" = "mini" ] + if [ "${LH_BOOTSTRAP_FLAVOUR}" = "minimal" ] || [ "${LH_BOOTSTRAP_FLAVOUR}" = "mini" ] then Chroot "dpkg -P cdebootstrap-helper-diverts" fi diff --git a/helpers/lh_bootstrap_debootstrap b/helpers/lh_bootstrap_debootstrap index 4c0fd6efc..ad71962b4 100755 --- a/helpers/lh_bootstrap_debootstrap +++ b/helpers/lh_bootstrap_debootstrap @@ -58,14 +58,14 @@ Create_lockfile .lock mkdir -p chroot # Setting debootstrap options -if [ -n "${LIVE_ARCHITECTURE}" ] +if [ -n "${LH_ARCHITECTURE}" ] then - DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --arch ${LIVE_ARCHITECTURE}" + DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --arch ${LH_ARCHITECTURE}" fi -if [ -n "${LIVE_BOOTSTRAP_CONFIG}" ] +if [ -n "${LH_BOOTSTRAP_CONFIG}" ] then - LIVE_DEBOOTSTRAP_SCRIPT="/usr/lib/debootstrap/scripts/${LIVE_BOOTSTRAP_CONFIG}" + LH_DEBOOTSTRAP_SCRIPT="/usr/lib/debootstrap/scripts/${LH_BOOTSTRAP_CONFIG}" fi if [ "${LH_VERBOSE}" = "true" ] @@ -84,7 +84,7 @@ then fi # Executing debootstrap (download-only) - ${LH_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BOOTSTRAP}" "${LIVE_DEBOOTSTRAP_SCRIPT}" + ${LH_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LH_DISTRIBUTION}" chroot "${LH_MIRROR_BOOTSTRAP}" "${LH_DEBOOTSTRAP_SCRIPT}" if [ -n "${LH_ROOT_COMMAND}" ] then @@ -104,7 +104,7 @@ then fi # Executing debootstrap (regular run) - ${LH_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_BOOTSTRAP}" "${LIVE_DEBOOTSTRAP_SCRIPT}" + ${LH_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS} "${LH_DISTRIBUTION}" chroot "${LH_MIRROR_BOOTSTRAP}" "${LH_DEBOOTSTRAP_SCRIPT}" if [ -n "${LH_ROOT_COMMAND}" ] then diff --git a/helpers/lh_chroot_apt b/helpers/lh_chroot_apt index b89c2c935..2534efd05 100755 --- a/helpers/lh_chroot_apt +++ b/helpers/lh_chroot_apt @@ -51,15 +51,15 @@ case "${1}" in mkdir -p chroot/etc/apt/apt.conf.d # Configuring apt ftp proxy - if [ -n "${LH_APT_FTPPROXY}" ] + if [ -n "${LH_APT_FTP_PROXY}" ] then - echo "Acquire::ftp::Proxy \"${LH_APT_FTPPROXY}\";" > chroot/etc/apt/apt.conf.d/00ftp-proxy + echo "Acquire::ftp::Proxy \"${LH_APT_FTP_PROXY}\";" > chroot/etc/apt/apt.conf.d/00ftp-proxy fi # Configuring apt http proxy - if [ -n "${LH_APT_HTTPPROXY}" ] + if [ -n "${LH_APT_HTTP_PROXY}" ] then - echo "Acquire::http::Proxy \"${LH_APT_HTTPPROXY}\";" > chroot/etc/apt/apt.conf.d/00http-proxy + echo "Acquire::http::Proxy \"${LH_APT_HTTP_PROXY}\";" > chroot/etc/apt/apt.conf.d/00http-proxy fi # Configuring apt pdiffs @@ -80,18 +80,17 @@ case "${1}" in fi # Configuring apt recommends - if [ "${LH_APT}" = "aptitude" ] - then - case "${LH_APT_RECOMMENDS}" in - enabled) - echo "Aptitude::Recommends-Important \"true\";" > chroot/etc/apt/apt.conf.d/00recommends - ;; - - disabled) - echo "Aptitude::Recommends-Important \"false\";" > chroot/etc/apt/apt.conf.d/00recommends - ;; - esac - fi + case "${LH_APT_RECOMMENDS}" in + enabled) + echo "APT::Install-Recommends \"true\";" > chroot/etc/apt/apt.conf.d/00recommends + echo "Aptitude::Recommends-Important \"true\";" >> chroot/etc/apt/apt.conf.d/00recommends + ;; + + disabled) + echo "APT::Install-Recommends \"false\";" > chroot/etc/apt/apt.conf.d/00recommends + echo "Aptitude::Recommends-Important \"false\";" >> chroot/etc/apt/apt.conf.d/00recommends + ;; + esac # Configuring apt secure case "${LH_APT_SECURE}" in diff --git a/helpers/lh_chroot_hacks b/helpers/lh_chroot_hacks index cc9b4319f..a8ee98979 100755 --- a/helpers/lh_chroot_hacks +++ b/helpers/lh_chroot_hacks @@ -49,7 +49,7 @@ Create_lockfile .lock # Removing udev mac caching rule Chroot "rm -f /etc/udev/rules.d/z25_persistent-net.rules" -case "${LIVE_BINARY_IMAGES}" in +case "${LH_BINARY_IMAGES}" in net) if [ ! -f chroot/usr/bin/smbmount ] then @@ -80,6 +80,12 @@ EOF ;; esac +# Remove resume +if [ "${LH_DISTRIBUTION}" = "etch" ] && [ -e /etc/initramfs-tools/conf.d/resume ] +then + rm -f /etc/initramfs-tools/conf.d/resume +fi + # Update initramfs Chroot "update-initramfs -k all -t -u" @@ -99,9 +105,9 @@ then ${LH_ROOT_COMMAND} chown -R --quiet `whoami`:`whoami` chroot fi -if [ -d chroot/home/${LIVE_USERNAME} ] +if [ -d chroot/home/${LH_USERNAME} ] then - chown -R --quiet 999:999 chroot/home/${LIVE_USERNAME} + chown -R --quiet 999:999 chroot/home/${LH_USERNAME} fi # Creating stage file diff --git a/helpers/lh_chroot_hooks b/helpers/lh_chroot_hooks index caa4fd3ab..3e1fc0d7c 100755 --- a/helpers/lh_chroot_hooks +++ b/helpers/lh_chroot_hooks @@ -47,7 +47,7 @@ Check_lockfile .lock Create_lockfile .lock # Processing hooks -for HOOK in ${LIVE_PACKAGES_LISTS} ${LIVE_TASKS} +for HOOK in ${LH_PACKAGES_LISTS} ${LH_TASKS} do if [ -f ${LH_BASE:-/usr/share/live-helper}/hooks/"${HOOK}" ] then @@ -71,7 +71,7 @@ do fi done -if [ -n "${LIVE_HOOKS}" ] && [ "${LIVE_HOOKS}" != "none" ] +if [ -n "${LH_HOOKS}" ] && [ "${LH_HOOKS}" != "none" ] then - LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" LIVE_DEBCONF_NOWARNINGS="no" Chroot "${LIVE_HOOKS}" + LH_DEBCONF_FRONTEND="readline" LH_DEBCONF_PRIORITY="low" LH_DEBCONF_NOWARNINGS="no" Chroot "${LH_HOOKS}" fi diff --git a/helpers/lh_chroot_hostname b/helpers/lh_chroot_hostname index be3b6af65..7d04d68df 100755 --- a/helpers/lh_chroot_hostname +++ b/helpers/lh_chroot_hostname @@ -1,6 +1,6 @@ #!/bin/sh -# lh_chroot_hostname(1) - manage /etc/hostname +# lh_chroot_hostname(1) - manage /bin/hostname # Copyright (C) 2006-2007 Daniel Baumann <daniel@debian.org> # # live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING. @@ -18,7 +18,7 @@ do done # Setting static variables -DESCRIPTION="manage /etc/hostname" +DESCRIPTION="manage /bin/hostname" HELP="" USAGE="${PROGRAM} {install|remove} [--force]" @@ -48,17 +48,23 @@ case "${1}" in # Creating lock file Create_lockfile .lock - if [ -f chroot/etc/hostname ] - then - # Save hostname file - mv chroot/etc/hostname chroot/etc/hostname.orig - fi + # Save hostname + mv chroot/bin/hostname chroot/bin/hostname.orig # Create hostname file echo "localhost.localdomain" > chroot/etc/hostname - # Set hostname - Chroot "hostname -F /etc/hostname" + Echo_message "Configuring file /bin/hostname" + + # Create hostname program + +cat > chroot/bin/hostname << EOF +#!/bin/sh + +echo "localhost.localdomain" +EOF + + chmod 755 chroot/bin/hostname # Creating stage file Create_stagefile .stage/chroot_hostname @@ -73,20 +79,10 @@ case "${1}" in # Creating lock file Create_lockfile .lock - if [ -f chroot/etc/hostname.orig ] - then - # Restore hostname file - mv chroot/etc/hostname.orig chroot/etc/hostname - else - # Remove hostname file - rm -f chroot/etc/hostname - fi - - # Set hostname (somehow this seems to be really needed :/) - if [ -f /etc/hostname ] - then - hostname -F /etc/hostname - fi + Echo_message "Deconfiguring file /bin/hostname" + + # Restore hostname file + mv chroot/bin/hostname.orig chroot/bin/hostname # Removing stage file rm -f .stage/chroot_hostname diff --git a/helpers/lh_chroot_interactive b/helpers/lh_chroot_interactive index 2a9417efa..8c63e2211 100755 --- a/helpers/lh_chroot_interactive +++ b/helpers/lh_chroot_interactive @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_INTERACTIVE}" = "disabled" ] +if [ "${LH_INTERACTIVE}" = "disabled" ] then exit 0 fi @@ -51,7 +51,7 @@ Check_lockfile .lock # Creating lock file Create_lockfile .lock -case "${LIVE_INTERACTIVE}" in +case "${LH_INTERACTIVE}" in enabled|shell) echo "Pausing build: starting interactive shell..." Chroot "/bin/bash --login" diff --git a/helpers/lh_chroot_linux-image b/helpers/lh_chroot_linux-image index c00d4c53b..44bbfa51f 100755 --- a/helpers/lh_chroot_linux-image +++ b/helpers/lh_chroot_linux-image @@ -70,11 +70,11 @@ EOF # mv chroot/usr/sbin/update-initramfs chroot/usr/sbin/update-initramfs.live-helper #fi - if [ "${LIVE_LINUX_PACKAGES}" != "none" ] + if [ "${LH_LINUX_PACKAGES}" != "none" ] then - for FLAVOUR in ${LIVE_LINUX_FLAVOURS} + for FLAVOUR in ${LH_LINUX_FLAVOURS} do - for PACKAGE in ${LIVE_LINUX_PACKAGES} + for PACKAGE in ${LH_LINUX_PACKAGES} do PACKAGES="${PACKAGES} ${PACKAGE}-${FLAVOUR}" done diff --git a/helpers/lh_chroot_localization b/helpers/lh_chroot_localization index c31072f5b..25e8d5f65 100755 --- a/helpers/lh_chroot_localization +++ b/helpers/lh_chroot_localization @@ -47,9 +47,9 @@ Check_lockfile .lock Create_lockfile .lock # Setting localizations -if [ -n "${LIVE_LANGUAGE}" ] +if [ -n "${LH_LANGUAGE}" ] then - case "${LIVE_LANGUAGE}" in + case "${LH_LANGUAGE}" in af) # Afrikaans LOCALIZATIONS="iceweasel kde openoffice" @@ -601,45 +601,45 @@ then esac # Setting languages - ICEAPE="${ICEAPE:-$LIVE_LANGUAGE}" - ICEDOVE="${ICEDOVE:-$LIVE_LANGUAGE}" - ICEWEASEL="${ICEWEASEL:-$LIVE_LANGUAGE}" - KDE="${KDE:-$LIVE_LANGUAGE}" - KOFFICE="${KOFFICE:-$LIVE_LANGUAGE}" - OPENOFFICE="${OPENOFFICE:-$LIVE_LANGUAGE}" + ICEAPE="${ICEAPE:-$LH_LANGUAGE}" + ICEDOVE="${ICEDOVE:-$LH_LANGUAGE}" + ICEWEASEL="${ICEWEASEL:-$LH_LANGUAGE}" + KDE="${KDE:-$LH_LANGUAGE}" + KOFFICE="${KOFFICE:-$LH_LANGUAGE}" + OPENOFFICE="${OPENOFFICE:-$LH_LANGUAGE}" # Setting packages for LOCALIZATION in ${LOCALIZATIONS} do case "${LOCALIZATION}" in iceape) - Check_package chroot/usr/bin/iceape iceweasel-l10n-"${ICEAPE}" + Check_installed chroot/usr/bin/iceape iceape; [ $INSTALL_STATUS -eq 0 ] && Check_package "" iceweasel-l10n-"${ICEAPE}" ;; icedove) - Check_package chroot/usr/bin/icedove icedove-locale-"${ICEDOVE}" + Check_installed chroot/usr/bin/icedove icedove; [ $INSTALL_STATUS -eq 0 ] && Check_package "" icedove-locale-"${ICEDOVE}" ;; iceweasel) - Check_package chroot/usr/bin/iceweasel iceweasel-l10n-"${ICEWEASEL}" + Check_installed chroot/usr/bin/iceweasel iceweasel; [ $INSTALL_STATUS -eq 0 ] && Check_package "" iceweasel-l10n-"${ICEWEASEL}" ;; kde) - Check_package chroot/usr/bin/kstart kde-i18n-"${KDE}" + Check_installed chroot/usr/bin/kstart kdebase-bin; [ $INSTALL_STATUS -eq 0 ] && Check_package "" kde-i18n-"${KDE}" ;; koffice) - Check_package chroot/usr/bin/usr/bin/koconverter koffice-i18n-"${KOFFICE}" + Check_installed chroot/usr/bin/koconverter koffice; [ $INSTALL_STATUS -eq 0 ] && Check_package "" koffice-i18n-"${KOFFICE}" ;; openoffice) - Check_package chroot/usr/bin/ooffice openoffice.org-l10n-"${OPENOFFICE}" + Check_installed chroot/usr/bin/ooffice openoffice.org-common; [ $INSTALL_STATUS -eq 0 ] && Check_package "" openoffice.org-l10n-"${OPENOFFICE}" ;; esac done - Check_package chroot/usr/bin/gwenview gwenview-i18n - Check_package chroot/usr/bin/k3b k3b-i18n + Check_installed chroot/usr/bin/gwenview gwenview; [ $INSTALL_STATUS -eq 0 ] && Check_package "" gwenview-i18n + Check_installed chroot/usr/bin/k3b k3b; [ $INSTALL_STATUS -eq 0 ] && Check_package "" k3b-i18n # Restoring cache Restore_cache cache/packages_localization diff --git a/helpers/lh_chroot_packages b/helpers/lh_chroot_packages index bfc427cab..87e8eaf98 100755 --- a/helpers/lh_chroot_packages +++ b/helpers/lh_chroot_packages @@ -46,7 +46,7 @@ Check_lockfile .lock # Creating lock file Create_lockfile .lock -if [ -n "${LIVE_PACKAGES}" ] && [ "${LIVE_PACKAGES}" != "none" ] +if [ -n "${LH_PACKAGES}" ] && [ "${LH_PACKAGES}" != "none" ] then # Restoring cache Restore_cache cache/packages_packages @@ -54,11 +54,11 @@ then # Installing packages case "${LH_APT}" in apt|apt-get) - Chroot "apt-get install --yes ${LIVE_PACKAGES}" + Chroot "apt-get install --yes ${LH_PACKAGES}" ;; aptitude) - Chroot "aptitude install --assume-yes ${LIVE_PACKAGES}" + Chroot "aptitude install --assume-yes ${LH_PACKAGES}" ;; esac diff --git a/helpers/lh_chroot_packageslists b/helpers/lh_chroot_packageslists index da796a764..2c21574f2 100755 --- a/helpers/lh_chroot_packageslists +++ b/helpers/lh_chroot_packageslists @@ -46,12 +46,12 @@ Check_lockfile .lock # Creating lock file Create_lockfile .lock -if [ -n "${LIVE_PACKAGES_LISTS}" ] && [ "${LIVE_PACKAGES_LISTS}" != "none" ] +if [ -n "${LH_PACKAGES_LISTS}" ] && [ "${LH_PACKAGES_LISTS}" != "none" ] then # Restoring cache Restore_cache cache/packages_packageslists - for LIST in ${LIVE_PACKAGES_LISTS} + for LIST in ${LH_PACKAGES_LISTS} do if [ -f ${LH_BASE:-/usr/share/live-helper}/lists/"${LIST}" ] then diff --git a/helpers/lh_chroot_preseed b/helpers/lh_chroot_preseed index 6e9cf9136..55732ef9a 100755 --- a/helpers/lh_chroot_preseed +++ b/helpers/lh_chroot_preseed @@ -47,7 +47,7 @@ Check_lockfile .lock Create_lockfile .lock # Processing preseeds -for PRESEED in ${LIVE_PACKAGES_LISTS} ${LIVE_TASKS} +for PRESEED in ${LH_PACKAGES_LISTS} ${LH_TASKS} do if [ -f ${LH_BASE:-/usr/share/live-helper}/preseed/"${PRESEED}" ] then diff --git a/helpers/lh_chroot_sources b/helpers/lh_chroot_sources index 9d255f9d1..4e46ea9b2 100755 --- a/helpers/lh_chroot_sources +++ b/helpers/lh_chroot_sources @@ -49,34 +49,34 @@ case "${1}" in Create_lockfile .lock # Configure custom sources.list - echo "deb ${LIVE_MIRROR_BOOTSTRAP} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > chroot/etc/apt/sources.list + echo "deb ${LH_MIRROR_BOOTSTRAP} ${LH_DISTRIBUTION} ${LH_SECTIONS}" > chroot/etc/apt/sources.list - if [ "${LIVE_SOURCE}" = "enabled" ] + if [ "${LH_SOURCE}" = "enabled" ] then - echo "deb-src ${LIVE_MIRROR_BOOTSTRAP} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + echo "deb-src ${LH_MIRROR_BOOTSTRAP} ${LH_DISTRIBUTION} ${LH_SECTIONS}" >> chroot/etc/apt/sources.list fi - if [ "${LIVE_SECURITY}" = "enabled" ] + if [ "${LH_SECURITY}" = "enabled" ] then case "${LH_MODE}" in debian) - if [ "${LIVE_DISTRIBUTION}" != "sid" ] && [ "${LIVE_DISTRIBUTION}" != "unstable" ] + if [ "${LH_DISTRIBUTION}" != "sid" ] && [ "${LH_DISTRIBUTION}" != "unstable" ] then - echo "deb ${LIVE_MIRROR_BOOTSTRAP_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + echo "deb ${LH_MIRROR_BOOTSTRAP_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_SECTIONS}" >> chroot/etc/apt/sources.list - if [ "${LIVE_SOURCE}" = "enabled" ] + if [ "${LH_SOURCE}" = "enabled" ] then - echo "deb-src ${LIVE_MIRROR_BOOTSTRAP_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + echo "deb-src ${LH_MIRROR_BOOTSTRAP_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_SECTIONS}" >> chroot/etc/apt/sources.list fi fi ;; ubuntu) - echo "deb ${LIVE_MIRROR_BOOTSTRAP_SECURITY} ${LIVE_DISTRIBUTION}-security ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + echo "deb ${LH_MIRROR_BOOTSTRAP_SECURITY} ${LH_DISTRIBUTION}-security ${LH_SECTIONS}" >> chroot/etc/apt/sources.list - if [ "${LIVE_SOURCE}" = "enabled" ] + if [ "${LH_SOURCE}" = "enabled" ] then - echo "deb-src ${LIVE_MIRROR_BOOTSTRAP_SECURITY} ${LIVE_DISTRIBUTION}-security ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + echo "deb-src ${LH_MIRROR_BOOTSTRAP_SECURITY} ${LH_DISTRIBUTION}-security ${LH_SECTIONS}" >> chroot/etc/apt/sources.list fi ;; esac @@ -175,9 +175,9 @@ case "${1}" in fi # Installing keyring packages - if [ -n "${LIVE_KEYRING_PACKAGES}" ] + if [ -n "${LH_KEYRING_PACKAGES}" ] then - Chroot "apt-get install --yes --force-yes ${LIVE_KEYRING_PACKAGES}" + Chroot "apt-get install --yes --force-yes ${LH_KEYRING_PACKAGES}" Chroot "apt-get update" fi @@ -211,11 +211,11 @@ case "${1}" in Create_lockfile .lock # Configure generic indices - if [ "${LIVE_BINARY_INDICES}" = "enabled" ] + if [ "${LH_BINARY_INDICES}" = "enabled" ] then # Don't do anything if it's not required - if [ "${LIVE_MIRROR_BOOTSTRAP}" = "${LIVE_MIRROR_BINARY}" ] && \ - [ "${LIVE_MIRROR_BOOTSTRAP_SECURITY}" = "${LIVE_MIRROR_BINARY_SECURITY}" ] + if [ "${LH_MIRROR_BOOTSTRAP}" = "${LH_MIRROR_BINARY}" ] && \ + [ "${LH_MIRROR_BOOTSTRAP_SECURITY}" = "${LH_MIRROR_BINARY_SECURITY}" ] then # Removing stage file rm -f .stage/chroot_sources @@ -227,34 +227,34 @@ case "${1}" in rm -rf chroot/var/lib/apt/lists mkdir -p chroot/var/lib/apt/lists/partial - echo "deb ${LIVE_MIRROR_BINARY} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > chroot/etc/apt/sources.list + echo "deb ${LH_MIRROR_BINARY} ${LH_DISTRIBUTION} ${LH_SECTIONS}" > chroot/etc/apt/sources.list - if [ "${LIVE_SOURCE}" = "enabled" ] + if [ "${LH_SOURCE}" = "enabled" ] then - echo "deb-src ${LIVE_MIRROR_BINARY} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + echo "deb-src ${LH_MIRROR_BINARY} ${LH_DISTRIBUTION} ${LH_SECTIONS}" >> chroot/etc/apt/sources.list fi - if [ "${LIVE_SECURITY}" = "enabled" ] + if [ "${LH_SECURITY}" = "enabled" ] then case "${LH_MODE}" in debian) - if [ "${LIVE_DISTRIBUTION}" != "sid" ] && [ "${LIVE_DISTRIBUTION}" != "unstable" ] + if [ "${LH_DISTRIBUTION}" != "sid" ] && [ "${LH_DISTRIBUTION}" != "unstable" ] then - echo "deb ${LIVE_MIRROR_BINARY_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + echo "deb ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_SECTIONS}" >> chroot/etc/apt/sources.list - if [ "${LIVE_SOURCE}" = "enabled" ] + if [ "${LH_SOURCE}" = "enabled" ] then - echo "deb-src ${LIVE_MIRROR_BINARY_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + echo "deb-src ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}/updates ${LH_SECTIONS}" >> chroot/etc/apt/sources.list fi fi ;; ubuntu) - echo "deb ${LIVE_MIRROR_BINARY_SECURITY} ${LIVE_DISTRIBUTION}-security ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + echo "deb ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}-security ${LH_SECTIONS}" >> chroot/etc/apt/sources.list - if [ "${LIVE_SOURCE}" = "enabled" ] + if [ "${LH_SOURCE}" = "enabled" ] then - echo "deb-src ${LIVE_MIRROR_BINARY_SECURITY} ${LIVE_DISTRIBUTION}-security ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list + echo "deb-src ${LH_MIRROR_BINARY_SECURITY} ${LH_DISTRIBUTION}-security ${LH_SECTIONS}" >> chroot/etc/apt/sources.list fi ;; esac diff --git a/helpers/lh_chroot_symlinks b/helpers/lh_chroot_symlinks index a7ceefe62..4fffd146a 100755 --- a/helpers/lh_chroot_symlinks +++ b/helpers/lh_chroot_symlinks @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_SYMLINKS}" != "enabled" ] +if [ "${LH_SYMLINKS}" != "enabled" ] then exit 0 fi diff --git a/helpers/lh_chroot_sysvinit b/helpers/lh_chroot_sysvinit index ca45aff39..ffed709de 100755 --- a/helpers/lh_chroot_sysvinit +++ b/helpers/lh_chroot_sysvinit @@ -46,7 +46,7 @@ Check_lockfile .lock # Creating lock file Create_lockfile .lock -if [ "${LIVE_SYSVINIT}" = "enabled" ] +if [ "${LH_SYSVINIT}" = "enabled" ] then # Disable all for FILE in chroot/etc/init.d/* diff --git a/helpers/lh_chroot_tasks b/helpers/lh_chroot_tasks index 704f3d49e..49f44b6d6 100755 --- a/helpers/lh_chroot_tasks +++ b/helpers/lh_chroot_tasks @@ -46,7 +46,7 @@ Check_lockfile .lock # Creating lock file Create_lockfile .lock -if [ -n "${LIVE_TASKS}" ] && [ "${LIVE_TASKS}" != "none" ] +if [ -n "${LH_TASKS}" ] && [ "${LH_TASKS}" != "none" ] then # Restoring cache Restore_cache cache/packages_tasks @@ -68,11 +68,11 @@ then # Installing tasks case "${LH_TASKSEL}" in aptitude) - Chroot "aptitude install --assume-yes ${LIVE_TASKS}" + Chroot "aptitude install --assume-yes ${LH_TASKS}" ;; tasksel) - for TASK in ${LIVE_TASKS} + for TASK in ${LH_TASKS} do Chroot "tasksel --debconf-apt-progress --logstderr install ${TASK}" done diff --git a/helpers/lh_config b/helpers/lh_config index 41c043250..60e8530c9 100755 --- a/helpers/lh_config +++ b/helpers/lh_config @@ -19,60 +19,505 @@ done # Setting static variables DESCRIPTION="create configuration for live-helper(7)" -HELP="" -USAGE="${PROGRAM} [--force]" +HELP="FIXME" +USAGE="${PROGRAM} [--apt apt|aptitude] [--apt-ftp-proxy URL] [--apt-http-proxy URL] [--apt-pdiffs enabled|disabled] [--apt-pipeline FIXME] [--apt-recommends enabled|disabled] [--apt-secure enabled|disabled] [-a|--architecture ARCHITECTURE] [-b|--binary-images iso|net|tar|usb-hdd] [--binary-indices enabled|disabled] [--bootappend PARAMETER|\"PARAMETERS\"] [--bootloader grub|syslinux|yaboot] [--bootstrap cdebootstrap|debootstrap] [--bootstrap-config FILE] [-f|--bootstrap-flavour minimal|standard] [--bootstrap-keyring PACKAGE] [--breakpoints] [--cache enabled|disabled] [--cache-indices enabled|disabled] [--cache-packages enabled|disabled] [--cache-stages STAGE|\"STAGES\"] [--chroot-build enabled|disabled] [--chroot-filesystem ext2|ext3|squashfs|plain] [-c|--conffile FILE] [--debconf-frontend dialog|editor|noninteractive|readline] [--debconf-nowarnings enabled|disabled] [--debconf-priority low|medium|high|critical] [--debian-installer enabled|disabled] [--debug] [-d|--distribution CODENAME] [-e|--encryption aes128|aes192|aes256] [--force] [--genisoimage genisomage|mkisofs] [--grub-splash FILE] [--hooks FILE] [--hostname NAME] [--includes PATH] [--initramfs auto|live-initramfs|casper] [--interactive shell] [--iso-application NAME] [--iso-preparer NAME] [--iso-publisher NAME] [--iso-volume NAME] [--keyring-packages PACKAGE|\"PACKAGES\"] [-l|--language LANGUAGE] [-k|--linux-flavours FLAVOUR|\"FLAVOURS\"] [--linux-packages \"PACKAGES\"] [--losetup losetup|losetup.orig] [--memtest memtest86+|memtest86] [-m|--mirror-binary-security URL] [--mirror-binary URL] [--mirror-bootstrap-security URL] [--mirror-bootstrap URL] [--mode debian|debian-edu|ubuntu] [--net-filesystem nfs|cfs] [--net-mountoptions OPTIONS] [--net-path PATH] [--net-server IP|HOSTNAME] [-p|--packages-lists FILE] [--packages PACKAGE|\"PACKAGES\"] [--quiet] [--root-command sudo] [--sections SECTION|\"SECTIONS\"] [--security enabled|disabled] [--source enabled|disabled] [-s|--source-images iso|net|tar|usb-hdd] [--symlinks enabled|disabled] [--syslinux-splash FILE] [--syslinux-timeout MILISECONDS] [--sysvinit enabled|disabled] [--tasksel aptitude|tasksel] [--tasks TASK] [--templates PATH] [--union-filesystem aufs|unionfs] [--username NAME] [--verbose]" -Arguments "${@}" +Local_arguments () +{ + ARGUMENTS="`getopt --longoptions apt:,apt-ftp-proxy:,apt-http-proxy:,apt-pdiffs:,apt-pipeline:,apt-recommends:,apt-secure:,bootstrap:,cache:,cache-indices:,cache-packages:,cache-stages:,debconf-frontend:,debconf-nowarnings:,debconf-priority:,genisoimage:,initramfs:,losetup:,mode:,root-command:,tasksel:,includes:,templates:,architecture:,bootstrap-config:,bootstrap-flavour:,bootstrap-keyring:,distribution:,mirror-bootstrap:,mirror-bootstrap-security:,mirror-binary:,mirror-binary-security:,sections:,chroot-filesystem:,union-filesystem:,hooks:,interactive:,keyring-packages:,language:,linux-flavours:,linux-packages:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,binary-images:,binary-indices:,bootappend:,bootloader:,chroot-build:,debian-installer:,encryption:,grub-splash:,hostname:,iso-application:,iso-preparer:,iso-publisher:,iso-volume:,iso-memtest:,net-filesystem:,net-mountoptions:,net-path:,net-server:,syslinux-splash:,syslinux-timeout:,username:,source:,source-images:,breakpoints,conffile:,debug,force,help,quiet,usage,verbose,version --name=${PROGRAM} --options a:f:d:m:l:k:p:b:e:s:c:huv --shell sh -- "${@}"`" -CONFIG="${1}" - -if [ -n "${LH_CONFIG}" ] -then - if [ -d ${LH_BASE:-/usr/share/live-helper}/configs/"${LH_CONFIG}" ] + if [ "${?}" != "0" ] then - mkdir "${LH_CONFIG}" - cp -r ${LH_BASE:-/usr/share/live-helper}/configs/"${LH_CONFIG}" "${LH_CONFIG}"/config - - LIVE_ROOT="${LH_CONFIG}" - CONFIG="" - else - Echo_error "Couldn't find config ${LH_CONFIG} in ${LH_BASE:-/usr/share/live-helper}/configs/." + Echo_error "terminating" >&2 + exit 1 fi -fi -if [ "${CONFIG}" != "newconfig" ] -then - # Source existing configuration - Read_conffile "${LIVE_ROOT}"/config/common - Read_conffile "${LIVE_ROOT}"/config/bootstrap - Read_conffile "${LIVE_ROOT}"/config/chroot - Read_conffile "${LIVE_ROOT}"/config/binary - Read_conffile "${LIVE_ROOT}"/config/source -fi + eval set -- "${ARGUMENTS}" + + while true + do + case "${1}" in + # config/common + --apt) + LH_APT="${2}" + shift 2 + ;; + + --apt-ftp-proxy) + LH_APT_FTP_PROXY="${2}" + shift 2 + ;; + + --apt-http-proxy) + LH_APT_HTTP_PROXY="${2}" + shift 2 + ;; + + --apt-pdiffs) + LH_APT_PDIFFS="${2}" + shift 2 + ;; + + --apt-pipeline) + LH_APT_PIPELINE="${2}" + shift 2 + ;; + + --apt-recommends) + LH_APT_RECOMMENDS="${2}" + shift 2 + ;; + + --apt-secure) + LH_APT_SECURE="${2}" + shift 2 + ;; + + --bootstrap) + LH_BOOTSTRAP="${2}" + shift 2 + ;; + + --cache) + LH_CACHE="${2}" + shift 2 + ;; + + --cache-indices) + LH_CACHE_INDICES="${2}" + shift 2 + ;; + + --cache-packages) + LH_CACHE_PACKAGES="${2}" + shift 2 + ;; + + --cache-stages) + LH_CACHE_STAGES="${2}" + shift 2 + ;; + + --debconf-frontend) + LH_DEBCONF_FRONTEND="${2}" + shift 2 + ;; + + --debconf-nowarnings) + LH_DEBCONF_NOWARNINGS="${2}" + shift 2 + ;; + + --debconf-priority) + LH_DEBCONF_PRIORITY="${2}" + shift 2 + ;; + + --genisoimage) + LH_GENISOIMAGE="${2}" + shift 2 + ;; + + --initramfs) + LH_INITRAMFS="${2}" + shift 2 + ;; + + --losetup) + LH_LOSETUP="${2}" + shift 2 + ;; + + --mode) + LH_MODE="${2}" + shift 2 + ;; + + --root-command) + LH_ROOT_COMMAND="${2}" + shift 2 + ;; + + --tasksel) + LH_TASKSEL="${2}" + shift 2 + ;; + + --includes) + LH_INCLUDES="${2}" + shift 2 + ;; + + --templates) + LH_TEMPLATES="${2}" + shift 2 + ;; + + --breakpoints) + LH_BREAKPOINTS="enabled" + shift + ;; + + --debug) + LH_DEBUG="enabled" + shift + ;; + + --force) + LH_FORCE="enabled" + shift + ;; + + --quiet) + LH_QUIET="enabled" + shift + ;; + + --verbose) + LH_VERBOSE="enabled" + shift + ;; + + -v|--version) + Version + shift + ;; + + # config/bootstrap + -a|--architecture) + LH_ARCHITECTURE="${2}" + shift 2 + ;; + + --bootstrap-config) + LH_BOOTSTRAP_CONFIG="${2}" + shift 2 + ;; + + -f|--bootstrap-flavour) + LH_BOOTSTRAP_FLAVOUR="${2}" + shift 2 + ;; + + --bootstrap-keyring) + LH_BOOTSTRAP_KEYRING="${2}" + shift 2 + ;; + + -d|--distribution) + LH_DISTRIBUTION="${2}" + shift 2 + ;; + + -m|--mirror-bootstrap) + LH_MIRROR_BOOTSTRAP="${2}" + shift 2 + ;; + + --mirror-bootstrap-security) + LH_MIRROR_BOOTSTRAP_SECURITY="${2}" + shift 2 + ;; + + --mirror-binary) + LH_MIRROR_BINARY="${2}" + shift 2 + ;; + + --mirror-binary-security) + LH_MIRROR_BINARY_SECURITY="${2}" + shift 2 + ;; + + --sections) + LH_SECTIONS="${2}" + shift 2 + ;; + + # config/chroot + --chroot-filesystem) + LH_CHROOT_FILESYSTEM="${2}" + shift 2 + ;; + + --union-filesystem) + LH_UNION_FILESYSTEM="${2}" + shift 2 + ;; + + --hooks) + LH_HOOKS="${2}" + shift 2 + ;; + + --interactive) + LH_INTERACTIVE="${2}" + shift 2 + ;; + + --keyring-packages) + LH_KEYRING_PACKAGES="${2}" + shift 2 + ;; + + -l|--language) + LH_LANGUAGE="${2}" + shift 2 + ;; + + -k|--linux-flavours) + LH_LINUX_FLAVOURS="${2}" + shift 2 + ;; + + --linux-packages) + LH_LINUX_PACKAGES="${2}" + shift 2 + ;; + + --packages) + LH_PACKAGES="${2}" + shift 2 + ;; + + -p|--packages-lists) + LH_PACKAGES_LISTS="${2}" + shift 2 + ;; + + --tasks) + LH_TASKS="${2}" + shift 2 + ;; + + --security) + LH_SECURITY="${2}" + shift 2 + ;; + + --symlinks) + LH_SYMLINKS="${2}" + shift 2 + ;; + + --sysvinit) + LH_SYSVINIT="${2}" + shift 2 + ;; + + # config/binary + -b|--binary-images) + LH_BINARY_IMAGES="${2}" + shift 2 + ;; + + --binary-indices) + LH_BINARY_INDICES="${2}" + shift 2 + ;; + + --bootappend) + LH_BOOTAPPEND="${2}" + shift 2 + ;; + + --bootloader) + LH_BOOTLOADER="${2}" + shift 2 + ;; + + --chroot-build) + LH_CHROOT_BUILD="${2}" + shift 2 + ;; + + --debian-installer) + LH_DEBIAN_INSTALLER="${2}" + shift 2 + ;; + + -e|--encryption) + LH_ENCRYPTION="${2}" + shift 2 + ;; + + --grub-splash) + LH_GRUB_SPLASH="${2}" + shift 2 + ;; + + --hostname) + LH_HOSTNAME="${2}" + shift 2 + ;; + + --iso-application) + LH_ISO_APPLICATION="${2}" + shift 2 + ;; + + --iso-preparer) + LH_ISO_PREPARER="${2}" + shift 2 + ;; + + --iso-publisher) + LH_ISO_PUBLISHER="${2}" + shift 2 + ;; + + --iso-volume) + LH_ISO_VOLUME="${2}" + shift 2 + ;; + + --iso-memtest) + LH_ISO_MEMTEST="${2}" + shift 2 + ;; + + --net-filesystem) + LH_NET_FILESYSTEM="${2}" + shift 2 + ;; + + --net-mountoptions) + LH_NET_MOUNTOPTIONS="${2}" + shift 2 + ;; + + --net-path) + LH_NET_PATH="${2}" + shift 2 + ;; + + --net-server) + LH_NET_SERVER="${2}" + shift 2 + ;; + + --syslinux-splash) + LH_SYSLINUX_SPLASH="${2}" + shift 2 + ;; + + --syslinux-timeout) + LH_SYSLINUX_TIMEOUT="${2}" + shift 2 + ;; + + --username) + LH_USERNAME="${2}" + shift 2 + ;; + + # config/source + --source) + LH_SOURCE="${2}" + shift 2 + ;; + + -s|--source-images) + LH_SOURCE_IMAGES="${2}" + shift 2 + ;; + + # other + --breakpoints) + LH_BREAKPOINTS="enabled" + shift + ;; + + -c|-conffile) + LH_CONFFILE="${2}" + shift 2 + ;; + + --debug) + LH_DEBUG="enabled" + shift + ;; + + --force) + LH_FORCE="enabled" + shift + ;; + + -h|--help) + Help + shift + ;; + + --quiet) + LH_QUIET="enabled" + shift + ;; + + -u|--usage) + Usage + shift + ;; + + --verbose) + LH_VERBOSE="enabled" + shift + ;; + + -v|--version) + Version + shift + ;; + + --) + shift + break + ;; + + *) + Echo_error "internal error" + exit 1 + ;; + esac + done +} + +# Reading existing configuration +Read_conffile config/common +Read_conffile config/bootstrap +Read_conffile config/chroot +Read_conffile config/binary +Read_conffile config/source # Setting defaults Set_defaults +Local_arguments "${@}" + +if [ -n "${LH_CONFFILE}" ] +then + Read_conffile "${LH_CONFFILE}" +fi + # Creating bootstrap configuration -mkdir -p "${LIVE_ROOT}"/config -mkdir -p "${LIVE_ROOT}"/config/includes -mkdir -p "${LIVE_ROOT}"/config/templates +mkdir -p config +mkdir -p config/includes +mkdir -p config/templates # Creating live-helper configuration -cat > "${LIVE_ROOT}"/config/common << EOF +cat > config/common << EOF # config/common - common options for live-helper(7) # \$LH_APT: set package manager # (Default: ${LH_APT}) LH_APT="${LH_APT}" -# \$LH_APT_FTPPROXY: set apt/aptitude ftp proxy +# \$LH_APT_FTP_PROXY: set apt/aptitude ftp proxy # (Default: autodetected or empty) -LH_APT_FTPPROXY="${LH_APT_FTPPROXY}" +LH_APT_FTP_PROXY="${LH_APT_FTP_PROXY}" -# \$LH_APT_HTTPPROXY: set apt/aptitude http proxy +# \$LH_APT_HTTP_PROXY: set apt/aptitude http proxy # (Default: autodetected or empty) -LH_APT_HTTPPROXY="${LH_APT_HTTPPROXY}" +LH_APT_HTTP_PROXY="${LH_APT_HTTP_PROXY}" # \$LH_APT_PDIFFS: set apt/aptitude pdiff indices # (Default: ${LH_APT_PDIFFS}) @@ -94,6 +539,10 @@ LH_APT_SECURE="${LH_APT_SECURE}" # (Default: ${LH_BOOTSTRAP}) LH_BOOTSTRAP="${LH_BOOTSTRAP}" +# \$LH_CACHE: control cache +# (Default: ${LH_CACHE}) +LH_CACHE="${LH_CACHE}" + # \$LH_CACHE_INDICES: control if downloaded package indices should be cached # (Default: ${LH_CACHE_INDICES}) LH_CACHE_INDICES="${LH_CACHE_INDICES}" @@ -142,17 +591,13 @@ LH_MODE="${LH_MODE}" # (Default: ${LH_TASKSEL}) LH_TASKSEL="${LH_TASKSEL}" -# \$LIVE_ROOT: set root directory -# (Default: ${LIVE_ROOT}) -LIVE_ROOT="${LIVE_ROOT}" - -# \$LIVE_INCLUDES: set includes -# (Default: ${LIVE_INCLUDES}) -LIVE_INCLUDES="${LIVE_INCLUDES}" +# \$LH_INCLUDES: set includes +# (Default: ${LH_INCLUDES}) +LH_INCLUDES="${LH_INCLUDES}" -# \$LIVE_TEMPLATES: set templates -# (Default: ${LIVE_TEMPLATES}) -LIVE_TEMPLATES="${LIVE_TEMPLATES}" +# \$LH_TEMPLATES: set templates +# (Default: ${LH_TEMPLATES}) +LH_TEMPLATES="${LH_TEMPLATES}" # Live-helper options @@ -178,225 +623,225 @@ LIVE_TEMPLATES="${LIVE_TEMPLATES}" EOF # Creating lh_bootstrap_* configuration -cat > "${LIVE_ROOT}"/config/bootstrap << EOF +cat > config/bootstrap << EOF # config/bootstrap - options for live-helper(7), bootstrap stage -# \$LIVE_ARCHITECTURE: select chroot architecture +# \$LH_ARCHITECTURE: select chroot architecture # (Default: autodetected) -LIVE_ARCHITECTURE="${LIVE_ARCHITECTURE}" +LH_ARCHITECTURE="${LH_ARCHITECTURE}" -# \$LIVE_BOOTSTRAP_CONFIG: set distribution config directory +# \$LH_BOOTSTRAP_CONFIG: set distribution config directory # (Default: empty) -LIVE_BOOTSTRAP_CONFIG="${LIVE_BOOTSTRAP_CONFIG}" +LH_BOOTSTRAP_CONFIG="${LH_BOOTSTRAP_CONFIG}" -# \$LIVE_BOOTSTRAP_FLAVOUR: select flavour to use -# (Default: ${LIVE_BOOTSTRAP_FLAVOUR}) -LIVE_BOOTSTRAP_FLAVOUR="${LIVE_BOOTSTRAP_FLAVOUR}" +# \$LH_BOOTSTRAP_FLAVOUR: select flavour to use +# (Default: ${LH_BOOTSTRAP_FLAVOUR}) +LH_BOOTSTRAP_FLAVOUR="${LH_BOOTSTRAP_FLAVOUR}" -# \$LIVE_BOOTSTRAP_KEYRING: set distribution keyring +# \$LH_BOOTSTRAP_KEYRING: set distribution keyring # (Default: empty) -LIVE_BOOTSTRAP_KEYRING="${LIVE_BOOTSTRAP_KEYRING}" +LH_BOOTSTRAP_KEYRING="${LH_BOOTSTRAP_KEYRING}" -# \$LIVE_DISTRIBUTION: select distribution to use -# (Default: ${LIVE_DISTRIBUTION}) -LIVE_DISTRIBUTION="${LIVE_DISTRIBUTION}" +# \$LH_DISTRIBUTION: select distribution to use +# (Default: ${LH_DISTRIBUTION}) +LH_DISTRIBUTION="${LH_DISTRIBUTION}" -# \$LIVE_MIRROR_BOOTSTRAP: set mirror to fetch packages from -# (Default: ${LIVE_MIRROR_BOOTSTRAP}) -LIVE_MIRROR_BOOTSTRAP="${LIVE_MIRROR_BOOTSTRAP}" +# \$LH_MIRROR_BOOTSTRAP: set mirror to fetch packages from +# (Default: ${LH_MIRROR_BOOTSTRAP}) +LH_MIRROR_BOOTSTRAP="${LH_MIRROR_BOOTSTRAP}" -# \$LIVE_MIRROR_BOOTSTRAP_SECURITY: set security mirror to fetch packages from -# (Default: ${LIVE_MIRROR_BOOTSTRAP_SECURITY}) -LIVE_MIRROR_BOOTSTRAP_SECURITY="${LIVE_MIRROR_BOOTSTRAP_SECURITY}" +# \$LH_MIRROR_BOOTSTRAP_SECURITY: set security mirror to fetch packages from +# (Default: ${LH_MIRROR_BOOTSTRAP_SECURITY}) +LH_MIRROR_BOOTSTRAP_SECURITY="${LH_MIRROR_BOOTSTRAP_SECURITY}" -# \$LIVE_MIRROR_BINARY: set mirror which ends up in the image -# (Default: ${LIVE_MIRROR_BINARY}) -LIVE_MIRROR_BINARY="${LIVE_MIRROR_BINARY}" +# \$LH_MIRROR_BINARY: set mirror which ends up in the image +# (Default: ${LH_MIRROR_BINARY}) +LH_MIRROR_BINARY="${LH_MIRROR_BINARY}" -# \$LIVE_MIRROR_BINARY_SECURITY: set security mirror which ends up in the image -# (Default: ${LIVE_MIRROR_BINARY_SECURITY}) -LIVE_MIRROR_BINARY_SECURITY="${LIVE_MIRROR_BINARY_SECURITY}" +# \$LH_MIRROR_BINARY_SECURITY: set security mirror which ends up in the image +# (Default: ${LH_MIRROR_BINARY_SECURITY}) +LH_MIRROR_BINARY_SECURITY="${LH_MIRROR_BINARY_SECURITY}" -# \$LIVE_SECTIONS: select section(s) to use -# (Default: ${LIVE_SECTIONS}) -LIVE_SECTIONS="${LIVE_SECTIONS}" +# \$LH_SECTIONS: select section(s) to use +# (Default: ${LH_SECTIONS}) +LH_SECTIONS="${LH_SECTIONS}" EOF # Creating lh_chroot_* configuration -mkdir -p "${LIVE_ROOT}"/config/chroot_local-hooks -mkdir -p "${LIVE_ROOT}"/config/chroot_local-includes -mkdir -p "${LIVE_ROOT}"/config/chroot_local-packages -mkdir -p "${LIVE_ROOT}"/config/chroot_local-packageslists -mkdir -p "${LIVE_ROOT}"/config/chroot_sources +mkdir -p config/chroot_local-hooks +mkdir -p config/chroot_local-includes +mkdir -p config/chroot_local-packages +mkdir -p config/chroot_local-packageslists +mkdir -p config/chroot_sources -cat > "${LIVE_ROOT}"/config/chroot << EOF +cat > config/chroot << EOF # config/chroot - options for live-helper(7), chroot stage -# \$LIVE_CHROOT_FILESYSTEM: set chroot filesystem -# (Default: ${LIVE_CHROOT_FILESYSTEM}) -LIVE_CHROOT_FILESYSTEM="${LIVE_CHROOT_FILESYSTEM}" +# \$LH_CHROOT_FILESYSTEM: set chroot filesystem +# (Default: ${LH_CHROOT_FILESYSTEM}) +LH_CHROOT_FILESYSTEM="${LH_CHROOT_FILESYSTEM}" -# \$LIVE_UNION_FILESYSTEM: set union filesystem -# (Default: ${LIVE_UNION_FILESYSTEM} -LIVE_UNION_FILESYSTEM="${LIVE_UNION_FILESYSTEM}" +# \$LH_UNION_FILESYSTEM: set union filesystem +# (Default: ${LH_UNION_FILESYSTEM} +LH_UNION_FILESYSTEM="${LH_UNION_FILESYSTEM}" -# \$LIVE_HOOKS: set hook commands +# \$LH_HOOKS: set hook commands # (Default: empty) -LIVE_HOOKS="${LIVE_HOOKS}" +LH_HOOKS="${LH_HOOKS}" -# \$LIVE_INTERACTIVE: set interactive build -# (Default: ${LIVE_INTERACTIVE}) -LIVE_INTERACTIVE="${LIVE_INTERACTIVE}" +# \$LH_INTERACTIVE: set interactive build +# (Default: ${LH_INTERACTIVE}) +LH_INTERACTIVE="${LH_INTERACTIVE}" -# \$LIVE_KEYRING_PACKAGES: set keyring packages +# \$LH_KEYRING_PACKAGES: set keyring packages # (Default: empty) -LIVE_KEYRING_PACKAGES="${LIVE_KEYRING_PACKAGES}" +LH_KEYRING_PACKAGES="${LH_KEYRING_PACKAGES}" -# \$LIVE_LANGUAGE: set language to use +# \$LH_LANGUAGE: set language to use # (Default: empty) -LIVE_LANGUAGE="${LIVE_LANGUAGE}" +LH_LANGUAGE="${LH_LANGUAGE}" -# \$LIVE_LINUX_FLAVOURS: set kernel flavour to use +# \$LH_LINUX_FLAVOURS: set kernel flavour to use # (Default: autodetected) -LIVE_LINUX_FLAVOURS="${LIVE_LINUX_FLAVOURS}" +LH_LINUX_FLAVOURS="${LH_LINUX_FLAVOURS}" -# \$LIVE_LINUX_PACKAGES: set kernel packages to use +# \$LH_LINUX_PACKAGES: set kernel packages to use # (Default: autodetected) -LIVE_LINUX_PACKAGES="${LIVE_LINUX_PACKAGES}" +LH_LINUX_PACKAGES="${LH_LINUX_PACKAGES}" -# \$LIVE_PACKAGES: set packages to install +# \$LH_PACKAGES: set packages to install # (Default: empty) -LIVE_PACKAGES="${LIVE_PACKAGES}" +LH_PACKAGES="${LH_PACKAGES}" -# \$LIVE_PACKAGES_LISTS: set package list to install -# (Default: ${LIVE_PACKAGES_LISTS}) -LIVE_PACKAGES_LISTS="${LIVE_PACKAGES_LISTS}" +# \$LH_PACKAGES_LISTS: set package list to install +# (Default: ${LH_PACKAGES_LISTS}) +LH_PACKAGES_LISTS="${LH_PACKAGES_LISTS}" -# \$LIVE_TASKS: set tasks to install +# \$LH_TASKS: set tasks to install # (Default: empty) -LIVE_TASKS="${LIVE_TASKS}" +LH_TASKS="${LH_TASKS}" -# \$LIVE_SECURITY: enable security updates -# (Default: ${LIVE_SECURITY}) -LIVE_SECURITY="${LIVE_SECURITY}" +# \$LH_SECURITY: enable security updates +# (Default: ${LH_SECURITY}) +LH_SECURITY="${LH_SECURITY}" -# \$LIVE_SYMLINKS: enable symlink convertion -# (Default: ${LIVE_SYMLINKS}) -LIVE_SYMLINKS="${LIVE_SYMLINKS}" +# \$LH_SYMLINKS: enable symlink convertion +# (Default: ${LH_SYMLINKS}) +LH_SYMLINKS="${LH_SYMLINKS}" -# \$LIVE_SYSVINIT: enable sysvinit -# (Default: ${LIVE_SYSVINIT}) -LIVE_SYSVINIT="${LIVE_SYSVINIT}" +# \$LH_SYSVINIT: enable sysvinit +# (Default: ${LH_SYSVINIT}) +LH_SYSVINIT="${LH_SYSVINIT}" EOF # Creating lh_binary_* configuration -mkdir -p "${LIVE_ROOT}"/config/binary_grub -mkdir -p "${LIVE_ROOT}"/config/binary_local-debs -mkdir -p "${LIVE_ROOT}"/config/binary_local-hooks -mkdir -p "${LIVE_ROOT}"/config/binary_local-includes -mkdir -p "${LIVE_ROOT}"/config/binary_local-udebs -mkdir -p "${LIVE_ROOT}"/config/binary_rootfs -mkdir -p "${LIVE_ROOT}"/config/binary_syslinux - -cat > "${LIVE_ROOT}"/config/binary << EOF +mkdir -p config/binary_grub +mkdir -p config/binary_local-debs +mkdir -p config/binary_local-hooks +mkdir -p config/binary_local-includes +mkdir -p config/binary_local-udebs +mkdir -p config/binary_rootfs +mkdir -p config/binary_syslinux + +cat > config/binary << EOF # config/binary - options for live-helper(7), binary stage -# \$LIVE_BINARY_IMAGES: set image type -# (Default: ${LIVE_BINARY_IMAGES}) -LIVE_BINARY_IMAGES="${LIVE_BINARY_IMAGES}" +# \$LH_BINARY_IMAGES: set image type +# (Default: ${LH_BINARY_IMAGES}) +LH_BINARY_IMAGES="${LH_BINARY_IMAGES}" -# \$LIVE_BINARY_INDICES: set apt/aptitude generic indices -# (Default: ${LIVE_BINARY_INDICES}) -LIVE_BINARY_INDICES="${LIVE_BINARY_INDICES}" +# \$LH_BINARY_INDICES: set apt/aptitude generic indices +# (Default: ${LH_BINARY_INDICES}) +LH_BINARY_INDICES="${LH_BINARY_INDICES}" -# \$LIVE_BOOTAPPEND: set boot parameters +# \$LH_BOOTAPPEND: set boot parameters # (Default: empty) -LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND}" +LH_BOOTAPPEND="${LH_BOOTAPPEND}" -# \$LIVE_BOOTLOADER: set bootloader -# (Default: ${LIVE_BOOTLOADER}) -LIVE_BOOTLOADER="${LIVE_BOOTLOADER}" +# \$LH_BOOTLOADER: set bootloader +# (Default: ${LH_BOOTLOADER}) +LH_BOOTLOADER="${LH_BOOTLOADER}" -# \${LIVE_CHROOT_BUILD: control if we build binary images chrooted -# (Default: ${LIVE_CHROOT_BUILD}) +# \${LH_CHROOT_BUILD: control if we build binary images chrooted +# (Default: ${LH_CHROOT_BUILD}) # DO NEVER, *NEVER*, *N*E*V*E*R* SET THIS OPTION to disabled. -LIVE_CHROOT_BUILD="${LIVE_CHROOT_BUILD}" +LH_CHROOT_BUILD="${LH_CHROOT_BUILD}" -# \$LIVE_DEBIAN_INSTALLER: set debian-installer -# (Default: ${LIVE_DEBIAN_INSTALLER}) -LIVE_DEBIAN_INSTALLER="${LIVE_DEBIAN_INSTALLER}" +# \$LH_DEBIAN_INSTALLER: set debian-installer +# (Default: ${LH_DEBIAN_INSTALLER}) +LH_DEBIAN_INSTALLER="${LH_DEBIAN_INSTALLER}" -# \$LIVE_ENCRYPTION: set encrytion +# \$LH_ENCRYPTION: set encrytion # (Default: empty) -LIVE_ENCRYPTION="${LIVE_ENCRYPTION}" +LH_ENCRYPTION="${LH_ENCRYPTION}" -# \$LIVE_GRUB_SPLASH: set custom grub splash +# \$LH_GRUB_SPLASH: set custom grub splash # (Default: empty) -LIVE_GRUB_SPLASH="${LIVE_GRUB_SPLASH}" +LH_GRUB_SPLASH="${LH_GRUB_SPLASH}" -# \$LIVE_HOSTNAME: set hostname -# (Default: ${LIVE_HOSTNAME}) -LIVE_HOSTNAME="${LIVE_HOSTNAME}" +# \$LH_HOSTNAME: set hostname +# (Default: ${LH_HOSTNAME}) +LH_HOSTNAME="${LH_HOSTNAME}" -# \$LIVE_ISO_APPLICATION: set iso author -# (Default: ${LIVE_ISO_APPLICATION}) -LIVE_ISO_APPLICATION="${LIVE_ISO_APPLICATION}" +# \$LH_ISO_APPLICATION: set iso author +# (Default: ${LH_ISO_APPLICATION}) +LH_ISO_APPLICATION="${LH_ISO_APPLICATION}" -# \$LIVE_ISO_PREPARER: set iso preparer -# (Default: ${LIVE_ISO_PREPARER}) -LIVE_ISO_PREPARER="${LIVE_ISO_PREPARER}" +# \$LH_ISO_PREPARER: set iso preparer +# (Default: ${LH_ISO_PREPARER}) +LH_ISO_PREPARER="${LH_ISO_PREPARER}" -# \$LIVE_ISO_PUBLISHER: set iso preparer -# (Default: ${LIVE_ISO_PUBLISHER}) -LIVE_ISO_PUBLISHER="${LIVE_ISO_PUBLISHER}" +# \$LH_ISO_PUBLISHER: set iso preparer +# (Default: ${LH_ISO_PUBLISHER}) +LH_ISO_PUBLISHER="${LH_ISO_PUBLISHER}" -# \$LIVE_ISO_VOLUME: set iso volume (max 32 chars) -# (Default: ${LIVE_ISO_VOLUME}) -LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}" +# \$LH_ISO_VOLUME: set iso volume (max 32 chars) +# (Default: ${LH_ISO_VOLUME}) +LH_ISO_VOLUME="${LH_ISO_VOLUME}" -# \$LIVE_MEMTEST: set memtest -# (Default: ${LIVE_MEMTEST}) -LIVE_MEMTEST="${LIVE_MEMTEST}" +# \$LH_MEMTEST: set memtest +# (Default: ${LH_MEMTEST}) +LH_MEMTEST="${LH_MEMTEST}" -# \$LIVE_NET_FILESYSTEM: set netboot filesystem -# (Default: ${LIVE_NET_FILESYSTEM}) -LIVE_NET_FILESYSTEM="${LIVE_NET_FILESYSTEM}" +# \$LH_NET_FILESYSTEM: set netboot filesystem +# (Default: ${LH_NET_FILESYSTEM}) +LH_NET_FILESYSTEM="${LH_NET_FILESYSTEM}" -# \$LIVE_NET_MOUNTOPTIONS: set nfsopts +# \$LH_NET_MOUNTOPTIONS: set nfsopts # (Default: empty) -LIVE_NET_MOUNTOPTIONS="${LIVE_NET_MOUNTOPTIONS}" +LH_NET_MOUNTOPTIONS="${LH_NET_MOUNTOPTIONS}" -# \$LIVE_NET_PATH: set netboot server directory -# (Default: ${LIVE_NET_PATH}) -LIVE_NET_PATH="${LIVE_NET_PATH}" +# \$LH_NET_PATH: set netboot server directory +# (Default: ${LH_NET_PATH}) +LH_NET_PATH="${LH_NET_PATH}" -# \$LIVE_NET_SERVER: set netboot server address -# (Default: ${LIVE_NET_SERVER}) -LIVE_NET_SERVER="${LIVE_NET_SERVER}" +# \$LH_NET_SERVER: set netboot server address +# (Default: ${LH_NET_SERVER}) +LH_NET_SERVER="${LH_NET_SERVER}" -# \$LIVE_SYSLINUX_SPLASH: set custom syslinux splash +# \$LH_SYSLINUX_SPLASH: set custom syslinux splash # (Default: empty) -LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}" +LH_SYSLINUX_SPLASH="${LH_SYSLINUX_SPLASH}" -# \$LIVE_USERNAME: set username -# (Default: ${LIVE_USERNAME}) -LIVE_USERNAME="${LIVE_USERNAME}" +# \$LH_USERNAME: set username +# (Default: ${LH_USERNAME}) +LH_USERNAME="${LH_USERNAME}" EOF # Creating lh_source_* configuration -cat > "${LIVE_ROOT}"/config/source << EOF +cat > config/source << EOF # config/source - options for live-helper(7), source stage -# \$LIVE_SOURCE: set source option -# (Default: ${LIVE_SOURCE}) -LIVE_SOURCE="${LIVE_SOURCE}" +# \$LH_SOURCE: set source option +# (Default: ${LH_SOURCE}) +LH_SOURCE="${LH_SOURCE}" -# \$LIVE_SOURCE_IMAGES: set image type -# (Default: ${LIVE_SOURCE_IMAGES}) -LIVE_SOURCE_IMAGES="${LIVE_SOURCE_IMAGES}" +# \$LH_SOURCE_IMAGES: set image type +# (Default: ${LH_SOURCE_IMAGES}) +LH_SOURCE_IMAGES="${LH_SOURCE_IMAGES}" EOF -if [ "${CONFIG}" = "clone" ] +if [ "${CONFIG}" = "clone" ] # FIXME then # Read package selection echo `dpkg --get-selections | awk '{ print $1 }'` > config/chroot_local-packageslists/local-system diff --git a/helpers/lh_losetup b/helpers/lh_losetup index c2c7a7b39..8ef33c946 100755 --- a/helpers/lh_losetup +++ b/helpers/lh_losetup @@ -20,7 +20,7 @@ done # Setting static variables DESCRIPTION="wrapper around losetup" HELP="" -USAGE="${PROGRAM} <device> <file> <partition>" +USAGE="${PROGRAM} DEVICE FILE [PARTITION]" Arguments "${@}" @@ -32,30 +32,26 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ -z "${1}" ] -then - DEVICE="`${LH_ROOT_COMMAND} ${LH_LOSETUP} -f`" -else - DEVICE="${1}" -fi - +DEVICE="${1}" FILE="${2}" -PARTITION="${3}" +PARTITION="${3:=1}" ${LH_ROOT_COMMAND} ${LH_LOSETUP} "${DEVICE}" "${FILE}" FDISK_OUT="`fdisk -l -u ${DEVICE} 2>&1`" ${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"` -#OFFSET="`expr 512 '*' ${CYL}`" -OFFSET="$((CYL*512))" - -echo loop $DEVICE at offset $OFFSET +LOOPDEVICE="`echo ${DEVICE}p${PARTITION}`" if [ "${PARTITION}" = "0" ] then + Echo_message "Mounting ${DEVICE} with offset 0" + ${LH_ROOT_COMMAND} ${LH_LOSETUP} "${DEVICE}" "${FILE}" else + CYLINDERS="`echo "$FDISK_OUT" | sed -ne "s_^$LOOPDEVICE[ *]*\([0-9]*\).*_\1_p"`" + OFFSET="`expr ${CYLINDERS} '*' 512`" + + Echo_message "Mounting ${DEVICE} with offset ${OFFSET}" + ${LH_ROOT_COMMAND} ${LH_LOSETUP} -o "${OFFSET}" "${DEVICE}" "${FILE}" fi diff --git a/helpers/lh_source_debian b/helpers/lh_source_debian index 09ddd43d4..b15f0938b 100755 --- a/helpers/lh_source_debian +++ b/helpers/lh_source_debian @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_SOURCE}" != "enabled" ] +if [ "${LH_SOURCE}" != "enabled" ] then exit 0 fi @@ -59,18 +59,32 @@ fi # Download sources Chroot "dpkg --get-selections" | awk '{ print $1 }' > chroot/root/dpkg-selection.txt -echo "${LIVE_BOOTLOADER}" >> chroot/root/dpkg-selection.txt -echo -e "live-helper\n${LH_INITRAMFS}" >> chroot/root/dpkg-selection.txt -echo -e "dosfstools\n${LH_GENISOIMAGE}\nparted\nsquashfs-tools\ngenext2fs" >> chroot/root/dpkg-selection.txt - -case "${LIVE_ARCHITECTURE}" in +cat >> chroot/root/dpkg-selection.txt << EOF +${LH_BOOTLOADER} +live-helper +${LH_INITRAMFS} +dosfstools +${LH_GENISOIMAGE} +parted +squashfs-tools +genext2fs +EOF + +case "${LH_ARCHITECTURE}" in amd64|i386) - echo -e "${LIVE_MEMTEST}\nmtools\nsyslinux\ngrub" >> chroot/root/dpkg-selection.txt + +cat >> chroot/root/dpkg-selection.txt << EOF +${LH_MEMTEST} +mtools +syslinux +grub +EOF + ;; powerpc) - echo -e "yaboot" >> chroot/root/dpkg-selection.txt + echo "yaboot" >> chroot/root/dpkg-selection.txt ;; esac diff --git a/helpers/lh_source_debian-live b/helpers/lh_source_debian-live index 970e0fd7b..00ddd2363 100755 --- a/helpers/lh_source_debian-live +++ b/helpers/lh_source_debian-live @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_SOURCE}" != "enabled" ] +if [ "${LH_SOURCE}" != "enabled" ] then exit 0 fi diff --git a/helpers/lh_source_disk b/helpers/lh_source_disk index e765f3b01..78242d888 100755 --- a/helpers/lh_source_disk +++ b/helpers/lh_source_disk @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_SOURCE_IMAGES}" != "iso" ] +if [ "${LH_SOURCE_IMAGES}" != "iso" ] then exit 0 fi @@ -53,10 +53,10 @@ Create_lockfile .lock mkdir -p source/.disk -ARCHITECTURE="`echo ${LIVE_ARCHITECTURE} | sed -e 's# #/#g'`" -DISTRIBUTION="`echo ${LIVE_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]'`" -DISTRIBUTION="${DISTRIBUTION}`echo ${LIVE_DISTRIBUTION} | cut -b 2-`" -eval VERSION="$`echo VERSION_${LIVE_DISTRIBUTION}`" +ARCHITECTURE="`echo ${LH_ARCHITECTURE} | sed -e 's# #/#g'`" +DISTRIBUTION="`echo ${LH_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]'`" +DISTRIBUTION="${DISTRIBUTION}`echo ${LH_DISTRIBUTION} | cut -b 2-`" +eval VERSION="$`echo VERSION_${LH_DISTRIBUTION}`" case "${LH_MODE}" in debian) diff --git a/helpers/lh_source_iso b/helpers/lh_source_iso index 79e588efd..da1e98e5b 100755 --- a/helpers/lh_source_iso +++ b/helpers/lh_source_iso @@ -32,12 +32,12 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_SOURCE}" != "enabled" ] +if [ "${LH_SOURCE}" != "enabled" ] then exit 0 fi -if ! echo "${LIVE_SOURCE_IMAGES}" | grep -qs iso +if ! echo "${LH_SOURCE_IMAGES}" | grep -qs iso then exit 0 fi @@ -73,24 +73,24 @@ then GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -v" fi -if [ -n "${LIVE_ISO_APPLICATION}" ] && [ "${LIVE_ISO_APPLICATION}" != "none" ] +if [ -n "${LH_ISO_APPLICATION}" ] && [ "${LH_ISO_APPLICATION}" != "none" ] then - GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -A \"${LIVE_ISO_APPLICATION}\"" + GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -A \"${LH_ISO_APPLICATION}\"" fi -if [ -n "${LIVE_ISO_PREPARER}" ] && [ "${LIVE_ISO_PREPARER}" != "none" ] +if [ -n "${LH_ISO_PREPARER}" ] && [ "${LH_ISO_PREPARER}" != "none" ] then - GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -p \"${LIVE_ISO_PREPARER}\"" + GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -p \"${LH_ISO_PREPARER}\"" fi -if [ -n "${LIVE_ISO_PUBLISHER}" ] && [ "${LIVE_ISO_PUBLISHER}" != "none" ] +if [ -n "${LH_ISO_PUBLISHER}" ] && [ "${LH_ISO_PUBLISHER}" != "none" ] then - GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -publisher \"${LIVE_ISO_PUBLISHER}\"" + GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -publisher \"${LH_ISO_PUBLISHER}\"" fi -if [ -n "${LIVE_ISO_VOLUME}" ] && [ "${LIVE_ISO_VOLUME}" != "none" ] +if [ -n "${LH_ISO_VOLUME}" ] && [ "${LH_ISO_VOLUME}" != "none" ] then - GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -V \"${LIVE_ISO_VOLUME}\"" + GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -V \"${LH_ISO_VOLUME}\"" fi # Moving image diff --git a/helpers/lh_source_md5sum b/helpers/lh_source_md5sum index 81caef45c..55e0d23ee 100755 --- a/helpers/lh_source_md5sum +++ b/helpers/lh_source_md5sum @@ -32,7 +32,7 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_SOURCE}" != "enabled" ] +if [ "${LH_SOURCE}" != "enabled" ] then exit 0 fi diff --git a/helpers/lh_source_net b/helpers/lh_source_net index 58da2f93c..c6ef05753 100755 --- a/helpers/lh_source_net +++ b/helpers/lh_source_net @@ -32,12 +32,12 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_SOURCE}" != "enabled" ] +if [ "${LH_SOURCE}" != "enabled" ] then exit 0 fi -if ! echo "${LIVE_SOURCE_IMAGES}" | grep -qs net +if ! echo "${LH_SOURCE_IMAGES}" | grep -qs net then exit 0 fi diff --git a/helpers/lh_source_tar b/helpers/lh_source_tar index 51170a33e..5a4d018fe 100755 --- a/helpers/lh_source_tar +++ b/helpers/lh_source_tar @@ -32,12 +32,12 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_SOURCE}" != "enabled" ] +if [ "${LH_SOURCE}" != "enabled" ] then exit 0 fi -if ! echo "${LIVE_SOURCE_IMAGES}" | grep -qs tar +if ! echo "${LH_SOURCE_IMAGES}" | grep -qs tar then exit 0 fi diff --git a/helpers/lh_source_usb-hdd b/helpers/lh_source_usb-hdd index 3487b6328..cf937864d 100755 --- a/helpers/lh_source_usb-hdd +++ b/helpers/lh_source_usb-hdd @@ -32,12 +32,12 @@ Read_conffile config/binary Read_conffile config/source Set_defaults -if [ "${LIVE_SOURCE}" != "enabled" ] +if [ "${LH_SOURCE}" != "enabled" ] then exit 0 fi -if ! echo "${LIVE_SOURCE_IMAGES}" | grep -qs usb-hdd +if ! echo "${LH_SOURCE_IMAGES}" | grep -qs usb-hdd then exit 0 fi diff --git a/helpers/make-live b/helpers/make-live index b0fa676f2..bf640a8c1 100755 --- a/helpers/make-live +++ b/helpers/make-live @@ -22,389 +22,7 @@ set -e -# Including common functions -LH_BASE="${LH_BASE:-/usr/share/live-helper}" +echo "make-live is deprecated." +echo "Use lh_config and lh_build instead." -for FUNCTION in "${LH_BASE}"/functions/*.sh -do - . "${FUNCTION}" -done - -# Setting 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] [--binary-indices 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-bootstrap URL] [--mirror-bootstrap-security URL] [--mirror-binary URL] [--mirror-binary-security URL] [--sections SECTION|\"SECTIONS\"] [--interactive shell|x11|xnest] [-k|--linux-flavours FLAVOUR] [--linux-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 BOOT_PARAMETER|\"BOOT_PARAMETERS\"] [-e|--encryption ALGORITHM] [--username NAME] [--hostname NAME] [--chroot-filesystem ext2|plain|squashfs] [--memtest memtest86|memtest86+] [--iso-volume STRING] [--iso-preparer STRING] [--iso-publisher STRING] [--iso-application STRING] [--net-server HOSTNAME|IP] [--net-path DIRECTORY] [--source enabled|disabled] [--bootloader grub|syslinux] [--grub-splash FILE] [--syslinux-splash FILE] [-b|--binary-images iso|net|tar|usb-hdd] [-s|--source-images iso|net|tar|usb-hdd] [--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:,binary-indices:,apt-pdiffs:,apt-recommends:,apt-secure:,bootstrap:,bootstrap-flavour:,cache:,debconf-frontend:,debconf-priority:,debconf-nowarnings:,genisoimage:,losetup:,tasksel:,root:,architecture:,distribution:,distribution-config:,linux-flavours:,mirror-bootstrap:,mirror-bootstrap-security:,mirror-binary:,mirror-binary-security:,sections:,interactive:,linux-packages:,keyring-packages:,hooks:,language:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,bootappend:,encryption:,username:,hostname:,chroot-filesystem:,memtest:,iso-application:,iso-preparer:,iso-publisher:,iso-volume:,net-server:,net-path:,source:,bootloader:,grub-splash:,syslinux-splash:,binary-images:,source-images:,includes:,templates:,help,usage,version,force,breakpoints,debug,quiet,verbose,root-command:,initramfs: --name=${PROGRAM} --options r:a:d:f:m:k:l:p:e:b:s:huv --shell sh -- "${@}"`" - - if [ "${?}" -ne "0" ] - then - echo "Terminating." >&2 - exit 1 - fi - - if [ "${1}" = "config" ] - then - CONFIG="true" - fi - - eval set -- "${ARGUMENTS}" - - while true - do - case "${1}" in - # common - --mode) - LH_MODE="${2}"; shift 2 - ;; - - --config) - LH_CONFIG="${2}"; shift 2 - ;; - - --apt) - LH_APT="${2}"; shift 2 - ;; - - --apt-ftpproxy) - LH_APT_FTPPROXY="${2}"; shift 2 - ;; - - --apt-httpproxy) - LH_APT_HTTPPROXY="${2}"; shift 2 - ;; - - --binary-indices) - LIVE_BINARY_INDICES="${2}"; shift 2 - ;; - - --apt-pdiffs) - LH_APT_PDIFFS="${2}"; shift 2 - ;; - - --apt-recommends) - LH_APT_RECOMMENDS="${2}"; shift 2 - ;; - - --apt-secure) - LH_APT_SECURE="${2}"; shift 2 - ;; - - --bootstrap) - LH_BOOTSTRAP="${2}"; shift 2 - ;; - - --cache) - LH_CACHE="${2}"; shift 2 - ;; - - --debconf-frontend) - LH_DEBCONF_FRONTEND="${2}"; shift 2 - ;; - - --debconf-priority) - LH_DEBCONF_PRIORITY="${2}"; shift 2 - ;; - - --debconf-nowarnings) - LH_DEBCONF_NOWARNINGS="${2}"; shift 2 - ;; - - --genisoimage) - LH_GENISOIMAGE="${2}"; shift 2 - ;; - - --losetup) - 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 - ;; - - -d|--distribution) - LIVE_DISTRIBUTION="${2}"; shift 2 - export LIVE_DISTRIBUTION - ;; - - --distribution-config) - LIVE_DISTRIBUTION_CONFIG="${2}"; shift 2 - ;; - - -f|--bootstrap-flavour) - LIVE_BOOTSTRAP_FLAVOUR="${2}"; shift 2 - ;; - - -m|--mirror-bootstrap) - LIVE_MIRROR_BOOTSTRAP="${2}"; shift 2 - ;; - - --mirror-bootstrap-security) - LIVE_MIRROR_BOOTSTRAP_SECURITY="${2}"; shift 2 - ;; - - --mirror-binary) - LIVE_MIRROR_BINARY="${2}"; shift 2 - ;; - - --mirror-binary-security) - LIVE_MIRROR_BINARY_SECURITY="${2}"; shift 2 - ;; - - --sections) - LIVE_SECTIONS="${2}"; shift 2 - ;; - - # chroot - --interactive) - LIVE_INTERACTIVE="${2}"; shift 2 - ;; - - --initramfs) - LH_INITRAMFS="${2}"; shift 2 - ;; - - -k|--linux-flavours) - LIVE_LINUX_FLAVOURS="${2}"; shift 2 - ;; - - --linux-packages) - LIVE_LINUX_PACKAGES="${2}"; shift 2 - ;; - - --keyring-packages) - LIVE_KEYRING_PACKAGES="${2}"; shift 2 - ;; - - --hooks) - LIVE_HOOKS="${2}"; shift 2 - ;; - - -l|--language) - LIVE_LANGUAGE="${2}"; shift 2 - ;; - - --packages) - LIVE_PACKAGES="${2}"; shift 2 - ;; - - -p|--packages-lists) - LIVE_PACKAGES_LISTS="${2}"; shift 2 - ;; - - --tasks) - LIVE_TASKS="${2}"; shift 2 - ;; - - --security) - LIVE_SECURITY="${2}"; shift 2 - ;; - - --symlinks) - LIVE_SYMLINKS="${2}"; shift 2 - ;; - - --sysvinit) - LIVE_SYSVINIT="${2}"; shift 2 - ;; - - # image - --bootappend) - LIVE_BOOTAPPEND="${2}"; shift 2 - ;; - - -e|--encryption) - LIVE_ENCRYPTION="${2}"; shift 2 - ;; - - --username) - LIVE_USERNAME="${2}"; shift 2 - ;; - - --hostname) - LIVE_HOSTNAME="${2}"; shift 2 - ;; - - --chroot-filesystem) - LIVE_CHROOT_FILESYSTEM="${2}"; shift 2 - ;; - - --memtest) - LIVE_MEMTEST="${2}"; shift 2 - ;; - - --iso-application) - LIVE_ISO_APPLICATION="${2}"; shift 2 - ;; - - --iso-preparer) - LIVE_ISO_PREPARER="${2}"; shift 2 - ;; - - --iso-publisher) - LIVE_ISO_PUBLISHER="${2}"; shift 2 - ;; - - --iso-volume) - LIVE_ISO_VOLUME="${2}"; shift 2 - ;; - - --net-server) - LIVE_NET_SERVER="${2}"; shift 2 - ;; - - --net-path) - LIVE_NET_PATH="${2}"; shift 2 - ;; - - --source) - LIVE_SOURCE="${2}"; shift 2 - ;; - - --bootloader) - LIVE_BOOTLOADER="${2}"; shift 2 - ;; - - --grub-splash) - LIVE_GRUB_SPLASH="${2}"; shift 2 - ;; - - --syslinux-splash) - LIVE_SYSLINUX_SPLASH="${2}"; shift 2 - ;; - - -b|--binary-images) - LIVE_BINARY_IMAGES="${2}"; shift 2 - ;; - - -s|--source-images) - LIVE_SOURCE_IMAGES="${2}"; shift 2 - ;; - - --includes) - LIVE_INCLUDES="${2}"; shift 2 - ;; - - --templates) - LIVE_TEMPLATES="${2}"; shift 2 - ;; - - # other - -h|--help) - Help; shift - ;; - - -u|--usage) - Usage; shift - ;; - - -v|--version) - Version; shift - ;; - - --breakpoints) - LH_BREAKPOINTS="enabled"; shift - ;; - - --debug) - LH_DEBUG="enabled"; shift - ;; - - --force) - LH_FORCE="enabled"; shift - ;; - - --quiet) - LH_QUIET="enabled"; shift - ;; - - --verbose) - LH_VERBOSE="enabled"; shift - ;; - - --) - shift; break - ;; - - *) - echo "Internal error." - exit 1 - ;; - esac - done -} - -Main () -{ - Local_arguments "${@}" - - Set_defaults - - ROOT="${ROOT:-$LIVE_ROOT}" - - # Source existing configuration - Read_conffile "${ROOT}"/config/common - Read_conffile "${ROOT}"/config/bootstrap - Read_conffile "${ROOT}"/config/chroot - Read_conffile "${ROOT}"/config/binary - Read_conffile "${ROOT}"/config/source - - 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}" LIVE_BINARY_INDICES="${LIVE_BINARY_INDICES}" 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_BOOTSTRAP="${LIVE_MIRROR_BOOTSTRAP}" LIVE_MIRROR_BOOTSTRAP_SECURITY="${LIVE_MIRROR_BOOTSTRAP_SECURITY}" LIVE_MIRROR_BINARY="${LIVE_MIRROR_BINARY}" LIVE_MIRROR_BINARY_SECURITY="${LIVE_MIRROR_BINARY_SECURITY}" LIVE_SECTIONS="${LIVE_SECTIONS}" LIVE_INTERACTIVE="${LIVE_INTERACTIVE}" LIVE_LINUX_FLAVOURS="${LIVE_LINUX_FLAVOURS}" LIVE_LINUX_PACKAGES="${LIVE_LINUX_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_CHROOT_FILESYSTEM="${LIVE_CHROOT_FILESYSTEM}" LIVE_MEMTEST="${LIVE_MEMTEST}" LIVE_ISO_APPLICATION="${LIVE_ISO_APPLICATION}" LIVE_ISO_PREPARER="${LIVE_ISO_PREPARER}" LIVE_ISO_PUBLISHER="${LIVE_ISO_PUBLISHER}" LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}" LIVE_NET_SERVER="${LIVE_NET_SERVER}" LIVE_NET_PATH="${LIVE_NET_PATH}" LIVE_SOURCE="${LIVE_SOURCE}" LIVE_BOOTLOADER="${LIVE_BOOTLOADER}" LIVE_GRUB_SPLASH="${LIVE_GRUB_SPLASH}" LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}" LIVE_BINARY_IMAGES="${LIVE_BINARY_IMAGES}" LIVE_SOURCE_IMAGES="${LIVE_SOURCE_IMAGES}" LIVE_INCLUDES="${LIVE_INCLUDES}" LIVE_TEMPLATES="${LIVE_TEMPLATES}" LH_ROOT_COMMAND="${LH_ROOT_COMMAND}" LH_INITRAMFS="${LH_INITRAMFS}" lh_config newconfig - - if [ "${LH_BREAKPOINTS}" = "enabled" ] - then - OPTIONS="${OPTIONS} --breakpoints" - fi - - if [ "${LH_DEBUG}" = "enabled" ] - then - OPTIONS="${OPTIONS} --debug" - fi - - if [ "${LH_FORCE}" = "enabled" ] - then - OPTIONS="${OPTIONS} --force" - fi - - if [ "${LH_QUIET}" = "enabled" ] - then - OPTIONS="${OPTIONS} --quiet" - fi - - if [ "${LH_VERBOSE}" = "enabled" ] - then - OPTIONS="${OPTIONS} --verbose" - fi - - # Building - if [ -z "${CONFIG}" ] - then - cd "${LIVE_ROOT}" && lh_build "${OPTIONS}" - 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 "${@}" +exit 1 |