From 677415f6d7efc1e5b888570d70af311d2900c69c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 23 Sep 2007 10:04:47 +0200 Subject: Adding live-helper 1.0~a2-1. --- helpers/lh_binary | 12 +--- helpers/lh_binary_encryption | 16 +++--- helpers/lh_binary_hdd | 46 ++++++++++++++++ helpers/lh_binary_includes | 14 ++--- helpers/lh_binary_iso | 18 +++--- helpers/lh_binary_linuximage | 24 ++++---- helpers/lh_binary_localincludes | 18 +++--- helpers/lh_binary_manifest | 15 +++-- helpers/lh_binary_md5sum | 27 +++------ helpers/lh_binary_memtest86 | 26 ++++----- helpers/lh_binary_net | 27 ++++----- helpers/lh_binary_rootfs | 38 ++++++------- helpers/lh_binary_syslinux | 78 +++++++++++++------------- helpers/lh_binary_usb | 66 +++++++++++----------- helpers/lh_bootstrap | 1 - helpers/lh_bootstrap_cdebootstrap | 42 ++++++-------- helpers/lh_bootstrap_debootstrap | 40 ++++++-------- helpers/lh_chroot_apt | 62 ++++++++++----------- helpers/lh_chroot_debianchroot | 24 ++++---- helpers/lh_chroot_hacks | 18 +++--- helpers/lh_chroot_hooks | 18 +++--- helpers/lh_chroot_hosts | 24 ++++---- helpers/lh_chroot_linuximage | 26 ++++----- helpers/lh_chroot_localhooks | 22 ++++---- helpers/lh_chroot_localincludes | 18 +++--- helpers/lh_chroot_localization | 36 ++++++------ helpers/lh_chroot_localpackages | 34 ++++++------ helpers/lh_chroot_localpackageslist | 32 +++++------ helpers/lh_chroot_packages | 24 ++++---- helpers/lh_chroot_packageslist | 28 +++++----- helpers/lh_chroot_proc | 24 ++++---- helpers/lh_chroot_resolv | 24 ++++---- helpers/lh_chroot_sources | 66 +++++++++++++--------- helpers/lh_chroot_symlinks | 16 +++--- helpers/lh_chroot_sysfs | 22 ++++---- helpers/lh_chroot_sysvinit | 14 ++--- helpers/lh_chroot_sysvrc | 26 ++++----- helpers/lh_chroot_tasks | 22 ++++---- helpers/lh_clean | 43 ++++++++------- helpers/lh_config | 36 +++++++----- helpers/lh_losetup | 22 ++++++-- helpers/lh_source | 3 +- helpers/lh_source_config | 52 ++++++++++++++++++ helpers/lh_source_download | 28 +++++----- helpers/lh_source_generic | 16 +++--- helpers/lh_source_hdd | 51 +++++++++++++++++ helpers/lh_source_iso | 16 +++--- helpers/lh_source_net | 18 +++--- helpers/lh_source_usb | 56 ++++++++++--------- helpers/make-live | 107 ++++++++---------------------------- 50 files changed, 818 insertions(+), 718 deletions(-) create mode 100755 helpers/lh_binary_hdd create mode 100755 helpers/lh_source_config create mode 100755 helpers/lh_source_hdd (limited to 'helpers') diff --git a/helpers/lh_binary b/helpers/lh_binary index 36dc72228..cc392f51f 100755 --- a/helpers/lh_binary +++ b/helpers/lh_binary @@ -2,17 +2,6 @@ # lh_image(1) - building the images -# Source common functions -for FUNCTION in /usr/share/live-helper/functions/*.sh -do - . ${FUNCTION} -done - -# Reading configuration files -Read_conffile config/common -Read_conffile config/image -Set_defaults - # Building root filesystem lh_binary_rootfs lh_binary_manifest @@ -34,6 +23,7 @@ lh_binary_localincludes lh_binary_md5sum # Building images +lh_binary_hdd lh_binary_iso lh_binary_net lh_binary_usb diff --git a/helpers/lh_binary_encryption b/helpers/lh_binary_encryption index 9df73b2a3..871adaabe 100755 --- a/helpers/lh_binary_encryption +++ b/helpers/lh_binary_encryption @@ -16,17 +16,17 @@ Read_conffile config/image Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap -Require_stagefile "${LIVE_ROOT}"/.stage/binary_rootfs +Require_stagefile .stage/bootstrap +Require_stagefile .stage/binary_rootfs # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/binary_encryption +Check_stagefile .stage/binary_encryption if [ -n "${LIVE_ENCRYPTION}" ] then @@ -51,11 +51,11 @@ then ;; esac - echo "Encrypting ${LIVE_ROOT}/binary/casper/filesystem.${ROOTFS} with ${LIVE_ENCRYPTION}..." + echo "Encrypting binary/casper/filesystem.${ROOTFS} with ${LIVE_ENCRYPTION}..." while true do - cat ${LIVE_ROOT}/binary/casper/filesystem.${ROOTFS} | aespipe -e "${LIVE_ENCRYPTION}" -T > "${LIVE_ROOT}"/binary/casper/filesystem.${ROOTFS} && break + cat binary/casper/filesystem.${ROOTFS} | aespipe -e "${LIVE_ENCRYPTION}" -T > binary/casper/filesystem.${ROOTFS} && break echo -n "Something went wrong... Retry? [YES/no] " @@ -69,5 +69,5 @@ then done # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/binary_encryption + Create_stagefile .stage/binary_encryption fi diff --git a/helpers/lh_binary_hdd b/helpers/lh_binary_hdd new file mode 100755 index 000000000..d973db52e --- /dev/null +++ b/helpers/lh_binary_hdd @@ -0,0 +1,46 @@ +#!/bin/sh + +# lh_binary_hdd(1) - build harddisk binary image + +set -e + +# Source common functions +for FUNCTION in /usr/share/live-helper/functions/*.sh +do + . ${FUNCTION} +done + +# Reading configuration files +Read_conffile config/common +Read_conffile config/bootstrap +Read_conffile config/image +Set_defaults + +# Requiring stage file +Require_stagefile .stage/bootstrap + +# Checking lock file +Check_lockfile .lock + +# Creating lock file +Create_lockfile .lock + +# Checking stage file +Check_stagefile .stage/binary_hdd + +for IMAGE in ${LIVE_BINARY_IMAGE} +do + if [ "${IMAGE}" = "hdd" ] + then + # Remove old binary + if [ -f binary-hdd.tar.gz ] + then + rm -f binary-hdd.tar.gz + fi + + tar cfz binary-hdd.tar.gz binary + + # Creating stage file + Create_stagefile .stage/binary_hdd + fi +done diff --git a/helpers/lh_binary_includes b/helpers/lh_binary_includes index b17051416..647ed0bca 100755 --- a/helpers/lh_binary_includes +++ b/helpers/lh_binary_includes @@ -17,26 +17,26 @@ Read_conffile config/image Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/binary_includes +Check_stagefile .stage/binary_includes if ls /usr/share/live-helper/includes/common/* &> /dev/null then - cp -r /usr/share/live-helper/includes/common/* "${LIVE_ROOT}"/binary + cp -r /usr/share/live-helper/includes/common/* binary fi if ls /usr/share/live-helper/includes/"${LIVE_BINARY_IMAGE}"/* &> /dev/null then - cp -r /usr/share/live-helper/includes/"${LIVE_BINARY_IMAGE}"/* "${LIVE_ROOT}"/binary + cp -r /usr/share/live-helper/includes/"${LIVE_BINARY_IMAGE}"/* binary fi # Creating stage file -Create_stagefile "${LIVE_ROOT}"/.stage/binary_includes +Create_stagefile .stage/binary_includes diff --git a/helpers/lh_binary_iso b/helpers/lh_binary_iso index d39313fc7..102b5a4a9 100755 --- a/helpers/lh_binary_iso +++ b/helpers/lh_binary_iso @@ -17,38 +17,38 @@ Read_conffile config/image Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/binary_iso +Check_stagefile .stage/binary_iso for IMAGE in ${LIVE_BINARY_IMAGE} do if [ "${IMAGE}" = "iso" ] then # Remove old binary - if [ -f "${LIVE_ROOT}"/binary.iso ] + if [ -f binary.iso ] then - rm -f "${LIVE_ROOT}"/binary.iso + rm -f binary.iso fi # Create image if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] then - ${LH_GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"binary.iso -r -J -l -V "${LIVE_ISO_VOLUME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "${LIVE_ROOT}"/binary ${LIVE_INCLUDE_IMAGE} + ${LH_GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_IMAGE}"binary.iso -r -J -l -V "${LIVE_ISO_VOLUME}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table binary ${LIVE_INCLUDE_IMAGE} else echo "W: Bootloader on your architecture not yet supported (Continuing in 5 seconds)." sleep 5 - ${LH_GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"binary.iso -r -J -l -V "${LIVE_ISO_VOLUME}" "${LIVE_ROOT}"/binary ${LIVE_INCLUDE_IMAGE} + ${LH_GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_IMAGE}"binary.iso -r -J -l -V "${LIVE_ISO_VOLUME}" binary ${LIVE_INCLUDE_IMAGE} fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/binary_iso + Create_stagefile .stage/binary_iso fi done diff --git a/helpers/lh_binary_linuximage b/helpers/lh_binary_linuximage index d332c53b0..7a9576d96 100755 --- a/helpers/lh_binary_linuximage +++ b/helpers/lh_binary_linuximage @@ -16,32 +16,32 @@ Read_conffile config/image Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/binary_linuximage +Check_stagefile .stage/binary_linuximage # Removing initrd backup files -rm -f "${LIVE_CHROOT}"/boot/initrd*bak* +rm -f chroot/boot/initrd*bak* # Setting destination directory case "${LIVE_BINARY_IMAGE}" in iso) - DESTDIR="${LIVE_ROOT}/binary/isolinux" + DESTDIR="binary/isolinux" ;; net) - DESTDIR="${LIVE_ROOT}/tftpboot" + DESTDIR="tftpboot" ;; - usb) - DESTDIR="${LIVE_ROOT}/binary" + usb|hdd) + DESTDIR="binary" ;; esac @@ -52,8 +52,8 @@ then fi # Installing linux-image -cp "${LIVE_CHROOT}"/boot/vmlinuz* "${DESTDIR}"/vmlinuz -cp "${LIVE_CHROOT}"/boot/initrd.img* "${DESTDIR}"/initrd.gz +cp chroot/boot/vmlinuz* "${DESTDIR}"/vmlinuz +cp chroot/boot/initrd.img* "${DESTDIR}"/initrd.gz # Creating stage file -Create_stagefile "${LIVE_ROOT}"/.stage/binary_linuximage +Create_stagefile .stage/binary_linuximage diff --git a/helpers/lh_binary_localincludes b/helpers/lh_binary_localincludes index 2aa654727..4cc2dd84b 100755 --- a/helpers/lh_binary_localincludes +++ b/helpers/lh_binary_localincludes @@ -16,24 +16,24 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/binary_localincludes +Check_stagefile .stage/binary_localincludes -if ls "${LIVE_ROOT}"/config/binary_localincludes/* &> /dev/null +if ls config/binary_localincludes/* &> /dev/null then - cd "${LIVE_ROOT}"/config/binary_localincludes - # Copying includes - find . | cpio -dmpu "${LIVE_ROOT}"/binary + cd config/binary_localincludes + find . | cpio -dmpu ../../binary + cd "${OLDPWD}" # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/binary_localincludes + Create_stagefile .stage/binary_localincludes fi diff --git a/helpers/lh_binary_manifest b/helpers/lh_binary_manifest index d109280db..a0c248022 100755 --- a/helpers/lh_binary_manifest +++ b/helpers/lh_binary_manifest @@ -16,19 +16,22 @@ Read_conffile config/image Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/binary_manifest +Check_stagefile .stage/binary_manifest # Add filesystem.manifest -Chroot "dpkg --get-selections" | awk '{ print $1 }' | sort -u > "${LIVE_ROOT}"/binary/casper/filesystem.manifest +Chroot "dpkg --get-selections" | awk '{ print $1 }' | sort -u > binary/casper/filesystem.manifest + +# Add packages.list +Chroot "dpkg -l" > packages.txt # Creating stage file -Create_stagefile "${LIVE_ROOT}"/.stage/binary_manifest +Create_stagefile .stage/binary_manifest diff --git a/helpers/lh_binary_md5sum b/helpers/lh_binary_md5sum index 9ab3f35a4..cd925d9bf 100755 --- a/helpers/lh_binary_md5sum +++ b/helpers/lh_binary_md5sum @@ -16,36 +16,27 @@ Read_conffile config/image Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/binary_md5sum +Check_stagefile .stage/binary_md5sum # Remove old md5sums -if [ -f "${LIVE_ROOT}"/binary/md5sum.txt ] +if [ -f binary/md5sum.txt ] then - rm -f "${LIVE_ROOT}"/binary/md5sum.txt + rm -f binary/md5sum.txt fi # Calculating md5sums -cd "${LIVE_ROOT}"/binary -find . -type f -print0 | xargs -0 md5sum > "${LIVE_ROOT}"/md5sum.txt +cd binary +find . -type f -print0 | xargs -0 md5sum > md5sum.txt cd "${OLDPWD}" -if [ -d "${LIVE_INCLUDE_IMAGE}" ] -then - cd "${LIVE_INCLUDE_IMAGE}" - find . -type f -print0 | xargs -0 md5sum >> "${LIVE_ROOT}"/md5sum.txt - cd "${OLDPWD}" -fi - -mv "${LIVE_ROOT}"/md5sum.txt "${LIVE_ROOT}"/binary - # Creating stage file -Create_stagefile "${LIVE_ROOT}"/.stage/binary_md5sum +Create_stagefile .stage/binary_md5sum diff --git a/helpers/lh_binary_memtest86 b/helpers/lh_binary_memtest86 index 95952afc9..1fc343076 100755 --- a/helpers/lh_binary_memtest86 +++ b/helpers/lh_binary_memtest86 @@ -17,16 +17,16 @@ Read_conffile config/image Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/binary_memtest86 +Check_stagefile .stage/binary_memtest86 if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ] then @@ -36,7 +36,7 @@ fi if [ "${LIVE_MEMTEST86}" = "enabled" ] then - if [ ! -f "${LIVE_CHROOT}"/boot/memtest86+.bin ] + if [ ! -f chroot/boot/memtest86+.bin ] then PACKAGES="${PACKAGES} memtest86+" fi @@ -45,7 +45,7 @@ then then # Installing symlinks case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get install --yes ${PACKAGES}" ;; @@ -57,15 +57,15 @@ then case "${LIVE_BINARY_IMAGE}" in iso) - DESTDIR="${LIVE_ROOT}/binary/isolinux" + DESTDIR="binary/isolinux" ;; net) - DESTDIR="${LIVE_ROOT}/tftpboot" + DESTDIR="tftpboot" ;; - usb) - DESTDIR="${LIVE_ROOT}/binary" + usb|hdd) + DESTDIR="binary" ;; esac @@ -76,13 +76,13 @@ then fi # Installing memtest86+ - cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin "${DESTDIR}"/memtest + cp chroot/boot/memtest86+.bin "${DESTDIR}"/memtest if [ -n "${PACKAGES}" ] then # Removing syslinux case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get remove --purge --yes ${PACKAGES}" ;; @@ -93,5 +93,5 @@ then fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/binary_memtest86 + Create_stagefile .stage/binary_memtest86 fi diff --git a/helpers/lh_binary_net b/helpers/lh_binary_net index 6281448ce..7d657c919 100755 --- a/helpers/lh_binary_net +++ b/helpers/lh_binary_net @@ -17,37 +17,38 @@ Read_conffile config/image Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/binary_net +Check_stagefile .stage/binary_net for IMAGE in ${LIVE_BINARY_IMAGE} do if [ "${IMAGE}" = "net" ] then # Remove old binary - if [ -f "${LIVE_ROOT}"/binary.tar.gz ] + if [ -f binary-net.tar.gz ] then - rm -f "${LIVE_ROOT}"/binary.tar.gz + rm -f binary-net.tar.gz fi # Creating image file - cd "${LIVE_ROOT}" && \ - mv binary "`basename ${LIVE_SERVER_PATH}`" && \ - cd .. && \ - tar cfz binary.tar.gz "`basename ${LIVE_ROOT}`/`basename ${LIVE_SERVER_PATH}`" "`basename ${LIVE_ROOT}`/tftpboot" && \ - mv binary.tar.gz "${LIVE_ROOT}" && \ - cd "${OLDPWD}" && \ + mv binary "`basename ${LIVE_SERVER_PATH}`" + + cd .. + tar cfz binary-net.tar.gz "${LIVE_ROOT}/`basename ${LIVE_SERVER_PATH}`" "${LIVE_ROOT}/tftpboot" + mv binary-net.tar.gz "${LIVE_ROOT}" + cd "${OLDPWD}" + mv "`basename ${LIVE_SERVER_PATH}`" binary # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/binary_net + Create_stagefile .stage/binary_net fi done diff --git a/helpers/lh_binary_rootfs b/helpers/lh_binary_rootfs index bbb2153c0..1ce994f87 100755 --- a/helpers/lh_binary_rootfs +++ b/helpers/lh_binary_rootfs @@ -16,61 +16,61 @@ Read_conffile config/image Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/binary_rootfs +Check_stagefile .stage/binary_rootfs # Creating directory -if [ ! -d "${LIVE_ROOT}"/binary/casper ] +if [ ! -d binary/casper ] then - mkdir -p "${LIVE_ROOT}"/binary/casper + mkdir -p binary/casper fi case "${LIVE_FILESYSTEM}" in ext2) - if [ -f "${LIVE_ROOT}"/binary/casper/filesystem.ext2 ] + if [ -f binary/casper/filesystem.ext2 ] then - rm -f "${LIVE_ROOT}"/binary/casper/filesystem.ext2 + rm -f binary/casper/filesystem.ext2 fi - DU_DIM="`du -ks ${LIVE_CHROOT} | cut -f1`" + DU_DIM="`du -ks chroot | cut -f1`" REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here... - genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root="${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.ext2 + genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root=chroot binary/casper/filesystem.ext2 ;; plain) - if [ -d "${LIVE_ROOT}"/binary/casper/filesystem.dir ] + if [ -d binary/casper/filesystem.dir ] then - rm -rf "${LIVE_ROOT}"/binary/casper/filesystem.dir + rm -rf binary/casper/filesystem.dir fi - cd "${LIVE_CHROOT}" - find . | cpio -pumd "${LIVE_ROOT}"/binary/casper/filesystem.dir + cd chroot + find . | cpio -pumd ../binary/casper/filesystem.dir cd "${OLDPWD}" ;; squashfs) - if [ -f "${LIVE_ROOT}"/binary/casper/filesystem.squashfs ] + if [ -f binary/casper/filesystem.squashfs ] then - rm "${LIVE_ROOT}"/binary/casper/filesystem.squashfs + rm binary/casper/filesystem.squashfs fi if [ "${LIVE_FLAVOUR}" = "minimal" ] || [ "${LIVE_FLAVOUR}" = "mini" ] then - mksquashfs "${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.squashfs -e "${LIVE_CHROOT}"/boot/vmlinuz* "${LIVE_CHROOT}"/boot/initrd.img* "${LIVE_CHROOT}"/vmlinuz "${LIVE_CHROOT}"/initrd.img "${LIVE_CHROOT}"/boot/config-* "${LIVE_CHROOT}"/boot/System.map-* + mksquashfs chroot binary/casper/filesystem.squashfs -e chroot/boot/vmlinuz* chroot/boot/initrd.img* chroot/vmlinuz chroot/initrd.img chroot/boot/config-* chroot/boot/System.map-* else - mksquashfs "${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.squashfs + mksquashfs chroot binary/casper/filesystem.squashfs fi ;; esac # Creating stage file -Create_stagefile "${LIVE_ROOT}"/.stage/binary_rootfs +Create_stagefile .stage/binary_rootfs diff --git a/helpers/lh_binary_syslinux b/helpers/lh_binary_syslinux index 5384232d6..d80d66eba 100755 --- a/helpers/lh_binary_syslinux +++ b/helpers/lh_binary_syslinux @@ -17,16 +17,16 @@ Read_conffile config/image Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/binary_syslinux +Check_stagefile .stage/binary_syslinux if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ] then @@ -36,7 +36,7 @@ fi if [ "${LIVE_SYSLINUX}" = "enabled" ] then - if [ ! -f "${LIVE_CHROOT}"/usr/bin/syslinux ] + if [ ! -f chroot/usr/bin/syslinux ] then PACKAGES="${PACKAGES} syslinux" fi @@ -45,7 +45,7 @@ then then # Installing symlinks case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get install --yes ${PACKAGES}" ;; @@ -63,73 +63,73 @@ then case "${LIVE_BINARY_IMAGE}" in iso) # Copying syslinux - mkdir -p "${LIVE_ROOT}"/binary/isolinux - cp "${LIVE_CHROOT}"/usr/lib/syslinux/isolinux.bin "${LIVE_ROOT}"/binary/isolinux - cp -r "${LIVE_TEMPLATES}"/syslinux/* "${LIVE_ROOT}"/binary/isolinux + mkdir -p binary/isolinux + cp chroot/usr/lib/syslinux/isolinux.bin binary/isolinux + cp -r "${LIVE_TEMPLATES}"/syslinux/* binary/isolinux # Copying splash screen if [ -n "${LIVE_SYSLINUX_SPLASH}" ] then - cp "${LIVE_SYSLINUX_SPLASH}" "${LIVE_ROOT}/binary/isolinux/splash.rle" + cp "${LIVE_SYSLINUX_SPLASH}" binary/isolinux/splash.rle fi # Configure syslinux templates - sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg - sed -i -e "s/LIVE_DATE/${DATE}/" "${LIVE_ROOT}"/binary/isolinux/f1.txt - sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/binary/isolinux/f10.txt + sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/isolinux/isolinux.cfg + sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" binary/isolinux/f1.txt + sed -i -e "s/LIVE_VERSION/${VERSION}/" binary/isolinux/f10.txt # Remove unused files - rm -f "${LIVE_ROOT}"/binary/isolinux/pxelinux.cfg + rm -f binary/isolinux/pxelinux.cfg ;; net) # Copying syslinux - mkdir -p "${LIVE_ROOT}"/tftpboot - cp "${LIVE_CHROOT}"/usr/lib/syslinux/pxelinux.0 "${LIVE_ROOT}"/tftpboot + mkdir -p tftpboot + cp chroot/usr/lib/syslinux/pxelinux.0 tftpboot # Install syslinux templates - mkdir -p "${LIVE_ROOT}"/tftpboot/pxelinux.cfg - cp -r "${LIVE_TEMPLATES}"/syslinux/* "${LIVE_ROOT}"/tftpboot/pxelinux.cfg - mv "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/pxelinux.cfg "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default - sed -i -e 's#splash.rle#pxelinux.cfg/splash.rle#' "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/isolinux.txt + mkdir -p tftpboot/pxelinux.cfg + cp -r "${LIVE_TEMPLATES}"/syslinux/* tftpboot/pxelinux.cfg + mv tftpboot/pxelinux.cfg/pxelinux.cfg tftpboot/pxelinux.cfg/default + sed -i -e 's#splash.rle#pxelinux.cfg/splash.rle#' tftpboot/pxelinux.cfg/isolinux.txt # Copying splash screen if [ -n "${LIVE_SYSLINUX_SPLASH}" ] then - cp "${LIVE_SYSLINUX_SPLASH}" "${LIVE_ROOT}/tftpboot/pxelinux.cfg/splash.rle" + cp "${LIVE_SYSLINUX_SPLASH}" ftpboot/pxelinux.cfg/splash.rle fi # Configure syslinux templates - sed -i -e "s/LIVE_SERVER_ADDRESS/${LIVE_SERVER_ADDRESS}/" -e "s#LIVE_SERVER_PATH#${LIVE_SERVER_PATH}#" -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/default - sed -i -e "s/LIVE_DATE/${DATE}/" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f1.txt - sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f10.txt + sed -i -e "s/LIVE_SERVER_ADDRESS/${LIVE_SERVER_ADDRESS}/" -e "s#LIVE_SERVER_PATH#${LIVE_SERVER_PATH}#" -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" tftpboot/pxelinux.cfg/default + sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" tftpboot/pxelinux.cfg/f1.txt + sed -i -e "s/LIVE_VERSION/${VERSION}/" tftpboot/pxelinux.cfg/f10.txt # Remove unused files - rm -f "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/isolinux.cfg + rm -f tftpboot/pxelinux.cfg/isolinux.cfg ;; - usb) + usb|hdd) # Copying syslinux - mkdir -p "${LIVE_ROOT}"/binary - cp "${LIVE_CHROOT}"/usr/lib/syslinux/isolinux.bin "${LIVE_ROOT}"/binary/syslinux.bin - cp -r "${LIVE_TEMPLATES}"/syslinux/* "${LIVE_ROOT}"/binary - mv "${LIVE_ROOT}"/binary/isolinux.cfg "${LIVE_ROOT}"/binary/syslinux.cfg - mv "${LIVE_ROOT}"/binary/isolinux.txt "${LIVE_ROOT}"/binary/syslinux.txt - sed -i -e "s/isolinux.txt/syslinux.txt/" "${LIVE_ROOT}"/binary/syslinux.cfg + mkdir -p binary + cp chroot/usr/lib/syslinux/isolinux.bin binary/syslinux.bin + cp -r "${LIVE_TEMPLATES}"/syslinux/* binary + mv binary/isolinux.cfg binary/syslinux.cfg + mv binary/isolinux.txt binary/syslinux.txt + sed -i -e "s/isolinux.txt/syslinux.txt/" binary/syslinux.cfg # Copying splash screen if [ -n "${LIVE_SYSLINUX_SPLASH}" ] then - cp "${LIVE_SYSLINUX_SPLASH}" "${LIVE_ROOT}/binary/splash.rle" + cp "${LIVE_SYSLINUX_SPLASH}" binary/splash.rle fi # Configure syslinux templates - sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/binary/syslinux.cfg - sed -i -e "s/LIVE_DATE/${DATE}/" "${LIVE_ROOT}"/binary/f1.txt - sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/binary/f10.txt + sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/syslinux.cfg + sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" binary/f1.txt + sed -i -e "s/LIVE_VERSION/${VERSION}/" binary/f10.txt # Remove unused files - rm -f "${LIVE_ROOT}"/binary/pxelinux.cfg + rm -f binary/pxelinux.cfg ;; esac @@ -137,7 +137,7 @@ then then # Removing syslinux case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get remove --purge --yes ${PACKAGES}" ;; @@ -148,5 +148,5 @@ then fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/binary_syslinux + Create_stagefile .stage/binary_syslinux fi diff --git a/helpers/lh_binary_usb b/helpers/lh_binary_usb index ec0d13f36..79a3ee028 100755 --- a/helpers/lh_binary_usb +++ b/helpers/lh_binary_usb @@ -17,37 +17,38 @@ Read_conffile config/image Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap +Require_stagefile .stage/chroot_proc # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/binary_usb +Check_stagefile .stage/binary_usb for IMAGE in ${LIVE_BINARY_IMAGE} do if [ "${IMAGE}" = "usb" ] then - if [ ! -f "${LIVE_CHROOT}"/sbin/mkdosfs ] + if [ ! -f chroot/sbin/mkdosfs ] then PACKAGES="${PACKAGES} dosfstools" fi - if [ ! -f "${LIVE_CHROOT}"/usr/bin/mtools ] + if [ ! -f chroot/usr/bin/mtools ] then PACKAGES="${PACKAGES} mtools" fi - if [ ! -f "${LIVE_CHROOT}"/sbin/parted ] + if [ ! -f chroot/sbin/parted ] then PACKAGES="${PACKAGES} parted" fi - if [ ! -f "${LIVE_CHROOT}"/usr/bin/syslinux ] + if [ ! -f chroot/usr/bin/syslinux ] then PACKAGES="${PACKAGES} syslinux" fi @@ -56,7 +57,7 @@ do then # Installing packages case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get install --yes ${PACKAGES}" ;; @@ -67,52 +68,55 @@ do fi # Remove old binary - if [ -f "${LIVE_ROOT}"/binary.img ] + if [ -f binary.img ] then - rm -f "${LIVE_ROOT}"/binary.img + rm -f binary.img fi # Everything which comes here needs to be cleaned up, - DU_DIM="`du -ms ${LIVE_ROOT}/binary | cut -f1`" + DU_DIM="`du -ms binary | cut -f1`" REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here... - dd if=/dev/zero of="${LIVE_ROOT}"/binary.img bs=1024k count=${REAL_DIM} - FREELO="`losetup -f`" - if [ ! -b "${LIVE_CHROOT}"/${FREELO} ] + dd if=/dev/zero of=binary.img bs=1024k count=${REAL_DIM} + FREELO="`${LH_LOSETUP} -f`" + if [ ! -b chroot/${FREELO} ] then MAKEDEV="true" - Chroot "cd /dev && ./MAKEDEV ${FREELO}" + + mv chroot/dev chroot/dev.tmp + find /dev | cpio -dmpu chroot fi echo "!!! The following error/warning messages can be ignored !!!" - lh_losetup $FREELO "${LIVE_ROOT}"/binary.img 0 + lh_losetup $FREELO binary.img 0 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 - cat "${LIVE_CHROOT}"/usr/lib/syslinux/mbr.bin > ${FREELO} - losetup -d ${FREELO} + cat chroot/usr/lib/syslinux/mbr.bin > ${FREELO} + ${LH_LOSETUP} -d ${FREELO} - lh_losetup $FREELO "${LIVE_ROOT}"/binary.img 1 + lh_losetup $FREELO binary.img 1 Chroot "mkfs.msdos -n DEBIAN_LIVE ${FREELO}" - mkdir -p "${LIVE_ROOT}"/binary.tmp - mount ${FREELO} "${LIVE_ROOT}"/binary.tmp - cp -r "${LIVE_ROOT}"/binary/* "${LIVE_ROOT}"/binary.tmp - umount "${LIVE_ROOT}"/binary.tmp - rmdir "${LIVE_ROOT}"/binary.tmp + mkdir -p binary.tmp + mount ${FREELO} binary.tmp + cp -r binary/* binary.tmp + umount binary.tmp + rmdir binary.tmp Chroot "syslinux ${FREELO}" - losetup -d ${FREELO} + ${LH_LOSETUP} -d ${FREELO} echo "!!! The above error/warning messages can be ignored !!!" if [ -n "${MAKEDEV}" ] then - rm -f "${LIVE_CHROOT}"/${FREELO} + rm -f chroot/dev + mv chroot/dev.tmp chroot/dev fi if [ -n "${PACKAGES}" ] then # Removing packages case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get remove --purge --yes ${PACKAGES}" ;; @@ -121,8 +125,8 @@ do ;; esac fi - fi - # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/binary_usb + # Creating stage file + Create_stagefile .stage/binary_usb + fi done diff --git a/helpers/lh_bootstrap b/helpers/lh_bootstrap index 9d1170dbc..c4db590f7 100755 --- a/helpers/lh_bootstrap +++ b/helpers/lh_bootstrap @@ -12,7 +12,6 @@ done # Reading configuration files Read_conffile config/common -Read_conffile config/bootstrap Set_defaults # Bootstrapping system diff --git a/helpers/lh_bootstrap_cdebootstrap b/helpers/lh_bootstrap_cdebootstrap index c5602a6e1..e4b83a2e7 100755 --- a/helpers/lh_bootstrap_cdebootstrap +++ b/helpers/lh_bootstrap_cdebootstrap @@ -19,24 +19,18 @@ Read_conffile config/bootstrap Set_defaults # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Check_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock - -# Creating root directory -if [ ! -d "${LIVE_ROOT}" ] -then - mkdir -p "${LIVE_ROOT}" -fi +Create_lockfile .lock # Creating chroot directory -if [ ! -d "${LIVE_CHROOT}" ] +if [ ! -d chroot ] then - mkdir -p "${LIVE_CHROOT}" + mkdir -p chroot fi # Setting cdebootstrap options @@ -60,44 +54,44 @@ fi if [ -x "/usr/bin/cdebootstrap" ] then # Restore old cache - if [ -d "${LIVE_ROOT}"/cache/bootstrap ] + if [ -d cache/bootstrap ] then - mkdir -p "${LIVE_CHROOT}"/var/cache/bootstrap - cp "${LIVE_ROOT}"/cache/bootstrap/*.deb "${LIVE_CHROOT}"/var/cache/bootstrap + mkdir -p chroot/var/cache/bootstrap + cp cache/bootstrap/*.deb chroot/var/cache/bootstrap fi if [ "${LH_CACHE}" = "enabled" ] then # Executing cdebootstrap (download-only) - cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}" + cdebootstrap ${CDEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_LOCAL}" # Removing old cache - if [ -d "${LIVE_ROOT}"/cache/bootstrap ] + if [ -d cache/bootstrap ] then - rm -f "${LIVE_ROOT}"/cache/bootstrap/*.deb + rm -f cache/bootstrap/*.deb fi # Saving new cache - if [ ! -d "${LIVE_ROOT}"/cache/bootstrap ] + if [ ! -d cache/bootstrap ] then - mkdir -p "${LIVE_ROOT}"/cache/bootstrap + mkdir -p cache/bootstrap fi - cp "${LIVE_CHROOT}"/var/cache/bootstrap/*.deb "${LIVE_ROOT}"/cache/bootstrap + cp chroot/var/cache/bootstrap/*.deb cache/bootstrap fi # Executing cdebootstrap (regular run) - cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}" + cdebootstrap ${CDEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_LOCAL}" else echo "E: Can't process file /usr/bin/cdebootstrap (FIXME)" exit 1 fi # Removing bootstrap cache -if [ -d "${LIVE_CHROOT}/var/cache/bootstrap" ] +if [ -d chroot/var/cache/bootstrap ] then - rm -rf "${LIVE_CHROOT}"/var/cache/bootstrap + rm -rf chroot/var/cache/bootstrap fi # Creating stage file -Create_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Create_stagefile .stage/bootstrap diff --git a/helpers/lh_bootstrap_debootstrap b/helpers/lh_bootstrap_debootstrap index 42009cbc5..8ff83af48 100755 --- a/helpers/lh_bootstrap_debootstrap +++ b/helpers/lh_bootstrap_debootstrap @@ -19,24 +19,18 @@ Read_conffile config/bootstrap Set_defaults # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Check_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock - -# Creating root directory -if [ ! -d "${LIVE_ROOT}" ] -then - mkdir -p "${LIVE_ROOT}" -fi +Create_lockfile .lock # Creating chroot directory -if [ ! -d "${LIVE_CHROOT}" ] +if [ ! -d chroot ] then - mkdir -p "${LIVE_CHROOT}" + mkdir -p chroot fi # Setting debootstrap options @@ -53,41 +47,41 @@ fi if [ -x "/usr/sbin/debootstrap" ] then # Restore old cache - if [ -d "${LIVE_ROOT}"/cache/bootstrap ] + if [ -d cache/bootstrap ] then - mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives - cp "${LIVE_ROOT}"/cache/bootstrap/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives + mkdir -p chroot/var/cache/apt/archives + cp cache/bootstrap/*.deb chroot/var/cache/apt/archives fi if [ "${LH_CACHE}" = "enabled" ] then # Executing debootstrap (download-only) - debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}" "${LIVE_DEBOOTSTRAP_SCRIPT}" + debootstrap ${DEBOOTSTRAP_OPTIONS} --download-only "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_LOCAL}" "${LIVE_DEBOOTSTRAP_SCRIPT}" # Removing old cache - if [ -d "${LIVE_ROOT}"/cache/bootstrap ] + if [ -d cache/bootstrap ] then - rm -f "${LIVE_ROOT}"/cache/bootstrap/*.deb + rm -f cache/bootstrap/*.deb fi # Saving new cache - if [ ! -d "${LIVE_ROOT}"/cache/bootstrap ] + if [ ! -d cache/bootstrap ] then - mkdir -p "${LIVE_ROOT}"/cache/bootstrap + mkdir -p cache/bootstrap fi - cp "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/bootstrap + cp chroot/var/cache/apt/archives/*.deb cache/bootstrap fi # Executing debootstrap (regular run) - debootstrap ${DEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}" "${LIVE_DEBOOTSTRAP_SCRIPT}" + debootstrap ${DEBOOTSTRAP_OPTIONS} "${LIVE_DISTRIBUTION}" chroot "${LIVE_MIRROR_LOCAL}" "${LIVE_DEBOOTSTRAP_SCRIPT}" else echo "E: Can't process file /usr/bin/debootstrap (FIXME)" exit 1 fi # Removing bootstrap cache -rm -rf "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb +rm -rf chroot/var/cache/apt/archives/*.deb # Creating stage file -Create_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Create_stagefile .stage/bootstrap diff --git a/helpers/lh_chroot_apt b/helpers/lh_chroot_apt index 39839238f..fd3701206 100755 --- a/helpers/lh_chroot_apt +++ b/helpers/lh_chroot_apt @@ -16,34 +16,34 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock case "${1}" in install) # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/chroot_apt + Check_stagefile .stage/chroot_apt - if [ "${LH_APT}" = "aptitude" ] && [ ! -d "${LIVE_CHROOT}"/etc/apt/apt.conf.d ] + if [ "${LH_APT}" = "aptitude" ] && [ ! -d chroot/etc/apt/apt.conf.d ] then - mkdir -p "${LIVE_CHROOT}"/etc/apt/apt.conf.d + mkdir -p chroot/etc/apt/apt.conf.d fi # Configuring apt ftp proxy if [ -n "${LH_APT_FTPPROXY}" ] then case "${LH_APT}" in - apt) - echo "Acquire::ftp::Proxy \"${LH_APT_FTPPROXY}\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf + apt|apt-get) + echo "Acquire::ftp::Proxy \"${LH_APT_FTPPROXY}\";" >> chroot/etc/apt/apt.conf ;; aptitude) - echo "Acquire::ftp::Proxy \"${LH_APT_FTPPROXY}\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/ftp-proxy + echo "Acquire::ftp::Proxy \"${LH_APT_FTPPROXY}\";" > chroot/etc/apt/apt.conf.d/ftp-proxy ;; esac fi @@ -52,12 +52,12 @@ case "${1}" in if [ -n "${LH_APT_HTTPPROXY}" ] then case "${LH_APT}" in - apt) - echo "Acquire::http::Proxy \"${LH_APT_HTTPPROXY}\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf + apt|apt-get) + echo "Acquire::http::Proxy \"${LH_APT_HTTPPROXY}\";" >> chroot/etc/apt/apt.conf ;; aptitude) - echo "Acquire::http::Proxy \"${LH_APT_HTTPPROXY}\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/http-proxy + echo "Acquire::http::Proxy \"${LH_APT_HTTPPROXY}\";" > chroot/etc/apt/apt.conf.d/http-proxy ;; esac fi @@ -66,22 +66,22 @@ case "${1}" in if [ "${LH_APT_PDIFFS}" = "enabled" ] then case "${LH_APT}" in - apt) - echo "Acquire::PDiffs \"true\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf + apt|apt-get) + echo "Acquire::PDiffs \"true\";" >> chroot/etc/apt/apt.conf ;; aptitude) - echo "Acquire::PDiffs \"true\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/pdiffs + echo "Acquire::PDiffs \"true\";" > chroot/etc/apt/apt.conf.d/pdiffs ;; esac else case "${LH_APT}" in - apt) - echo "Acquire::PDiffs \"false\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf + apt|apt-get) + echo "Acquire::PDiffs \"false\";" >> chroot/etc/apt/apt.conf ;; aptitude) - echo "Acquire::PDiffs \"false\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/pdiffs + echo "Acquire::PDiffs \"false\";" > chroot/etc/apt/apt.conf.d/pdiffs ;; esac fi @@ -90,48 +90,48 @@ case "${1}" in if [ "${LH_APT_RECOMMENDS}" = "enabled" ] then case "${LH_APT}" in - apt) - echo "Aptitude::Recommends-Important \"true\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf + apt|apt-get) + echo "Aptitude::Recommends-Important \"true\";" >> chroot/etc/apt/apt.conf ;; aptitude) - echo "Aptitude::Recommends-Important \"true\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/recommends + echo "Aptitude::Recommends-Important \"true\";" > chroot/etc/apt/apt.conf.d/recommends ;; esac else case "${LH_APT}" in - apt) - echo "Aptitude::Recommends-Important \"false\";" >> "${LIVE_CHROOT}"/etc/apt/apt.conf + apt|apt-get) + echo "Aptitude::Recommends-Important \"false\";" >> chroot/etc/apt/apt.conf ;; aptitude) - echo "Aptitude::Recommends-Important \"false\";" > "${LIVE_CHROOT}"/etc/apt/apt.conf.d/recommends + echo "Aptitude::Recommends-Important \"false\";" > chroot/etc/apt/apt.conf.d/recommends ;; esac fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_apt + Create_stagefile .stage/chroot_apt ;; remove) # Deconfiguring apt settings - rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf + rm -f chroot/etc/apt/apt.conf # Deconfiguring aptitude ftp proxy - rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/ftp-proxy + rm -f chroot/etc/apt/apt.conf.d/ftp-proxy # Deconfiguring aptitude http proxy - rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/http-proxy + rm -f chroot/etc/apt/apt.conf.d/http-proxy # Deconfiguring aptitude pdiffs - rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/pdiffs + rm -f chroot/etc/apt/apt.conf.d/pdiffs # Deconfiguring aptitude recommends - rm -f "${LIVE_CHROOT}"/etc/apt/apt.conf.d/recommends + rm -f chroot/etc/apt/apt.conf.d/recommends # Removing stage file - rm -f "${LIVE_ROOT}"/.stage/chroot_apt + rm -f .stage/chroot_apt ;; *) diff --git a/helpers/lh_chroot_debianchroot b/helpers/lh_chroot_debianchroot index 6272fe052..d6fcaa362 100755 --- a/helpers/lh_chroot_debianchroot +++ b/helpers/lh_chroot_debianchroot @@ -16,44 +16,44 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock case "${1}" in install) # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/chroot_debianchroot + Check_stagefile .stage/chroot_debianchroot - if [ -f "${LIVE_CHROOT}"/etc/debian_chroot ] + if [ -f chroot/etc/debian_chroot ] then # Save chroot file - mv "${LIVE_CHROOT}"/etc/debian_chroot "${LIVE_CHROOT}"/etc/debian_chroot.orig + mv chroot/etc/debian_chroot chroot/etc/debian_chroot.orig fi # Create chroot file - echo "live" > "${LIVE_CHROOT}"/etc/debian_chroot + echo "live" > chroot/etc/debian_chroot # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_debianchroot + Create_stagefile .stage/chroot_debianchroot ;; remove) - if [ -f "${LIVE_CHROOT}"/etc/debian_chroot.orig ] + if [ -f chroot/etc/debian_chroot.orig ] then # Restore chroot file - mv "${LIVE_CHROOT}"/etc/debian_chroot.orig "${LIVE_CHROOT}"/etc/debian_chroot + mv chroot/etc/debian_chroot.orig chroot/etc/debian_chroot else # Remove chroot file - rm -f "${LIVE_CHROOT}"/etc/debian_chroot + rm -f chroot/etc/debian_chroot fi # Removing stage file - rm -f "${LIVE_ROOT}"/.stage/chroot_debianchroot + rm -f .stage/chroot_debianchroot ;; *) diff --git a/helpers/lh_chroot_hacks b/helpers/lh_chroot_hacks index d46e0c559..2b08283e8 100755 --- a/helpers/lh_chroot_hacks +++ b/helpers/lh_chroot_hacks @@ -16,16 +16,16 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/chroot_hacks +Check_stagefile .stage/chroot_hacks # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Removing udev mac caching rule rm -f chroot/etc/udev/rules.d/z25_persistent-net.rules @@ -33,7 +33,7 @@ rm -f chroot/etc/udev/rules.d/z25_persistent-net.rules case "${LIVE_BINARY_IMAGE}" in net) case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get install --yes smbfs" ;; @@ -42,13 +42,13 @@ case "${LIVE_BINARY_IMAGE}" in ;; esac - if [ ! -d "${LIVE_CHROOT}"/etc/initramfs-tools ] + if [ ! -d chroot/etc/initramfs-tools ] then - mkdir "${LIVE_CHROOT}"/etc/initramfs-tools + mkdir chroot/etc/initramfs-tools fi # Configuring initramfs for NFS -cat >> "${LIVE_CHROOT}"/etc/initramfs-tools/initramfs.conf << EOF +cat >> chroot/etc/initramfs-tools/initramfs.conf << EOF MODULES=netboot BOOT=nfs NFSROOT=auto @@ -60,4 +60,4 @@ esac Chroot "update-initramfs -tu" # Creating stage file -Create_stagefile "${LIVE_ROOT}"/.stage/chroot_hacks +Create_stagefile .stage/chroot_hacks diff --git a/helpers/lh_chroot_hooks b/helpers/lh_chroot_hooks index 727eed947..d6558256a 100755 --- a/helpers/lh_chroot_hooks +++ b/helpers/lh_chroot_hooks @@ -16,35 +16,35 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/chroot_hooks +Check_stagefile .stage/chroot_hooks # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Processing hooks if [ -n "${LIVE_PACKAGES_LIST}" ] && [ -f /usr/share/live-helper/hooks/"${LIVE_PACKAGES_LIST}" ] then # Copying hook - cp /usr/share/live-helper/hooks/"${LIVE_PACKAGES_LIST}" "${LIVE_CHROOT}"/root + cp /usr/share/live-helper/hooks/"${LIVE_PACKAGES_LIST}" chroot/root # Making hook executable - if [ -x "${LIVE_CHROOT}"/root/${LIVE_PACKAGES_LIST} ] + if [ ! -x chroot/root/${LIVE_PACKAGES_LIST} ] then - chmod +x "${LIVE_CHROOT}"/root/${LIVE_PACKAGES_LIST} + chmod +x chroot/root/${LIVE_PACKAGES_LIST} fi # Executing hook Chroot "/root/${LIVE_PACKAGES_LIST}" # Removing hook - rm -f "${LIVE_CHROOT}"/root/"${LIVE_PACKAGE_LIST}" + rm -f chroot/root/"${LIVE_PACKAGE_LIST}" # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_hooks + Create_stagefile .stage/chroot_hooks fi diff --git a/helpers/lh_chroot_hosts b/helpers/lh_chroot_hosts index d1c160794..48cc1c925 100755 --- a/helpers/lh_chroot_hosts +++ b/helpers/lh_chroot_hosts @@ -16,47 +16,47 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock case "${1}" in install) # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/chroot_hosts + Check_stagefile .stage/chroot_hosts - if [ -f "${LIVE_CHROOT}"/etc/hosts ] + if [ -f chroot/etc/hosts ] then # Save hosts file - cp "${LIVE_CHROOT}"/etc/hosts "${LIVE_CHROOT}"/etc/hosts.orig + cp chroot/etc/hosts chroot/etc/hosts.orig fi if [ -f /etc/hosts ] then # Copy hosts file - cp /etc/hosts "${LIVE_CHROOT}"/etc/hosts + cp /etc/hosts chroot/etc/hosts fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_hosts + Create_stagefile .stage/chroot_hosts ;; remove) - if [ -f "${LIVE_CHROOT}"/etc/hosts.orig ] + if [ -f chroot/etc/hosts.orig ] then # Restore hosts file - mv "${LIVE_CHROOT}"/etc/hosts.orig "${LIVE_CHROOT}"/etc/hosts + mv chroot/etc/hosts.orig chroot/etc/hosts else # Remove hosts file - rm -f "${LIVE_CHROOT}"/etc/hosts + rm -f chroot/etc/hosts fi # Removing stage file - rm -f "${LIVE_ROOT}"/.stage/chroot_hosts + rm -f .stage/chroot_hosts ;; *) diff --git a/helpers/lh_chroot_linuximage b/helpers/lh_chroot_linuximage index 354c5078d..0658155f6 100755 --- a/helpers/lh_chroot_linuximage +++ b/helpers/lh_chroot_linuximage @@ -16,34 +16,34 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock case "${1}" in install) # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/chroot_linuximage + Check_stagefile .stage/chroot_linuximage - if [ -f "${LIVE_CHROOT}"/etc/kernel-img.conf ] + if [ -f chroot/etc/kernel-img.conf ] then # Saving kernel-img.conf - cp "${LIVE_CHROOT}"/etc/kernel-img.conf "${LIVE_CHROOT}"/etc/kernel-img.conf.old + cp chroot/etc/kernel-img.conf chroot/etc/kernel-img.conf.old fi # Configuring kernel-img.conf - echo "do_initrd = Yes" >> "${LIVE_CHROOT}"/etc/kernel-img.conf + echo "do_initrd = Yes" >> chroot/etc/kernel-img.conf # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_linuximage + Create_stagefile .stage/chroot_linuximage # Installing linux-image, modules and casper case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get install --yes ${LIVE_KERNEL_PACKAGES}" ;; @@ -54,17 +54,17 @@ case "${1}" in ;; remove) - if [ -f "${LIVE_CHROOT}"/etc/kernel-img.conf.old ] + if [ -f chroot/etc/kernel-img.conf.old ] then # Restoring kernel-img.conf file - mv "${LIVE_CHROOT}"/etc/kernel-img.conf.old "${LIVE_CHROOT}"/etc/kernel-img.conf + mv chroot/etc/kernel-img.conf.old chroot/etc/kernel-img.conf else # Removing kernel-img.conf file - rm -f "${LIVE_CHROOT}"/etc/kernel-img.conf + rm -f chroot/etc/kernel-img.conf fi # Removing stage file - rm -f "${LIVE_ROOT}"/.stage/chroot_linuximage + rm -f .stage/chroot_linuximage ;; *) diff --git a/helpers/lh_chroot_localhooks b/helpers/lh_chroot_localhooks index 4d0bf3bb1..794e75903 100755 --- a/helpers/lh_chroot_localhooks +++ b/helpers/lh_chroot_localhooks @@ -16,38 +16,38 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/chroot_localhooks +Check_stagefile .stage/chroot_localhooks # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Processing localhooks -if ls "${LIVE_ROOT}"/config/chroot_localhooks/* &> /dev/null +if ls config/chroot_localhooks/* &> /dev/null then - for HOOK in "${LIVE_ROOT}"/config/chroot_localhooks/* + for HOOK in config/chroot_localhooks/* do # Copying hook - cp "${HOOK}" "${LIVE_CHROOT}"/root + cp "${HOOK}" chroot/root # Making hook executable - if [ -x "${LIVE_CHROOT}"/root/"${HOOK}" ] + if [ ! -x chroot/root/"`basename ${HOOK}`" ] then - chmod +x "${LIVE_CHROOT}"/root/${HOOK} + chmod +x chroot/root/"`basename ${HOOK}`" fi # Executing hook Chroot "/root/`basename ${HOOK}`" # Removing hook - rm -f "${LIVE_CHROOT}"/"`basename ${HOOK}`" + rm -f chroot/"`basename ${HOOK}`" done # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_localhooks + Create_stagefile .stage/chroot_localhooks fi diff --git a/helpers/lh_chroot_localincludes b/helpers/lh_chroot_localincludes index 4c0957a43..fc9c82992 100755 --- a/helpers/lh_chroot_localincludes +++ b/helpers/lh_chroot_localincludes @@ -16,24 +16,24 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/chroot_localincludes +Check_stagefile .stage/chroot_localincludes # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock -if ls "${LIVE_ROOT}"/config/chroot_localincludes/* &> /dev/null +if ls config/chroot_localincludes/* &> /dev/null then - cd "${LIVE_ROOT}"/config/chroot_localincludes - # Copying includes - find . | cpio -dmpu "${LIVE_CHROOT}" + cd config/chroot_localincludes + find . | cpio -dmpu ../../chroot + cd "${OLDPWD}" # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_localincludes + Create_stagefile .stage/chroot_localincludes fi diff --git a/helpers/lh_chroot_localization b/helpers/lh_chroot_localization index bbf05bfa4..24d60c006 100755 --- a/helpers/lh_chroot_localization +++ b/helpers/lh_chroot_localization @@ -16,16 +16,16 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/chroot_localization +Check_stagefile .stage/chroot_localization # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Setting localizations if [ -n "${LIVE_LANGUAGE}" ] @@ -617,42 +617,42 @@ then do case "${LOCALZATION}" in iceape) - if [ -f "${LIVE_CHROOT}"/usr/bin/iceape ] + if [ -f chroot/usr/bin/iceape ] then PACKAGES="${PACKAGES} iceweasel-l10n-${ICEAPE}" fi ;; icedove) - if [ -f "${LIVE_CHROOT}"/usr/bin/icedove ] + if [ -f chroot/usr/bin/icedove ] then PACKAGES="${PACKAGES} icedove-locale-${ICEDOVE}" fi ;; iceweasel) - if [ -f "${LIVE_CHROOT}"/usr/bin/iceweasel ] + if [ -f chroot/usr/bin/iceweasel ] then PACKAGES="${PACKAGES} iceweasel-l10n-${ICEWEASEL}" fi ;; kde) - if [ -f "${LIVE_CHROOT}"/usr/bin/kstart ] + if [ -f chroot/usr/bin/kstart ] then PACKAGES="${PACKAGES} kde-i18n-${KDE}" fi ;; koffice) - if [ -f "${LIVE_CHROOT}" ] + if [ -f chroot/usr/bin/usr/bin/koconverter ] then PACKAGES="${PACKAGES} koffice-i18n-${KOFFICE}" fi ;; openoffice) - if [ -f "${LIVE_CHROOT}"/usr/bin/ooffice ] + if [ -f chroot/usr/bin/ooffice ] then PACKAGES="${PACKAGES} openoffice.org-l10n-${OPENOFFICE}" fi @@ -661,14 +661,14 @@ then done # Restore old cache - if [ -d "${LIVE_ROOT}"/cache/chroot_localization ] + if [ -d cache/chroot_localization ] then - cp "${LIVE_ROOT}"/cache/chroot_localization/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives + cp cache/chroot_localization/*.deb chroot/var/cache/apt/archives fi # Installing packages case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get install --yes ${PACKAGES}" ;; @@ -680,16 +680,16 @@ then # Saving new cache Chroot "apt-get autoclean" - if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null + if ls chroot/var/cache/apt/archives/*.deb &> /dev/null then - if [ ! -d "${LIVE_ROOT}"/cache/chroot_localization ] + if [ ! -d cache/chroot_localization ] then - mkdir -p "${LIVE_ROOT}"/cache/chroot_localization + mkdir -p cache/chroot_localization fi - mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_localization + mv -f chroot/var/cache/apt/archives/*.deb cache/chroot_localization fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_localization + Create_stagefile .stage/chroot_localization fi diff --git a/helpers/lh_chroot_localpackages b/helpers/lh_chroot_localpackages index 1ed433948..7f13acb62 100755 --- a/helpers/lh_chroot_localpackages +++ b/helpers/lh_chroot_localpackages @@ -16,35 +16,35 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/chroot_localpackages +Check_stagefile .stage/chroot_localpackages # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock -if ls "${LIVE_ROOT}"/config/chroot_localpackages/*.deb &> /dev/null +if ls config/chroot_localpackages/*.deb &> /dev/null then # Restore old cache - if [ -d "${LIVE_ROOT}"/cache/chroot_localpackages ] + if [ -d cache/chroot_localpackages ] then - cp "${LIVE_ROOT}"/cache/chroot_localpackages/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives + cp cache/chroot_localpackages/*.deb chroot/var/cache/apt/archives fi # Copying packages - cp "${LIVE_ROOT}"/config/chroot_localpackages/*.deb "${LIVE_CHROOT}"/root + cp config/chroot_localpackages/*.deb chroot/root # Installing packages - Chroot "find /root -name *.deb" > "${LIVE_CHROOT}"/root/localpackages + Chroot "find /root -name *.deb" > chroot/root/localpackages Chroot "xargs --arg-file=/root/localpackages dpkg -i" || true # Cleaning dependencies case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get install -f --yes" ;; @@ -54,22 +54,22 @@ then esac # Removing package files - rm -f "${LIVE_CHROOT}"/root/*.deb - rm -f "${LIVE_CHROOT}"/root/localpackages + rm -f chroot/root/*.deb + rm -f chroot/root/localpackages # Saving new cache Chroot "apt-get autoclean" - if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null + if ls chroot/var/cache/apt/archives/*.deb &> /dev/null then - if [ ! -d "${LIVE_ROOT}"/cache/chroot_localpackages ] + if [ ! -d cache/chroot_localpackages ] then - mkdir -p "${LIVE_ROOT}"/cache/chroot_localpackages + mkdir -p cache/chroot_localpackages fi - mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_localpackages + mv -f chroot/var/cache/apt/archives/*.deb cache/chroot_localpackages fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_localpackages + Create_stagefile .stage/chroot_localpackages fi diff --git a/helpers/lh_chroot_localpackageslist b/helpers/lh_chroot_localpackageslist index a7313cb30..5039bc321 100755 --- a/helpers/lh_chroot_localpackageslist +++ b/helpers/lh_chroot_localpackageslist @@ -16,33 +16,33 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/chroot_localpackageslist +Check_stagefile .stage/chroot_localpackageslist # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock -if ls "${LIVE_ROOT}"/config/chroot_localpackageslist/* &> /dev/null +if ls config/chroot_localpackageslist/* &> /dev/null then # Restore old cache - if [ -d "${LIVE_ROOT}"/cache/chroot_localpackageslist ] + if [ -d cache/chroot_localpackageslist ] then - cp "${LIVE_ROOT}"/cache/chroot_localpackageslist/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives + cp cache/chroot_localpackageslist/*.deb chroot/var/cache/apt/archives fi - for PACKAGESLIST in "${LIVE_ROOT}"/config/chroot_localpackageslist/* + for PACKAGESLIST in config/chroot_localpackageslist/* do # Copying package list - grep -v "^#" "${PACKAGESLIST}" > "${LIVE_CHROOT}"/root/"`basename ${PACKAGESLIST}`" + grep -v "^#" "${PACKAGESLIST}" > chroot/root/"`basename ${PACKAGESLIST}`" # Installing package list case "${LH_APT}" in - apt) + apt|apt-get) Chroot "xargs --arg-file=/root/`basename ${PACKAGESLIST}` apt-get install --yes" ;; @@ -52,22 +52,22 @@ then esac # Removing package list - rm -f "${LIVE_CHROOT}"/root/"`basename ${PACKAGESLIST}`" + rm -f chroot/root/"`basename ${PACKAGESLIST}`" done # Saving new cache Chroot "apt-get autoclean" - if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null + if ls chroot/var/cache/apt/archives/*.deb &> /dev/null then - if [ ! -d "${LIVE_ROOT}"/cache/chroot_localpackageslist ] + if [ ! -d cache/chroot_localpackageslist ] then - mkdir -p "${LIVE_ROOT}"/cache/chroot_localpackageslist + mkdir -p cache/chroot_localpackageslist fi - mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_localpackageslist + mv -f chroot/var/cache/apt/archives/*.deb cache/chroot_localpackageslist fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_localpackageslist + Create_stagefile .stage/chroot_localpackageslist fi diff --git a/helpers/lh_chroot_packages b/helpers/lh_chroot_packages index 14e96592e..e61d160e3 100755 --- a/helpers/lh_chroot_packages +++ b/helpers/lh_chroot_packages @@ -17,28 +17,28 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/chroot_packages +Check_stagefile .stage/chroot_packages # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock if [ -n "${LIVE_PACKAGES}" ] then # Restore old cache - if [ -d "${LIVE_ROOT}"/cache/chroot ] + if [ -d cache/chroot ] then - cp "${LIVE_ROOT}"/cache/chroot_packages/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives + cp cache/chroot_packages/*.deb chroot/var/cache/apt/archives fi # Installing packages case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get install --yes ${LIVE_PACKAGES}" ;; @@ -50,16 +50,16 @@ then # Saving new cache Chroot "apt-get autoclean" - if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null + if ls chroot/var/cache/apt/archives/*.deb &> /dev/null then - if [ ! -d "${LIVE_ROOT}"/cache/chroot_packages ] + if [ ! -d cache/chroot_packages ] then - mkdir -p "${LIVE_ROOT}"/cache/chroot_packages + mkdir -p cache/chroot_packages fi - mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_packages + mv -f chroot/var/cache/apt/archives/*.deb cache/chroot_packages fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_packages + Create_stagefile .stage/chroot_packages fi diff --git a/helpers/lh_chroot_packageslist b/helpers/lh_chroot_packageslist index c222d7dde..dfe3a5c0e 100755 --- a/helpers/lh_chroot_packageslist +++ b/helpers/lh_chroot_packageslist @@ -16,23 +16,23 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/chroot_packageslist +Check_stagefile .stage/chroot_packageslist # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock if [ -n "${LIVE_PACKAGES_LIST}" ] then # Restore old cache - if [ -d "${LIVE_ROOT}"/cache/chroot_packageslist ] + if [ -d cache/chroot_packageslist ] then - cp "${LIVE_ROOT}"/cache/chroot_packageslist/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives + cp cache/chroot_packageslist/*.deb chroot/var/cache/apt/archives fi for LIST in ${LIVE_PACKAGES_LIST} @@ -40,11 +40,11 @@ then if [ -f /usr/share/live-helper/lists/"${LIST}" ] then # Copying package list - grep -v "^#" /usr/share/live-helper/lists/"${LIST}" > "${LIVE_CHROOT}"/root/"${LIST}" + grep -v "^#" /usr/share/live-helper/lists/"${LIST}" > chroot/root/"${LIST}" # Installing package list case "${LH_APT}" in - apt) + apt|apt-get) Chroot "xargs --arg-file=/root/${LIST} apt-get install --yes" ;; @@ -54,23 +54,23 @@ then esac # Removing package list - rm -f "${LIVE_CHROOT}"/root/"${LIST}" + rm -f chroot/root/"${LIST}" fi done # Saving new cache Chroot "apt-get autoclean" - if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null + if ls chroot/var/cache/apt/archives/*.deb &> /dev/null then - if [ ! -d "${LIVE_ROOT}"/cache/chroot_packageslist ] + if [ ! -d cache/chroot_packageslist ] then - mkdir -p "${LIVE_ROOT}"/cache/chroot_packageslist + mkdir -p cache/chroot_packageslist fi - mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_packageslist + mv -f chroot/var/cache/apt/archives/*.deb cache/chroot_packageslist fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_packageslist + Create_stagefile .stage/chroot_packageslist fi diff --git a/helpers/lh_chroot_proc b/helpers/lh_chroot_proc index 1b78ecfd1..0310d9c2a 100755 --- a/helpers/lh_chroot_proc +++ b/helpers/lh_chroot_proc @@ -16,42 +16,42 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock case "${1}" in install) # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/chroot_proc + Check_stagefile .stage/chroot_proc - if [ ! -d "${LIVE_CHROOT}"/proc ] + if [ ! -d chroot/proc ] then # Creating mountpoint - mkdir -p "${LIVE_CHROOT}"/proc + mkdir -p chroot/proc fi # Mounting /proc - mount proc-live -t proc "${LIVE_CHROOT}"/proc + mount proc-live -t proc chroot/proc # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_proc + Create_stagefile .stage/chroot_proc ;; remove) # Workaround binfmt-support /proc locking - umount "${LIVE_CHROOT}"/proc/sys/fs/binfmt_misc > /dev/null 2>&1 || true + umount chroot/proc/sys/fs/binfmt_misc > /dev/null 2>&1 || true # Unmounting /proc - #fuser -km "${LIVE_CHROOT}"/proc - umount "${LIVE_CHROOT}"/proc > /dev/null 2>&1 + #fuser -km chroot/proc + umount chroot/proc > /dev/null 2>&1 # Removing stage file - rm -f "${LIVE_ROOT}"/.stage/chroot_proc + rm -f .stage/chroot_proc ;; *) diff --git a/helpers/lh_chroot_resolv b/helpers/lh_chroot_resolv index b6a794812..830c1858b 100755 --- a/helpers/lh_chroot_resolv +++ b/helpers/lh_chroot_resolv @@ -16,47 +16,47 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock case "${1}" in install) # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/chroot_resolv + Check_stagefile .stage/chroot_resolv - if [ -f "${LIVE_CHROOT}"/etc/resolv.conf ] + if [ -f chroot/etc/resolv.conf ] then # Save resolv file - cp "${LIVE_CHROOT}"/etc/resolv.conf "${LIVE_CHROOT}"/etc/resolv.conf.orig + cp chroot/etc/resolv.conf chroot/etc/resolv.conf.orig fi if [ -f /etc/resolv.conf ] then # Copy resolv file - cp /etc/resolv.conf "${LIVE_CHROOT}"/etc/resolv.conf + cp /etc/resolv.conf chroot/etc/resolv.conf fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_resolv + Create_stagefile .stage/chroot_resolv ;; remove) - if [ -f "${LIVE_CHROOT}"/etc/resolv.conf.orig ] + if [ -f chroot/etc/resolv.conf.orig ] then # Restore resolv file - mv "${LIVE_CHROOT}"/etc/resolv.conf.orig "${LIVE_CHROOT}"/etc/resolv.conf + mv chroot/etc/resolv.conf.orig chroot/etc/resolv.conf else # Remove resolv file - rm -f "${LIVE_CHROOT}"/etc/resolv.conf + rm -f chroot/etc/resolv.conf fi # Removing stage file - rm -f "${LIVE_ROOT}"/.stage/chroot_resolv + rm -f .stage/chroot_resolv ;; *) diff --git a/helpers/lh_chroot_sources b/helpers/lh_chroot_sources index 8d4ddbe5c..4fae531ce 100755 --- a/helpers/lh_chroot_sources +++ b/helpers/lh_chroot_sources @@ -18,47 +18,55 @@ Read_conffile config/image Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock case "${1}" in install) # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/chroot_sources + Check_stagefile .stage/chroot_sources # Configure custom sources.list - echo "deb ${LIVE_MIRROR} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > "${LIVE_CHROOT}"/etc/apt/sources.list + echo "deb ${LIVE_MIRROR_LOCAL} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > chroot/etc/apt/sources.list if [ "${LIVE_SOURCE}" = "enabled" ] then - echo "deb-src ${LIVE_MIRROR} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list + echo "deb-src ${LIVE_MIRROR_LOCAL} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list fi if [ "${LIVE_SECURITY}" = "enabled" ] then - if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "testing" ] + if [ "${LIVE_DISTRIBUTION}" != "sid" ] && [ "${LIVE_DISTRIBUTION}" = "unstable" ] then - echo "deb ${LIVE_MIRROR_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list + echo "deb ${LIVE_MIRROR_LOCAL_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list if [ "${LIVE_SOURCE}" = "yes" ] then - echo "deb-src ${LIVE_MIRROR_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list + echo "deb-src ${LIVE_MIRROR_LOCAL_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list fi fi fi + # Check local sources.list + if [ -f config/sources.list.local ] + then + echo "" >> chroot/etc/apt/sources.list + echo "# Custom repositories" >> chroot/etc/apt/sources.list + cat config/sources.list.local >> chroot/etc/apt/sources.list + fi + # Installing aptitude if [ "${LH_APT}" = "apt" ] then Chroot "apt-get update" elif [ "${LH_APT}" = "aptitude" ] then - if [ ! -x "${LH_CHROOT}"/usr/bin/aptitude ] + if [ ! -x /usr/bin/aptitude ] then Chroot "apt-get update" Chroot "apt-get install --yes --force-yes aptitude" @@ -68,7 +76,7 @@ case "${1}" in fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_sources + Create_stagefile .stage/chroot_sources ;; remove) @@ -76,31 +84,39 @@ case "${1}" in if [ "${LH_APT_GENERIC}" = "enabled" ] then # Cleaning apt list cache - rm -rf "${LIVE_CHROOT}"/var/lib/apt/lists - mkdir -p "${LIVE_CHROOT}"/var/lib/apt/lists/partial + rm -rf chroot/var/lib/apt/lists + mkdir -p chroot/var/lib/apt/lists/partial - echo "deb ${LIVE_MIRROR_GENERIC} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > "${LIVE_CHROOT}"/etc/apt/sources.list + echo "deb ${LIVE_MIRROR_GENERIC} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > chroot/etc/apt/sources.list if [ "${LIVE_SOURCE}" = "enabled" ] then - echo "deb-src ${LIVE_MIRROR_GENERIC} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list + echo "deb-src ${LIVE_MIRROR_GENERIC} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list fi if [ "${LIVE_SECURITY}" = "enabled" ] then if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "testing" ] then - echo "deb ${LIVE_MIRROR_GENERIC_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list + echo "deb ${LIVE_MIRROR_GENERIC_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list if [ "${LIVE_SOURCE}" = "yes" ] then - echo "deb-src ${LIVE_MIRROR_GENERIC_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> "${LIVE_CHROOT}"/etc/apt/sources.list + echo "deb-src ${LIVE_MIRROR_GENERIC_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list fi fi fi + # Check local sources.list + if [ -f config/sources.list.generic ] + then + echo "" >> chroot/etc/apt/sources.list + echo "# Custom repositories" >> chroot/etc/apt/sources.list + cat config/sources.list.generic >> chroot/etc/apt/sources.list + fi + case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get update" ;; @@ -111,17 +127,17 @@ case "${1}" in fi # Cleaning apt packages cache - rm -rf "${LIVE_CHROOT}"/var/cache/apt - mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial + rm -rf chroot/var/cache/apt + mkdir -p chroot/var/cache/apt/archives/partial # Removing old files - rm -f "${LIVE_CHROOT}"/var/lib/dpkg/available-old - rm -f "${LIVE_CHROOT}"/var/lib/dpkg/diversions-old - rm -f "${LIVE_CHROOT}"/var/lib/dpkg/statoverride-old - rm -f "${LIVE_CHROOT}"/var/lib/dpkg/status-old + rm -f chroot/var/lib/dpkg/available-old + rm -f chroot/var/lib/dpkg/diversions-old + rm -f chroot/var/lib/dpkg/statoverride-old + rm -f chroot/var/lib/dpkg/status-old # Removing stage file - rm -f "${LIVE_ROOT}"/.stage/chroot_sources + rm -f .stage/chroot_sources ;; *) diff --git a/helpers/lh_chroot_symlinks b/helpers/lh_chroot_symlinks index 8da149f14..9f958c648 100755 --- a/helpers/lh_chroot_symlinks +++ b/helpers/lh_chroot_symlinks @@ -16,20 +16,20 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/chroot_symlinks +Check_stagefile .stage/chroot_symlinks if [ "${LIVE_SYMLINKS}" = "enabled" ] then - if [ -f "${LIVE_CHROOT}"/usr/bin/symlinks ] + if [ -f chroot/usr/bin/symlinks ] then SYMLINKS="true" fi @@ -38,7 +38,7 @@ then then # Installing symlinks case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get install --yes symlinks" ;; @@ -55,7 +55,7 @@ then then # Removing symlinks case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get remove --purge --yes symlinks" ;; @@ -66,5 +66,5 @@ then fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_symlinks + Create_stagefile .stage/chroot_symlinks fi diff --git a/helpers/lh_chroot_sysfs b/helpers/lh_chroot_sysfs index 421d993c6..8480061f1 100755 --- a/helpers/lh_chroot_sysfs +++ b/helpers/lh_chroot_sysfs @@ -16,39 +16,39 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock case "${1}" in install) # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/chroot_sysfs + Check_stagefile .stage/chroot_sysfs - if [ ! -d "${LIVE_CHROOT}"/sys ] + if [ ! -d chroot/sys ] then # Create mountpoint - mkdir -p "${LIVE_CHROOT}"/sys + mkdir -p chroot/sys fi # Mounting /sys - mount sys-live -t sysfs "${LIVE_CHROOT}"/sys + mount sys-live -t sysfs chroot/sys # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_sysfs + Create_stagefile .stage/chroot_sysfs ;; remove) # Unmounting /sys - #fuser -km "${LIVE_CHROOT}"/sys - umount "${LIVE_CHROOT}"/sys > /dev/null 2>&1 + #fuser -km chroot/sys + umount chroot/sys > /dev/null 2>&1 # Removing stage file - rm -f "${LIVE_ROOT}"/.stage/chroot_sysfs + rm -f .stage/chroot_sysfs ;; *) diff --git a/helpers/lh_chroot_sysvinit b/helpers/lh_chroot_sysvinit index 933da573e..cae4b8a45 100755 --- a/helpers/lh_chroot_sysvinit +++ b/helpers/lh_chroot_sysvinit @@ -16,21 +16,21 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/chroot_sysvinit +Check_stagefile .stage/chroot_sysvinit if [ "${LIVE_SYSVINIT}" = "enabled" ] then # Disable all - for FILE in "${LIVE_CHROOT}"/etc/init.d/* + for FILE in chroot/etc/init.d/* do Chroot "update-rc.d -f `basename ${FILE}` remove" done @@ -38,7 +38,7 @@ then # Re-enable all required (taken from -f standard chroot) for PACKAGE in casper console-common cron dpkg ifupdown initscripts kbd klogd libc6 libdevmapper1.02 libselinux1 libsepol1 login makedev module-init-tools netbase openbsd-inetd procps sudo sysklogd udev util-linux do - if [ -f "${LIVE_CHROOT}"/var/lib/dpkg/info/${PACKAGE}.postinst ] + if [ -f chroot/var/lib/dpkg/info/${PACKAGE}.postinst ] then # Re-configure if existing Chroot "/var/lib/dpkg/info/${PACKAGE}.postinst configure" @@ -46,5 +46,5 @@ then done # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_sysvinit + Create_stagefile .stage/chroot_sysvinit fi diff --git a/helpers/lh_chroot_sysvrc b/helpers/lh_chroot_sysvrc index 4f4eeef17..403982bed 100755 --- a/helpers/lh_chroot_sysvrc +++ b/helpers/lh_chroot_sysvrc @@ -16,27 +16,27 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock case "${1}" in install) # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/chroot_sysvrc + Check_stagefile .stage/chroot_sysvrc - if [ -f "${LIVE_CHROOT}"/usr/sbin/policy-rc.d ] + if [ -f chroot/usr/sbin/policy-rc.d ] then # Save policy-rc.d file - mv "${LIVE_CHROOT}"/usr/sbin/policy-rc.d "${LIVE_CHROOT}"/usr/sbin/policy-rc.d.orig + mv chroot/usr/sbin/policy-rc.d chroot/usr/sbin/policy-rc.d.orig fi # Create policy-rc.d file -cat > "${LIVE_CHROOT}"/usr/sbin/policy-rc.d << EOF +cat > chroot/usr/sbin/policy-rc.d << EOF #!/bin/sh echo @@ -45,24 +45,24 @@ echo "Warning: invoke-rc.d policy in action. Skiping daemon starting" exit 101 EOF - chmod 0755 "${LIVE_CHROOT}"/usr/sbin/policy-rc.d + chmod 0755 chroot/usr/sbin/policy-rc.d # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_sysvrc + Create_stagefile .stage/chroot_sysvrc ;; remove) - if [ -f "${LIVE_CHROOT}"/usr/sbin/policy-rc.d.orig ] + if [ -f chroot/usr/sbin/policy-rc.d.orig ] then # Restore policy-rc.d file - mv "${LIVE_CHROOT}"/usr/sbin/policy-rc.d.orig "${LIVE_CHROOT}"/usr/sbin/policy-rc.d + mv chroot/usr/sbin/policy-rc.d.orig chroot/usr/sbin/policy-rc.d else # Remove policy-rc.d file - rm -f "${LIVE_CHROOT}"/usr/sbin/policy-rc.d + rm -f chroot/usr/sbin/policy-rc.d fi # Removing stage file - rm -f "${LIVE_ROOT}"/.stage/chroot_sysvrc + rm -f .stage/chroot_sysvrc ;; *) diff --git a/helpers/lh_chroot_tasks b/helpers/lh_chroot_tasks index 4959d76cf..b2ffb8fab 100755 --- a/helpers/lh_chroot_tasks +++ b/helpers/lh_chroot_tasks @@ -16,23 +16,23 @@ Read_conffile config/chroot Set_defaults # Requiring stage file -Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap +Require_stagefile .stage/bootstrap # Checking stage file -Check_stagefile "${LIVE_ROOT}"/.stage/chroot_tasks +Check_stagefile .stage/chroot_tasks # Checking lock file -Check_lockfile "${LIVE_ROOT}"/.lock +Check_lockfile .lock # Creating lock file -Create_lockfile "${LIVE_ROOT}"/.lock +Create_lockfile .lock if [ -n "${LIVE_TASKS}" ] && [ "${LH_APT}" = "aptitude" ] then # Restore old cache - if [ -d "${LIVE_ROOT}"/cache/chroot_tasks ] + if [ -d cache/chroot_tasks ] then - cp "${LIVE_ROOT}"/cache/chroot_tasks/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives + cp cache/chroot_tasks/*.deb chroot/var/cache/apt/archives fi Chroot "aptitude install --assume-yes ${LIVE_TASKS}" @@ -40,16 +40,16 @@ then # Saving new cache Chroot "apt-get autoclean" - if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null + if ls chroot/var/cache/apt/archives/*.deb &> /dev/null then - if [ ! -d "${LIVE_ROOT}"/cache/chroot_tasks ] + if [ ! -d cache/chroot_tasks ] then - mkdir -p "${LIVE_ROOT}"/cache/chroot_tasks + mkdir -p cache/chroot_tasks fi - mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_tasks + mv -f chroot/var/cache/apt/archives/*.deb cache/chroot_tasks fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/chroot_tasks + Create_stagefile .stage/chroot_tasks fi diff --git a/helpers/lh_clean b/helpers/lh_clean index f4c89601b..8508a9cc8 100755 --- a/helpers/lh_clean +++ b/helpers/lh_clean @@ -26,43 +26,44 @@ case "${1}" in ;; cache) - rm -rf "${LIVE_ROOT}"/cache + rm -rf cache ;; chroot) - umount -f "${LIVE_CHROOT}"/sys > /dev/null 2>&1 || true - umount -f "${LIVE_CHROOT}"/proc > /dev/null 2>&1 || true - umount -f "${LIVE_CHROOT}"/lib/init/rw > /dev/null 2>&1 || true - umount -f "${LIVE_CHROOT}"/dev/shm > /dev/null 2>&1 || true - umount -f "${LIVE_CHROOT}"/dev/pts > /dev/null 2>&1 || true - umount -f "${LIVE_CHROOT}"/dev > /dev/null 2>&1 || true - - rm -rf "${LIVE_CHROOT}" + umount -f chroot/sys > /dev/null 2>&1 || true + umount -f chroot/proc > /dev/null 2>&1 || true + umount -f chroot/lib/init/rw > /dev/null 2>&1 || true + umount -f chroot/dev/shm > /dev/null 2>&1 || true + umount -f chroot/dev/pts > /dev/null 2>&1 || true + umount -f chroot/dev > /dev/null 2>&1 || true + + rm -rf chroot ;; binary) - rm -rf "${LIVE_ROOT}"/binary + rm -rf binary - rm -f "${LIVE_ROOT}"/binary.iso - rm -f "${LIVE_ROOT}"/binary.img - rm -f "${LIVE_ROOT}"/binary.tar.gz + rm -f binary.iso + rm -f binary.img + rm -f binary*.tar.gz + rm -f packages.txt - rm -f "${LIVE_ROOT}"/.stage/binary* + rm -f .stage/binary* ;; stage) - rm -rf "${LIVE_ROOT}"/.stage - rm -f "${LIVE_ROOT}"/.lock + rm -rf .stage + rm -f .lock ;; source) - rm -rf "${LIVE_ROOT}"/source + rm -rf source - rm -f "${LIVE_ROOT}"/source.iso - rm -f "${LIVE_ROOT}"/source.img - rm -f "${LIVE_ROOT}"/source.tar.gz + rm -f source.iso + rm -f source.img + rm -f source*.tar.gz - rm -f "${LIVE_ROOT}"/.stage/source* + rm -f .stage/source* ;; *) diff --git a/helpers/lh_config b/helpers/lh_config index a9bdb9889..b0aff1e3c 100755 --- a/helpers/lh_config +++ b/helpers/lh_config @@ -10,6 +10,16 @@ do . ${FUNCTION} done +if [ "${1}" != "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/image +fi + +# Setting defaults Set_defaults # Creating configuration directory @@ -47,7 +57,7 @@ LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS}" # (Default: ${LH_BOOTSTRAP}) LH_BOOTSTRAP="${LH_BOOTSTRAP}" -# \$LH_CACHE: enable cache +# \$LH_CACHE: control if downloaded packages should be cached # (Default: ${LH_CACHE}) LH_CACHE="${LH_CACHE}" @@ -63,13 +73,13 @@ LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}" # (Default: autodetected) LH_GENISOIMAGE="${LH_GENISOIMAGE}" +# \$LH_LOSETUP: set the losetup program +# (Default: autodetected) +LH_LOSETUP="${LH_LOSETUP}" + # \$LIVE_ROOT: set the root directory -# (Default: \`pwd\`/debian-live) +# (Default: ${LIVE_ROOT}) LIVE_ROOT="${LIVE_ROOT}" - -# \$LIVE_CHROOT: set the chroot directory -# (Default: \${LIVE_ROOT}/chroot) -LIVE_CHROOT="${LIVE_CHROOT}" EOF # Creating lh_chroot_* configuration @@ -139,13 +149,13 @@ LIVE_DISTRIBUTION_CONFIG="${LIVE_DISTRIBUTION_CONFIG}" # (Default: ${LIVE_FLAVOUR}) LIVE_FLAVOUR="${LIVE_FLAVOUR}" -# \$LIVE_MIRROR: set the mirror to use -# (Default: ${LIVE_MIRROR}) -LIVE_MIRROR="${LIVE_MIRROR}" +# \$LIVE_MIRROR_LOCAL: set the local mirror to use +# (Default: ${LIVE_MIRROR_LOCAL}) +LIVE_MIRROR_LOCAL="${LIVE_MIRROR_LOCAL}" -# \$LIVE_MIRROR_SECURITY: set the security mirror to use -# (Default: ${LIVE_MIRROR_SECURITY}) -LIVE_MIRROR_SECURITY="${LIVE_MIRROR_SECURITY}" +# \$LIVE_MIRROR_LOCAL_SECURITY: set the local security mirror to use +# (Default: ${LIVE_MIRROR_LOCAL_SECURITY}) +LIVE_MIRROR_LOCAL_SECURITY="${LIVE_MIRROR_LOCAL_SECURITY}" # \$LIVE_MIRROR_GENERIC: set the generic mirror to use # (Default: ${LIVE_MIRROR_GENERIC}) @@ -155,7 +165,7 @@ LIVE_MIRROR_GENERIC="${LIVE_MIRROR_GENERIC}" # (Default: ${LIVE_MIRROR_GENERIC_SECURITY}) LIVE_MIRROR_GENERIC_SECURITY="${LIVE_MIRROR_GENERIC_SECURITY}" -# \$LIVE_SECTIONS: select the section to use +# \$LIVE_SECTIONS: select the section(s) to use # (Default: ${LIVE_SECTIONS}) LIVE_SECTIONS="${LIVE_SECTIONS}" EOF diff --git a/helpers/lh_losetup b/helpers/lh_losetup index 442afdb87..94337acf4 100755 --- a/helpers/lh_losetup +++ b/helpers/lh_losetup @@ -2,9 +2,21 @@ # lh_losetup +set -e + +# Source common functions +for FUNCTION in /usr/share/live-helper/functions/*.sh +do + . ${FUNCTION} +done + +# Reading configuration files +Read_conffile config/common +Set_defaults + if [ -z "${1}" ] then - DEVICE="`losetup -f`" + DEVICE="`${LH_LOSETUP} -f`" else DEVICE="${1}" fi @@ -12,9 +24,9 @@ fi FILE="${2}" PARTITION="${3}" -losetup "${DEVICE}" "${FILE}" +${LH_LOSETUP} "${DEVICE}" "${FILE}" FDISK_OUT="`fdisk -l -u ${DEVICE} 2>&1`" -losetup -d "${DEVICE}" +${LH_LOSETUP} -d "${DEVICE}" LOOPDEVICE="`echo ${DEVICE}p${PARTITION:=1}`" CYL=`echo "$FDISK_OUT" | sed -ne "s_^$LOOPDEVICE[ *]*\([0-9]*\).*_\1_p"` @@ -25,7 +37,7 @@ echo loop $DEVICE at offset $OFFSET if [ "${PARTITION}" = "0" ] then - losetup "${DEVICE}" "${FILE}" + ${LH_LOSETUP} "${DEVICE}" "${FILE}" else - losetup -o "${OFFSET}" "${DEVICE}" "${FILE}" + ${LH_LOSETUP} -o "${OFFSET}" "${DEVICE}" "${FILE}" fi diff --git a/helpers/lh_source b/helpers/lh_source index 5d08385f7..0d23184ef 100755 --- a/helpers/lh_source +++ b/helpers/lh_source @@ -19,6 +19,7 @@ lh_chroot_resolv install lh_chroot_sources install # Preparing images +lh_source_config lh_source_download # Building images @@ -28,6 +29,6 @@ lh_source_net lh_source_usb # Deconfiguring chroot -rm -f "${LIVE_ROOT}"/.stage/chroot_sources +rm -f .stage/chroot_sources lh_chroot_resolv remove lh_chroot_hosts remove diff --git a/helpers/lh_source_config b/helpers/lh_source_config new file mode 100755 index 000000000..fe96d094a --- /dev/null +++ b/helpers/lh_source_config @@ -0,0 +1,52 @@ +#!/bin/sh + +# lh_source_config(1) - copies debian-live config into source + +set -e + +# Source common functions +for FUNCTION in /usr/share/live-helper/functions/*.sh +do + . ${FUNCTION} +done + +# Reading configuration files +Read_conffile config/common +Read_conffile config/image +Set_defaults + +if [ "${LIVE_SOURCE}" = "enabled" ] +then + # Requiring stage file + Require_stagefile .stage/bootstrap + + # Checking lock file + Check_lockfile .lock + + # Creating lock file + Create_lockfile .lock + + # Checking stage file + Check_stagefile .stage/source_config + + # Remove old sources + if [ -d source/debian-live ] + then + rm -rf source/debian-live + fi + + # Copy system configuration + mkdir -p source/debian-live + cp -a config source/debian-live + + # Create tarball + cd source + tar cfz debian-live-config_`date +%Y%m%d.%s`.tar.gz debian-live + cd "${OLDPWD}" + + rm -rf source/debian-live/config + mv source/debian-live-config_*.tar.gz source/debian-live + + # Creating stage file + Create_stagefile .stage/source_config +fi diff --git a/helpers/lh_source_download b/helpers/lh_source_download index 0684d87de..208122064 100755 --- a/helpers/lh_source_download +++ b/helpers/lh_source_download @@ -18,30 +18,31 @@ Set_defaults if [ "${LIVE_SOURCE}" = "enabled" ] then # Requiring stage file - Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap + Require_stagefile .stage/bootstrap # Checking lock file - Check_lockfile "${LIVE_ROOT}"/.lock + Check_lockfile .lock # Creating lock file - Create_lockfile "${LIVE_ROOT}"/.lock + Create_lockfile .lock # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/source_download + Check_stagefile .stage/source_download # Remove old sources - if [ "${LIVE_ROOT}"/source ] + if [ -d source/debian ] then - rm -rf "${LIVE_ROOT}"/source + rm -rf source/debian fi # Download sources - Chroot "dpkg --get-selections" | awk '{ print $1 }' > "${LIVE_CHROOT}"/root/dpkg-selection.txt + Chroot "dpkg --get-selections" | awk '{ print $1 }' > chroot/root/dpkg-selection.txt + #echo "live-helper" >> chroot/root/dpkg-selection.txt Chroot "xargs --arg-file=/root/dpkg-selection.txt apt-get source --download-only" - rm -f "${LIVE_CHROOT}"/root/dpkg-selection.txt + rm -f chroot/root/dpkg-selection.txt # Sort sources - for DSC in "${LIVE_CHROOT}"/*.dsc + for DSC in chroot/*.dsc do SOURCE="`awk '/Source:/ { print $2; }' ${DSC}`" @@ -53,15 +54,12 @@ then fi # Install directory - install -d -m 0755 "${LIVE_ROOT}"/source/"${LETTER}"/"${SOURCE}" + install -d -m 0755 source/debian/"${LETTER}"/"${SOURCE}" # Move files - mv "${LIVE_CHROOT}"/"${SOURCE}"_* "${LIVE_ROOT}"/source/"${LETTER}"/"${SOURCE}" + mv chroot/"${SOURCE}"_* source/debian/"${LETTER}"/"${SOURCE}" done - # Copy system configuration - cp -a "${LIVE_ROOT}"/config "${LIVE_ROOT}"/source - # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/source_download + Create_stagefile .stage/source_download fi diff --git a/helpers/lh_source_generic b/helpers/lh_source_generic index a4fa1cca2..88b0bf7c2 100755 --- a/helpers/lh_source_generic +++ b/helpers/lh_source_generic @@ -17,7 +17,6 @@ Set_defaults if [ "${LIVE_SOURCE}" = "disabled" ] then - echo "W: source images disabled (FIXME)" exit 0 fi @@ -26,28 +25,27 @@ do if [ "${IMAGE}" = "generic" ] then # Requiring stage file - Require_stagefile "${LIVE_ROOT}"/.stage/source_download + Require_stagefile .stage/source_download # Checking lock file - Check_lockfile "${LIVE_ROOT}"/.lock + Check_lockfile .lock # Creating lock file - Create_lockfile "${LIVE_ROOT}"/.lock + Create_lockfile .lock # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/source_generic + Check_stagefile .stage/source_generic # Remove old source - if [ -f "${LIVE_ROOT}"/source.tar ] + if [ -f source.tar ] then - rm -f "${LIVE_ROOT}"/source.tar + rm -f source.tar fi # Create tarball - cd "${LIVE_ROOT}" && tar cf source.tar source # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/source_generic + Create_stagefile .stage/source_generic fi done diff --git a/helpers/lh_source_hdd b/helpers/lh_source_hdd new file mode 100755 index 000000000..93eaa7f02 --- /dev/null +++ b/helpers/lh_source_hdd @@ -0,0 +1,51 @@ +#!/bin/sh + +# lh_source_hdd(1) - build source harddisk image + +set -e + +# Source common functions +for FUNCTION in /usr/share/live-helper/functions/*.sh +do + . ${FUNCTION} +done + +# Reading configuration files +Read_conffile config/common +Read_conffile config/image +Set_defaults + +if [ "${LIVE_SOURCE}" = "disabled" ] +then + exit 0 +fi + +for IMAGE in ${LIVE_SOURCE_IMAGE} +do + if [ "${IMAGE}" = "hdd" ] + then + # Requiring stage file + Require_stagefile .stage/source_download + + # Checking lock file + Check_lockfile .lock + + # Creating lock file + Create_lockfile .lock + + # Checking stage file + Check_stagefile .stage/source_hdd + + # Remove old source + if [ -f source-hdd.tar.gz ] + then + rm -f source-hdd.tar.gz + fi + + # Create tarball + tar cfz source-hdd.tar.gz source + + # Creating stage file + Create_stagefile .stage/source_hdd + fi +done diff --git a/helpers/lh_source_iso b/helpers/lh_source_iso index 96d24aee2..3254ed62a 100755 --- a/helpers/lh_source_iso +++ b/helpers/lh_source_iso @@ -17,7 +17,6 @@ Set_defaults if [ "${LIVE_SOURCE}" = "disabled" ] then - echo "W: source images disabled (FIXME)" exit 0 fi @@ -26,28 +25,27 @@ do if [ "${IMAGE}" = "iso" ] then # Requiring stage file - Require_stagefile "${LIVE_ROOT}"/.stage/source_download + Require_stagefile .stage/source_download # Checking lock file - Check_lockfile "${LIVE_ROOT}"/.lock + Check_lockfile .lock # Creating lock file - Create_lockfile "${LIVE_ROOT}"/.lock + Create_lockfile .lock # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/source_iso + Check_stagefile .stage/source_iso # Remove old source - if [ -f "${LIVE_ROOT}"/source.iso ] + if [ -f source.iso ] then - rm -f "${LIVE_ROOT}"/source.iso + rm -f source.iso fi # Create image - cd "${LIVE_ROOT}" && ${LH_GENISOIMAGE} -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o source.iso -r -J -l -V "${LIVE_DISK_VOLUME}" source # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/source_iso + Create_stagefile .stage/source_iso fi done diff --git a/helpers/lh_source_net b/helpers/lh_source_net index 30a8b8389..0f60ddc88 100755 --- a/helpers/lh_source_net +++ b/helpers/lh_source_net @@ -17,7 +17,6 @@ Set_defaults if [ "${LIVE_SOURCE}" = "disabled" ] then - echo "W: source images disabled (FIXME)" exit 0 fi @@ -26,28 +25,27 @@ do if [ "${IMAGE}" = "net" ] then # Requiring stage file - Require_stagefile "${LIVE_ROOT}"/.stage/source_download + Require_stagefile .stage/source_download # Checking lock file - Check_lockfile "${LIVE_ROOT}"/.lock + Check_lockfile .lock # Creating lock file - Create_lockfile "${LIVE_ROOT}"/.lock + Create_lockfile .lock # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/source_net + Check_stagefile .stage/source_net # Remove old source - if [ -f "${LIVE_ROOT}"/source.tar.gz ] + if [ -f source-net.tar.gz ] then - rm -f "${LIVE_ROOT}"/source.tar.gz + rm -f source-net.tar.gz fi # Create tarball - cd "${LIVE_ROOT}" && - tar cfz source.tar.gz source + tar cfz source-net.tar.gz source # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/source_net + Create_stagefile .stage/source_net fi done diff --git a/helpers/lh_source_usb b/helpers/lh_source_usb index 03e90d7c2..7df37c748 100755 --- a/helpers/lh_source_usb +++ b/helpers/lh_source_usb @@ -18,7 +18,6 @@ Set_defaults if [ "${LIVE_SOURCE}" = "disabled" ] then - echo "W: source images disabled (FIXME)" exit 0 fi @@ -27,23 +26,23 @@ do if [ "${IMAGE}" = "usb" ] then # Requiring stage file - Require_stagefile "${LIVE_ROOT}"/.stage/source_download + Require_stagefile .stage/source_download # Checking lock file - Check_lockfile "${LIVE_ROOT}"/.lock + Check_lockfile .lock # Creating lock file - Create_lockfile "${LIVE_ROOT}"/.lock + Create_lockfile .lock # Checking stage file - Check_stagefile "${LIVE_ROOT}"/.stage/source_usb + Check_stagefile .stage/source_usb - if [ ! -f "${LIVE_CHROOT}"/sbin/mkdosfs ] + if [ ! -f chroot/sbin/mkdosfs ] then PACKAGES="${PACKAGES} dosfstools" fi - if [ ! -f "${LIVE_CHROOT}"/sbin/parted ] + if [ ! -f chroot/sbin/parted ] then PACKAGES="${PACKAGES} parted" fi @@ -52,7 +51,7 @@ do then # Installing packages case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get install --yes ${PACKAGES}" ;; @@ -63,49 +62,52 @@ do fi # Remove old source - if [ -f "${LIVE_ROOT}"/source.img ] + if [ -f source.img ] then - rm -f "${LIVE_ROOT}"/source.img + rm -f source.img fi # Everything which comes here needs to be cleaned up, - DU_DIM="`du -ms ${LIVE_ROOT}/source | cut -f1`" + DU_DIM="`du -ms source | cut -f1`" REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here... - dd if=/dev/zero of="${LIVE_ROOT}"/source.img bs=1024k count=${REAL_DIM} - FREELO="`losetup -f`" - if [ ! -b "${LIVE_CHROOT}"/${FREELO} ] + dd if=/dev/zero of=source.img bs=1024k count=${REAL_DIM} + FREELO="`${LH_LOSETUP} -f`" + if [ ! -b chroot/${FREELO} ] then MAKEDEV="true" - Chroot "cd /dev && ./MAKEDEV ${FREELO}" + + mv chroot/dev chroot/dev.tmp + find /dev | cpio -dmpu chroot fi echo "!!! The following error/warning messages can be ignored !!!" - lh_losetup $FREELO "${LIVE_ROOT}"/source.img 0 + lh_losetup $FREELO source.img 0 Chroot "parted -s ${FREELO} mklabel msdos" || true Chroot "parted -s ${FREELO} mkpartfs primary fat16 0.0 100%" || true Chroot "parted -s ${FREELO} set 1 lba off" || true - losetup -d ${FREELO} + ${LH_LOSETUP} -d ${FREELO} - lh_losetup $FREELO "${LIVE_ROOT}"/source.img 1 + lh_losetup $FREELO source.img 1 Chroot "mkfs.msdos -n DEBIAN_LIVE ${FREELO}" - mkdir -p "${LIVE_ROOT}"/source.tmp - mount ${FREELO} "${LIVE_ROOT}"/source.tmp - cp -r "${LIVE_ROOT}"/source/* "${LIVE_ROOT}"/source.tmp - umount "${LIVE_ROOT}"/source.tmp - rmdir "${LIVE_ROOT}"/source.tmp - losetup -d ${FREELO} + mkdir -p source.tmp + mount ${FREELO} source.tmp + cp -r source/* source.tmp + umount source.tmp + rmdir source.tmp + ${LH_LOSETUP} -d ${FREELO} echo "!!! The above error/warning messages can be ignored !!!" if [ -n "${MAKEDEV}" ] then - rm -f "${LIVE_CHROOT}"/${FREELO} + rm -f chroot/dev + mv chroot/dev.tmp chroot/dev fi if [ -n "${PACKAGES}" ] then # Removing packages case "${LH_APT}" in - apt) + apt|apt-get) Chroot "apt-get remove --purge --yes ${PACKAGES}" ;; @@ -116,6 +118,6 @@ do fi # Creating stage file - Create_stagefile "${LIVE_ROOT}"/.stage/source_usb + Create_stagefile .stage/source_usb fi done diff --git a/helpers/make-live b/helpers/make-live index 8ae82ae97..6dc27af95 100755 --- a/helpers/make-live +++ b/helpers/make-live @@ -4,6 +4,7 @@ set -e # Set static variables PROGRAM="`basename ${0}`" +DESCRIPTION="utility to build Debian Live systems" # Source common functions for FUNCTION in /usr/share/live-helper/functions/*.sh @@ -11,67 +12,21 @@ do . ${FUNCTION} done -USAGE="Usage: ${PROGRAM} build|config [--apt apt|aptitude] [--apt-ftpproxy URL] [--apt-httpproxy URL] [--apt-generic enabled|disabled] [--apt-pdiffs enabled|disabled] [--apt-recommends enabled|disabled] [--bootstrap cdebootstrap|deboostrap] [--cache enabled|disabled] [--debconf-frontend dialog|readline|noninteractive] [--debconf-priority low|medium|high|critical] [--genisoimage genisoimage|mkisofs] [--root DIRECTORY] [--chroot DIRECTORY] [-a|--architecture ARCHITECTURE] [-d|--distribution testing|unstable|etch|sid] [--distribution-config DIRECTORY] [-f|--flavour minimal|standard] [-m|--mirror URL] [--mirror-security URL] [--mirror-generic URL] [--mirror-generic-security URL] [--sections SECTION|\"SECTIONS\"] [-k|--kernel KERNEL] [--kernel-packages PACKAGES] [-l|--language LANGUAGE] [--packages PACKAGE|\"PACKAGES\"] [-p|--packages-list LIST] [--tasks TASK|\"TASKS\"] [--security enabled|disabled] [--symlinks enabled|disabled] [--sysvinit enabled|disabled] [--bootappend KERNEL_PARAMETER|\"KERNEL_PARAMETERS\"] [-e|--encryption ALGORITHM] [--filesystem ext2|plain|squashfs] [--memtest86 enabled|disabled] [--iso-volume STRING] [--server-address HOSTNAME|IP] [--server-path DIRECTORY] [--source enabled|disabled] [--syslinux enabled|disabled] [--syslinux-splash FILE] [-b|--binary-image iso|usb|net] [-s|--source-image generic|iso|usb|net] [--templates DIRECTORY]" +Set_defaults -Help () -{ - echo "${PROGRAM} - utility to build Debian Live systems" - echo - echo "${USAGE}" - echo "Usage: ${PROGRAM} [-h|--help]" - echo "Usage: ${PROGRAM} [-u|--usage]" - echo "Usage: ${PROGRAM} [-v|--version]" - echo - echo "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" - echo - echo "Report bugs to Debian Live project ." - exit 0 -} +# Source existing configuration +Read_conffile debian-live/config/common +Read_conffile debian-live/config/bootstrap +Read_conffile debian-live/config/chroot +Read_conffile debian-live/config/image -Usage () -{ - echo "${PROGRAM} - utility to build Debian Live systems" - echo - echo "${USAGE}" - echo "Usage: ${PROGRAM} [-h|--help]" - echo "Usage: ${PROGRAM} [-u|--usage]" - echo "Usage: ${PROGRAM} [-v|--version]" - echo - echo "Try \"${PROGRAM} --help\" for more information." - exit ${1} -} +USAGE="Usage: ${PROGRAM} [config] [--apt apt|aptitude] [--apt-ftpproxy URL] [--apt-httpproxy URL] [--apt-generic enabled|disabled] [--apt-pdiffs enabled|disabled] [--apt-recommends enabled|disabled] [--bootstrap cdebootstrap|deboostrap] [--cache enabled|disabled] [--debconf-frontend dialog|readline|noninteractive] [--debconf-priority low|medium|high|critical] [--genisoimage genisoimage|mkisofs] [--losetup losetup|losetup.org] [--root DIRECTORY] [-a|--architecture ARCHITECTURE] [-d|--distribution testing|unstable|etch|sid] [--distribution-config DIRECTORY] [-f|--flavour minimal|standard] [-m|--mirror-local URL] [--mirror-local-security URL] [--mirror-generic URL] [--mirror-generic-security URL] [--sections SECTION|\"SECTIONS\"] [-k|--kernel KERNEL] [--kernel-packages PACKAGES] [-l|--language LANGUAGE] [--packages PACKAGE|\"PACKAGES\"] [-p|--packages-list LIST] [--tasks TASK|\"TASKS\"] [--security enabled|disabled] [--symlinks enabled|disabled] [--sysvinit enabled|disabled] [--bootappend KERNEL_PARAMETER|\"KERNEL_PARAMETERS\"] [-e|--encryption ALGORITHM] [--filesystem ext2|plain|squashfs] [--memtest86 enabled|disabled] [--iso-volume STRING] [--server-address HOSTNAME|IP] [--server-path DIRECTORY] [--source enabled|disabled] [--syslinux enabled|disabled] [--syslinux-splash FILE] [-b|--binary-image hdd|iso|usb|net] [-s|--source-image generic|hdd|iso|usb|net] [--templates DIRECTORY]" -Version () -{ - echo "${PROGRAM}, version ${VERSION}" - echo - echo "Copyright (C) 2006-2007 Daniel Baumann " - echo "Copyright (C) 2006-2007 Marco Amadori " - echo - echo "This program is free software; you can redistribute it and/or modify" - echo "it under the terms of the GNU General Public License as published by" - echo "the Free Software Foundation; either version 2 of the License, or" - echo "(at your option) any later version." - echo - echo "This program is distributed in the hope that it will be useful," - echo "but WITHOUT ANY WARRANTY; without even the implied warranty of" - echo "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" - echo "GNU General Public License for more details." - echo - echo "You should have received a copy of the GNU General Public License" - echo "along with this program; if not, write to the Free Software" - echo "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA" - echo - echo "On Debian systems, the complete text of the GNU General Public License" - echo "can be found in /usr/share/common-licenses/GPL file." - echo - echo "Homepage: " - exit 0 -} +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" Main () { - ARGUMENTS="`getopt --longoptions build,config,apt:,apt-ftpproxy:,apt-httpprox:,apt-generic:,apt-pdiffs:,apt-recommends:,bootstrap:,cache:,debconf-frontend:,debconf-priority:,genisoimage:,root:,chroot:,architecture:,distribution:,distribution-config:,flavour:,mirror:,mirror-security:,mirror-generic:,mirror-generic-security:,sections:,kernel:,kernel-packages:,language:,packages:,packages-list:,tasks:,security:,symlinks:,sysvinit:,bootappend:,encryption:,filesystem:,memtest86:,iso-volume:,server-address:,server-path:,source:,syslinux:,syslinux-splash:,binary-image:,binary-source:,templates:,help,usage,version --name=${PROGRAM} --options a:d:f:m:k:l:p:e:b:s:huv --shell sh -- "${@}"`" + ARGUMENTS="`getopt --longoptions apt:,apt-ftpproxy:,apt-httpproxy:,apt-generic:,apt-pdiffs:,apt-recommends:,bootstrap:,cache:,debconf-frontend:,debconf-priority:,genisoimage:,losetup:,root:,architecture:,distribution:,distribution-config:,flavour:,mirror:,mirror-security:,mirror-generic:,mirror-generic-security:,sections:,kernel:,kernel-packages:,language:,packages:,packages-list:,tasks:,security:,symlinks:,sysvinit:,bootappend:,encryption:,filesystem:,memtest86:,iso-volume:,server-address:,server-path:,source:,syslinux:,syslinux-splash:,binary-image:,binary-source:,templates:,help,usage,version --name=${PROGRAM} --options a:d:f:m:k:l:p:e:b:s:huv --shell sh -- "${@}"`" if [ "${?}" != "0" ] then @@ -79,20 +34,10 @@ Main () exit 1 fi - case "${1}" in - config) - CONFIG="true" - ;; - - build) - BUILD="true" - ;; - - *) - echo "E: no operation (config|build) specified." - exit 1 - ;; - esac + if [ "${1}" = "config" ] + then + CONFIG="true" + fi eval set -- "${ARGUMENTS}" @@ -144,12 +89,12 @@ Main () LH_GENISOIMAGE="${2}"; shift 2 ;; - --root) - LIVE_ROOT="${2}"; shift 2 + --losetup) + LH_LOSETUP="${2}"; shift 2 ;; - --chroot) - LIVE_CHROOT="${2}"; shift 2 + --root) + LIVE_ROOT="${2}"; shift 2 ;; # bootstrap @@ -170,12 +115,12 @@ Main () LIVE_FLAVOUR="${2}"; shift 2 ;; - -m|--mirror) - LIVE_MIRROR="${2}"; shift 2 + -m|--mirror-local) + LIVE_MIRROR_LOCAL="${2}"; shift 2 ;; - --mirror-security) - LIVE_MIRROR_SECURITY="${2}"; shift 2 + --mirror-local-security) + LIVE_MIRROR_LOCAL_SECURITY="${2}"; shift 2 ;; --mirror-generic) @@ -306,16 +251,12 @@ Main () # Initializing lh_testroot - Set_defaults # Configuring (this is really shit!) - if [ "${CONFIG}" = "true" ] - then - LH_APT="${LH_APT}" LH_APT_FTPPROXY="${LH_APT_FTPPROXY}" LH_APT_HTTPPROXY="${LH_APT_HTTPPROXY}" LH_APT_GENERIC="${LH_APT_GENERIC}" LH_APT_PDIFFS="${LH_APT_PDIFFS}" LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS}" LH_BOOTSTRAP="${LH_BOOTSTRAP}" LH_CACHE="${LH_CACHE}" LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}" LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}" LH_GENISOIMAGE="${LH_GENISOIMAGE}" LIVE_ROOT="${LIVE_ROOT}" LIVE_CHROOT="${LIVE_CHROOT}" LIVE_ARCHITECTURE="${LIVE_ARCHITECTURE}" LIVE_DISTRIBUTION="${LIVE_DISTRIBUTION}" LIVE_DISTRIBUTION_CONFIG="${LIVE_DISTRIBUTION_CONFIG}" LIVE_FLAVOUR="${LIVE_FLAVOUR}" LIVE_MIRROR="${LIVE_MIRROR}" LIVE_MIRROR_SECURITY="${LIVE_MIRROR_SECURITY}" LIVE_MIRROR_GENERIC="${LIVE_MIRROR_GENERIC}" LIVE_MIRROR_GENERIC_SECURITY="${LIVE_MIRROR_GENERIC_SECURITY}" LIVE_SECTIONS="${LIVE_SECTIONS}" LIVE_KERNEL="${LIVE_KERNEL}" LIVE_KERNEL_PACKAGES="${LIVE_KERNEL_PACKAGES}" LIVE_LANGUAGE="${LIVE_LANGUAGE}" LIVE_PACKAGES="${LIVE_PACKAGES}" LIVE_PACKAGES_LIST="${LIVE_PACKAGES_LIST}" 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_FILESYSTEM="${LIVE_FILESYSTEM}" LIVE_MEMTEST86="${LIVE_MEMTEST86}" LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}" LIVE_SERVER_ADDRESS="${LIVE_SERVER_ADDRESS}" LIVE_SERVER_PATH="${LIVE_SERVER_PATH}" LIVE_SOURCE="${LIVE_SOURCE}" LIVE_SYSLINUX="${LIVE_SYSLINUX}" LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}" LIVE_BINARY_IMAGE="${LIVE_BINARY_IMAGE}" LIVE_SOURCE_IMAGE="${LIVE_SOURCE_IMAGE}" LIVE_TEMPLATES="${LIVE_TEMPLATES}" lh_config - fi + LH_APT="${LH_APT}" LH_APT_FTPPROXY="${LH_APT_FTPPROXY}" LH_APT_HTTPPROXY="${LH_APT_HTTPPROXY}" LH_APT_GENERIC="${LH_APT_GENERIC}" LH_APT_PDIFFS="${LH_APT_PDIFFS}" LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS}" LH_BOOTSTRAP="${LH_BOOTSTRAP}" LH_CACHE="${LH_CACHE}" LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}" LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}" LH_GENISOIMAGE="${LH_GENISOIMAGE}" LIVE_ROOT="${LIVE_ROOT}" LIVE_ARCHITECTURE="${LIVE_ARCHITECTURE}" LIVE_DISTRIBUTION="${LIVE_DISTRIBUTION}" LIVE_DISTRIBUTION_CONFIG="${LIVE_DISTRIBUTION_CONFIG}" LIVE_FLAVOUR="${LIVE_FLAVOUR}" LIVE_MIRROR_LOCAL="${LIVE_MIRROR_LOCAL}" LIVE_MIRROR_LOCAL_SECURITY="${LIVE_MIRROR_LOCAL_SECURITY}" LIVE_MIRROR_GENERIC="${LIVE_MIRROR_GENERIC}" LIVE_MIRROR_GENERIC_SECURITY="${LIVE_MIRROR_GENERIC_SECURITY}" LIVE_SECTIONS="${LIVE_SECTIONS}" LIVE_KERNEL="${LIVE_KERNEL}" LIVE_KERNEL_PACKAGES="${LIVE_KERNEL_PACKAGES}" LIVE_LANGUAGE="${LIVE_LANGUAGE}" LIVE_PACKAGES="${LIVE_PACKAGES}" LIVE_PACKAGES_LIST="${LIVE_PACKAGES_LIST}" 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_FILESYSTEM="${LIVE_FILESYSTEM}" LIVE_MEMTEST86="${LIVE_MEMTEST86}" LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}" LIVE_SERVER_ADDRESS="${LIVE_SERVER_ADDRESS}" LIVE_SERVER_PATH="${LIVE_SERVER_PATH}" LIVE_SOURCE="${LIVE_SOURCE}" LIVE_SYSLINUX="${LIVE_SYSLINUX}" LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}" LIVE_BINARY_IMAGE="${LIVE_BINARY_IMAGE}" LIVE_SOURCE_IMAGE="${LIVE_SOURCE_IMAGE}" LIVE_TEMPLATES="${LIVE_TEMPLATES}" lh_config newconfig # Building - if [ "${BUILD}" = "true" ] + if [ -z "${CONFIG}" ] then cd "${LIVE_ROOT}" && lh_build fi -- cgit v1.2.3