summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:04:50 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:18:29 +0100
commit4739146fc6c4de8b16418517bb882312c475195c (patch)
treea3c29d97d1ead4ad4fa532b1c6bfdb419f160e71 /helpers
parent1863ed88740575342008ac5f694d03e944bcece2 (diff)
downloadlive-build-4739146fc6c4de8b16418517bb882312c475195c.zip
live-build-4739146fc6c4de8b16418517bb882312c475195c.tar.gz
Adding live-helper 1.0~a6-1.
Diffstat (limited to 'helpers')
-rwxr-xr-xhelpers/lh_binary3
-rwxr-xr-xhelpers/lh_binary_chroot16
-rwxr-xr-xhelpers/lh_binary_encryption8
-rwxr-xr-xhelpers/lh_binary_grub82
-rwxr-xr-xhelpers/lh_binary_hdd6
-rwxr-xr-xhelpers/lh_binary_includes59
-rwxr-xr-xhelpers/lh_binary_iso8
-rwxr-xr-xhelpers/lh_binary_linuximage20
-rwxr-xr-xhelpers/lh_binary_localincludes6
-rwxr-xr-xhelpers/lh_binary_manifest6
-rwxr-xr-xhelpers/lh_binary_md5sum6
-rwxr-xr-xhelpers/lh_binary_memtest150
-rwxr-xr-xhelpers/lh_binary_memtest86125
-rwxr-xr-xhelpers/lh_binary_net6
-rwxr-xr-xhelpers/lh_binary_rootfs6
-rwxr-xr-xhelpers/lh_binary_syslinux473
-rwxr-xr-xhelpers/lh_binary_usb57
-rwxr-xr-xhelpers/lh_binary_yaboot217
-rwxr-xr-xhelpers/lh_bootstrap_cdebootstrap7
-rwxr-xr-xhelpers/lh_bootstrap_debootstrap2
-rwxr-xr-xhelpers/lh_chroot_apt135
-rwxr-xr-xhelpers/lh_chroot_debianchroot18
-rwxr-xr-xhelpers/lh_chroot_hooks5
-rwxr-xr-xhelpers/lh_chroot_hosts18
-rwxr-xr-xhelpers/lh_chroot_interactive47
-rwxr-xr-xhelpers/lh_chroot_linuximage24
-rwxr-xr-xhelpers/lh_chroot_proc23
-rwxr-xr-xhelpers/lh_chroot_resolv18
-rwxr-xr-xhelpers/lh_chroot_sources28
-rwxr-xr-xhelpers/lh_chroot_symlinks6
-rwxr-xr-xhelpers/lh_chroot_sysfs18
-rwxr-xr-xhelpers/lh_chroot_sysvinit6
-rwxr-xr-xhelpers/lh_chroot_sysvrc18
-rwxr-xr-xhelpers/lh_clean3
-rwxr-xr-xhelpers/lh_config46
-rwxr-xr-xhelpers/lh_source_config54
-rwxr-xr-xhelpers/lh_source_download98
-rwxr-xr-xhelpers/lh_source_generic8
-rwxr-xr-xhelpers/lh_source_hdd8
-rwxr-xr-xhelpers/lh_source_iso8
-rwxr-xr-xhelpers/lh_source_md5sum44
-rwxr-xr-xhelpers/lh_source_net8
-rwxr-xr-xhelpers/lh_source_usb8
-rwxr-xr-xhelpers/make-live22
44 files changed, 1171 insertions, 763 deletions
diff --git a/helpers/lh_binary b/helpers/lh_binary
index 1326637..8498d93 100755
--- a/helpers/lh_binary
+++ b/helpers/lh_binary
@@ -42,9 +42,10 @@ lh_binary_encryption "${@}"
# Prepare images
lh_binary_linuximage "${@}"
-lh_binary_memtest86 "${@}"
+lh_binary_memtest "${@}"
lh_binary_grub "${@}"
lh_binary_syslinux "${@}"
+lh_binary_yaboot "${@}"
lh_binary_includes "${@}"
lh_binary_localincludes "${@}"
lh_binary_md5sum "${@}"
diff --git a/helpers/lh_binary_chroot b/helpers/lh_binary_chroot
index 86da15d..24ee5f8 100755
--- a/helpers/lh_binary_chroot
+++ b/helpers/lh_binary_chroot
@@ -36,20 +36,32 @@ Breakpoint "binary_chroot: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
+# Checking stage file
+Check_stagefile .stage/binary_chroot
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Checking stage file
-Check_stagefile .stage/binary_chroot
+# Normally, proc is not mounted here, but people tend to be lazy
+if [ -f chroot/proc/version ]
+then
+ umount chroot/proc
+fi
+
+if [ -d chroot/sys/kernel ]
+then
+ umount chroot/sys
+fi
# Removing old chroot
rm -rf chroot/chroot
rm -rf chroot.tmp
# Copying new chroot
+Echo_message "Copying chroot, this can take a while."
cp -a chroot chroot.tmp
mv chroot.tmp chroot/chroot
diff --git a/helpers/lh_binary_encryption b/helpers/lh_binary_encryption
index 09c0fea..c10ba9a 100755
--- a/helpers/lh_binary_encryption
+++ b/helpers/lh_binary_encryption
@@ -42,22 +42,22 @@ Breakpoint "binary_encryption: Init"
Require_stagefile .stage/bootstrap
Require_stagefile .stage/binary_rootfs
+# Checking stage file
+Check_stagefile .stage/binary_encryption
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Checking stage file
-Check_stagefile .stage/binary_encryption
-
case "${LIVE_FILESYSTEM}" in
ext2)
ROOTFS="ext2"
;;
plain)
- echo "W: encryption not supported on plain filesystem."
+ Echo_warning "encryption not supported on plain filesystem."
exit 0
;;
diff --git a/helpers/lh_binary_grub b/helpers/lh_binary_grub
index c115f79..3b652af 100755
--- a/helpers/lh_binary_grub
+++ b/helpers/lh_binary_grub
@@ -41,15 +41,15 @@ Breakpoint "binary_grub: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
+# Checking stage file
+Check_stagefile .stage/binary_grub
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Checking stage file
-Check_stagefile .stage/binary_grub
-
if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ]
then
Echo_warning "skipping binary_grub, foreign architecture."
@@ -94,18 +94,23 @@ case "${LIVE_BINARY_IMAGE}" in
;;
net)
- Echo_error "not supported, FIXME"
+ Echo_error "not supported, aborting (FIXME)."
+ exit 1
;;
esac
# Temporary check for broken syslinux
if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
then
- case "${LIVE_ARCHITECTURE}" in
- i386)
- DESTDIR="${DESTDIR}.386"
- ;;
- esac
+ # Assemble multi-arch
+ if [ -n "${MULTIARCH}" ]
+ then
+ case "${LIVE_ARCHITECTURE}" in
+ i386)
+ DESTDIR="${DESTDIR}.386"
+ ;;
+ esac
+ fi
fi
# Creating directory
@@ -132,15 +137,13 @@ fi
LIVE_BOOTAPPEND="`echo ${LIVE_BOOTAPPEND} | sed -e 's/ //'`"
+# Parameters are listed at: linux/Documentation/kernel-parameters.txt
+FAILSAFE="noapic noapm nodma nomce nolapic nosmp vga=normal"
+
# Assembling kernel configuration
-if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
-then
- DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`"
- LINUX="title\t\tDebian GNU/Linux - Live\nkernel\t\t/`basename ${DESTDIR}`/`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\ninitrd\t\t/`basename ${DESTDIR}`/initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
-else
- DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`"
- LINUX="title\t\tDebian GNU/Linux - Live\nkernel\t\t`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\ninitrd\t\tinitrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
-fi
+DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`"
+LINUX="title\t\tDebian GNU/Linux - Live\nkernel\t\t/`basename ${DESTDIR}`/`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}` boot=casper LIVE_BOOTAPPEND\ninitrd\t\t/`basename ${DESTDIR}`/initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'`"
+LINUX="${LINUX}\n\ntitle\t\tDebian GNU/Linux - Live (failsafe mode)\nkernel\t\t/`basename ${DESTDIR}`/`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}\ninitrd\t\t/`basename ${DESTDIR}`/initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'`"
if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ]
then
@@ -148,20 +151,12 @@ then
do
if [ -z "${LINUX}" ]
then
- if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
- then
- LINUX="title\t\tDebian GNU/Linux - Live, kernel `basename ${KERNEL} | sed -e 's/vmlinuz-//'`\nkernel\t\t/`basename ${DESTDIR}`/`basename ${KERNEL}`\ninitrd\t\t/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
- else
- LINUX="title\t\tDebian GNU/Linux - Live, kernel `basename ${KERNEL} | sed -e 's/vmlinuz-//'`\nkernel\t\t`basename ${KERNEL}`\ninitrd\t\tinitrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
- fi
+ LINUX="title\t\tDebian GNU/Linux - Live, kernel `basename ${KERNEL} | sed -e 's/vmlinuz-//'`\nkernel\t\t/`basename ${DESTDIR}`/`basename ${KERNEL}` boot=casper LIVE_BOOTAPPEND\ninitrd\t\t/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`"
+ LINUX="${LINUX}\n\ntitle\t\tDebian GNU/Linux - Live, kernel `basename ${KERNEL} | sed -e 's/vmlinuz-//'` (failsafe mode)\nkernel\t\t/`basename ${DESTDIR}`/`basename ${KERNEL}` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}\ninitrd\t\t/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`"
else
- if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
- then
- LINUX="${LINUX}\n\ntitle\t\tDebian GNU/Linux - Live, kernel `basename ${KERNEL} | sed -e 's/vmlinuz-//'`\nkernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\ninitrd\t\t/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
- else
- LINUX="${LINUX}\n\ntitle\t\tDebian GNU/Linux - Live, kernel `basename ${KERNEL} | sed -e 's/vmlinuz-//'`\nkernel `basename ${KERNEL}`\ninitrd\t\tinitrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
- fi
- fi
+ LINUX="${LINUX}\n\ntitle\t\tDebian GNU/Linux - Live, kernel `basename ${KERNEL} | sed -e 's/vmlinuz-//'`\nkernel /`basename ${DESTDIR}`/`basename ${KERNEL}` boot=casper LIVE_BOOTAPPEND\ninitrd\t\t/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`"
+ LINUX="${LINUX}\n\ntitle\t\tDebian GNU/Linux - Live, kernel `basename ${KERNEL} | sed -e 's/vmlinuz-//'` (failsafe mode)\nkernel /`basename ${DESTDIR}`/`basename ${KERNEL}` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}\ninitrd\t\t/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`"
+ fi
done
fi
@@ -170,18 +165,15 @@ LINUX="`echo ${LINUX} | sed -e 's#//#/#g'`"
# Assembling memtest configuration
if [ -f "${DESTDIR}"/memtest ]
then
- if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
- then
- MEMTEST="title\t\tMemtest86+\nkernel\t\t/`basename ${DESTDIR}`/memtest"
- MEMTEST="`echo ${MEMTEST} | sed -e 's#//#/#g'`"
- else
- MEMTEST="title\t\tMemtest86+\nkernel\t\tmemtest"
- fi
+ MEMTEST="title\t\t${LIVE_MEMTEST}\nkernel\t\t/`basename ${DESTDIR}`/memtest"
+ MEMTEST="`echo ${MEMTEST} | sed -e 's#//#/#g'`"
fi
+# Copying templates
mkdir -p binary/boot/grub
cp -r "${LIVE_TEMPLATES}"/grub/* binary/boot/grub
+# Copyring grub
case ${LIVE_BINARY_IMAGE} in
iso)
cp chroot/usr/lib/grub/i386-pc/stage2_eltorito binary/boot/grub
@@ -195,10 +187,17 @@ esac
# Copying splash screen
if [ -n "${LIVE_GRUB_SPLASH}" ]
then
- # FIXME
- cp "${LIVE_GRUB_SPLASH}" binary/boot/grub
+ if [ "${LIVE_GRUB_SPLASH}" = "none" ]
+ then
+ # Removing splash file
+ rm -f binary/boot/grub/splash.xpm.gz
- LIVE_SPLASH="splashimage /boot/grub/`basename ${LIVE_GRUB_SPLASH}`"
+ # Removing splash entry
+ sed -e "s/splashimage.*//" binary/boot/grub/menu.lst
+ else
+ # Overwriting splash file
+ cp -f "${LIVE_GRUB_SPLASH}" binary/boot/grub/splash.xpm.gz
+ fi
fi
# Configure grub templates
@@ -208,11 +207,10 @@ cat >> binary/boot/grub/menu.lst << EOF
title Other:
root
-
LIVE_MEMTEST
EOF
-sed -i -e "s#LIVE_SPLASH#${LIVE_SPLASH}#" -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/boot/grub/menu.lst
+sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/boot/grub/menu.lst
sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/boot/grub/menu.lst
if [ -n "${PACKAGES}" ]
diff --git a/helpers/lh_binary_hdd b/helpers/lh_binary_hdd
index 5a450ab..545ae84 100755
--- a/helpers/lh_binary_hdd
+++ b/helpers/lh_binary_hdd
@@ -41,15 +41,15 @@ do
# Requiring stage file
Require_stagefile .stage/bootstrap
+ # Checking stage file
+ Check_stagefile .stage/binary_hdd
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
- # Checking stage file
- Check_stagefile .stage/binary_hdd
-
# Remove old binary
if [ -f binary-hdd.tar.gz ]
then
diff --git a/helpers/lh_binary_includes b/helpers/lh_binary_includes
index e343d72..18ad540 100755
--- a/helpers/lh_binary_includes
+++ b/helpers/lh_binary_includes
@@ -41,15 +41,15 @@ Breakpoint "binary_includes: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
+# Checking stage file
+Check_stagefile .stage/binary_includes
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Checking stage file
-Check_stagefile .stage/binary_includes
-
# Check includes
if [ ! -d "${LIVE_INCLUDES}" ]
then
@@ -62,18 +62,51 @@ then
fi
fi
-if ls "${LIVE_INCLUDES}"/common/* &> /dev/null
-then
- cd "${LIVE_INCLUDES}"/common
- find . | cpio -dmpu "${OLDPWD}"/binary
- cd "${OLDPWD}"
-fi
+# Assemble architecture
+case "${LIVE_ARCHITECTURE}" in
+ amd64)
+ ARCH="amd"
+ ;;
+
+ i386)
+ ARCH="386"
+ ;;
-if ls "${LIVE_INCLUDES}"/"${LIVE_BINARY_IMAGE}"/* &> /dev/null
+ powerpc)
+ ARCH="ppc"
+ ;;
+esac
+
+if [ "${LIVE_DEBIAN_INSTALLER}" = "enabled" ]
then
- cd "${LIVE_INCLUDES}"/"${LIVE_BINARY_IMAGE}"
- find . | cpio -dmpu "${OLDPWD}"/binary
- cd "${OLDPWD}"
+ # Copying d-i templates
+ if [ -d "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install ] && \
+ ls "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install/* &> /dev/null
+ then
+ cp -r "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install/* binary
+ fi
+
+ if [ -d "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install."${ARCH}" ] && \
+ ls "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install."${ARCH}"/* &> /dev/null
+ then
+ cp -r "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install."${ARCH}"/* binary
+ fi
+
+ # Adjusting d-i templates
+ DEBIAN_NAME="/Debian GNU/Linux 4.0 r0 \"Etch\" - Unofficial amd64 NETINST/LIVE Binary-1"
+ DEBIAN_DATE="`date +%Y%m%d-%H:%M`"
+
+ if [ "${LIVE_ARCHITECTURE}" = "i386" ]
+ then
+ DEBIAN_TOOLS_HTML=" <P>\n <tt>&nbsp;\n <A href="tools/">/tools/</a>\n </tt>\n\n and\n <tt>&nbsp;\n <A href="install/floppy/">/install/floppy/</a>\n </tt>"
+ DEBIAN_TOOLS_TXT="/tools/ and /install/floppy/"
+ else
+ DEBIAN_TOOLS_HTML=" <P>\n <tt>&nbsp;\n <A href="tools/">/tools/</a>\n </tt>\n\n\n\n\n\n"
+ DEBIAN_TOOLS_TXT="/tools/"
+ fi
+
+ sed -i -e "s/DEBIAN_NAME/${DEBIAN_NAME}/g" -e "s/DEBIAN_DATE/${DEBIAN_DATE}/g" -e "s/DEBIAN_TOOLS/${DEBIAN_TOOLS_HTML}/g" binary/README.html
+ sed -i -e "s/DEBIAN_NAME/${DEBIAN_NAME}/g" -e "s/DEBIAN_DATE/${DEBIAN_DATE}/g" -e "s/DEBIAN_TOOLS/${DEBIAN_TOOLS_TXT}/g" binary/README.txt
fi
# Creating stage file
diff --git a/helpers/lh_binary_iso b/helpers/lh_binary_iso
index c77394e..63156aa 100755
--- a/helpers/lh_binary_iso
+++ b/helpers/lh_binary_iso
@@ -40,15 +40,15 @@ do
# Requiring stage file
Require_stagefile .stage/bootstrap
+ # Checking stage file
+ Check_stagefile .stage/binary_iso
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
- # Checking stage file
- Check_stagefile .stage/binary_iso
-
if [ ! -f chroot/usr/bin/"${LH_GENISOIMAGE}" ]
then
PACKAGES="${PACKAGES} ${LH_GENISOIMAGE}"
@@ -91,7 +91,7 @@ do
;;
esac
else
- echo "W: Bootloader on your architecture not yet supported (Continuing in 5 seconds)."
+ Echo_warning "Bootloader on your architecture not yet supported (Continuing in 5 seconds)."
sleep 5
#Chroot "${LH_GENISOIMAGE} -A 'Debian Live' -p 'Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org' -publisher 'Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org' -o binary.iso -r -J -l -V \"${LIVE_ISO_VOLUME}\" binary"
Chroot "${LH_GENISOIMAGE} -o binary.iso -r -J -l binary"
diff --git a/helpers/lh_binary_linuximage b/helpers/lh_binary_linuximage
index bcdddc1..600aeaa 100755
--- a/helpers/lh_binary_linuximage
+++ b/helpers/lh_binary_linuximage
@@ -36,15 +36,15 @@ Breakpoint "binary_linuximage: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
+# Checking stage file
+Check_stagefile .stage/binary_linuximage
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Checking stage file
-Check_stagefile .stage/binary_linuximage
-
# Removing initrd backup files
rm -f chroot/boot/initrd*bak*
@@ -66,11 +66,15 @@ esac
# Temporary check for broken syslinux
if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
then
- case "${LIVE_ARCHITECTURE}" in
- i386)
- DESTDIR="${DESTDIR}.386"
- ;;
- esac
+ # Assemble multi-arch
+ if [ -n "${MULTIARCH}" ]
+ then
+ case "${LIVE_ARCHITECTURE}" in
+ i386)
+ DESTDIR="${DESTDIR}.386"
+ ;;
+ esac
+ fi
fi
# Creating directory
diff --git a/helpers/lh_binary_localincludes b/helpers/lh_binary_localincludes
index dc427d9..dcbaa2c 100755
--- a/helpers/lh_binary_localincludes
+++ b/helpers/lh_binary_localincludes
@@ -36,15 +36,15 @@ Breakpoint "binary_localincludes: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
+# Checking stage file
+Check_stagefile .stage/binary_localincludes
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Checking stage file
-Check_stagefile .stage/binary_localincludes
-
if ls config/binary_localincludes/* &> /dev/null
then
# Copying includes
diff --git a/helpers/lh_binary_manifest b/helpers/lh_binary_manifest
index e90f98b..f8c3899 100755
--- a/helpers/lh_binary_manifest
+++ b/helpers/lh_binary_manifest
@@ -36,15 +36,15 @@ Breakpoint "binary_manifest: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
+# Checking stage file
+Check_stagefile .stage/binary_manifest
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Checking stage file
-Check_stagefile .stage/binary_manifest
-
# Add filesystem.manifest
Chroot "dpkg --get-selections" | awk '{ print $1 }' | sort -u > binary/casper/filesystem.manifest
diff --git a/helpers/lh_binary_md5sum b/helpers/lh_binary_md5sum
index 96e1007..59864ce 100755
--- a/helpers/lh_binary_md5sum
+++ b/helpers/lh_binary_md5sum
@@ -36,15 +36,15 @@ Breakpoint "binary_md5sum: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
+# Checking stage file
+Check_stagefile .stage/binary_md5sum
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Checking stage file
-Check_stagefile .stage/binary_md5sum
-
# Remove old md5sums
if [ -f binary/md5sum.txt ]
then
diff --git a/helpers/lh_binary_memtest b/helpers/lh_binary_memtest
new file mode 100755
index 0000000..48c8001
--- /dev/null
+++ b/helpers/lh_binary_memtest
@@ -0,0 +1,150 @@
+#!/bin/sh
+
+# lh_binary_memtest(1) - installs a memtest into binary
+# Copyright (C) 2006-2007 Daniel Baumann <daniel@debian.org>
+#
+# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+# This is free software, and you are welcome to redistribute it
+# under certain conditions; see COPYING for details.
+
+set -e
+
+# Source common functions
+for FUNCTION in /usr/share/live-helper/functions/*.sh
+do
+ . ${FUNCTION}
+done
+
+# Set static variables
+DESCRIPTION="installs a memtest into binary"
+HELP=""
+USAGE="${PROGRAM} [--force]"
+
+Arguments "${@}"
+
+Echo_debug "Init ${PROGRAM}"
+
+# Reading configuration files
+Read_conffile config/bootstrap
+Read_conffile config/chroot
+Read_conffile config/common
+Read_conffile config/image
+Set_defaults
+
+if [ "${LIVE_MEMTEST}" = "disabled" ]
+then
+ exit 0
+fi
+
+Breakpoint "binary_memtest: Init"
+
+# Requiring stage file
+Require_stagefile .stage/bootstrap
+
+# Checking stage file
+Check_stagefile .stage/binary_memtest
+
+# Checking lock file
+Check_lockfile .lock
+
+# Creating lock file
+Create_lockfile .lock
+
+if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ]
+then
+ Echo_warning "skipping binary_memtest, foreign architecture."
+ exit 0
+fi
+
+case "${LIVE_MEMTEST}" in
+ memtest86)
+ if [ ! -f chroot/boot/memtest86.bin ]
+ then
+ PACKAGES="${PACKAGES} memtest86"
+ fi
+ ;;
+
+ memtest86+)
+ if [ ! -f chroot/boot/memtest86+.bin ]
+ then
+ PACKAGES="${PACKAGES} memtest86+"
+ fi
+ ;;
+esac
+
+if [ -n "${PACKAGES}" ]
+then
+ # Installing symlinks
+ case "${LH_APT}" in
+ apt|apt-get)
+ Chroot "apt-get install --yes ${PACKAGES}"
+ ;;
+
+ aptitude)
+ Chroot "aptitude install --assume-yes ${PACKAGES}"
+ ;;
+ esac
+fi
+
+# Setting destination directory
+case "${LIVE_BINARY_IMAGE}" in
+ iso)
+ DESTDIR="binary/live"
+ ;;
+
+ net)
+ DESTDIR="tftpboot"
+ ;;
+
+ usb|hdd)
+ DESTDIR="binary"
+ ;;
+esac
+
+# Temporary check for broken syslinux
+if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
+then
+ # Assemble multi-arch
+ if [ -n "${MULTIARCH}" ]
+ then
+ case "${LIVE_ARCHITECTURE}" in
+ i386)
+ DESTDIR="${DESTDIR}.386"
+ ;;
+ esac
+ fi
+fi
+
+# Creating directory
+if [ ! -d "${DESTDIR}" ]
+then
+ mkdir -p "${DESTDIR}"
+fi
+
+# Installing memtest
+case "${LIVE_MEMTEST}" in
+ memtest86)
+ cp -f chroot/boot/memtest86.bin "${DESTDIR}"/memtest
+ ;;
+
+ memtest86+)
+ cp -f chroot/boot/memtest86+.bin "${DESTDIR}"/memtest
+ ;;
+esac
+
+if [ -n "${PACKAGES}" ]
+then
+ # Removing packages
+ case "${LH_APT}" in
+ apt|apt-get)
+ Chroot "apt-get remove --purge --yes ${PACKAGES}"
+ ;;
+
+ aptitude)
+ Chroot "aptitude purge --assume-yes ${PACKAGES}"
+ ;;
+ esac
+fi
+
+# Creating stage file
+Create_stagefile .stage/binary_memtest
diff --git a/helpers/lh_binary_memtest86 b/helpers/lh_binary_memtest86
deleted file mode 100755
index 5f5e89c..0000000
--- a/helpers/lh_binary_memtest86
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/bin/sh
-
-# lh_binary_memtest86(1) - installs memtest86+ into binary
-# Copyright (C) 2006-2007 Daniel Baumann <daniel@debian.org>
-#
-# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-# This is free software, and you are welcome to redistribute it
-# under certain conditions; see COPYING for details.
-
-set -e
-
-# Source common functions
-for FUNCTION in /usr/share/live-helper/functions/*.sh
-do
- . ${FUNCTION}
-done
-
-# Set static variables
-DESCRIPTION="installs memtest86+ into binary"
-HELP=""
-USAGE="${PROGRAM} [--force]"
-
-Arguments "${@}"
-
-Echo_debug "Init ${PROGRAM}"
-
-# Reading configuration files
-Read_conffile config/bootstrap
-Read_conffile config/chroot
-Read_conffile config/common
-Read_conffile config/image
-Set_defaults
-
-Breakpoint "binary_memtest86: Init"
-
-# 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_memtest86
-
-if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ]
-then
- echo "W: skipping binary_memtest86, foreign architecture."
- exit 0
-fi
-
-if [ "${LIVE_MEMTEST86}" = "enabled" ]
-then
- if [ ! -f chroot/boot/memtest86+.bin ]
- then
- PACKAGES="${PACKAGES} memtest86+"
- fi
-
- if [ -n "${PACKAGES}" ]
- then
- # Installing symlinks
- case "${LH_APT}" in
- apt|apt-get)
- Chroot "apt-get install --yes ${PACKAGES}"
- ;;
-
- aptitude)
- Chroot "aptitude install --assume-yes ${PACKAGES}"
- ;;
- esac
- fi
-
- # Setting destination directory
- case "${LIVE_BINARY_IMAGE}" in
- iso)
- DESTDIR="binary/live"
- ;;
-
- net)
- DESTDIR="tftpboot"
- ;;
-
- usb|hdd)
- DESTDIR="binary"
- ;;
- esac
-
- # Temporary check for broken syslinux
- if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
- then
- case "${LIVE_ARCHITECTURE}" in
- i386)
- DESTDIR="${DESTDIR}.386"
- ;;
- esac
- fi
-
- # Creating directory
- if [ ! -d "${DESTDIR}" ]
- then
- mkdir -p "${DESTDIR}"
- fi
-
- # Installing memtest86+
- cp chroot/boot/memtest86+.bin "${DESTDIR}"/memtest
-
- if [ -n "${PACKAGES}" ]
- then
- # Removing packages
- case "${LH_APT}" in
- apt|apt-get)
- Chroot "apt-get remove --purge --yes ${PACKAGES}"
- ;;
-
- aptitude)
- Chroot "aptitude purge --assume-yes ${PACKAGES}"
- ;;
- esac
- fi
-
- # Creating stage file
- Create_stagefile .stage/binary_memtest86
-fi
diff --git a/helpers/lh_binary_net b/helpers/lh_binary_net
index 2acd2fb..f07e5e6 100755
--- a/helpers/lh_binary_net
+++ b/helpers/lh_binary_net
@@ -40,15 +40,15 @@ do
# Requiring stage file
Require_stagefile .stage/bootstrap
+ # Checking stage file
+ Check_stagefile .stage/binary_net
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
- # Checking stage file
- Check_stagefile .stage/binary_net
-
# Remove old binary
if [ -f binary-net.tar.gz ]
then
diff --git a/helpers/lh_binary_rootfs b/helpers/lh_binary_rootfs
index a1d3d3a..daacaea 100755
--- a/helpers/lh_binary_rootfs
+++ b/helpers/lh_binary_rootfs
@@ -37,15 +37,15 @@ Breakpoint "binary_rootfs: Init"
Require_stagefile .stage/bootstrap
Require_stagefile .stage/binary_chroot
+# Checking stage file
+Check_stagefile .stage/binary_rootfs
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Checking stage file
-Check_stagefile .stage/binary_rootfs
-
# Creating directory
if [ ! -d binary/casper ]
then
diff --git a/helpers/lh_binary_syslinux b/helpers/lh_binary_syslinux
index 3afc191..dff16f4 100755
--- a/helpers/lh_binary_syslinux
+++ b/helpers/lh_binary_syslinux
@@ -31,76 +31,82 @@ Read_conffile config/common
Read_conffile config/image
Set_defaults
+if [ "${LIVE_BOOTLOADER}" != "syslinux" ]
+then
+ exit 0
+fi
+
Breakpoint "binary_syslinux: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
+# Checking stage file
+Check_stagefile .stage/binary_syslinux
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Checking stage file
-Check_stagefile .stage/binary_syslinux
-
if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ]
then
- echo "W: skipping binary_syslinux, foreign architecture."
+ Echo_warning "skipping binary_syslinux, foreign architecture."
exit 0
fi
-if [ "${LIVE_BOOTLOADER}" = "syslinux" ]
+# Check templates
+if [ ! -d "${LIVE_TEMPLATES}" ]
then
- # Check templates
- if [ ! -d "${LIVE_TEMPLATES}" ]
+ if [ -d ../"${LIVE_TEMPLATES}" ]
then
- if [ -d ../"${LIVE_TEMPLATES}" ]
- then
- LIVE_TEMPLATES="../${LIVE_TEMPLATES}"
- else
- Echo_error "user specified templates not accessible in ${LIVE_TEMPLATES}"
- exit 1
- fi
- fi
-
- if [ ! -f chroot/usr/bin/syslinux ]
- then
- PACKAGES="${PACKAGES} syslinux"
- fi
-
- if [ -n "${PACKAGES}" ]
- then
- # Installing symlinks
- case "${LH_APT}" in
- apt|apt-get)
- Chroot "apt-get install --yes ${PACKAGES}"
- ;;
-
- aptitude)
- Chroot "aptitude install --assume-yes ${PACKAGES}"
- ;;
- esac
+ LIVE_TEMPLATES="../${LIVE_TEMPLATES}"
+ else
+ Echo_error "user specified templates not accessible in ${LIVE_TEMPLATES}"
+ exit 1
fi
+fi
- # Setting destination directory
- case "${LIVE_BINARY_IMAGE}" in
- iso)
- DESTDIR="binary/live"
- ;;
+if [ ! -f chroot/usr/bin/syslinux ]
+then
+ PACKAGES="${PACKAGES} syslinux"
+fi
- net)
- DESTDIR="tftpboot"
+if [ -n "${PACKAGES}" ]
+then
+ # Installing symlinks
+ case "${LH_APT}" in
+ apt|apt-get)
+ Chroot "apt-get install --yes ${PACKAGES}"
;;
- usb|hdd)
- DESTDIR="binary"
+ aptitude)
+ Chroot "aptitude install --assume-yes ${PACKAGES}"
;;
esac
+fi
- # Temporary check for broken syslinux
- if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
+# Setting destination directory
+case "${LIVE_BINARY_IMAGE}" in
+ iso)
+ DESTDIR="binary/live"
+ ;;
+
+ net)
+ DESTDIR="tftpboot"
+ ;;
+
+ usb|hdd)
+ DESTDIR="binary"
+ ;;
+esac
+
+# Temporary check for broken syslinux
+if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
+then
+ # Assembling multi-arch
+ if [ -n "${MULTIARCH}" ]
then
case "${LIVE_ARCHITECTURE}" in
i386)
@@ -108,218 +114,245 @@ then
;;
esac
fi
+fi
- # Creating directory
- if [ ! -d "${DESTDIR}" ]
- then
- mkdir -p "${DESTDIR}"
- fi
+# Creating directory
+if [ ! -d "${DESTDIR}" ]
+then
+ mkdir -p "${DESTDIR}"
+fi
- # Setting boot parameters
- if [ -n "${LIVE_ENCRYPTION}" ]
- then
- LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} encryption=${LIVE_ENCRYPTION}"
- fi
+# Setting boot parameters
+if [ -n "${LIVE_ENCRYPTION}" ]
+then
+ LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} encryption=${LIVE_ENCRYPTION}"
+fi
- if [ -n "${LIVE_USERNAME}" ]
- then
- LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} username=${LIVE_USERNAME}"
- fi
+if [ -n "${LIVE_USERNAME}" ]
+then
+ LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} username=${LIVE_USERNAME}"
+fi
- if [ -n "${LIVE_HOSTNAME}" ]
- then
- LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} hostname=${LIVE_HOSTNAME}"
- fi
+if [ -n "${LIVE_HOSTNAME}" ]
+then
+ LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} hostname=${LIVE_HOSTNAME}"
+fi
- LIVE_BOOTAPPEND="`echo ${LIVE_BOOTAPPEND} | sed -e 's/ //'`"
+LIVE_BOOTAPPEND="`echo ${LIVE_BOOTAPPEND} | sed -e 's/ //'`"
- # Assembling kernel configuration
- if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
- then
- DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`"
- LINUX="label LIVE\n kernel /`basename ${DESTDIR}`/`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
- else
- DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`"
- LINUX="label LIVE\n kernel `basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
- fi
+# Parameters are listed at: linux/Documentation/kernel-parameters.txt
+FAILSAFE="noapic noapm nodma nomce nolapic nosmp vga=normal"
- if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ]
- then
- for KERNEL in chroot/boot/vmlinuz*
- do
- if [ -z "${LINUX}" ]
+# Assembling kernel configuration
+if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
+then
+ DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`"
+ LINUX="label LIVE\n kernel /`basename ${DESTDIR}`/`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
+ LINUX="${LINUX}\nlabel LIVE-failsafe\n kernel /`basename ${DESTDIR}`/`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}"
+else
+ DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`"
+ LINUX="label LIVE\n kernel `basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
+ LINUX="${LINUX}\nlabel LIVE-failsafe\n kernel `basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n append initrd=initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}"
+fi
+
+if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ]
+then
+ for KERNEL in chroot/boot/vmlinuz*
+ do
+ if [ -z "${LINUX}" ]
+ then
+ if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
+ then
+ LINUX="label LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
+ LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`-failsafe\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}"
+ else
+ LINUX="label LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
+ LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}"
+ fi
+ else
+ if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
then
- if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
- then
- LINUX="label LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
- else
- LINUX="label LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
- fi
+ LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
+ LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`-failsafe\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}"
else
- if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
- then
- LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
- else
- LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
- fi
+ LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
+ LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND ${FAILSAFE}"
fi
- done
- fi
+ fi
+ done
+fi
- LINUX="`echo ${LINUX} | sed -e 's#//#/#g'`"
+LINUX="`echo ${LINUX} | sed -e 's#//#/#g'`"
- # Assembling memtest configuration
- if [ -f "${DESTDIR}"/memtest ]
+# Assembling memtest configuration
+if [ -f "${DESTDIR}"/memtest ]
+then
+ if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
then
- if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
- then
- MEMTEST="label memtest\n kernel /`basename ${DESTDIR}`/memtest"
- MEMTEST="`echo ${MEMTEST} | sed -e 's#//#/#g'`"
- else
- MEMTEST="label memtest\n kernel memtest"
- fi
+ MEMTEST="label memtest\n kernel /`basename ${DESTDIR}`/memtest"
+ MEMTEST="`echo ${MEMTEST} | sed -e 's#//#/#g'`"
+ else
+ MEMTEST="label memtest\n kernel memtest"
fi
+fi
- case "${LIVE_BINARY_IMAGE}" in
- iso)
- # Copying syslinux
- mkdir -p binary/isolinux
- cp chroot/usr/lib/syslinux/isolinux.bin binary/isolinux
- cp -r "${LIVE_TEMPLATES}"/syslinux/* binary/isolinux
+case "${LIVE_BINARY_IMAGE}" in
+ iso)
+ # Copying syslinux
+ 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}" ]
+ # Copying splash screen
+ if [ -n "${LIVE_SYSLINUX_SPLASH}" ]
+ then
+ if [ "${LIVE_SYSLINUX_SPLASH}" = "none" ]
then
- cp "${LIVE_SYSLINUX_SPLASH}" binary/isolinux/splash.rle
+ rm -f binary/isolinux/splash.rle
+ sed -e "s/.*splash.*//" binary/isolinux/isolinux.txt
+ else
+ cp -f "${LIVE_SYSLINUX_SPLASH}" binary/isolinux/splash.rle
fi
+ fi
- # Configure syslinux templates
- sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/isolinux/isolinux.cfg
- sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/isolinux/isolinux.cfg
- sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" binary/isolinux/f1.txt
- sed -i -e "s/LIVE_VERSION/${VERSION}/" binary/isolinux/f10.txt
+ # Configure syslinux templates
+ sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/isolinux/isolinux.cfg
+ sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/isolinux/isolinux.cfg
+ sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" binary/isolinux/f1.txt
+ sed -i -e "s/LIVE_VERSION/${VERSION}/" binary/isolinux/f10.txt
- # Remove unused files
- rm -f binary/isolinux/pxelinux.cfg
+ # Remove unused files
+ rm -f binary/isolinux/pxelinux.cfg
- # Working arround syslinux 8.3 limitation
- if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ]
- then
- for FLAVOUR in ${LIVE_KERNEL_FLAVOUR}
- do
- NUMBER=$(($NUMBER + 1))
-
- mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER}
- mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img
- sed -i -e "s/LIVE.*-${FLAVOUR}/live${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" -e "s/LIVE/live/" binary/isolinux/isolinux.cfg
- done
- else
- mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz
- mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img
- sed -i -e "s/LIVE.*-${LIVE_KERNEL_FLAVOUR}/live/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" -e "s/LIVE/live/" binary/isolinux/isolinux.cfg
- fi
- ;;
+ # Working arround syslinux 8.3 limitation
+ if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ]
+ then
+ for FLAVOUR in ${LIVE_KERNEL_FLAVOUR}
+ do
+ NUMBER=$(($NUMBER + 1))
+
+ mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER}
+ mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img
+ sed -i -e "s/LIVE.*-${FLAVOUR}/live${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" -e "s/LIVE/live/" binary/isolinux/isolinux.cfg
+ done
+ else
+ mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz
+ mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img
+ sed -i -e "s/LIVE.*-${LIVE_KERNEL_FLAVOUR}/live/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" -e "s/LIVE/live/" binary/isolinux/isolinux.cfg
+ fi
+ ;;
- net)
- # Copying syslinux
- cp chroot/usr/lib/syslinux/pxelinux.0 tftpboot
+ net)
+ # Copying syslinux
+ cp chroot/usr/lib/syslinux/pxelinux.0 tftpboot
- # Install syslinux templates
- 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
+ # Install syslinux templates
+ 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}" ]
+ # Copying splash screen
+ if [ -n "${LIVE_SYSLINUX_SPLASH}" ]
+ then
+ if [ "${LIVE_SYSLINUX_SPLASH}" = "none" ]
then
- cp "${LIVE_SYSLINUX_SPLASH}" tftpboot/pxelinux.cfg/splash.rle
+ rm -f tftpboot/pxelinux.cfg/splash.rle
+ sed -e "s/.*splash.*//" tftpboot/pxelinux.cfg/isolinux.txt
+ else
+ cp -f "${LIVE_SYSLINUX_SPLASH}" tftpboot/pxelinux.cfg/splash.rle
fi
+ fi
- # Configure syslinux templates
- sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" tftpboot/pxelinux.cfg/default
- sed -i -e "s/LIVE_SERVER_ADDRESS/${LIVE_SERVER_ADDRESS}/" -e "s#LIVE_SERVER_PATH#${LIVE_SERVER_PATH}#" -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" tftpboot/pxelinux.cfg/default
- sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" tftpboot/pxelinux.cfg/f1.txt
- sed -i -e "s/LIVE_VERSION/${VERSION}/" tftpboot/pxelinux.cfg/f10.txt
+ # Configure syslinux templates
+ sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" tftpboot/pxelinux.cfg/default
+ sed -i -e "s/LIVE_SERVER_ADDRESS/${LIVE_SERVER_ADDRESS}/" -e "s#LIVE_SERVER_PATH#${LIVE_SERVER_PATH}#" -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" tftpboot/pxelinux.cfg/default
+ sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" tftpboot/pxelinux.cfg/f1.txt
+ sed -i -e "s/LIVE_VERSION/${VERSION}/" tftpboot/pxelinux.cfg/f10.txt
- # Remove unused files
- rm -f tftpboot/pxelinux.cfg/isolinux.cfg
+ # Remove unused files
+ rm -f tftpboot/pxelinux.cfg/isolinux.cfg
- # Working arround syslinux 8.3 limitation
- if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ]
+ # Working arround syslinux 8.3 limitation
+ if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ]
+ then
+ for FLAVOUR in ${LIVE_KERNEL_FLAVOUR}
+ do
+ NUMBER=$(($NUMBER + 1))
+
+ mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER}
+ mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img
+ sed -i -e "s/LIVE.*-${FLAVOUR}/live${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" -e "s/LIVE/live/" tftpboot/pxelive.cfg/default
+ done
+ else
+ mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz
+ mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img
+ sed -i -e "s/LIVE.*-${LIVE_KERNEL_FLAVOUR}/live/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" -e "s/LIVE/live/" tftpboot/pxelinux.cfg/default
+ fi
+ ;;
+
+ usb|hdd)
+ # Copying syslinux
+ 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
+ if [ "${LIVE_SYSLINUX_SPLASH}" = "none" ]
then
- for FLAVOUR in ${LIVE_KERNEL_FLAVOUR}
- do
- NUMBER=$(($NUMBER + 1))
-
- mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER}
- mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img
- sed -i -e "s/LIVE.*-${FLAVOUR}/live${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" -e "s/LIVE/live/" tftpboot/pxelive.cfg/default
- done
+ rm -f binary/splash.rle
+ sed -e "s/.*splash.*//" binary/syslinux.txt
else
- mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz
- mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img
- sed -i -e "s/LIVE.*-${LIVE_KERNEL_FLAVOUR}/live/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" -e "s/LIVE/live/" tftpboot/pxelinux.cfg/default
+ cp -f "${LIVE_SYSLINUX_SPLASH}" binary/splash.rle
fi
- ;;
+ fi
- usb|hdd)
- # Copying syslinux
- 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}" binary/splash.rle
- fi
+ # Configure syslinux templates
+ sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/syslinux.cfg
+ sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/syslinux.cfg
+ sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" binary/f1.txt
+ sed -i -e "s/LIVE_VERSION/${VERSION}/" binary/f10.txt
- # Configure syslinux templates
- sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/syslinux.cfg
- sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/syslinux.cfg
- sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" binary/f1.txt
- sed -i -e "s/LIVE_VERSION/${VERSION}/" binary/f10.txt
+ # Remove unused files
+ rm -f binary/pxelinux.cfg
- # Remove unused files
- rm -f binary/pxelinux.cfg
+ # Working arround syslinux 8.3 limitation
+ if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ]
+ then
+ for FLAVOUR in ${LIVE_KERNEL_FLAVOUR}
+ do
+ NUMBER=$(($NUMBER + 1))
+
+ mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER}
+ mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img
+ sed -i -e "s/LIVE.*-${FLAVOUR}/live${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" -e "s/LIVE/live/" binary/syslinux.cfg
+ done
+ else
+ mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz
+ mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img
+ sed -i -e "s/LIVE.*-${LIVE_KERNEL_FLAVOUR}/live/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" -e "s/LIVE/live/" binary/syslinux.cfg
+ fi
+ ;;
+esac
- # Working arround syslinux 8.3 limitation
- if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ]
- then
- for FLAVOUR in ${LIVE_KERNEL_FLAVOUR}
- do
- NUMBER=$(($NUMBER + 1))
-
- mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER}
- mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img
- sed -i -e "s/LIVE.*-${FLAVOUR}/live${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" -e "s/LIVE/live/" binary/syslinux.cfg
- done
- else
- mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz
- mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img
- sed -i -e "s/LIVE.*-${LIVE_KERNEL_FLAVOUR}/live/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" -e "s/LIVE/live/" binary/syslinux.cfg
- fi
+if [ -n "${PACKAGES}" ]
+then
+ # Removing packages
+ case "${LH_APT}" in
+ apt|apt-get)
+ Chroot "apt-get remove --purge --yes ${PACKAGES}"
;;
- esac
-
- if [ -n "${PACKAGES}" ]
- then
- # Removing packages
- case "${LH_APT}" in
- apt|apt-get)
- Chroot "apt-get remove --purge --yes ${PACKAGES}"
- ;;
- aptitude)
- Chroot "aptitude purge --assume-yes ${PACKAGES}"
- ;;
- esac
- fi
-
- # Creating stage file
- Create_stagefile .stage/binary_syslinux
+ aptitude)
+ Chroot "aptitude purge --assume-yes ${PACKAGES}"
+ ;;
+ esac
fi
+
+# Creating stage file
+Create_stagefile .stage/binary_syslinux
diff --git a/helpers/lh_binary_usb b/helpers/lh_binary_usb
index 228250e..291f877 100755
--- a/helpers/lh_binary_usb
+++ b/helpers/lh_binary_usb
@@ -41,15 +41,15 @@ do
Require_stagefile .stage/bootstrap
Require_stagefile .stage/chroot_proc
+ # Checking stage file
+ Check_stagefile .stage/binary_usb
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
- # Checking stage file
- Check_stagefile .stage/binary_usb
-
if [ ! -f chroot/sbin/mkdosfs ]
then
PACKAGES="${PACKAGES} dosfstools"
@@ -65,15 +65,21 @@ do
PACKAGES="${PACKAGES} parted"
fi
- if [ "${LIVE_BOOTLOADER}" = "grub" ] && [ ! -f chroot/usr/sbin/grub ]
- then
- PACKAGES="${PACKAGES} grub"
- fi
+ case "${LIVE_BOOTLOADER}" in
+ grub)
+ if [ ! -f chroot/usr/sbin/grub ]
+ then
+ PACKAGES="${PACKAGES} grub"
+ fi
+ ;;
- if [ "${LIVE_BOOTLOADER}" = "syslinux" ] && [ ! -f chroot/usr/bin/syslinux ]
- then
- PACKAGES="${PACKAGES} syslinux"
- fi
+ syslinux)
+ if [ ! -f chroot/usr/bin/syslinux ]
+ then
+ PACKAGES="${PACKAGES} syslinux"
+ fi
+ ;;
+ esac
if [ -n "${PACKAGES}" ]
then
@@ -117,7 +123,15 @@ do
case "${LIVE_BOOTLOADER}" in
grub)
- Chroot "grub-install --no-floppy ${FREELO}"
+ #echo "(hd0) ${FREELO}" > binary/boot/grub/device.map
+#grub --batch --no-floppy --device-map=binary/boot/grub/device.map << EOF
+#setup --stage1=binary/boot/grub/stage1 --stage2=binary/boot/grub/stage2 --prefix=/boot/grub (hd0)
+#
+#quit
+#EOF
+ #rm -f binary/boot/grub/device.map
+
+ #Chroot "grub-install --no-floppy --root-directory=/ (hd0)"
;;
syslinux)
@@ -127,6 +141,7 @@ do
${LH_LOSETUP} -d ${FREELO}
+ FREELO="`${LH_LOSETUP} -f`"
lh_losetup $FREELO binary.img 1
Chroot "mkfs.msdos -n DEBIAN_LIVE ${FREELO}"
mkdir -p binary.tmp
@@ -134,8 +149,24 @@ do
cp -r binary/* binary.tmp
umount binary.tmp
rmdir binary.tmp
- Chroot "syslinux ${FREELO}"
+
+ if [ "${LIVE_BOOTLOADER}" = "syslinux" ]
+ then
+ Chroot "syslinux ${FREELO}"
+ fi
+
${LH_LOSETUP} -d ${FREELO}
+
+ #if [ "${LIVE_BOOTLOADER}" = "grub" ]
+ #then
+ # FREELO="`${LH_LOSETUP} -f`"
+ # lh_losetup $FREELO binary.img 0
+
+ # dd if=binary/boot/grub/stage1 of=${FREELO} bs=512 count=1
+ # dd if=binary/boot/grub/stage2 of=${FREELO} bs=512 seek=1
+
+ # ${LH_LOSETUP} -d ${FREELO}
+ #fi
echo "!!! The above error/warning messages can be ignored !!!"
if [ -n "${MAKEDEV}" ]
diff --git a/helpers/lh_binary_yaboot b/helpers/lh_binary_yaboot
new file mode 100755
index 0000000..f891927
--- /dev/null
+++ b/helpers/lh_binary_yaboot
@@ -0,0 +1,217 @@
+#!/bin/sh
+
+# lh_binary_yaboot(1) - installs yaboot into binary
+# Copyright (C) 2006-2007 Daniel Baumann <daniel@debian.org>
+#
+# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+# This is free software, and you are welcome to redistribute it
+# under certain conditions; see COPYING for details.
+
+set -e
+
+# Source common functions
+for FUNCTION in /usr/share/live-helper/functions/*.sh
+do
+ . ${FUNCTION}
+done
+
+# Set static variables
+DESCRIPTION="installs yaboot into binary"
+HELP=""
+USAGE="${PROGRAM} [--force]"
+
+Arguments "${@}"
+
+Echo_debug "Init ${PROGRAM}"
+
+# Reading configuration files
+Read_conffile config/bootstrap
+Read_conffile config/chroot
+Read_conffile config/common
+Read_conffile config/image
+Set_defaults
+
+if [ "${LIVE_BOOTLOADER}" != "yaboot" ]
+then
+ exit 0
+fi
+
+Breakpoint "binary_yaboot: Init"
+
+# Requiring stage file
+Require_stagefile .stage/bootstrap
+
+# Checking stage file
+Check_stagefile .stage/binary_yaboot
+
+# Checking lock file
+Check_lockfile .lock
+
+# Creating lock file
+Create_lockfile .lock
+
+if [ "${LIVE_ARCHITECTURE}" != "powerpc" ] && [ "${LIVE_ARCHITECTURE}" != "ppc64" ]
+then
+ Echo_warning "skipping binary_yaboot, foreign architecture."
+ exit 0
+fi
+
+# Check templates
+if [ ! -d "${LIVE_TEMPLATES}" ]
+then
+ if [ -d ../"${LIVE_TEMPLATES}" ]
+ then
+ LIVE_TEMPLATES="../${LIVE_TEMPLATES}"
+ else
+ Echo_error "user specified templates not accessible in ${LIVE_TEMPLATES}"
+ exit 1
+ fi
+fi
+
+if [ ! -f chroot/usr/lib/yaboot/yaboot ]
+then
+ PACKAGES="${PACKAGES} yaboot"
+fi
+
+if [ -n "${PACKAGES}" ]
+then
+ # Installing symlinks
+ case "${LH_APT}" in
+ apt|apt-get)
+ Chroot "apt-get install --yes ${PACKAGES}"
+ ;;
+
+ aptitude)
+ Chroot "aptitude install --assume-yes ${PACKAGES}"
+ ;;
+ esac
+fi
+
+# Setting destination directory
+case "${LIVE_BINARY_IMAGE}" in
+ iso)
+ DESTDIR="binary/live"
+ ;;
+
+ net|usb|hdd)
+ Echo_error "not supported, FIXME"
+ ;;
+esac
+
+# Temporary check for broken yaboot
+if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
+then
+ case "${LIVE_ARCHITECTURE}" in
+ powerpc)
+ DESTDIR="${DESTDIR}.ppc"
+ ;;
+ esac
+fi
+
+# Creating directory
+if [ ! -d "${DESTDIR}" ]
+then
+ mkdir -p "${DESTDIR}"
+fi
+
+# Setting boot parameters
+if [ -n "${LIVE_ENCRYPTION}" ]
+then
+ LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} encryption=${LIVE_ENCRYPTION}"
+fi
+
+if [ -n "${LIVE_USERNAME}" ]
+then
+ LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} username=${LIVE_USERNAME}"
+fi
+
+if [ -n "${LIVE_HOSTNAME}" ]
+then
+ LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} hostname=${LIVE_HOSTNAME}"
+fi
+
+LIVE_BOOTAPPEND="`echo ${LIVE_BOOTAPPEND} | sed -e 's/ //'`"
+
+# Assembling kernel configuration
+if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
+then
+ DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`"
+ LINUX="image=/`basename ${DESTDIR}`/`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n\tinitrd=/`basename ${DESTDIR}`/initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'`\n\tlabel=LIVE\n\tappend=\"boot=casper LIVE_BOOTAPPEND\"\n\tinitrd-size=1048576\n\tread-only"
+else
+ DEFAULT_FLAVOUR="`echo ${LIVE_KERNEL_FLAVOUR} | awk '{ print $1 }'`"
+ LINUX="image=`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR}`\n\tinitrd=initrd.img-`basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinuz-//'`\n\tlabel=LIVE\n\tappend=\"boot=casper LIVE_BOOTAPPEND\"\n\tinitrd-size=1048576\n\tread-only"
+fi
+
+# FIXME
+if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ]
+then
+ for KERNEL in chroot/boot/vmlinuz*
+ do
+ if [ -z "${LINUX}" ]
+ then
+ if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
+ then
+ LINUX="label LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
+ else
+ LINUX="label LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
+ fi
+ else
+ if [ "${LIVE_BINARY_IMAGE}" = "iso" ]
+ then
+ LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel /`basename ${DESTDIR}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
+ else
+ LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinuz-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinuz-//'` boot=casper LIVE_BOOTAPPEND"
+ fi
+ fi
+ done
+fi
+
+LINUX="`echo ${LINUX} | sed -e 's#//#/#g'`"
+
+case "${LIVE_BINARY_IMAGE}" in
+ iso)
+ # Copying yaboot
+ mkdir -p binary/install
+ cp chroot/usr/lib/yaboot/yaboot binary/install
+ cp -r "${LIVE_TEMPLATES}"/yaboot/* binary/yaboot
+
+ # Configure yaboot templates
+ sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/install/yaboot.conf
+ sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/yaboot/yaboot.conf
+ sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" -e "s/LIVE_VERSION/${VERSION}/" binary/yaboot/boot.msg
+
+ # Working arround yaboot 8.3 limitation
+ if [ "`echo ${LIVE_KERNEL_FLAVOUR} | wc -w`" -gt "1" ]
+ then
+ for FLAVOUR in ${LIVE_KERNEL_FLAVOUR}
+ do
+ NUMBER=$(($NUMBER + 1))
+
+ mv "${DESTDIR}"/vmlinuz-*-${FLAVOUR} "${DESTDIR}"/vmlinuz${NUMBER}
+ mv "${DESTDIR}"/initrd.img-*-${FLAVOUR} "${DESTDIR}"/initrd${NUMBER}.img
+ sed -i -e "s/LIVE.*-${FLAVOUR}/live${NUMBER}/g" -e "s/vmlinuz-.*-${FLAVOUR}/vmlinuz${NUMBER}/g" -e "s/initrd.img-.*-${FLAVOUR}/initrd${NUMBER}.img/g" -e "s/LIVE/live/" binary/install/yaboot.conf
+ done
+ else
+ mv "${DESTDIR}"/vmlinuz-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/vmlinuz
+ mv "${DESTDIR}"/initrd.img-*-${LIVE_KERNEL_FLAVOUR} "${DESTDIR}"/initrd.img
+ sed -i -e "s/LIVE.*-${LIVE_KERNEL_FLAVOUR}/live/g" -e "s/vmlinuz-.*-${LIVE_KERNEL_FLAVOUR}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_KERNEL_FLAVOUR}/initrd.img/g" -e "s/LIVE/live/" binary/install/yaboot.conf
+ fi
+ ;;
+esac
+
+if [ -n "${PACKAGES}" ]
+then
+ # Removing packages
+ case "${LH_APT}" in
+ apt|apt-get)
+ Chroot "apt-get remove --purge --yes ${PACKAGES}"
+ ;;
+
+ aptitude)
+ Chroot "aptitude purge --assume-yes ${PACKAGES}"
+ ;;
+ esac
+fi
+
+# Creating stage file
+Create_stagefile .stage/binary_yaboot
diff --git a/helpers/lh_bootstrap_cdebootstrap b/helpers/lh_bootstrap_cdebootstrap
index 9581d8c..5453d02 100755
--- a/helpers/lh_bootstrap_cdebootstrap
+++ b/helpers/lh_bootstrap_cdebootstrap
@@ -137,6 +137,11 @@ then
Chroot "dpkg -P cdebootstrap-helper-diverts"
fi
+ # Deconfiguring cdebootstrap configurations
+ rm -f chroot/etc/apt/sources.list
+ rm -f chroot/etc/hosts
+ rm -f chroot/etc/resolv.conf
+
# Removing bootstrap cache
if [ -d chroot/var/cache/bootstrap ]
then
@@ -157,6 +162,6 @@ then
# Creating stage file
Create_stagefile .stage/bootstrap
else
- echo "E: Can't process file /usr/bin/cdebootstrap (FIXME)"
+ Echo_error "Can't process file /usr/bin/cdebootstrap (FIXME)"
exit 1
fi
diff --git a/helpers/lh_bootstrap_debootstrap b/helpers/lh_bootstrap_debootstrap
index a32c491..d7b807f 100755
--- a/helpers/lh_bootstrap_debootstrap
+++ b/helpers/lh_bootstrap_debootstrap
@@ -131,6 +131,6 @@ then
# Creating stage file
Create_stagefile .stage/bootstrap
else
- echo "E: Can't process file /usr/bin/debootstrap (FIXME)"
+ Echo_error "Can't process file /usr/bin/debootstrap (FIXME)"
exit 1
fi
diff --git a/helpers/lh_chroot_apt b/helpers/lh_chroot_apt
index 47107e7..cecd8ab 100755
--- a/helpers/lh_chroot_apt
+++ b/helpers/lh_chroot_apt
@@ -36,24 +36,18 @@ Breakpoint "chroot_apt: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
-# Checking lock file
-Check_lockfile .lock
-
-# Creating lock file
-Create_lockfile .lock
-
case "${1}" in
install)
# Checking stage file
Check_stagefile .stage/chroot_apt
- if [ -f chroot/etc/apt/apt.conf ]
- then
- # Remove old /etc/apt/apt.conf
- rm -f chroot/etc/apt/apt.conf
- fi
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
- if [ "${LH_APT}" = "aptitude" ] && [ ! -d chroot/etc/apt/apt.conf.d ]
+ if [ ! -d chroot/etc/apt/apt.conf.d ]
then
mkdir -p chroot/etc/apt/apt.conf.d
fi
@@ -61,125 +55,76 @@ case "${1}" in
# Configuring apt ftp proxy
if [ -n "${LH_APT_FTPPROXY}" ]
then
- case "${LH_APT}" in
- apt|apt-get)
- echo "Acquire::ftp::Proxy \"${LH_APT_FTPPROXY}\";" >> chroot/etc/apt/apt.conf
- ;;
-
- aptitude)
- echo "Acquire::ftp::Proxy \"${LH_APT_FTPPROXY}\";" > chroot/etc/apt/apt.conf.d/ftp-proxy
- ;;
- esac
+ echo "Acquire::ftp::Proxy \"${LH_APT_FTPPROXY}\";" > chroot/etc/apt/apt.conf.d/00ftp-proxy
fi
# Configuring apt http proxy
if [ -n "${LH_APT_HTTPPROXY}" ]
then
- case "${LH_APT}" in
- apt|apt-get)
- echo "Acquire::http::Proxy \"${LH_APT_HTTPPROXY}\";" >> chroot/etc/apt/apt.conf
- ;;
-
- aptitude)
- echo "Acquire::http::Proxy \"${LH_APT_HTTPPROXY}\";" > chroot/etc/apt/apt.conf.d/http-proxy
- ;;
- esac
+ echo "Acquire::http::Proxy \"${LH_APT_HTTPPROXY}\";" > chroot/etc/apt/apt.conf.d/00http-proxy
fi
# Configuring apt pdiffs
- if [ "${LH_APT_PDIFFS}" = "enabled" ]
- then
- case "${LH_APT}" in
- apt|apt-get)
- echo "Acquire::PDiffs \"true\";" >> chroot/etc/apt/apt.conf
- ;;
-
- aptitude)
- echo "Acquire::PDiffs \"true\";" > chroot/etc/apt/apt.conf.d/pdiffs
- ;;
- esac
- else
- case "${LH_APT}" in
- apt|apt-get)
- echo "Acquire::PDiffs \"false\";" >> chroot/etc/apt/apt.conf
- ;;
+ case "${LH_APT_PDIFFS}" in
+ enabled)
+ echo "Acquire::PDiffs \"true\";" > chroot/etc/apt/apt.conf.d/00pdiffs
+ ;;
- aptitude)
- echo "Acquire::PDiffs \"false\";" > chroot/etc/apt/apt.conf.d/pdiffs
- ;;
- esac
- fi
+ disabled)
+ echo "Acquire::PDiffs \"false\";" > chroot/etc/apt/apt.conf.d/00pdiffs
+ ;;
+ esac
# Configuring apt recommends
- if [ "${LH_APT_RECOMMENDS}" = "enabled" ]
+ if [ "${LH_APT}" = "aptitude" ]
then
- case "${LH_APT}" in
- apt|apt-get)
- echo "Aptitude::Recommends-Important \"true\";" >> chroot/etc/apt/apt.conf
+ case "${LH_APT_RECOMMENDS}" in
+ enabled)
+ echo "Aptitude::Recommends-Important \"true\";" > chroot/etc/apt/apt.conf.d/00recommends
;;
- aptitude)
- echo "Aptitude::Recommends-Important \"true\";" > chroot/etc/apt/apt.conf.d/recommends
- ;;
- esac
- else
- case "${LH_APT}" in
- apt|apt-get)
- echo "Aptitude::Recommends-Important \"false\";" >> chroot/etc/apt/apt.conf
- ;;
-
- aptitude)
- echo "Aptitude::Recommends-Important \"false\";" > chroot/etc/apt/apt.conf.d/recommends
+ disabled)
+ echo "Aptitude::Recommends-Important \"false\";" > chroot/etc/apt/apt.conf.d/00recommends
;;
esac
fi
# Configuring apt secure
- if [ "${LH_APT_SECURE}" = "enabled" ]
- then
- case "${LH_APT}" in
- apt|apt-get)
- echo "APT::Get::AllowUnauthenticated \"true\";" >> chroot/etc/apt/apt.conf
- ;;
+ case "${LH_APT_SECURE}" in
+ enabled)
+ echo "APT::Get::AllowUnauthenticated \"true\";" > chroot/etc/apt/apt.conf.d/00secure
+ ;;
- aptitude)
- echo "APT::Get::AllowUnauthenticated \"true\";" > chroot/etc/apt/apt.conf.d/secure
- ;;
- esac
- else
- case "${LH_APT}" in
- apt|apt-get)
- echo "APT::Get::AllowUnauthenticated \"false\";" >> chroot/etc/apt/apt.conf
- ;;
-
- aptitude)
- echo "APT::Get::AllowUnauthenticated \"false\";" > chroot/etc/apt/apt.conf.d/secure
- ;;
- esac
- fi
+ disabled)
+ echo "APT::Get::AllowUnauthenticated \"false\";" > chroot/etc/apt/apt.conf.d/00secure
+ ;;
+ esac
# Creating stage file
Create_stagefile .stage/chroot_apt
;;
remove)
- # Deconfiguring apt settings
- rm -f chroot/etc/apt/apt.conf
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
# Deconfiguring aptitude ftp proxy
- rm -f chroot/etc/apt/apt.conf.d/ftp-proxy
+ rm -f chroot/etc/apt/apt.conf.d/00ftp-proxy
# Deconfiguring aptitude http proxy
- rm -f chroot/etc/apt/apt.conf.d/http-proxy
+ rm -f chroot/etc/apt/apt.conf.d/00http-proxy
# Deconfiguring aptitude pdiffs
- rm -f chroot/etc/apt/apt.conf.d/pdiffs
+ rm -f chroot/etc/apt/apt.conf.d/00pdiffs
# Deconfiguring aptitude recommends
- rm -f chroot/etc/apt/apt.conf.d/recommends
+ rm -f chroot/etc/apt/apt.conf.d/00recommends
# Deconfiguring aptitude secure
- rm -f chroot/etc/apt/apt.conf.d/secure
+ rm -f chroot/etc/apt/apt.conf.d/00secure
# Removing stage file
rm -f .stage/chroot_apt
diff --git a/helpers/lh_chroot_debianchroot b/helpers/lh_chroot_debianchroot
index b0f3a57..bc83028 100755
--- a/helpers/lh_chroot_debianchroot
+++ b/helpers/lh_chroot_debianchroot
@@ -36,17 +36,17 @@ Breakpoint "chroot_debianchroot: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
-# Checking lock file
-Check_lockfile .lock
-
-# Creating lock file
-Create_lockfile .lock
-
case "${1}" in
install)
# Checking stage file
Check_stagefile .stage/chroot_debianchroot
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
if [ -f chroot/etc/debian_chroot ]
then
# Save chroot file
@@ -61,6 +61,12 @@ case "${1}" in
;;
remove)
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
if [ -f chroot/etc/debian_chroot.orig ]
then
# Restore chroot file
diff --git a/helpers/lh_chroot_hooks b/helpers/lh_chroot_hooks
index 85386a8..d2fac35 100755
--- a/helpers/lh_chroot_hooks
+++ b/helpers/lh_chroot_hooks
@@ -66,3 +66,8 @@ then
# Creating stage file
Create_stagefile .stage/chroot_hooks
fi
+
+if [ -n "${LIVE_HOOKS}" ]
+then
+ LIVE_DEBCONF_FRONTEND="readline" LIVE_DEBCONF_PRIORITY="low" LIVE_DEBCONF_NOWARNINGS="no" Chroot "${LIVE_HOOKS}"
+fi
diff --git a/helpers/lh_chroot_hosts b/helpers/lh_chroot_hosts
index 52784d5..4262f60 100755
--- a/helpers/lh_chroot_hosts
+++ b/helpers/lh_chroot_hosts
@@ -36,17 +36,17 @@ Breakpoint "chroot_hosts: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
-# Checking lock file
-Check_lockfile .lock
-
-# Creating lock file
-Create_lockfile .lock
-
case "${1}" in
install)
# Checking stage file
Check_stagefile .stage/chroot_hosts
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
if [ -f chroot/etc/hosts ]
then
# Save hosts file
@@ -64,6 +64,12 @@ case "${1}" in
;;
remove)
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
if [ -f chroot/etc/hosts.orig ]
then
# Restore hosts file
diff --git a/helpers/lh_chroot_interactive b/helpers/lh_chroot_interactive
index ac90f89..556f079 100755
--- a/helpers/lh_chroot_interactive
+++ b/helpers/lh_chroot_interactive
@@ -33,40 +33,37 @@ Set_defaults
Breakpoint "chroot_interactive: Init"
-if [ "${LIVE_INTERACTIVE}" != "disabled" ]
+if [ "${LIVE_INTERACTIVE}" = "disabled" ]
then
- # Requiring stage file
- Require_stagefile .stage/bootstrap
+ exit 0
+fi
- # Checking lock file
- Check_lockfile .lock
+# Requiring stage file
+Require_stagefile .stage/bootstrap
- # Creating lock file
- Create_lockfile .lock
+# Checking stage file
+Check_stagefile .stage/chroot_interactive
- # Checking stage file
- Check_stagefile .stage/chroot_interactive
+# Checking lock file
+Check_lockfile .lock
- case "${LIVE_INTERACTIVE}" in
- enabled|shell)
- echo "Pausing build: starting interactive shell..."
+# Creating lock file
+Create_lockfile .lock
+case "${LIVE_INTERACTIVE}" in
+ enabled|shell)
+ echo "Pausing build: starting interactive shell..."
Chroot "/bin/bash --login"
- ;;
-
+ ;;
x11)
- echo "Pausing build: starting interactive X11..."
-
+ echo "Pausing build: starting interactive X11..."
Chroot "startx"
- ;;
-
+ ;;
xnest)
- echo "Pausing build: starting interactive Xnest..."
-
+ echo "Pausing build: starting interactive Xnest..."
#Chroot "" # FIXME
- ;;
- esac
+ ;;
+esac
- # Creating stage file
- Create_stagefile .stage/chroot_symlinks
-fi
+# Creating stage file
+Create_stagefile .stage/chroot_symlinks
diff --git a/helpers/lh_chroot_linuximage b/helpers/lh_chroot_linuximage
index 0af6e18..e3d3786 100755
--- a/helpers/lh_chroot_linuximage
+++ b/helpers/lh_chroot_linuximage
@@ -36,17 +36,17 @@ Breakpoint "chroot_linuximage: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
-# Checking lock file
-Check_lockfile .lock
-
-# Creating lock file
-Create_lockfile .lock
-
case "${1}" in
install)
# Checking stage file
Check_stagefile .stage/chroot_linuximage
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
if [ -f chroot/etc/kernel-img.conf ]
then
# Saving kernel-img.conf
@@ -54,7 +54,11 @@ case "${1}" in
fi
# Configuring kernel-img.conf
- echo "do_initrd = Yes" >> chroot/etc/kernel-img.conf
+cat >> chroot/etc/kernel-img.conf << EOF
+do_bootloader = No
+do_initrd = Yes
+warn_initrd = No
+EOF
if [ "${LIVE_KERNEL_PACKAGES}" != "none" ]
then
@@ -85,6 +89,12 @@ case "${1}" in
;;
remove)
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
if [ -f chroot/etc/kernel-img.conf.old ]
then
# Restoring kernel-img.conf file
diff --git a/helpers/lh_chroot_proc b/helpers/lh_chroot_proc
index b689cc6..42a7feb 100755
--- a/helpers/lh_chroot_proc
+++ b/helpers/lh_chroot_proc
@@ -39,17 +39,17 @@ Breakpoint "chroot_proc: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
-# Checking lock file
-Check_lockfile .lock
-
-# Creating lock file
-Create_lockfile .lock
-
case "${1}" in
install)
# Checking stage file
Check_stagefile .stage/chroot_proc
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
if [ ! -d chroot/proc ]
then
# Creating mountpoint
@@ -64,8 +64,17 @@ case "${1}" in
;;
remove)
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
# Workaround binfmt-support /proc locking
- umount chroot/proc/sys/fs/binfmt_misc > /dev/null 2>&1 || true
+ if [ -e chroot/proc/sys/fs/binftm_misc/status ]
+ then
+ umount chroot/proc/sys/fs/binfmt_misc
+ fi
# Unmounting /proc
#fuser -km chroot/proc
diff --git a/helpers/lh_chroot_resolv b/helpers/lh_chroot_resolv
index db68e8c..71143f2 100755
--- a/helpers/lh_chroot_resolv
+++ b/helpers/lh_chroot_resolv
@@ -36,17 +36,17 @@ Breakpoint "chroot_resolv: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
-# Checking lock file
-Check_lockfile .lock
-
-# Creating lock file
-Create_lockfile .lock
-
case "${1}" in
install)
# Checking stage file
Check_stagefile .stage/chroot_resolv
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
if [ -f chroot/etc/resolv.conf ]
then
# Save resolv file
@@ -64,6 +64,12 @@ case "${1}" in
;;
remove)
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
if [ -f chroot/etc/resolv.conf.orig ]
then
# Restore resolv file
diff --git a/helpers/lh_chroot_sources b/helpers/lh_chroot_sources
index af85217..c4a3a51 100755
--- a/helpers/lh_chroot_sources
+++ b/helpers/lh_chroot_sources
@@ -36,17 +36,17 @@ Breakpoint "chroot_sources: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
-# Checking lock file
-Check_lockfile .lock
-
-# Creating lock file
-Create_lockfile .lock
-
case "${1}" in
install)
# Checking stage file
Check_stagefile .stage/chroot_sources
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
# Configure custom sources.list
echo "deb ${LIVE_MIRROR_BUILD} ${LIVE_DISTRIBUTION} ${LIVE_SECTIONS}" > chroot/etc/apt/sources.list
@@ -57,7 +57,7 @@ case "${1}" in
if [ "${LIVE_SECURITY}" = "enabled" ]
then
- if [ "${LIVE_DISTRIBUTION}" != "sid" ] && [ "${LIVE_DISTRIBUTION}" = "unstable" ]
+ if [ "${LIVE_DISTRIBUTION}" != "sid" ] && [ "${LIVE_DISTRIBUTION}" != "unstable" ]
then
echo "deb ${LIVE_MIRROR_BUILD_SECURITY} ${LIVE_DISTRIBUTION}/updates ${LIVE_SECTIONS}" >> chroot/etc/apt/sources.list
@@ -76,7 +76,7 @@ case "${1}" in
for FILE in config/chroot_sources/*.build
do
- cat ${FILE} >> chroot/etc/apt/sources.list
+ cat ${FILE} | grep -v "^##" >> chroot/etc/apt/sources.list
done
fi
@@ -103,7 +103,7 @@ case "${1}" in
fi
# Installing aptitude
- if [ "${LH_APT}" = "apt" ]
+ if [ "${LH_APT}" = "apt" ] || [ "${LH_APT}" = "apt-get" ]
then
Chroot "apt-get update"
elif [ "${LH_APT}" = "aptitude" ]
@@ -129,6 +129,12 @@ case "${1}" in
;;
remove)
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
# Configure generic indices
if [ "${LH_APT_GENERIC}" = "enabled" ]
then
@@ -169,9 +175,9 @@ case "${1}" in
echo "" >> chroot/etc/apt/sources.list
echo "# Custom repositories" >> chroot/etc/apt/sources.list
- for FILE in config/chroot_sources/*.image
+ for FILE in config/chroot_sources/*.build
do
- cat ${FILE} >> chroot/etc/apt/sources.list
+ cat ${FILE} | grep -v "^##" >> chroot/etc/apt/sources.list
done
fi
diff --git a/helpers/lh_chroot_symlinks b/helpers/lh_chroot_symlinks
index a2413e5..e574480 100755
--- a/helpers/lh_chroot_symlinks
+++ b/helpers/lh_chroot_symlinks
@@ -36,15 +36,15 @@ Breakpoint "chroot_symlinks: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
+# Checking stage file
+Check_stagefile .stage/chroot_symlinks
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Checking stage file
-Check_stagefile .stage/chroot_symlinks
-
if [ "${LIVE_SYMLINKS}" = "enabled" ]
then
if [ -f chroot/usr/bin/symlinks ]
diff --git a/helpers/lh_chroot_sysfs b/helpers/lh_chroot_sysfs
index ae9c0b4..539a793 100755
--- a/helpers/lh_chroot_sysfs
+++ b/helpers/lh_chroot_sysfs
@@ -39,17 +39,17 @@ Breakpoint "chroot_sysfs: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
-# Checking lock file
-Check_lockfile .lock
-
-# Creating lock file
-Create_lockfile .lock
-
case "${1}" in
install)
# Checking stage file
Check_stagefile .stage/chroot_sysfs
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
if [ ! -d chroot/sys ]
then
# Create mountpoint
@@ -64,6 +64,12 @@ case "${1}" in
;;
remove)
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
# Unmounting /sys
#fuser -km chroot/sys
umount chroot/sys > /dev/null 2>&1
diff --git a/helpers/lh_chroot_sysvinit b/helpers/lh_chroot_sysvinit
index 48eae43..4cee00b 100755
--- a/helpers/lh_chroot_sysvinit
+++ b/helpers/lh_chroot_sysvinit
@@ -36,15 +36,15 @@ Breakpoint "chroot_sysvinit: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
+# Checking stage file
+Check_stagefile .stage/chroot_sysvinit
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Checking stage file
-Check_stagefile .stage/chroot_sysvinit
-
if [ "${LIVE_SYSVINIT}" = "enabled" ]
then
# Disable all
diff --git a/helpers/lh_chroot_sysvrc b/helpers/lh_chroot_sysvrc
index f864854..8913236 100755
--- a/helpers/lh_chroot_sysvrc
+++ b/helpers/lh_chroot_sysvrc
@@ -36,17 +36,17 @@ Breakpoint "chroot_sysvrc: Init"
# Requiring stage file
Require_stagefile .stage/bootstrap
-# Checking lock file
-Check_lockfile .lock
-
-# Creating lock file
-Create_lockfile .lock
-
case "${1}" in
install)
# Checking stage file
Check_stagefile .stage/chroot_sysvrc
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
if [ -f chroot/usr/sbin/policy-rc.d ]
then
# Save policy-rc.d file
@@ -70,6 +70,12 @@ EOF
;;
remove)
+ # Checking lock file
+ Check_lockfile .lock
+
+ # Creating lock file
+ Create_lockfile .lock
+
if [ -f chroot/usr/sbin/policy-rc.d.orig ]
then
# Restore policy-rc.d file
diff --git a/helpers/lh_clean b/helpers/lh_clean
index dde83d5..10118f5 100755
--- a/helpers/lh_clean
+++ b/helpers/lh_clean
@@ -58,7 +58,7 @@ case "${1}" in
umount -f chroot/dev/pts > /dev/null 2>&1 || true
umount -f chroot/dev > /dev/null 2>&1 || true
- rm -rf chroot
+ rm -rf chroot chroot.tmp
if [ "${PURGE}" != "true" ] && [ -d cache/chroot_bootstrap ]
then
@@ -98,6 +98,7 @@ case "${1}" in
source)
rm -f source.iso
rm -f source.img
+ rm -f source*.tar
rm -f source*.tar.gz
rm -rf source
diff --git a/helpers/lh_config b/helpers/lh_config
index 0d42477..13c1835 100755
--- a/helpers/lh_config
+++ b/helpers/lh_config
@@ -22,9 +22,25 @@ USAGE="${PROGRAM} [--force]"
Arguments "${@}"
+CONFIG="${1}"
+
Echo_debug "Init ${PROGRAM}"
-if [ "${1}" != "newconfig" ]
+if [ -n "${LH_CONFIG}" ]
+then
+ if [ -d /usr/share/live-helper/configs/"${LH_CONFIG}" ]
+ then
+ mkdir "${LH_CONFIG}"
+ cp -r /usr/share/live-helper/configs/"${LH_CONFIG}" "${LH_CONFIG}"/config
+
+ LIVE_ROOT="${LH_CONFIG}"
+ CONFIG=""
+ else
+ Echo_error "Couldn't find config ${LH_CONFIG} in /usr/share/live-helper/configs/."
+ fi
+fi
+
+if [ "${CONFIG}" != "newconfig" ]
then
# Source existing configuration
Read_conffile "${LIVE_ROOT}"/config/common
@@ -39,7 +55,7 @@ Set_defaults
Breakpoint "config: Init"
# Creating configuration directory
-install -d -m 0755 "${LIVE_ROOT}"/config || true
+mkdir -p "${LIVE_ROOT}"/config
# Creating live-helper configuration
cat > "${LIVE_ROOT}"/config/common << EOF
@@ -93,6 +109,10 @@ LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}"
# (Default: ${LH_DEBCONF_PRIORITY})
LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}"
+# \$LH_DEBCONF_NOWARNINGS: set debconf(1) warnings
+# (Default: ${LH_DEBCONF_NOWARNINGS})
+LH_DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}"
+
# \$LH_GENISOIMAGE: set the genisoimage program
# (Default: ${LH_GENISOIMAGE})
LH_GENISOIMAGE="${LH_GENISOIMAGE}"
@@ -144,6 +164,10 @@ LIVE_KERNEL_PACKAGES="${LIVE_KERNEL_PACKAGES}"
# (Default: empty)
LIVE_KEYRING_PACKAGES="${LIVE_KEYRING_PACKAGES}"
+# \$LIVE_HOOKS: set hook commands
+# (Default: empty)
+LIVE_HOOKS="${LIVE_HOOKS}"
+
# \$LIVE_LANGUAGE: set the language to use
# (Default: empty)
LIVE_LANGUAGE="${LIVE_LANGUAGE}"
@@ -178,11 +202,11 @@ LIVE_INTERACTIVE="${LIVE_INTERACTIVE}"
EOF
# Creating lh_chroot_* directories
-install -d -m 0755 "${LIVE_ROOT}"/config/chroot_localhooks || true
-install -d -m 0755 "${LIVE_ROOT}"/config/chroot_localincludes || true
-install -d -m 0755 "${LIVE_ROOT}"/config/chroot_localpackages || true
-install -d -m 0755 "${LIVE_ROOT}"/config/chroot_localpackageslists || true
-install -d -m 0755 "${LIVE_ROOT}"/config/chroot_sources || true
+mkdir -p "${LIVE_ROOT}"/config/chroot_localhooks
+mkdir -p "${LIVE_ROOT}"/config/chroot_localincludes
+mkdir -p "${LIVE_ROOT}"/config/chroot_localpackages
+mkdir -p "${LIVE_ROOT}"/config/chroot_localpackageslists
+mkdir -p "${LIVE_ROOT}"/config/chroot_sources
# Creating lh_bootstrap_* configuration
cat > "${LIVE_ROOT}"/config/bootstrap << EOF
@@ -249,9 +273,9 @@ LIVE_HOSTNAME="${LIVE_HOSTNAME}"
# (Default: ${LIVE_FILESYSTEM})
LIVE_FILESYSTEM="${LIVE_FILESYSTEM}"
-# \$LIVE_MEMTEST86: set memtest86+
-# (Default: ${LIVE_MEMTEST86})
-LIVE_MEMTEST86="${LIVE_MEMTEST86}"
+# \$LIVE_MEMTEST: set memtest
+# (Default: ${LIVE_MEMTEST})
+LIVE_MEMTEST="${LIVE_MEMTEST}"
# \$LIVE_ISO_VOLUME: set iso volume
# (Default: ${LIVE_ISO_VOLUME})
@@ -299,4 +323,4 @@ LIVE_TEMPLATES="${LIVE_TEMPLATES}"
EOF
# Creating lh_binary_* directories
-install -d -m 0755 "${LIVE_ROOT}"/config/binary_localincludes || true
+mkdir -p "${LIVE_ROOT}"/config/binary_localincludes
diff --git a/helpers/lh_source_config b/helpers/lh_source_config
index 3982696..5b549be 100755
--- a/helpers/lh_source_config
+++ b/helpers/lh_source_config
@@ -33,38 +33,40 @@ Set_defaults
Breakpoint "source_config: Init"
-if [ "${LIVE_SOURCE}" = "enabled" ]
+if [ "${LIVE_SOURCE}" != "enabled" ]
then
- # Requiring stage file
- Require_stagefile .stage/bootstrap
+ exit 0
+fi
- # Checking lock file
- Check_lockfile .lock
+# Requiring stage file
+Require_stagefile .stage/bootstrap
- # Creating lock file
- Create_lockfile .lock
+# Checking stage file
+Check_stagefile .stage/source_config
- # Checking stage file
- Check_stagefile .stage/source_config
+# Checking lock file
+Check_lockfile .lock
- # Remove old sources
- if [ -d source/debian-live ]
- then
- rm -rf source/debian-live
- fi
+# Creating lock file
+Create_lockfile .lock
- # Copy system configuration
- mkdir -p source/debian-live
- cp -a config source/debian-live
+# Remove old sources
+if [ -d source/debian-live ]
+then
+ rm -rf source/debian-live
+fi
- # Create tarball
- cd source
- tar cfz debian-live-config_`date +%Y%m%d.%s`.tar.gz debian-live
- cd "${OLDPWD}"
+# Copy system configuration
+mkdir -p source/debian-live
+cp -a config source/debian-live
- rm -rf source/debian-live/config
- mv source/debian-live-config_*.tar.gz source/debian-live
+# Create tarball
+cd source
+tar cfz debian-live-config_`date +%Y%m%d.%s`.tar.gz debian-live
+cd "${OLDPWD}"
- # Creating stage file
- Create_stagefile .stage/source_config
-fi
+rm -rf source/debian-live/config
+mv source/debian-live-config_*.tar.gz source/debian-live
+
+# Creating stage file
+Create_stagefile .stage/source_config
diff --git a/helpers/lh_source_download b/helpers/lh_source_download
index a3ec267..d9f0adf 100755
--- a/helpers/lh_source_download
+++ b/helpers/lh_source_download
@@ -33,51 +33,57 @@ Set_defaults
Breakpoint "source_download: Init"
-if [ "${LIVE_SOURCE}" = "enabled" ]
+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_download
-
- # Remove old sources
- if [ -d source/debian ]
- then
- rm -rf source/debian
- fi
-
- # Download sources
- 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 chroot/root/dpkg-selection.txt
-
- # Sort sources
- for DSC in chroot/*.dsc
- do
- SOURCE="`awk '/Source:/ { print $2; }' ${DSC}`"
-
- if [ "`echo ${SOURCE} | cut -b 1-3`" == "lib" ]
- then
- LETTER="`echo ${SOURCE} | cut -b 1-4`"
- else
- LETTER="`echo ${SOURCE} | cut -b 1`"
- fi
-
- # Install directory
- install -d -m 0755 source/debian/"${LETTER}"/"${SOURCE}"
-
- # Move files
- mv chroot/"${SOURCE}"_* source/debian/"${LETTER}"/"${SOURCE}"
- done
-
- # Creating stage file
- Create_stagefile .stage/source_download
+ exit 0
fi
+
+# Requiring stage file
+Require_stagefile .stage/bootstrap
+
+# Checking stage file
+Check_stagefile .stage/source_download
+
+# Checking lock file
+Check_lockfile .lock
+
+# Creating lock file
+Create_lockfile .lock
+
+# Remove old sources
+if [ -d source/debian ]
+then
+ rm -rf source/debian
+fi
+
+# Download sources
+Chroot "dpkg --get-selections" | awk '{ print $1 }' > chroot/root/dpkg-selection.txt
+echo "${LIVE_BOOTLOADER}" >> 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 chroot/root/dpkg-selection.txt
+
+# Sort sources
+for DSC in chroot/*.dsc
+do
+ SOURCE="`sed -n 's/^Source: //p' ${DSC}`"
+
+ case "${SOURCE}" in
+ lib?*)
+ LETTER="`echo ${SOURCE} | sed 's/\(....\).*/\1/'`"
+ ;;
+
+ *)
+ LETTER="`echo ${SOURCE} | sed 's/\(.\).*/\1/'`"
+ ;;
+ esac
+
+ # Install directory
+ mkdir -p source/debian/"${LETTER}"/"${SOURCE}"
+
+ # Move files
+ mv chroot/"${SOURCE}"_* source/debian/"${LETTER}"/"${SOURCE}"
+done
+
+# Creating stage file
+Create_stagefile .stage/source_download
diff --git a/helpers/lh_source_generic b/helpers/lh_source_generic
index 3740fe3..0ffa9fc 100755
--- a/helpers/lh_source_generic
+++ b/helpers/lh_source_generic
@@ -33,7 +33,7 @@ Set_defaults
Breakpoint "source_generic: Init"
-if [ "${LIVE_SOURCE}" = "disabled" ]
+if [ "${LIVE_SOURCE}" != "enabled" ]
then
exit 0
fi
@@ -45,15 +45,15 @@ do
# Requiring stage file
Require_stagefile .stage/source_download
+ # Checking stage file
+ Check_stagefile .stage/source_generic
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
- # Checking stage file
- Check_stagefile .stage/source_generic
-
# Remove old source
if [ -f source.tar ]
then
diff --git a/helpers/lh_source_hdd b/helpers/lh_source_hdd
index a3bdd8c..1c8c88b 100755
--- a/helpers/lh_source_hdd
+++ b/helpers/lh_source_hdd
@@ -33,7 +33,7 @@ Set_defaults
Breakpoint "source_hdd: Init"
-if [ "${LIVE_SOURCE}" = "disabled" ]
+if [ "${LIVE_SOURCE}" != "enabled" ]
then
exit 0
fi
@@ -45,15 +45,15 @@ do
# Requiring stage file
Require_stagefile .stage/source_download
+ # Checking stage file
+ Check_stagefile .stage/source_hdd
+
# 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
diff --git a/helpers/lh_source_iso b/helpers/lh_source_iso
index f5b18cc..f69b705 100755
--- a/helpers/lh_source_iso
+++ b/helpers/lh_source_iso
@@ -33,7 +33,7 @@ Set_defaults
Breakpoint "source_iso: Init"
-if [ "${LIVE_SOURCE}" = "disabled" ]
+if [ "${LIVE_SOURCE}" != "enabled" ]
then
exit 0
fi
@@ -45,15 +45,15 @@ do
# Requiring stage file
Require_stagefile .stage/source_download
+ # Checking stage file
+ Check_stagefile .stage/source_iso
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
- # Checking stage file
- Check_stagefile .stage/source_iso
-
# Remove old source
if [ -f source.iso ]
then
diff --git a/helpers/lh_source_md5sum b/helpers/lh_source_md5sum
index 8fc2b39..e175663 100755
--- a/helpers/lh_source_md5sum
+++ b/helpers/lh_source_md5sum
@@ -33,31 +33,33 @@ Set_defaults
Breakpoint "source_md5sum: Init"
-if [ "${LIVE_SOURCE}" = "enabled" ]
+if [ "${LIVE_SOURCE}" != "enabled" ]
then
- # Requiring stage file
- Require_stagefile .stage/source_download
-
- # Checking lock file
- Check_lockfile .lock
+ exit 0
+fi
- # Creating lock file
- Create_lockfile .lock
+# Requiring stage file
+Require_stagefile .stage/source_download
- # Checking stage file
- Check_stagefile .stage/source_md5sum
+# Checking stage file
+Check_stagefile .stage/source_md5sum
- # Remove old md5sums
- if [ -f source/md5sum.txt ]
- then
- rm -f source/md5sum.txt
- fi
+# Checking lock file
+Check_lockfile .lock
- # Calculating md5sums
- cd source
- find . -type f -print0 | xargs -0 md5sum > md5sum.txt
- cd "${OLDPWD}"
+# Creating lock file
+Create_lockfile .lock
- # Creating stage file
- Create_stagefile .stage/source_md5sum
+# Remove old md5sums
+if [ -f source/md5sum.txt ]
+then
+ rm -f source/md5sum.txt
fi
+
+# Calculating md5sums
+cd source
+find . -type f -print0 | xargs -0 md5sum > md5sum.txt
+cd "${OLDPWD}"
+
+# Creating stage file
+Create_stagefile .stage/source_md5sum
diff --git a/helpers/lh_source_net b/helpers/lh_source_net
index a149d5c..67ed8fa 100755
--- a/helpers/lh_source_net
+++ b/helpers/lh_source_net
@@ -33,7 +33,7 @@ Set_defaults
Breakpoint "source_net: Init"
-if [ "${LIVE_SOURCE}" = "disabled" ]
+if [ "${LIVE_SOURCE}" != "enabled" ]
then
exit 0
fi
@@ -45,15 +45,15 @@ do
# Requiring stage file
Require_stagefile .stage/source_download
+ # Checking stage file
+ Check_stagefile .stage/source_net
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
- # Checking stage file
- Check_stagefile .stage/source_net
-
# Remove old source
if [ -f source-net.tar.gz ]
then
diff --git a/helpers/lh_source_usb b/helpers/lh_source_usb
index bec69e0..178a558 100755
--- a/helpers/lh_source_usb
+++ b/helpers/lh_source_usb
@@ -33,7 +33,7 @@ Set_defaults
Breakpoint "source_usb: Init"
-if [ "${LIVE_SOURCE}" = "disabled" ]
+if [ "${LIVE_SOURCE}" != "enabled" ]
then
exit 0
fi
@@ -45,15 +45,15 @@ do
# Requiring stage file
Require_stagefile .stage/source_download
+ # Checking stage file
+ Check_stagefile .stage/source_usb
+
# Checking lock file
Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
- # Checking stage file
- Check_stagefile .stage/source_usb
-
if [ ! -f chroot/sbin/mkdosfs ]
then
PACKAGES="${PACKAGES} dosfstools"
diff --git a/helpers/make-live b/helpers/make-live
index d92bebc..29a6067 100755
--- a/helpers/make-live
+++ b/helpers/make-live
@@ -31,13 +31,13 @@ done
# Set static variables
PROGRAM="`basename ${0}`"
DESCRIPTION="utility to build Debian Live systems"
-USAGE="${PROGRAM} [config] [--mode MODE] [--apt apt|aptitude] [--apt-ftpproxy URL] [--apt-httpproxy URL] [--apt-generic enabled|disabled] [--apt-pdiffs enabled|disabled] [--apt-recommends enabled|disabled] [--apt-secure enabled|disabled] [--bootstrap cdebootstrap|deboostrap] [--cache enabled|disabled] [--debconf-frontend dialog|readline|noninteractive] [--debconf-priority low|medium|high|critical] [--genisoimage genisoimage|mkisofs] [--losetup losetup|losetup.org] [-r|--root DIRECTORY] [-a|--architecture ARCHITECTURE] [-d|--distribution testing|unstable|etch|sid] [--distribution-config DIRECTORY] [-f|--bootstrap-flavour minimal|standard] [-m|--mirror-build URL] [--mirror-build-security URL] [--mirror-image URL] [--mirror-image-security URL] [--sections SECTION|\"SECTIONS\"] [--interactive shell|x11|xnest] [-k|--kernel-flavour FLAVOUR] [--kernel-packages PACKAGE|\"PACKAGES\"] [--keyring-packages PACKAGE|\"PACKAGES\"] [-l|--language LANGUAGE] [--packages PACKAGE|\"PACKAGES\"] [-p|--packages-lists LIST|\"LISTS\"] [--tasks TASK|\"TASKS\"] [--security enabled|disabled] [--symlinks enabled|disabled] [--sysvinit enabled|disabled] [--bootappend KERNEL_PARAMETER|\"KERNEL_PARAMETERS\"] [-e|--encryption ALGORITHM] [--username NAME] [--hostname NAME] [--filesystem ext2|plain|squashfs] [--memtest86 enabled|disabled] [--iso-volume STRING] [--server-address HOSTNAME|IP] [--server-path DIRECTORY] [--source enabled|disabled] [--bootloader grub|syslinux] [--grub-splash FILE] [--syslinux-splash FILE] [-b|--binary-image hdd|iso|usb|net] [-s|--source-image generic|hdd|iso|usb|net] [--includes PATH] [--templates PATH] [--breakpoints] [--debug] [--force] [--quiet] [--verbose]"
+USAGE="${PROGRAM} [config] [--mode MODE] [--config CONFIG] [--apt apt|aptitude] [--apt-ftpproxy URL] [--apt-httpproxy URL] [--apt-generic enabled|disabled] [--apt-pdiffs enabled|disabled] [--apt-recommends enabled|disabled] [--apt-secure enabled|disabled] [--bootstrap cdebootstrap|deboostrap] [--cache enabled|disabled] [--debconf-frontend dialog|readline|noninteractive] [--debconf-priority low|medium|high|critical] [--debconf-nowarnings yes|no] [--genisoimage genisoimage|mkisofs] [--losetup losetup|losetup.org] [-r|--root DIRECTORY] [-a|--architecture ARCHITECTURE] [-d|--distribution testing|unstable|etch|sid] [--distribution-config DIRECTORY] [-f|--bootstrap-flavour minimal|standard] [-m|--mirror-build URL] [--mirror-build-security URL] [--mirror-image URL] [--mirror-image-security URL] [--sections SECTION|\"SECTIONS\"] [--interactive shell|x11|xnest] [-k|--kernel-flavour FLAVOUR] [--kernel-packages PACKAGE|\"PACKAGES\"] [--keyring-packages PACKAGE|\"PACKAGES\"] [--hooks \"COMMAND\"|\"COMMANDS\"] [-l|--language LANGUAGE] [--packages PACKAGE|\"PACKAGES\"] [-p|--packages-lists LIST|\"LISTS\"] [--tasks TASK|\"TASKS\"] [--security enabled|disabled] [--symlinks enabled|disabled] [--sysvinit enabled|disabled] [--bootappend KERNEL_PARAMETER|\"KERNEL_PARAMETERS\"] [-e|--encryption ALGORITHM] [--username NAME] [--hostname NAME] [--filesystem ext2|plain|squashfs] [--memtest memtest86|memtest86+] [--iso-volume STRING] [--server-address HOSTNAME|IP] [--server-path DIRECTORY] [--source enabled|disabled] [--bootloader grub|syslinux] [--grub-splash FILE] [--syslinux-splash FILE] [-b|--binary-image hdd|iso|usb|net] [-s|--source-image generic|hdd|iso|usb|net] [--includes PATH] [--templates PATH] [--breakpoints] [--debug] [--force] [--quiet] [--verbose]"
HELP="Lists: gnome, gnome-core, gnome-desktop, gnome-full, gnome-junior, gnustep, kde, kde-core, kde-desktop, kde-extra, kde-full, kde-junior, mini, minimal, minimal-net, rescue, standard, standard-x11, xfce, xfce-desktop, xfce-junior"
Local_arguments ()
{
- ARGUMENTS="`getopt --longoptions mode:,apt:,apt-ftpproxy:,apt-httpproxy:,apt-generic:,apt-pdiffs:,apt-recommends:,apt-secure:,bootstrap:,cache:,debconf-frontend:,debconf-priority:,genisoimage:,losetup:,root:,architecture:,distribution:,distribution-config:,flavour:,mirror-local:,mirror-local-security:,mirror-generic:,mirror-generic-security:,sections:,interactive:,kernel:,kernel-packages:,keyring-packages:,language:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,bootappend:,encryption:,username:,hostname:,filesystem:,memtest86:,iso-volume:,server-address:,server-path:,source:,bootloader:,grub-splash:,syslinux-splash:,binary-image:,binary-source:,includes:,templates:,help,usage,version,force,breakpoints,debug,quiet,verbose --name=${PROGRAM} --options r:a:d:f:m:k:l:p:e:b:s:huv --shell sh -- "${@}"`"
+ ARGUMENTS="`getopt --longoptions mode:,config:,apt:,apt-ftpproxy:,apt-httpproxy:,apt-generic:,apt-pdiffs:,apt-recommends:,apt-secure:,bootstrap:,cache:,debconf-frontend:,debconf-priority:,debconf-nowarnings:,genisoimage:,losetup:,root:,architecture:,distribution:,distribution-config:,flavour:,mirror-build:,mirror-build-security:,mirror-image:,mirror-image-security:,sections:,interactive:,kernel:,kernel-packages:,keyring-packages:,hooks:,language:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,bootappend:,encryption:,username:,hostname:,filesystem:,memtest:,iso-volume:,server-address:,server-path:,source:,bootloader:,grub-splash:,syslinux-splash:,binary-image:,binary-source:,includes:,templates:,help,usage,version,force,breakpoints,debug,quiet,verbose --name=${PROGRAM} --options r:a:d:f:m:k:l:p:e:b:s:huv --shell sh -- "${@}"`"
if [ "${?}" != "0" ]
then
@@ -60,6 +60,10 @@ Local_arguments ()
LH_MODE="${2}"; shift 2
;;
+ --config)
+ LH_CONFIG="${2}"; shift 2
+ ;;
+
--apt)
LH_APT="${2}"; shift 2
;;
@@ -104,6 +108,10 @@ Local_arguments ()
LH_DEBCONF_PRIORITY="${2}"; shift 2
;;
+ --debconf-nowarnings)
+ LH_DEBCONF_NOWARNINGS="${2}"; shift 2
+ ;;
+
--genisoimage)
LH_GENISOIMAGE="${2}"; shift 2
;;
@@ -171,6 +179,10 @@ Local_arguments ()
LIVE_KEYRING_PACKAGS="${2}"; shift 2
;;
+ --hooks)
+ LIVE_HOOKS="${2}"; shift 2
+ ;;
+
-l|--language)
LIVE_LANGUAGE="${2}"; shift 2
;;
@@ -220,8 +232,8 @@ Local_arguments ()
LIVE_FILESYSTEM="${2}"; shift 2
;;
- --memtest86)
- LIVE_MEMTEST86="${2}"; shift 2
+ --memtest)
+ LIVE_MEMTEST="${2}"; shift 2
;;
--iso-volume)
@@ -333,7 +345,7 @@ Main ()
Local_arguments "${@}"
# Configuring (this is really shit!)
- LH_MODE="${LH_MODE}" LH_APT="${LH_APT}" LH_APT_FTPPROXY="${LH_APT_FTPPROXY}" LH_APT_HTTPPROXY="${LH_APT_HTTPPROXY}" LH_APT_GENERIC="${LH_APT_GENERIC}" LH_APT_PDIFFS="${LH_APT_PDIFFS}" LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS}" LH_APT_SECURE="${LH_APT_SECURE}" LH_BOOTSTRAP="${LH_BOOTSTRAP}" LH_CACHE="${LH_CACHE}" LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}" LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}" LH_GENISOIMAGE="${LH_GENISOIMAGE}" LIVE_ROOT="${LIVE_ROOT}" LIVE_ARCHITECTURE="${LIVE_ARCHITECTURE}" LIVE_DISTRIBUTION="${LIVE_DISTRIBUTION}" LIVE_DISTRIBUTION_CONFIG="${LIVE_DISTRIBUTION_CONFIG}" LIVE_BOOTSTRAP_FLAVOUR="${LIVE_BOOTSTRAP_FLAVOUR}" LIVE_MIRROR_BUILD="${LIVE_MIRROR_BUILD}" LIVE_MIRROR_BUILD_SECURITY="${LIVE_MIRROR_BUILD_SECURITY}" LIVE_MIRROR_IMAGE="${LIVE_MIRROR_IMAGE}" LIVE_MIRROR_IMAGE_SECURITY="${LIVE_MIRROR_IMAGE_SECURITY}" LIVE_SECTIONS="${LIVE_SECTIONS}" LIVE_INTERACTIVE="${LIVE_INTERACTIVE}" LIVE_KERNEL_FLAVOUR="${LIVE_KERNEL_FLAVOUR}" LIVE_KERNEL_PACKAGES="${LIVE_KERNEL_PACKAGES}" LIVE_KEYRING_PACKAGES="${LIVE_KEYRING_PACKAGES}" LIVE_LANGUAGE="${LIVE_LANGUAGE}" LIVE_PACKAGES="${LIVE_PACKAGES}" LIVE_PACKAGES_LISTS="${LIVE_PACKAGES_LISTS}" LIVE_TASKS="${LIVE_TASKS}" LIVE_SECURITY="${LIVE_SECURITY}" LIVE_SYMLINKS="${LIVE_SYMLINKS}" LIVE_SYSVINIT="${LIVE_SYSVINIT}" LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND}" LIVE_ENCRYPTION="${LIVE_ENCRYPTION}" LIVE_USERNAME="${LIVE_USERNAME}" LIVE_HOSTNAME="${LIVE_HOSTNAME}" LIVE_FILESYSTEM="${LIVE_FILESYSTEM}" LIVE_MEMTEST86="${LIVE_MEMTEST86}" LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}" LIVE_SERVER_ADDRESS="${LIVE_SERVER_ADDRESS}" LIVE_SERVER_PATH="${LIVE_SERVER_PATH}" LIVE_SOURCE="${LIVE_SOURCE}" LIVE_BOOTLOADER="${LIVE_BOOTLOADER}" LIVE_GRUB_SPLASH="${LIVE_GRUB_SPLASH}" LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}" LIVE_BINARY_IMAGE="${LIVE_BINARY_IMAGE}" LIVE_SOURCE_IMAGE="${LIVE_SOURCE_IMAGE}" LIVE_INCLUDES="${LIVE_INCLUDES}" LIVE_TEMPLATES="${LIVE_TEMPLATES}" lh_config newconfig
+ LH_MODE="${LH_MODE}" LH_CONFIG="${LH_CONFIG}" LH_APT="${LH_APT}" LH_APT_FTPPROXY="${LH_APT_FTPPROXY}" LH_APT_HTTPPROXY="${LH_APT_HTTPPROXY}" LH_APT_GENERIC="${LH_APT_GENERIC}" LH_APT_PDIFFS="${LH_APT_PDIFFS}" LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS}" LH_APT_SECURE="${LH_APT_SECURE}" LH_BOOTSTRAP="${LH_BOOTSTRAP}" LH_CACHE="${LH_CACHE}" LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}" LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}" LH_DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}" LH_GENISOIMAGE="${LH_GENISOIMAGE}" LIVE_ROOT="${LIVE_ROOT}" LIVE_ARCHITECTURE="${LIVE_ARCHITECTURE}" LIVE_DISTRIBUTION="${LIVE_DISTRIBUTION}" LIVE_DISTRIBUTION_CONFIG="${LIVE_DISTRIBUTION_CONFIG}" LIVE_BOOTSTRAP_FLAVOUR="${LIVE_BOOTSTRAP_FLAVOUR}" LIVE_MIRROR_BUILD="${LIVE_MIRROR_BUILD}" LIVE_MIRROR_BUILD_SECURITY="${LIVE_MIRROR_BUILD_SECURITY}" LIVE_MIRROR_IMAGE="${LIVE_MIRROR_IMAGE}" LIVE_MIRROR_IMAGE_SECURITY="${LIVE_MIRROR_IMAGE_SECURITY}" LIVE_SECTIONS="${LIVE_SECTIONS}" LIVE_INTERACTIVE="${LIVE_INTERACTIVE}" LIVE_KERNEL_FLAVOUR="${LIVE_KERNEL_FLAVOUR}" LIVE_KERNEL_PACKAGES="${LIVE_KERNEL_PACKAGES}" LIVE_KEYRING_PACKAGES="${LIVE_KEYRING_PACKAGES}" LIVE_HOOKS="${LIVE_HOOKS}" LIVE_LANGUAGE="${LIVE_LANGUAGE}" LIVE_PACKAGES="${LIVE_PACKAGES}" LIVE_PACKAGES_LISTS="${LIVE_PACKAGES_LISTS}" LIVE_TASKS="${LIVE_TASKS}" LIVE_SECURITY="${LIVE_SECURITY}" LIVE_SYMLINKS="${LIVE_SYMLINKS}" LIVE_SYSVINIT="${LIVE_SYSVINIT}" LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND}" LIVE_ENCRYPTION="${LIVE_ENCRYPTION}" LIVE_USERNAME="${LIVE_USERNAME}" LIVE_HOSTNAME="${LIVE_HOSTNAME}" LIVE_FILESYSTEM="${LIVE_FILESYSTEM}" LIVE_MEMTEST="${LIVE_MEMTEST}" LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}" LIVE_SERVER_ADDRESS="${LIVE_SERVER_ADDRESS}" LIVE_SERVER_PATH="${LIVE_SERVER_PATH}" LIVE_SOURCE="${LIVE_SOURCE}" LIVE_BOOTLOADER="${LIVE_BOOTLOADER}" LIVE_GRUB_SPLASH="${LIVE_GRUB_SPLASH}" LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}" LIVE_BINARY_IMAGE="${LIVE_BINARY_IMAGE}" LIVE_SOURCE_IMAGE="${LIVE_SOURCE_IMAGE}" LIVE_INCLUDES="${LIVE_INCLUDES}" LIVE_TEMPLATES="${LIVE_TEMPLATES}" lh_config newconfig
if [ "${LH_BREAKPOINTS}" = "enabled" ]
then