summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:05:12 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:19:41 +0100
commit504c05c3a63de0af4fd0e876274afc039c5c0ed1 (patch)
tree5a29d0f82735a131c9319b5b825c57b740584d13 /helpers
parent37a5c53ddd2825bf6b0ce521908a63d419683981 (diff)
downloadlive-build-504c05c3a63de0af4fd0e876274afc039c5c0ed1.zip
live-build-504c05c3a63de0af4fd0e876274afc039c5c0ed1.tar.gz
Adding live-helper 1.0~a15-1.
Diffstat (limited to 'helpers')
-rwxr-xr-xhelpers/lh_binary1
-rwxr-xr-xhelpers/lh_binary_chroot2
-rwxr-xr-xhelpers/lh_binary_debian-installer288
-rwxr-xr-xhelpers/lh_binary_grub36
-rwxr-xr-xhelpers/lh_binary_includes17
-rwxr-xr-xhelpers/lh_binary_iso70
-rwxr-xr-xhelpers/lh_binary_linux-image18
-rwxr-xr-xhelpers/lh_binary_live-installer333
-rwxr-xr-xhelpers/lh_binary_manifest2
-rwxr-xr-xhelpers/lh_binary_memtest13
-rwxr-xr-xhelpers/lh_binary_rootfs51
-rwxr-xr-xhelpers/lh_binary_syslinux82
-rwxr-xr-xhelpers/lh_binary_usb-hdd81
-rwxr-xr-xhelpers/lh_binary_yaboot94
-rwxr-xr-xhelpers/lh_bootstrap1
-rwxr-xr-xhelpers/lh_bootstrap_cache5
-rwxr-xr-xhelpers/lh_bootstrap_clone61
-rwxr-xr-xhelpers/lh_bootstrap_copy58
-rwxr-xr-xhelpers/lh_chroot_apt6
-rwxr-xr-xhelpers/lh_chroot_cache5
-rwxr-xr-xhelpers/lh_chroot_debianchroot6
-rwxr-xr-xhelpers/lh_chroot_hosts6
-rwxr-xr-xhelpers/lh_chroot_linux-image6
-rwxr-xr-xhelpers/lh_chroot_resolv6
-rwxr-xr-xhelpers/lh_chroot_sources6
-rwxr-xr-xhelpers/lh_chroot_sysvrc6
-rwxr-xr-xhelpers/lh_clean13
-rwxr-xr-xhelpers/lh_config5
-rwxr-xr-xhelpers/make-live4
29 files changed, 900 insertions, 382 deletions
diff --git a/helpers/lh_binary b/helpers/lh_binary
index e710b33..39ba209 100755
--- a/helpers/lh_binary
+++ b/helpers/lh_binary
@@ -42,6 +42,7 @@ lh_binary_encryption ${*}
# Prepare images
lh_binary_linux-image ${*}
lh_binary_debian-installer ${*}
+lh_binary_live-installer ${*}
lh_binary_memtest ${*}
lh_binary_grub ${*}
lh_binary_syslinux ${*}
diff --git a/helpers/lh_binary_chroot b/helpers/lh_binary_chroot
index 4c81a30..a62080c 100755
--- a/helpers/lh_binary_chroot
+++ b/helpers/lh_binary_chroot
@@ -63,7 +63,7 @@ ${LH_ROOT_COMMAND} rm -rf chroot/chroot
${LH_ROOT_COMMAND} rm -rf chroot.tmp
# Copying new chroot
-${LH_ROOT_COMMAND} cp -a chroot chroot.tmp
+${LH_ROOT_COMMAND} cp -al chroot chroot.tmp
${LH_ROOT_COMMAND} mv chroot.tmp chroot/chroot
if [ -n "${LH_ROOT_COMMAND}" ]
diff --git a/helpers/lh_binary_debian-installer b/helpers/lh_binary_debian-installer
index d04ec31..de15f1c 100755
--- a/helpers/lh_binary_debian-installer
+++ b/helpers/lh_binary_debian-installer
@@ -55,32 +55,26 @@ Create_lockfile .lock
case "${LIVE_BINARY_IMAGES}" in
iso)
DESTDIR="binary/install"
- DESTDIR_INSTALLER="cdrom"
+ DI="cdrom"
;;
net)
DESTDIR="tftpboot"
- DESTDIR_INSTALLER="netboot"
+ DI="netboot"
Echo_error "Not supported yet (FIXME)"
exit 1
;;
tar|usb-hdd)
+ DESTDIR="binary/install"
+ DI="hd-media"
+
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
- if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "lenny" ]
+ if [ "${LIVE_DISTRIBUTION}" = "etch" ] && [ "${LIVE_BOOTLOADER}" = "syslinux" ]
then
- if [ "${LIVE_BOOTLOADER}" = "syslinux" ]
- then
- DESTDIR="binary"
- else
- DESTDIR="binary/install"
- fi
- else
- DESTDIR="binary/install"
+ DESTDIR="binary"
fi
-
- DESTDIR_INSTALLER="hd-media"
;;
esac
@@ -106,96 +100,71 @@ then
fi
fi
-# Downloading debian-installer
-mkdir -p "${DESTDIR}"
+VMLINUZ_DI="vmlinuz"
+INITRD_DI="initrd.gz"
+DESTDIR_DI="${DESTDIR}"
+
+VMLINUZ_GI="gtk/vmlinuz"
+INITRD_GI="gtk/initrd.gz"
+DESTDIR_GI="${DESTDIR}/gtk"
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
-if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "lenny" ]
+if [ "${LIVE_DISTRIBUTION}" = "etch" ]
then
if [ "${LIVE_BINARY_IMAGES}" = "tar" ] || [ "${LIVE_BINARY_IMAGES}" = "usb-hdd" ]
then
- if [ "${LIVE_BOOTLOADER}" = "syslinux" ]
- then
- wget --no-clobber -O "${DESTDIR}"/vmlinuz.di "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/vmlinuz
- wget --no-clobber -O "${DESTDIR}"/initrddi.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/initrd.gz
- else
- wget --no-clobber -O "${DESTDIR}"/vmlinuz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/vmlinuz
- wget --no-clobber -O "${DESTDIR}"/initrd.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/initrd.gz
- fi
- else
- wget --no-clobber -O "${DESTDIR}"/vmlinuz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/vmlinuz
- wget --no-clobber -O "${DESTDIR}"/initrd.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/initrd.gz
+ VMLINUZ_DI="vmlinuz.di"
+ INITRD_DI="initrddi.gz"
+ DESTDIR_DI="${DESTDIR}"
+
+ VMLINUZ_GI="vmlinuz.gi"
+ INITRD_GI="initrdgi.gz"
+ DESTDIR_GI="${DESTDIR}"
fi
-else
- wget --no-clobber -O "${DESTDIR}"/vmlinuz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/vmlinuz
- wget --no-clobber -O "${DESTDIR}"/initrd.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/initrd.gz
fi
+# Downloading debian-installer
+mkdir -p "${DESTDIR_DI}"
+wget --no-clobber -O "${DESTDIR}"/"${VMLINUZ_DI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/vmlinuz
+wget --no-clobber -O "${DESTDIR}"/"${INITRD_DI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/initrd.gz
+
# Downloading graphical-installer
if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
then
- # Workaround for syslinux (<< 3.36) which doesn't support long file/path names
- if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "lenny" ]
- then
- if [ "${LIVE_BINARY_IMAGES}" = "tar" ] || [ "${LIVE_BINARY_IMAGES}" = "usb-hdd" ]
- then
- if [ "${LIVE_BOOTLOADER}" = "syslinux" ]
- then
- wget --no-clobber -O "${DESTDIR}"/vmlinuz.gi "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/vmlinuz
- wget --no-clobber -O "${DESTDIR}"/initrdgi.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/initrd.gz
- else
- mkdir -p "${DESTDIR}"/gtk
-
- wget --no-clobber -O "${DESTDIR}"/gtk/vmlinuz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/vmlinuz
- wget --no-clobber -O "${DESTDIR}"/gtk/initrd.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/initrd.gz
- fi
- else
- mkdir -p "${DESTDIR}"/gtk
-
- wget --no-clobber -O "${DESTDIR}"/gtk/vmlinuz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/vmlinuz
- wget --no-clobber -O "${DESTDIR}"/gtk/initrd.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/initrd.gz
- fi
- else
- mkdir -p "${DESTDIR}"/gtk
-
- wget --no-clobber -O "${DESTDIR}"/gtk/vmlinuz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/vmlinuz
- wget --no-clobber -O "${DESTDIR}"/gtk/initrd.gz "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DESTDIR_INSTALLER}"/gtk/initrd.gz
- fi
+ mkdir -p "${DESTDIR_GI}"
+ wget --no-clobber -O "${DESTDIR}"/"${VMLINUZ_GI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/gtk/vmlinuz
+ wget --no-clobber -O "${DESTDIR}"/"${INITRD_GI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/gtk/initrd.gz
fi
-FIXME ()
-{
-# Downloading udebs
-mkdir -p binary/dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"
-cd binary/dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"
-wget "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"/Packages.gz
-gunzip -c Packages.gz > Packages
-cd "${OLDPWD}"
+# Downloading additional packages
+mkdir -p chroot/binary.deb/archives/partial
+mv chroot/var/lib/dpkg/status chroot/var/lib/dpkg/status.tmp
+touch chroot/var/lib/dpkg/status
-for DISTRIBUTION in frozen stable testing unstable
-do
- ln -s ${LIVE_DISTRIBUTION} binary/dists/${DISTRIBUTION}
-done
+case "${LIVE_ARCHITECTURE}" in
+ amd64)
+ DI_PACKAGES="linux-image-2.6-amd64 lilo grub"
+ ;;
-DEBS="`awk '/Filename: / { print $2 }' binary/dists/${LIVE_DISTRIBUTION}/main/debian-installer/binary-${LIVE_ARCHITECTURE}/Packages`"
-UDEBS="`echo ${DEBS} | grep '.*.udeb'`"
+ i386)
+ DI_PACKAGES="linux-image-2.6-486 linux-image-2.6-686 lilo grub"
+ ;;
-rm -f packages.di
+ powerpc)
+ DI_PACKAGES="linux-image-2.6-powerpc linux-image-2.6-powerpc64 linux-image-2.6-powerpc-smp linux-image-2.6-prep yaboot" # FIXME bootloader?
+ ;;
+esac
-for UDEB in ${UDEBS}
-do
- mkdir -p binary/`dirname ${UDEB}`
- cd binary/`dirname ${UDEB}`
- wget "${LIVE_MIRROR_BOOTSTRAP}"/${UDEB}
- cd "${OLDPWD}"
-done
+Chroot "apt-get -o Dir::Cache=/binary.deb --download-only install --yes ${DI_PACKAGES}"
+mv chroot/binary.deb ./
+mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
-# Downloading debs
+# Including base debian packages
if [ -d cache/packages_bootstrap ]
then
- for FILE in cache/packages_bootstrap/*.deb
+ for FILE in cache/packages_bootstrap/*.deb binary.deb/archives/*.deb
do
- SOURCE="`dpkg -f ${FILE} Source`"
+ SOURCE="`dpkg -f ${FILE} Source | awk '{ print $1 }'`"
if [ -z "${SOURCE}" ]
then
@@ -220,85 +189,120 @@ then
done
fi
+# Generating deb indices
mkdir -p binary/dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}
+cd binary
+apt-ftparchive packages pool/main > dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages
+gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages > dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages.gz
+#apt-ftparchive sources pool/main > dists/${LIVE_DISTRIBUTION}/main/source/Sources
+#gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/source/Sources > dists/${LIVE_DISTRIBUTION}/main/source/Sources
+cd "${OLDPWD}"
+
+# Writing release
cat > binary/dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Release << EOF
-Archive: ${LIVE_DISTRIBUTION}
+Archive: stable
+Version: 4.0r0
Component: main
Origin: Debian
Label: Debian
Architecture: ${LIVE_ARCHITECTURE}
EOF
-mkdir -p cache/indices_debian-installer
-
-cat > cache/indices_debian-installer/archive << EOF
-Dir
-{
- ArchiveDir "binary";
- // OverrideDir "";
- // CacheDir "";
- FileListDir "cache/indices_debian-installer";
-};
-
-Default
-{
- Packages::Compress ". gzip";
- // Packages::Extension ".deb";
- // Sources::Extensions ".dsc";
- // Contents::Compress "gzip";
- // DeLinkLimit "0";
- // FileMode "0644";
-};
-
-TreeDefault
-{
- // MaxContentsChange
- // ContentsAge
- Directory "dists/\$(DIST)/\$(SECTION)/binary-\$(ARCH)/";
- Packages "dists/\$(DIST)/\$(SECTION)/binary-\$(ARCH)/Packages";
- InternalPrefix "dists/\$(DIST)/\$(SECTION)/";
- Contents "dists/\$(DIST)/Contents-\$(ARCH)";
- // Contents::Header
- // BinCacheDB "cache.\$(DIST).\$(SECTION).\$(ARCH)";
- // FileList "filelist.\$(DIST).\$(SECTION).\$(ARCH)";
- FileList "filelist";
- // BinOverride "override.\$(DIST).\$(SECTION)";
-};
-
-tree "${LIVE_DISTRIBUTION}"
-{
- Sections "main";
- Architectures "${LIVE_ARCHITECTURE}";
-};
-EOF
+#cat > binary/dists/${LIVE_DISTRIBUTION}/main/source/Release << EOF
+#Archive: stable
+#Version: 4.0r0
+#Component: main
+#Origin: Debian
+#Label: Debian
+#Architecture: source
+#EOF
-cd binary
-find pool -name "*.deb" | sort > ../cache/indices_debian-installer/filelist
+mkdir binary.udeb
+cd binary.udeb
+
+# Downloading udeb indices
+wget "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"/Packages.gz
+gunzip -c Packages.gz > Packages
+
+# Sorting udebs
+UDEBS="`awk '/Filename: / { print $2 }' Packages`"
+
+# Downloading udebs
+DOWNLOAD=""
+for UDEB in ${UDEBS}
+do
+ DOWNLOAD="$DOWNLOAD ${LIVE_MIRROR_BOOTSTRAP}/${UDEB}"
+done
+echo $DOWNLOAD | xargs wget
+
+# Excluding udebs
+grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/udeb_exclude > exclude
+grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/exclude-udebs > exclude
+grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/exclude-udebs-${LIVE_ARCHITECTURE} >> exclude
+
+for EXCLUDE in `cat exclude`
+do
+ rm -f "${EXCLUDE}"_*.udeb
+done
+
+# Moving udebs
+for UDEB in ${UDEBS}
+do
+ if [ -f "`basename ${UDEB}`" ]
+ then
+ mkdir -p `dirname ${UDEB}`
+ mv "`basename ${UDEB}`" "`dirname ${UDEB}`"
+ fi
+done
+
+# Creating udeb indices
+mkdir -p dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"
+apt-ftparchive packages pool/main > dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"/Packages
+gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/debian-installer/binary-${LIVE_ARCHITECTURE}/Packages > dists/${LIVE_DISTRIBUTION}/main/debian-installer/binary-${LIVE_ARCHITECTURE}/Packages.gz
+
+rm -f Packages* exclude
+find . | cpio -dmpu "${OLDPWD}"/binary
cd "${OLDPWD}"
-cat > cache/indices_debian-installer/release << EOF
-APT::FTPArchive::Release::Origin "Debian";
-APT::FTPArchive::Release::Label "Debian";
-APT::FTPArchive::Release::Suite "${LIVE_DISTRIBUTION}";
-APT::FTPArchive::Release::Version "4.0";
-APT::FTPArchive::Release::Codename "${LIVE_DISTRIBUTION}";
-APT::FTPArchive::Release::Date "`date -R`";
-APT::FTPArchive::Release::Architectures "${LIVE_ARCHITECTURE}";
-APT::FTPArchive::Release::Components "main";
-EOF
+rm -rf binary.udeb
+rm -rf binary.deb
+
+# Generating release file
+apt-ftparchive \
+ -o APT::FTPArchive::Release::Origin="Debian" \
+ -o APT::FTPArchive::Release::Label="Debian" \
+ -o APT::FTPArchive::Release::Suite="${LIVE_DISTRIBUTION}" \
+ -o APT::FTPArchive::Release::Version="4.0" \
+ -o APT::FTPArchive::Release::Codename="${LIVE_DISTRIBUTION}" \
+ -o APT::FTPArchive::Release::Date="`date -R`" \
+ -o APT::FTPArchive::Release::Architectures="${LIVE_ARCHITECTURE}" \
+ -o APT::FTPArchive::Release::Components="main" \
+ -o APT::FTPArchive::Release::Description="Last updated: `date -R`" \
+release binary/dists/${LIVE_DISTRIBUTION} > binary/dists/${LIVE_DISTRIBUTION}/Release
+
+# Creating dist symlinks
+for DISTRIBUTION in frozen stable testing unstable
+do
+ ln -s ${LIVE_DISTRIBUTION} binary/dists/${DISTRIBUTION}
+done
-apt-ftparchive generate cache/indices_debian-installer/archive
-apt-ftparchive -c cache/indices_debian-installer/release -o APT::FTPArchive::Release::Description="Last updated: `date -R`" release binary/dists/${LIVE_DISTRIBUTION} > binary/dists/${LIVE_DISTRIBUTION}/Release
-}
+ln -s . binary/debian
+# Creating disk info
mkdir binary/.disk
echo "main" > binary/.disk/base_components
touch binary/.disk/base_installable
echo "not_complete" > binary/.disk/cd_type
-#echo "Debian GNU/Linux 4.0 r0 \"Etch\" - Official i386 NETINST Binary-1 20070407-11:29" > binary/.disk/info
-echo "Debian GNU/Linux ${LIVE_DISTRIBUTION} - Unofficial ${LIVE_ARCHITECTURE} NETINST Binary-1 `date +%Y%m%d-%H:%M`" > binary/.disk/info
+echo "Debian GNU/Linux ${LIVE_DISTRIBUTION} - Unofficial ${LIVE_ARCHITECTURE} LIVE Binary `date +%Y%m%d-%H:%M`" > binary/.disk/info
touch binary/.disk/mkisofs
+cat > binary/.disk/udeb_include << EOF
+netcfg
+ethdetect
+pcmcia-cs-udeb
+pcmciautils-udeb
+wireless-tools-udeb
+EOF
# Creating stage file
Create_stagefile .stage/binary_debian-installer
diff --git a/helpers/lh_binary_grub b/helpers/lh_binary_grub
index db26ae9..dc22d7f 100755
--- a/helpers/lh_binary_grub
+++ b/helpers/lh_binary_grub
@@ -194,38 +194,22 @@ fi
LINUX="`echo ${LINUX} | sed -e 's#//#/#g'`"
# Assembling debian-installer configuration
-if [ "${LIVE_DEBIAN_INSTALLER}" = "enabled" ]
+if [ "${LIVE_DEBIAN_INSTALLER}" = "enabled" ] || [ "${LIVE_LIVE_INSTALLER}" = "enabled" ]
then
LINUX="title\t\tLive:\nroot\n\n${LINUX}"
LIVE_LINUX_INSTALL="title\t\tInstaller:\nroot"
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - install\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz vga=normal -- \ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/initrd.gz"
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - install\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz vga=normal --\ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/initrd.gz"
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - installgui\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz video=vesa:ywrap,mtrr vga=788 --\ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/gtk/initrd.gz"
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
- then
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - installgui\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz video=vesa:ywrap,mtrr vga=788 -- \ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/gtk/initrd.gz"
- fi
-
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - expert\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz priority=low vga=normal -- \ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/initrd.gz"
-
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
- then
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - expertgui\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz priority=low video=vesa:ywrap,mtrr vga=788\ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/gtk/initrd.gz"
- fi
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - expert\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz priority=low vga=normal --\ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/initrd.gz"
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - expertgui\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz priority=low video=vesa:ywrap,mtrr vga=788\ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/gtk/initrd.gz"
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - rescue\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz vga=normal rescue/enable=true -- \ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/initrd.gz"
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - rescue\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz vga=normal rescue/enable=true --\ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/initrd.gz"
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - rescuegui\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz video=vesa:ywrap,mtrr vga=788 rescue/enable=true --\ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/gtk/initrd.gz"
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
- then
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - rescuegui\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz video=vesa:ywrap,mtrr vga=788 rescue/enable=true --\ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/gtk/initrd.gz"
- fi
-
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - auto\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz auto=true priority=critical vga=normal -- \ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/initrd.gz"
-
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
- then
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - autogui\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz auto=true priority=critical video=vesa:ywrap,mtrr vga=788 -- \ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/gtk/initrd.gz"
- fi
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - auto\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz auto=true priority=critical vga=normal --\ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/initrd.gz"
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\ntitle\t\tDebian GNU/Linux - autogui\nkernel\t\t/`basename ${DESTDIR_INSTALL}`/vmlinuz auto=true priority=critical video=vesa:ywrap,mtrr vga=788 --\ninitrd\t\t/`basename ${DESTDIR_INSTALL}`/gtk/initrd.gz"
fi
# Assembling memtest configuration
@@ -246,7 +230,7 @@ case ${LIVE_BINARY_IMAGES} in
;;
tar|usb-hdd)
- cp chroot/usr/lib/grub/*/stage1 chroot/usr/lib/grub/*/stage2 binary/boot/grub
+ cp chroot/usr/lib/grub/*/stage1 chroot/usr/lib/grub/*/e2fs_stage1_5 chroot/usr/lib/grub/*/stage2 binary/boot/grub
;;
esac
diff --git a/helpers/lh_binary_includes b/helpers/lh_binary_includes
index 7979dfe..0841f40 100755
--- a/helpers/lh_binary_includes
+++ b/helpers/lh_binary_includes
@@ -92,7 +92,7 @@ then
CP_OPTIONS="-L"
fi
- # Copying d-i templates
+ # Copying install templates
if [ -d "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install ] && \
ls "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install/* &> /dev/null
then
@@ -105,7 +105,7 @@ then
cp -r ${CP_OPTIONS} "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/install."${ARCH}"/* binary
fi
- # Adjusting d-i templates
+ # Adjusting install templates
DEBIAN_NAME="Debian GNU/Linux 4.0 r0 \"Etch\" - Unofficial amd64 NETINST/LIVE Binary-1"
DEBIAN_DATE="`date +%Y%m%d-%H:%M`"
@@ -122,5 +122,18 @@ then
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
+# Copying live templates
+if [ -d "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/live ] && \
+ls "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/live/* &> /dev/null
+then
+ cp -r ${CP_OPTIONS} "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/live/* binary
+fi
+
+if [ -d "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/live."${ARCH}" ] && \
+ls "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/live."${ARCH}"/* &> /dev/null
+then
+ cp -r ${CP_OPTIONS} "${LIVE_INCLUDES}"/"${LIVE_DISTRIBUTION}"/live."${ARCH}"/* binary
+fi
+
# Creating stage file
Create_stagefile .stage/binary_includes
diff --git a/helpers/lh_binary_iso b/helpers/lh_binary_iso
index 1b60024..e6c8ccc 100755
--- a/helpers/lh_binary_iso
+++ b/helpers/lh_binary_iso
@@ -92,38 +92,44 @@ fi
mv binary chroot
# Create image
-if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
-then
- case "${LIVE_BOOTLOADER}" in
- grub)
- GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -b boot/grub/stage2_eltorito"
-
- if [ "${LIVE_PACKAGES_LISTS}" = "mini" ] || [ "${LIVE_PACKAGES_LISTS}" = "minimal" ]
- then
- GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -m boot/grub/stage2_eltorito"
- fi
- ;;
-
- syslinux)
- GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -b isolinux/isolinux.bin -c isolinux/boot.cat"
-
- if [ "${LIVE_PACKAGES_LISTS}" = "mini" ] || [ "${LIVE_PACKAGES_LISTS}" = "minimal" ]
- then
- GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -m isolinux/isolinux.bin"
- fi
- ;;
-
- *)
- Echo_warning "Bootloader on your architecture not yet supported (Continuing in 5 seconds)."
- sleep 5
- ;;
- esac
-
- GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table"
-fi
-
-cat >> chroot/binary.sh << EOF
-${LH_GENISOIMAGE} ${GENISOIMAGE_OPTIONS} -o binary.iso -r -J -l -cache-inodes binary
+case "${LIVE_BOOTLOADER}" in
+ grub)
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table"
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -r -b boot/grub/stage2_eltorito"
+
+ if [ "${LIVE_PACKAGES_LISTS}" = "mini" ] || [ "${LIVE_PACKAGES_LISTS}" = "minimal" ]
+ then
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -m boot/grub/stage2_eltorito"
+ fi
+ ;;
+
+ syslinux)
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -no-emul-boot -boot-load-size 4 -boot-info-table"
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -b isolinux/isolinux.bin -c isolinux/boot.cat"
+
+ if [ "${LIVE_PACKAGES_LISTS}" = "mini" ] || [ "${LIVE_PACKAGES_LISTS}" = "minimal" ]
+ then
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -m isolinux/isolinux.bin"
+ fi
+ ;;
+
+ yaboot)
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} --iso-level 2 --netatalk -hfs -probe -map yaboot/hfs.map --chrp-boot -part -no-desktop -hfs-bless binary/yaboot -hfs-volid Debian/Live_powerpc"
+
+ if [ "${LIVE_PACKAGES_LISTS}" = "mini" ] || [ "${LIVE_PACKAGES_LISTS}" = "minimal" ]
+ then
+ GENISOIMAGE_OPTIONS="${GENISOIMAGE_OPTIONS} -m yaboot/hfs.map"
+ fi
+ ;;
+
+ *)
+ Echo_warning "Bootloader on your architecture not yet supported (Continuing in 5 seconds)."
+ sleep 5
+ ;;
+esac
+
+cat > chroot/binary.sh << EOF
+${LH_GENISOIMAGE} ${GENISOIMAGE_OPTIONS} -o binary.iso -J -l -cache-inodes binary
EOF
Chroot "sh binary.sh"
diff --git a/helpers/lh_binary_linux-image b/helpers/lh_binary_linux-image
index 306590d..c6bb3f8 100755
--- a/helpers/lh_binary_linux-image
+++ b/helpers/lh_binary_linux-image
@@ -60,17 +60,12 @@ case "${LIVE_BINARY_IMAGES}" in
;;
tar|usb-hdd)
+ DESTDIR="binary/live"
+
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
- if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "lenny" ]
+ if [ "${LIVE_DISTRIBUTION}" = "etch" ] && [ "${LIVE_BOOTLOADER}" = "syslinux" ]
then
- if [ "${LIVE_BOOTLOADER}" = "syslinux" ]
- then
- DESTDIR="binary"
- else
- DESTDIR="binary/live"
- fi
- else
- DESTDIR="binary/live"
+ DESTDIR="binary"
fi
;;
esac
@@ -84,14 +79,17 @@ then
case "${LIVE_ARCHITECTURE}" in
amd64)
DESTDIR="${DESTDIR}.amd"
+ LINUX="vmlinuz"
;;
i386)
DESTDIR="${DESTDIR}.386"
+ LINUX="vmlinuz"
;;
powerpc)
DESTDIR="${DESTDIR}.ppc"
+ LINUX="vmlinux"
;;
esac
fi
@@ -101,7 +99,7 @@ fi
mkdir -p "${DESTDIR}"
# Installing linux-image
-cp chroot/boot/vmlinuz* "${DESTDIR}"
+cp chroot/boot/"${LINUX}"* "${DESTDIR}"
cp chroot/boot/initrd.img* "${DESTDIR}"
# Creating stage file
diff --git a/helpers/lh_binary_live-installer b/helpers/lh_binary_live-installer
new file mode 100755
index 0000000..8517ceb
--- /dev/null
+++ b/helpers/lh_binary_live-installer
@@ -0,0 +1,333 @@
+#!/bin/sh
+
+# lh_binary_live-installer(1) - install live-installer 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
+
+# Including common functions
+LH_BASE="${LH_BASE:-/usr/share/live-helper}"
+
+for FUNCTION in "${LH_BASE}"/functions/*.sh
+do
+ . "${FUNCTION}"
+done
+
+# Setting static variables
+DESCRIPTION="install live-installer into binary"
+HELP=""
+USAGE="${PROGRAM} [--force]"
+
+Arguments "${@}"
+
+# Reading configuration files
+Read_conffile config/common
+Read_conffile config/bootstrap
+Read_conffile config/chroot
+Read_conffile config/binary
+Read_conffile config/source
+Set_defaults
+
+if [ "${LIVE_LIVE_INSTALLER}" != "enabled" ]
+then
+ exit 0
+fi
+
+Echo_message "Begin installing live-installer..."
+
+# Requiring stage file
+Require_stagefile .stage/bootstrap
+
+# Checking stage file
+Check_stagefile .stage/binary_live-installer
+
+# Checking lock file
+Check_lockfile .lock
+
+# Creating lock file
+Create_lockfile .lock
+
+# Setting destination directory
+case "${LIVE_BINARY_IMAGES}" in
+ iso)
+ DESTDIR="binary/install"
+ DI="cdrom"
+ ;;
+
+ net)
+ DESTDIR="tftpboot"
+ DI="netboot"
+
+ Echo_error "Not supported yet (FIXME)"
+ exit 1
+ ;;
+
+ tar|usb-hdd)
+ DESTDIR="binary/install"
+ DI="hd-media"
+
+ # Workaround for syslinux (<< 3.36) which doesn't support long file/path names
+ if [ "${LIVE_DISTRIBUTION}" = "etch" ] && [ "${LIVE_BOOTLOADER}" = "syslinux" ]
+ then
+ DESTDIR="binary"
+ fi
+ ;;
+esac
+
+# Temporary check for broken syslinux
+if [ "${LIVE_BINARY_IMAGES}" = "iso" ]
+then
+ # Assemble multi-arch
+ if [ -n "${MULTIARCH}" ]
+ then
+ case "${LIVE_ARCHITECTURE}" in
+ amd64)
+ DESTDIR="${DESTDIR}.amd"
+ ;;
+
+ i386)
+ DESTDIR="${DESTDIR}.386"
+ ;;
+
+ powerpc)
+ DESTDIR="${DESTDIR}.ppc"
+ ;;
+ esac
+ fi
+fi
+
+VMLINUZ_DI="vmlinuz"
+INITRD_DI="initrd.gz"
+DESTDIR_DI="${DESTDIR}"
+
+VMLINUZ_GI="gtk/vmlinuz"
+INITRD_GI="gtk/initrd.gz"
+DESTDIR_GI="${DESTDIR}/gtk"
+
+# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
+if [ "${LIVE_DISTRIBUTION}" = "etch" ]
+then
+ if [ "${LIVE_BINARY_IMAGES}" = "tar" ] || [ "${LIVE_BINARY_IMAGES}" = "usb-hdd" ]
+ then
+ VMLINUZ_DI="vmlinuz.di"
+ INITRD_DI="initrddi.gz"
+ DESTDIR_DI="${DESTDIR}"
+
+ VMLINUZ_GI="vmlinuz.gi"
+ INITRD_GI="initrdgi.gz"
+ DESTDIR_GI="${DESTDIR}"
+ fi
+fi
+
+# Downloading debian-installer
+mkdir -p "${DESTDIR_DI}"
+wget --no-clobber -O "${DESTDIR}"/"${VMLINUZ_DI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/vmlinuz
+wget --no-clobber -O "${DESTDIR}"/"${INITRD_DI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/initrd.gz
+
+# Downloading graphical-installer
+if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
+then
+ mkdir -p "${DESTDIR_GI}"
+ wget --no-clobber -O "${DESTDIR}"/"${VMLINUZ_GI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/gtk/vmlinuz
+ wget --no-clobber -O "${DESTDIR}"/"${INITRD_GI}" "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/installer-"${LIVE_ARCHITECTURE}"/current/images/"${DI}"/gtk/initrd.gz
+fi
+
+# Downloading additional packages
+mkdir -p chroot/binary.deb/archives/partial
+mv chroot/var/lib/dpkg/status chroot/var/lib/dpkg/status.tmp
+touch chroot/var/lib/dpkg/status
+
+case "${LIVE_ARCHITECTURE}" in
+ amd64)
+ DI_PACKAGES="linux-image-2.6-amd64 lilo grub"
+ ;;
+
+ i386)
+ DI_PACKAGES="linux-image-2.6-486 linux-image-2.6-686 lilo grub"
+ ;;
+
+ powerpc)
+ DI_PACKAGES="linux-image-2.6-powerpc linux-image-2.6-powerpc64 linux-image-2.6-powerpc-smp linux-image-2.6-prep yaboot" # FIXME bootloader?
+ ;;
+esac
+
+Chroot "apt-get -o Dir::Cache=/binary.deb --download-only install --yes ${DI_PACKAGES}"
+mv chroot/binary.deb ./
+mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
+
+# Including base debian packages
+if [ -d cache/packages_bootstrap ]
+then
+ for FILE in cache/packages_bootstrap/*.deb binary.deb/archives/*.deb
+ do
+ SOURCE="`dpkg -f ${FILE} Source | awk '{ print $1 }'`"
+
+ if [ -z "${SOURCE}" ]
+ then
+ SOURCE="`basename ${FILE} | awk -F_ '{ print $1 }'`"
+ fi
+
+ case "${SOURCE}" in
+ lib?*)
+ LETTER="`echo ${SOURCE} | sed 's/\(....\).*/\1/'`"
+ ;;
+
+ *)
+ LETTER="`echo ${SOURCE} | sed 's/\(.\).*/\1/'`"
+ ;;
+ esac
+
+ # Install directory
+ mkdir -p binary/pool/main/"${LETTER}"/"${SOURCE}"
+
+ # Move files
+ cp "${FILE}" binary/pool/main/"${LETTER}"/"${SOURCE}"
+ done
+fi
+
+# Generating deb indices
+mkdir -p binary/dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}
+
+cd binary
+apt-ftparchive packages pool/main > dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages
+gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages > dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Packages.gz
+#apt-ftparchive sources pool/main > dists/${LIVE_DISTRIBUTION}/main/source/Sources
+#gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/source/Sources > dists/${LIVE_DISTRIBUTION}/main/source/Sources
+cd "${OLDPWD}"
+
+# Fetching release
+wget http://"${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/binary-"${LIVE_ARCHITECTURE}"/Release -O binary/dists/${LIVE_DISTRIBUTION}/main/binary-${LIVE_ARCHITECTURE}/Release
+
+#cat > binary/dists/${LIVE_DISTRIBUTION}/main/source/Release << EOF
+#Archive: stable
+#Version: 4.0r0
+#Component: main
+#Origin: Debian
+#Label: Debian
+#Architecture: source
+#EOF
+
+mkdir binary.udeb
+cd binary.udeb
+
+# Downloading udeb indices
+wget "${LIVE_MIRROR_BOOTSTRAP}"/dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"/Packages.gz
+gunzip -c Packages.gz > Packages
+
+# Sorting udebs
+UDEBS="`awk '/Filename: / { print $2 }' Packages`"
+
+# Downloading udebs
+for UDEB in ${UDEBS}
+do
+ wget "${LIVE_MIRROR_BOOTSTRAP}"/${UDEB}
+done
+
+# Including local udebs
+if ls ../config/binary_local-udebs/* &> /dev/null
+then
+ for FILE in ../config/binary_local-udebs/*.udeb
+ do
+ SOURCE="`dpkg -f ${FILE} Source | awk '{ print $1 }'`"
+
+ if [ -z "${SOURCE}" ]
+ then
+ SOURCE="`basename ${FILE} | awk -F_ '{ print $1 }'`"
+ fi
+
+ case "${SOURCE}" in
+ lib?*)
+ LETTER="`echo ${SOURCE} | sed 's/\(....\).*/\1/'`"
+ ;;
+
+ *)
+ LETTER="`echo ${SOURCE} | sed 's/\(.\).*/\1/'`"
+ ;;
+ esac
+
+ # Install directory
+ mkdir -p pool/main/"${LETTER}"/"${SOURCE}"
+
+ # Copy files
+ cp "${FILE}" pool/main/"${LETTER}"/"${SOURCE}"
+
+ # Prefere local udebs over downloaded udebs
+ rm -f "`basename ${FILE} | awk -F_ '{ print $1 }'`"_*.udeb
+ done
+fi
+
+# Excluding udebs
+grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/udeb_exclude > exclude
+grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/exclude-udebs > exclude
+grep -v "^#" ${LH_BASE:-/usr/share/live-helper}/data/debian-cd/"${LIVE_DISTRIBUTION}"/exclude-udebs-${LIVE_ARCHITECTURE} >> exclude
+
+for EXCLUDE in `cat exclude`
+do
+ rm -f "${EXCLUDE}"_*.udeb
+done
+
+# Moving udebs
+for UDEB in ${UDEBS}
+do
+ if [ -f "`basename ${UDEB}`" ]
+ then
+ mkdir -p `dirname ${UDEB}`
+ mv "`basename ${UDEB}`" "`dirname ${UDEB}`"
+ fi
+done
+
+# Creating udeb indices
+mkdir -p dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"
+apt-ftparchive packages pool/main > dists/"${LIVE_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_ARCHITECTURE}"/Packages
+gzip -9 -c dists/${LIVE_DISTRIBUTION}/main/debian-installer/binary-${LIVE_ARCHITECTURE}/Packages > dists/${LIVE_DISTRIBUTION}/main/debian-installer/binary-${LIVE_ARCHITECTURE}/Packages.gz
+
+rm -f Packages* exclude
+find . | cpio -dmpu "${OLDPWD}"/binary
+cd "${OLDPWD}"
+
+rm -rf binary.udeb
+rm -rf binary.deb
+
+# Generating release file
+apt-ftparchive \
+ -o APT::FTPArchive::Release::Origin="Debian" \
+ -o APT::FTPArchive::Release::Label="Debian" \
+ -o APT::FTPArchive::Release::Suite="${LIVE_DISTRIBUTION}" \
+ -o APT::FTPArchive::Release::Version="4.0" \
+ -o APT::FTPArchive::Release::Codename="${LIVE_DISTRIBUTION}" \
+ -o APT::FTPArchive::Release::Date="`date -R`" \
+ -o APT::FTPArchive::Release::Architectures="${LIVE_ARCHITECTURE}" \
+ -o APT::FTPArchive::Release::Components="main" \
+ -o APT::FTPArchive::Release::Description="Last updated: `date -R`" \
+release binary/dists/${LIVE_DISTRIBUTION} > binary/dists/${LIVE_DISTRIBUTION}/Release
+
+# Creating dist symlinks
+for DISTRIBUTION in frozen stable testing unstable
+do
+ ln -s ${LIVE_DISTRIBUTION} binary/dists/${DISTRIBUTION}
+done
+
+ln -s . binary/debian
+
+# Creating disk info
+mkdir binary/.disk
+echo "main" > binary/.disk/base_components
+touch binary/.disk/base_installable
+echo "not_complete" > binary/.disk/cd_type
+echo "Debian GNU/Linux ${LIVE_DISTRIBUTION} - Unofficial ${LIVE_ARCHITECTURE} LIVE Binary `date +%Y%m%d-%H:%M`" > binary/.disk/info
+touch binary/.disk/mkisofs
+cat > binary/.disk/udeb_include << EOF
+netcfg
+ethdetect
+pcmcia-cs-udeb
+pcmciautils-udeb
+wireless-tools-udeb
+live-installer
+EOF
+
+# Creating stage file
+Create_stagefile .stage/binary_debian-installer
diff --git a/helpers/lh_binary_manifest b/helpers/lh_binary_manifest
index 0016f19..0ff6fa6 100755
--- a/helpers/lh_binary_manifest
+++ b/helpers/lh_binary_manifest
@@ -60,7 +60,7 @@ esac
Chroot "dpkg --get-selections" | awk '{ print $1 }' | sort -u > binary/${INITFS}/filesystem.manifest
# Add packages.list
-Chroot "dpkg -l" > packages.txt
+Chroot "dpkg -l" > binary/packages.txt
# Creating stage file
Create_stagefile .stage/binary_manifest
diff --git a/helpers/lh_binary_memtest b/helpers/lh_binary_memtest
index 0ab2c4e..329f566 100755
--- a/helpers/lh_binary_memtest
+++ b/helpers/lh_binary_memtest
@@ -82,17 +82,12 @@ case "${LIVE_BINARY_IMAGES}" in
;;
tar|usb-hdd)
+ DESTDIR="binary/live"
+
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
- if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "lenny" ]
+ if [ "${LIVE_DISTRIBUTION}" = "etch" ] && [ "${LIVE_BOOTLOADER}" = "syslinux" ]
then
- if [ "${LIVE_BOOTLOADER}" = "syslinux" ]
- then
- DESTDIR="binary"
- else
- DESTDIR="binary/live"
- fi
- else
- DESTDIR="binary/live"
+ DESTDIR="binary"
fi
;;
esac
diff --git a/helpers/lh_binary_rootfs b/helpers/lh_binary_rootfs
index 455b1ab..f2a00f3 100755
--- a/helpers/lh_binary_rootfs
+++ b/helpers/lh_binary_rootfs
@@ -47,6 +47,16 @@ Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
+case "${LIVE_ARCHITECTURE}" in
+ amd64|i386)
+ LINUX="vmlinuz"
+ ;;
+
+ powerpc)
+ LINUX="vmlinux"
+ ;;
+esac
+
case "${LH_INITRAMFS}" in
casper)
INITFS="casper"
@@ -60,6 +70,28 @@ esac
# Creating directory
mkdir -p binary/${INITFS}
+for STAGE in ${LH_CACHE_STAGES}
+do
+ if [ "${STAGE}" = "rootfs" ] && [ -d cache/stages_rootfs ]
+ then
+ # Removing old chroot
+ rm -rf binary/"${INITFS}"/filesystem.*
+
+ # Restoring old cache
+ mkdir -p binary/"${INITFS}"
+ ${LH_ROOT_COMMAND} cp -a cache/stages_rootfs/filesystem.* binary/"${INITFS}"
+
+ if [ -n "${LH_ROOT_COMMAND}" ]
+ then
+ ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` binary
+ fi
+
+ # Creating stage file
+ Create_stagefile .stage/binary_rootfs
+ exit 0
+ fi
+done
+
case "${LIVE_CHROOT_FILESYSTEM}" in
ext2)
# Checking depends
@@ -121,7 +153,7 @@ case "${LIVE_CHROOT_FILESYSTEM}" in
if [ "${LIVE_PACKAGES_LISTS}" != "minimal" ] && [ "${LIVE_PACKAGES_LISTS}" != "mini" ]
then
- MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -e chroot/boot/vmlinuz* chroot/boot/initrd.img* chroot/vmlinuz* chroot/initrd.img* chroot/boot/config-* chroot/boot/System.map-*"
+ MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -e chroot/boot/${LINUX}* chroot/boot/initrd.img* chroot/${LINUX}* chroot/initrd.img* chroot/boot/config-* chroot/boot/System.map-*"
fi
if [ -f config/binary_rootfs/squashfs.sort ]
@@ -147,5 +179,22 @@ case "${LIVE_CHROOT_FILESYSTEM}" in
;;
esac
+for STAGE in ${LH_CACHE_STAGES}
+do
+ if [ "${STAGE}" = "rootfs" ]
+ then
+ rm -rf cache/stages_rootfs
+
+ mkdir -p cache/stages_rootfs
+
+ ${LH_ROOT_COMMAND} cp -a binary/"${INITFS}"/filesystem.* cache/stages_rootfs
+
+ if [ -n "${LH_ROOT_COMMAND}" ]
+ then
+ ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` cache/stages_rootfs
+ fi
+ fi
+done
+
# Creating stage file
Create_stagefile .stage/binary_rootfs
diff --git a/helpers/lh_binary_syslinux b/helpers/lh_binary_syslinux
index 977796d..d736d5f 100755
--- a/helpers/lh_binary_syslinux
+++ b/helpers/lh_binary_syslinux
@@ -104,14 +104,14 @@ case "${LIVE_BINARY_IMAGES}" in
;;
tar|usb-hdd)
+ DESTDIR_LIVE="binary/live"
+ DESTDIR_INSTALL="binary/install"
+
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
- if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "lenny" ]
+ if [ "${LIVE_DISTRIBUTION}" = "etch" ]
then
DESTDIR_LIVE="binary"
DESTDIR_INSTALL="binary"
- else
- DESTDIR_LIVE="binary/live"
- DESTDIR_INSTALL="binary/install"
fi
;;
esac
@@ -233,10 +233,16 @@ fi
LINUX="`echo ${LINUX} | sed -e 's#//#/#g'`"
# Assembling debian-installer configuration
-if [ "${LIVE_DEBIAN_INSTALLER}" = "enabled" ]
+if [ "${LIVE_DEBIAN_INSTALLER}" = "enabled" ] || [ "${LIVE_LIVE_INSTALLER}" = "enabled" ]
then
+ VMLINUZ_DI="vmlinuz"
+ INITRD_DI="initrd.gz"
+
+ VMLINUZ_GI="gtk/vmlinuz"
+ INITRD_GI="gtk/initrd.gz"
+
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
- if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "lenny" ]
+ if [ "${LIVE_DISTRIBUTION}" = "etch" ]
then
if [ "${LIVE_BINARY_IMAGES}" = "tar" ] || [ "${LIVE_BINARY_IMAGES}" = "usb-hdd" ]
then
@@ -245,19 +251,7 @@ then
VMLINUZ_GI="vmlinuz.gi"
INITRD_GI="initrdgi.gz"
- else
- VMLINUZ_DI="vmlinuz"
- INITRD_DI="initrd.gz"
-
- VMLINUZ_GI="gtk/vmlinuz"
- INITRD_GI="gtk/initrd.gz"
fi
- else
- VMLINUZ_DI="vmlinuz"
- INITRD_DI="initrd.gz"
-
- VMLINUZ_GI="gtk/vmlinuz"
- INITRD_GI="gtk/initrd.gz"
fi
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
@@ -265,61 +259,29 @@ then
then
LIVE_LINUX_INSTALL="LABEL install\n\tkernel ${VMLINUZ_DI}\n\tappend vga=normal initrd=${INITRD_DI} -- "
LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL linux\n\tkernel ${VMLINUZ_DI}\n\tappend vga=normal initrd=${INITRD_DI} -- "
-
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
- then
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL installgui\n\tkernel ${VMLINUZ_GI}\n\tappend video=vesa:ywrap,mtrr vga=788 initrd=${INITRD_GI} -- "
- fi
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL installgui\n\tkernel ${VMLINUZ_GI}\n\tappend video=vesa:ywrap,mtrr vga=788 initrd=${INITRD_GI} -- "
LIVE_KENREL_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL expert\n\tkernel ${VMLINUZ_DI}\n\tappend priority=low vga=normal initrd=${INITRD_DI} -- "
-
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
- then
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL expertgui\n\tkernel ${VMLINUZ_GI}\n\tappend priority=low video=vesa:ywrap,mtrr vga=788 initrd=${INITRD_GI} -- "
- fi
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL expertgui\n\tkernel ${VMLINUZ_GI}\n\tappend priority=low video=vesa:ywrap,mtrr vga=788 initrd=${INITRD_GI} -- "
LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL rescue\n\tkernel ${VMLINUZ_DI}\n\tappend vga=normal initrd=${INITRD_DI} rescue/enable=true -- "
-
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
- then
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL rescuegui\n\tkernel ${VMLINUZ_GI}\n\tappend video=vesa:ywrap,mtrr vga=788 initrd=${INITRD_GI} rescue/enable=true -- "
- fi
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL rescuegui\n\tkernel ${VMLINUZ_GI}\n\tappend video=vesa:ywrap,mtrr vga=788 initrd=${INITRD_GI} rescue/enable=true -- "
LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL auto\n\tkernel ${VMLINUZ_DI}\n\tappend auto=true priority=critical vga=normal initrd=${INITRD_DI} -- "
-
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
- then
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL autogui\n\tkernel ${VMLINUZ_GI}\n\tappend auto=true priority=critical video=vesa:ywrap,mtrr vga=788 initrd=${INITRD_GI} -- "
- fi
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL autogui\n\tkernel ${VMLINUZ_GI}\n\tappend auto=true priority=critical video=vesa:ywrap,mtrr vga=788 initrd=${INITRD_GI} -- "
else
LIVE_LINUX_INSTALL="LABEL install\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_DI}\n\tappend vga=normal initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_DI} -- "
LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL linux\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_DI}\n\tappend vga=normal initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_DI} -- "
-
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
- then
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL installgui\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_GI}\n\tappend video=vesa:ywrap,mtrr vga=788 initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_GI} -- "
- fi
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL installgui\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_GI}\n\tappend video=vesa:ywrap,mtrr vga=788 initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_GI} -- "
LIVE_KENREL_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL expert\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_DI}\n\tappend priority=low vga=normal initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_DI} -- "
-
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
- then
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL expertgui\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_GI}\n\tappend priority=low video=vesa:ywrap,mtrr vga=788 initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_GI} -- "
- fi
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL expertgui\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_GI}\n\tappend priority=low video=vesa:ywrap,mtrr vga=788 initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_GI} -- "
LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL rescue\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_DI}\n\tappend vga=normal initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_DI} rescue/enable=true -- "
-
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
- then
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL rescuegui\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_GI}\n\tappend video=vesa:ywrap,mtrr vga=788 initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_GI} rescue/enable=true -- "
- fi
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL rescuegui\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_GI}\n\tappend video=vesa:ywrap,mtrr vga=788 initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_GI} rescue/enable=true -- "
LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL auto\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_DI}\n\tappend auto=true priority=critical vga=normal initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_DI} -- "
-
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ] || [ "${LIVE_ARCHITECTURE}" = "powerpc" ]
- then
- LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL autogui\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_GI}\n\tappend auto=true priority=critical video=vesa:ywrap,mtrr vga=788 initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_GI} -- "
- fi
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL autogui\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_GI}\n\tappend auto=true priority=critical video=vesa:ywrap,mtrr vga=788 initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_GI} -- "
fi
fi
@@ -451,7 +413,7 @@ case "${LIVE_BINARY_IMAGES}" in
tar|usb-hdd)
# Workaround for syslinux (<< 3.36) which doesn't support dedicated directory
- if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "lenny" ]
+ if [ "${LIVE_DISTRIBUTION}" = "etch" ]
then
DESTDIR="binary"
else
@@ -491,7 +453,7 @@ case "${LIVE_BINARY_IMAGES}" in
rm -f "${DESTDIR}"/pxelinux.cfg
# Workaround for syslinux (<< 3.36) which doesn't support long file/path names
- if [ "${LIVE_DISTRIBUTION}" = "etch" ] || [ "${LIVE_DISTRIBUTION}" = "lenny" ]
+ if [ "${LIVE_DISTRIBUTION}" = "etch" ]
then
if [ "`echo ${LIVE_LINUX_FLAVOURS} | wc -w`" -gt "1" ]
then
diff --git a/helpers/lh_binary_usb-hdd b/helpers/lh_binary_usb-hdd
index 49f8e8e..a417238 100755
--- a/helpers/lh_binary_usb-hdd
+++ b/helpers/lh_binary_usb-hdd
@@ -79,7 +79,7 @@ fi
# Everything which comes here needs to be cleaned up,
DU_DIM="`du -ms binary | cut -f1`"
REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 50`" # Just 2% more to be sure, need something more sophistcated here...
-dd if=/dev/zero of=binary.img bs=1024k count=${REAL_DIM}
+dd if=/dev/zero of=chroot/binary.img bs=1024k count=${REAL_DIM}
FREELO="`${LH_LOSETUP} -f`"
if [ ! -b chroot/${FREELO} ]
then
@@ -90,40 +90,59 @@ then
fi
echo "!!! The following error/warning messages can be ignored !!!"
-lh_losetup $FREELO binary.img 0
+lh_losetup $FREELO chroot/binary.img 0
Chroot "parted -s ${FREELO} mklabel msdos" || true
Chroot "parted -s ${FREELO} mkpartfs primary fat16 0.0 100%" || true
Chroot "parted -s ${FREELO} set 1 boot on" || true
Chroot "parted -s ${FREELO} set 1 lba off" || true
-case "${LIVE_BOOTLOADER}" in
- grub)
- #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)
- cat chroot/usr/lib/syslinux/mbr.bin > ${FREELO}
- ;;
-esac
+if [ "${LIVE_BOOTLOADER}" = "syslinux" ]
+then
+ cat chroot/usr/lib/syslinux/mbr.bin > ${FREELO}
+fi
${LH_LOSETUP} -d ${FREELO}
FREELO="`${LH_LOSETUP} -f`"
-lh_losetup $FREELO binary.img 1
+lh_losetup $FREELO chroot/binary.img 1
Chroot " mkfs.vfat -F 16 -n DEBIAN_LIVE ${FREELO}"
-mkdir -p binary.tmp
-${LH_ROOT_COMMAND} mount ${FREELO} binary.tmp
-cp -r binary/* binary.tmp
-${LH_ROOT_COMMAND} umount binary.tmp
-rmdir binary.tmp
+mkdir -p chroot/binary.tmp
+${LH_ROOT_COMMAND} mount ${FREELO} chroot/binary.tmp
+cp -r binary/* chroot/binary.tmp
+
+FIXME()
+{
+if [ "${LIVE_BOOTLOADER}" = "grub" ]
+then
+
+cat > chroot/grub.sh << EOF
+cd binary.tmp
+grub --batch << EOM
+find /live/vmlinuz
+EOM
+EOF
+
+ rootpartition="`Chroot 'sh grub.sh' 2>/dev/null | grep -A 1 'find /live/vmlinuz' | grep -v 'find /live/vmlinuz'`"
+ usbdev="`echo $rootpartition | sed -e 's/,[[:digit:]]//'`"
+ echo "Root partition is $rootpartition, device is: $usbdev"
+
+ echo "WAITING..." && read
+
+#cat > chroot/grub.sh << EOF
+#grub --batch << EOM
+#root $rootpartition
+#setup $usbdev
+#EOM
+#EOF
+
+#Chroot "sh grub.sh"
+
+ rm -f chroot/grub.sh
+fi
+}
+
+${LH_ROOT_COMMAND} umount chroot/binary.tmp
+rmdir chroot/binary.tmp
if [ "${LIVE_BOOTLOADER}" = "syslinux" ]
then
@@ -132,16 +151,6 @@ 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}" ]
@@ -150,6 +159,8 @@ then
mv chroot/dev.tmp chroot/dev
fi
+mv chroot/binary.img ./
+
# Removing depends
Remove_package
diff --git a/helpers/lh_binary_yaboot b/helpers/lh_binary_yaboot
index d368692..fea812e 100755
--- a/helpers/lh_binary_yaboot
+++ b/helpers/lh_binary_yaboot
@@ -54,7 +54,7 @@ Create_lockfile .lock
if [ "${LIVE_ARCHITECTURE}" != "powerpc" ] && [ "${LIVE_ARCHITECTURE}" != "ppc64" ]
then
Echo_warning "skipping binary_yaboot, foreign architecture."
- exit 0
+ #exit 0 # REMOVE_ME
fi
# Check user templates
@@ -94,7 +94,8 @@ esac
# Setting destination directory
case "${LIVE_BINARY_IMAGES}" in
iso)
- DESTDIR="binary/live"
+ DESTDIR_LIVE="binary/live"
+ DESTDIR_INSTALL="binary/install"
;;
net|tar|usb-hdd)
@@ -102,18 +103,23 @@ case "${LIVE_BINARY_IMAGES}" in
;;
esac
-# Temporary check for broken yaboot
+# Temporary check for broken syslinux FIXME
if [ "${LIVE_BINARY_IMAGES}" = "iso" ]
then
- case "${LIVE_ARCHITECTURE}" in
- powerpc)
- DESTDIR="${DESTDIR}.ppc"
- ;;
- esac
+ # Assembling multi-arch
+ if [ -n "${MULTIARCH}" ]
+ then
+ case "${LIVE_ARCHITECTURE}" in
+ powerpc)
+ DESTDIR_LIVE="${DESTDIR_LIVE}.ppc"
+ DESTDIR_INSTALL="${DESTDIR_INSTALL}.ppc"
+ ;;
+ esac
+ fi
fi
# Creating directory
-mkdir -p "${DESTDIR}"
+mkdir -p "${DESTDIR_LIVE}"
# Setting boot parameters
if [ -n "${LIVE_ENCRYPTION}" ]
@@ -147,7 +153,7 @@ then
live-initramfs)
if [ "${LIVE_HOSTNAME}" != "debian" ]
then
- LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} username=${LIVE_HOSTNAME}"
+ LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND} hostname=${LIVE_HOSTNAME}"
fi
;;
esac
@@ -155,70 +161,82 @@ 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" # FIXME
+
# Assembling kernel configuration
-if [ "${LIVE_BINARY_IMAGES}" = "iso" ]
+if [ "${LIVE_BINARY_IMAGES}" != "net" ]
then
DEFAULT_FLAVOUR="`echo ${LIVE_LINUX_FLAVOURS} | 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=${INITFS} LIVE_BOOTAPPEND\"\n\tinitrd-size=1048576\n\tread-only"
+ LINUX="image=/`basename ${DESTDIR_LIVE}`/`basename chroot/boot/vmlinux-*${DEFAULT_FLAVOUR}`\n\tinitrd=/`basename ${DESTDIR_LIVE}`/initrd.img-`basename chroot/boot/vmlinux-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinux-//'`\n\tlabel=live\n\tappend=\"boot=${INITFS} LIVE_BOOTAPPEND\"\n\tinitrd-size=1048576\n\tread-only"
else
DEFAULT_FLAVOUR="`echo ${LIVE_LINUX_FLAVOURS} | 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=${INITFS} LIVE_BOOTAPPEND\"\n\tinitrd-size=1048576\n\tread-only"
+ LINUX="image=`basename chroot/boot/vmlinux-*${DEFAULT_FLAVOUR}`\n\tinitrd=initrd.img-`basename chroot/boot/vmlinux-*${DEFAULT_FLAVOUR} | sed -e 's/vmlinux-//'`\n\tlabel=live\n\tappend=\"boot=${INITFS} LIVE_BOOTAPPEND\"\n\tinitrd-size=1048576\n\tread-only"
fi
# FIXME
if [ "`echo ${LIVE_LINUX_FLAVOURS} | wc -w`" -gt "1" ]
then
- for KERNEL in chroot/boot/vmlinuz*
+ for KERNEL in chroot/boot/vmlinux*
do
if [ -z "${LINUX}" ]
then
if [ "${LIVE_BINARY_IMAGES}" = "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=${INITFS} LIVE_BOOTAPPEND"
+ LINUX="label LIVE-`basename ${KERNEL} | sed -e 's/vmlinux-//'`\n kernel /`basename ${DESTDIR_LIVE}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR_LIVE}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinux-//'` boot=${INITFS} 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=${INITFS} LIVE_BOOTAPPEND"
+ LINUX="label LIVE-`basename ${KERNEL} | sed -e 's/vmlinux-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinux-//'` boot=${INITFS} LIVE_BOOTAPPEND"
fi
else
if [ "${LIVE_BINARY_IMAGES}" = "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=${INITFS} LIVE_BOOTAPPEND"
+ LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinux-//'`\n kernel /`basename ${DESTDIR_LIVE}`/`basename ${KERNEL}`\n append initrd=/`basename ${DESTDIR_LIVE}`/initrd.img-`basename ${KERNEL} | sed -e 's/vmlinux-//'` boot=${INITFS} 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=${INITFS} LIVE_BOOTAPPEND"
+ LINUX="${LINUX}\nlabel LIVE-`basename ${KERNEL} | sed -e 's/vmlinux-//'`\n kernel `basename ${KERNEL}`\n append initrd=initrd.img-`basename ${KERNEL} | sed -e 's/vmlinux-//'` boot=${INITFS} LIVE_BOOTAPPEND"
fi
fi
done
fi
+# Removing '//'
LINUX="`echo ${LINUX} | sed -e 's#//#/#g'`"
+# Assembling debian-installer configuration
+if [ "${LIVE_DEBIAN_INSTALLER}" = "enabled" ] || [ "${LIVE_LIVE_INSTALLER}" = "enabled" ]
+then
+ VMLINUZ_DI="vmlinuz"
+ INITRD_DI="initrd.gz"
+
+ VMLINUZ_GI="gtk/vmlinuz"
+ INITRD_GI="gtk/initrd.gz"
+
+ LIVE_LINUX_INSTALL="LABEL install\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_DI}\n\tappend vga=normal initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_DI} -- "
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL linux\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_DI}\n\tappend vga=normal initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_DI} -- "
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL installgui\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_GI}\n\tappend video=vesa:ywrap,mtrr vga=788 initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_GI} -- "
+
+ LIVE_KENREL_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL expert\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_DI}\n\tappend priority=low vga=normal initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_DI} -- "
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL expertgui\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_GI}\n\tappend priority=low video=vesa:ywrap,mtrr vga=788 initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_GI} -- "
+
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL rescue\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_DI}\n\tappend vga=normal initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_DI} rescue/enable=true -- "
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL rescuegui\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_GI}\n\tappend video=vesa:ywrap,mtrr vga=788 initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_GI} rescue/enable=true -- "
+
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL auto\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_DI}\n\tappend auto=true priority=critical vga=normal initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_DI} -- "
+ LIVE_LINUX_INSTALL="${LIVE_LINUX_INSTALL}\n\nLABEL autogui\n\tkernel /`basename ${DESTDIR_INSTALL}`/${VMLINUZ_GI}\n\tappend auto=true priority=critical video=vesa:ywrap,mtrr vga=788 initrd=/`basename ${DESTDIR_INSTALL}`/${INITRD_GI} -- "
+fi
+
+LIVE_LINUX_INSTALL="`echo ${LIVE_LINUX_INSTALL} | sed -e 's/binary//g' -e 's#//#/#g'`"
+
case "${LIVE_BINARY_IMAGES}" in
iso)
# Copying yaboot
- mkdir -p binary/install
- cp chroot/usr/lib/yaboot/yaboot binary/install
+ mkdir -p binary/yaboot
+ cp chroot/usr/lib/yaboot/yaboot binary/yaboot
cp -r "${LIVE_TEMPLATES}"/yaboot/* binary/yaboot
# Configure yaboot templates
- sed -i -e "s#LIVE_LINUX_LIVE#${LINUX}#" -e "s#LIVE_LINUX_INSTALL#${LIVE_LINUX_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/install/yaboot.conf
+ sed -i -e "s#LIVE_LINUX_LIVE#${LINUX}#" -e "s#LIVE_LINUX_INSTALL#${LIVE_LINUX_INSTALL}#" binary/yaboot/yaboot.conf
sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/yaboot/yaboot.conf
sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" -e "s/LIVE_VERSION/${VERSION}/" binary/yaboot/boot.msg
-
- # Working arround yaboot 8.3 limitation
- if [ "`echo ${LIVE_LINUX_FLAVOURS} | wc -w`" -gt "1" ]
- then
- for FLAVOUR in ${LIVE_LINUX_FLAVOURS}
- 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_LINUX_FLAVOURS} "${DESTDIR}"/vmlinuz
- mv "${DESTDIR}"/initrd.img-*-${LIVE_LINUX_FLAVOURS} "${DESTDIR}"/initrd.img
- sed -i -e "s/LIVE.*-${LIVE_LINUX_FLAVOURS}/live/g" -e "s/vmlinuz-.*-${LIVE_LINUX_FLAVOURS}/vmlinuz/g" -e "s/initrd.img-.*-${LIVE_LINUX_FLAVOURS}/initrd.img/g" -e "s/LIVE/live/" binary/install/yaboot.conf
- fi
;;
esac
diff --git a/helpers/lh_bootstrap b/helpers/lh_bootstrap
index 5e483ae..c16f10c 100755
--- a/helpers/lh_bootstrap
+++ b/helpers/lh_bootstrap
@@ -34,6 +34,7 @@ Set_defaults
# Bootstrapping system
lh_bootstrap_cache restore ${*}
+lh_bootstrap_copy ${*}
lh_bootstrap_cdebootstrap ${*}
lh_bootstrap_debootstrap ${*}
lh_bootstrap_cache save ${*}
diff --git a/helpers/lh_bootstrap_cache b/helpers/lh_bootstrap_cache
index 6d79e09..03ae904 100755
--- a/helpers/lh_bootstrap_cache
+++ b/helpers/lh_bootstrap_cache
@@ -49,8 +49,11 @@ do
if [ "${STAGE}" = "bootstrap" ] && [ -d cache/stages_bootstrap ]
then
+ # Removing old chroot
+ rm -rf chroot
+
# Restoring old cache
- ${LH_ROOT_COMMAND} cp -a cache/stages_bootstrap/* chroot
+ ${LH_ROOT_COMMAND} cp -a cache/stages_bootstrap chroot
if [ -n "${LH_ROOT_COMMAND}" ]
then
diff --git a/helpers/lh_bootstrap_clone b/helpers/lh_bootstrap_clone
new file mode 100755
index 0000000..ce5f29f
--- /dev/null
+++ b/helpers/lh_bootstrap_clone
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# lh_bootstrap_clone(1) - bootstrap by cloning the host system
+# 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
+
+# Including common functions
+LH_BASE="${LH_BASE:-/usr/share/live-helper}"
+
+for FUNCTION in "${LH_BASE}"/functions/*.sh
+do
+ . "${FUNCTION}"
+done
+
+# Setting static variables
+DESCRIPTION="bootstrap by cloning the host system"
+HELP=""
+USAGE="${PROGRAM} [--force]"
+
+Arguments "${@}"
+
+# Reading configuration files
+Read_conffile config/common
+Read_conffile config/bootstrap
+Read_conffile config/chroot
+Read_conffile config/binary
+Read_conffile config/source
+Set_defaults
+
+if [ "${LH_BOOTSTRAP}" != "clone" ]
+then
+ exit 0
+fi
+
+Echo_message "Begin bootstrapping system..."
+
+# Ensure that a system is built as root
+lh_testroot
+
+# Checking stage file
+Check_stagefile .stage/bootstrap
+
+# Checking lock file
+Check_lockfile .lock
+
+# Creating lock file
+Create_lockfile .lock
+
+# Read package selection
+dpkg --get-selections
+
+# Read debconf values
+> preseed
+
+# Creating stage file
+Create_stagefile .stage/bootstrap
diff --git a/helpers/lh_bootstrap_copy b/helpers/lh_bootstrap_copy
new file mode 100755
index 0000000..c1991fb
--- /dev/null
+++ b/helpers/lh_bootstrap_copy
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# lh_bootstrap_copy(1) - bootstrap by copying the host system
+# 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
+
+# Including common functions
+LH_BASE="${LH_BASE:-/usr/share/live-helper}"
+
+for FUNCTION in "${LH_BASE}"/functions/*.sh
+do
+ . "${FUNCTION}"
+done
+
+# Setting static variables
+DESCRIPTION="bootstrap by copying the host system"
+HELP=""
+USAGE="${PROGRAM} [--force]"
+
+Arguments "${@}"
+
+# Reading configuration files
+Read_conffile config/common
+Read_conffile config/bootstrap
+Read_conffile config/chroot
+Read_conffile config/binary
+Read_conffile config/source
+Set_defaults
+
+if [ "${LH_BOOTSTRAP}" != "copy" ]
+then
+ exit 0
+fi
+
+Echo_message "Begin bootstrapping system..."
+
+# Ensure that a system is built as root
+lh_testroot
+
+# Checking stage file
+Check_stagefile .stage/bootstrap
+
+# Checking lock file
+Check_lockfile .lock
+
+# Creating lock file
+Create_lockfile .lock
+
+# Copying host system
+find / ! -name /proc ! -name /sys ! -name "`dirname ${PWD}`" | xargs cp -a chroot
+
+# Creating stage file
+Create_stagefile .stage/bootstrap
diff --git a/helpers/lh_chroot_apt b/helpers/lh_chroot_apt
index cafabd3..b89c2c9 100755
--- a/helpers/lh_chroot_apt
+++ b/helpers/lh_chroot_apt
@@ -32,13 +32,13 @@ Read_conffile config/binary
Read_conffile config/source
Set_defaults
-Echo_message "Configuring file /etc/apt/apt.conf"
-
# Requiring stage file
Require_stagefile .stage/bootstrap
case "${1}" in
install)
+ Echo_message "Configuring file /etc/apt/apt.conf"
+
# Checking stage file
Check_stagefile .stage/chroot_apt
@@ -111,6 +111,8 @@ case "${1}" in
;;
remove)
+ Echo_message "Deconfiguring file /etc/apt/apt.conf"
+
# Checking lock file
Check_lockfile .lock
diff --git a/helpers/lh_chroot_cache b/helpers/lh_chroot_cache
index 8d3d962..2f016a6 100755
--- a/helpers/lh_chroot_cache
+++ b/helpers/lh_chroot_cache
@@ -49,8 +49,11 @@ do
if [ "${STAGE}" = "chroot" ] && [ -d cache/stages_chroot ]
then
+ # Removing old chroot
+ rm -rf chroot
+
# Restoring old cache
- ${LH_ROOT_COMMAND} cp -a cache/stages_chroot/* chroot
+ ${LH_ROOT_COMMAND} cp -a cache/stages_chroot chroot
if [ -n "${LH_ROOT_COMMAND}" ]
then
diff --git a/helpers/lh_chroot_debianchroot b/helpers/lh_chroot_debianchroot
index 4410227..3a193a6 100755
--- a/helpers/lh_chroot_debianchroot
+++ b/helpers/lh_chroot_debianchroot
@@ -32,13 +32,13 @@ Read_conffile config/binary
Read_conffile config/source
Set_defaults
-Echo_message "Configuring file /etc/debian_chroot"
-
# Requiring stage file
Require_stagefile .stage/bootstrap
case "${1}" in
install)
+ Echo_message "Configuring file /etc/debian_chroot"
+
# Checking stage file
Check_stagefile .stage/chroot_debianchroot
@@ -62,6 +62,8 @@ case "${1}" in
;;
remove)
+ Echo_message "Deconfiguring file /etc/debian_chroot"
+
# Checking lock file
Check_lockfile .lock
diff --git a/helpers/lh_chroot_hosts b/helpers/lh_chroot_hosts
index 09ae098..9807433 100755
--- a/helpers/lh_chroot_hosts
+++ b/helpers/lh_chroot_hosts
@@ -32,13 +32,13 @@ Read_conffile config/binary
Read_conffile config/source
Set_defaults
-Echo_message "Configuring file /etc/hosts"
-
# Requiring stage file
Require_stagefile .stage/bootstrap
case "${1}" in
install)
+ Echo_message "Configuring file /etc/hosts"
+
# Checking stage file
Check_stagefile .stage/chroot_hosts
@@ -65,6 +65,8 @@ case "${1}" in
;;
remove)
+ Echo_message "Deconfiguring file /etc/hosts"
+
# Checking lock file
Check_lockfile .lock
diff --git a/helpers/lh_chroot_linux-image b/helpers/lh_chroot_linux-image
index 218f248..0678134 100755
--- a/helpers/lh_chroot_linux-image
+++ b/helpers/lh_chroot_linux-image
@@ -32,13 +32,13 @@ Read_conffile config/binary
Read_conffile config/source
Set_defaults
-Echo_message "Configuring file /etc/kernel-img.conf"
-
# Requiring stage file
Require_stagefile .stage/bootstrap
case "${1}" in
install)
+ Echo_message "Configuring file /etc/kernel-img.conf"
+
# Checking stage file
Check_stagefile .stage/chroot_linux-image
@@ -90,6 +90,8 @@ EOF
;;
remove)
+ Echo_message "Deconfiguring file /etc/kernel-img.conf"
+
# Checking lock file
Check_lockfile .lock
diff --git a/helpers/lh_chroot_resolv b/helpers/lh_chroot_resolv
index 031bdc2..5549ccb 100755
--- a/helpers/lh_chroot_resolv
+++ b/helpers/lh_chroot_resolv
@@ -32,13 +32,13 @@ Read_conffile config/binary
Read_conffile config/source
Set_defaults
-Echo_message "Configuring file /etc/resolv.conf"
-
# Requiring stage file
Require_stagefile .stage/bootstrap
case "${1}" in
install)
+ Echo_message "Configuring file /etc/resolv.conf"
+
# Checking stage file
Check_stagefile .stage/chroot_resolv
@@ -65,6 +65,8 @@ case "${1}" in
;;
remove)
+ Echo_message "Deconfiguring file /etc/resolv.conf"
+
# Checking lock file
Check_lockfile .lock
diff --git a/helpers/lh_chroot_sources b/helpers/lh_chroot_sources
index 341f2d6..b8c9371 100755
--- a/helpers/lh_chroot_sources
+++ b/helpers/lh_chroot_sources
@@ -32,13 +32,13 @@ Read_conffile config/binary
Read_conffile config/source
Set_defaults
-Echo_message "Configuring file /etc/apt/sources.list"
-
# Requiring stage file
Require_stagefile .stage/bootstrap
case "${1}" in
install)
+ Echo_message "Configuring file /etc/apt/sources.list"
+
# Checking stage file
Check_stagefile .stage/chroot_sources
@@ -202,6 +202,8 @@ case "${1}" in
;;
remove)
+ Echo_message "Deconfiguring file /etc/apt/sources.list"
+
# Checking lock file
Check_lockfile .lock
diff --git a/helpers/lh_chroot_sysvrc b/helpers/lh_chroot_sysvrc
index a2b2230..ed365b9 100755
--- a/helpers/lh_chroot_sysvrc
+++ b/helpers/lh_chroot_sysvrc
@@ -32,13 +32,13 @@ Read_conffile config/binary
Read_conffile config/source
Set_defaults
-Echo_message "Configuring file /usr/sbin/policy-rc.d"
-
# Requiring stage file
Require_stagefile .stage/bootstrap
case "${1}" in
install)
+ Echo_message "Configuring file /usr/sbin/policy-rc.d"
+
# Checking stage file
Check_stagefile .stage/chroot_sysvrc
@@ -71,6 +71,8 @@ EOF
;;
remove)
+ Echo_message "Deconfiguring file /usr/sbin/policy-rc.d"
+
# Checking lock file
Check_lockfile .lock
diff --git a/helpers/lh_clean b/helpers/lh_clean
index 84c60b8..bd22681 100755
--- a/helpers/lh_clean
+++ b/helpers/lh_clean
@@ -20,7 +20,7 @@ done
# Setting static variables
DESCRIPTION="clean up system build directories"
HELP=""
-USAGE="${PROGRAM} [all|cache|chroot|binary|lock|purge|stage|source]"
+USAGE="${PROGRAM} [all|cache|chroot|binary|purge|stage|source]"
Arguments "${@}"
@@ -32,11 +32,12 @@ Read_conffile config/binary
Read_conffile config/source
Set_defaults
+rm -f .lock
+
case "${1}" in
all)
"${0}" chroot
"${0}" binary
- "${0}" lock
"${0}" stage
"${0}" source
@@ -53,6 +54,7 @@ case "${1}" in
chroot)
${LH_ROOT_COMMAND} umount -f chroot/sys > /dev/null 2>&1 || true
+ ${LH_ROOT_COMMAND} umount -f chroot/proc/sys/fs/binfmt_misc > /dev/null 2>&1 || true
${LH_ROOT_COMMAND} umount -f chroot/proc > /dev/null 2>&1 || true
${LH_ROOT_COMMAND} umount -f chroot/lib/init/rw > /dev/null 2>&1 || true
${LH_ROOT_COMMAND} umount -f chroot/dev/shm > /dev/null 2>&1 || true
@@ -72,10 +74,11 @@ case "${1}" in
;;
binary)
+ ${LH_ROOT_COMMAND} umount -f binary.tmp > /dev/null 2>&1 || true
+ rm -rf binary.tmp binary.deb binary.udeb
rm -f binary.iso
rm -f binary.img
rm -f binary*.tar.gz
- rm -f packages.txt
rm -rf binary
rm -rf tftpboot
@@ -83,10 +86,6 @@ case "${1}" in
rm -f .stage/binary*
;;
- lock)
- rm -f .lock
- ;;
-
purge)
PURGE="true" "${0}" all
"${0}" cache
diff --git a/helpers/lh_config b/helpers/lh_config
index 551e5b1..ef5e423 100755
--- a/helpers/lh_config
+++ b/helpers/lh_config
@@ -292,6 +292,7 @@ EOF
# Creating lh_binary_* configuration
mkdir -p "${LIVE_ROOT}"/config/binary_grub
mkdir -p "${LIVE_ROOT}"/config/binary_local-includes
+mkdir -p "${LIVE_ROOT}"/config/binary_local-udebs
mkdir -p "${LIVE_ROOT}"/config/binary_rootfs
mkdir -p "${LIVE_ROOT}"/config/binary_syslinux
@@ -318,6 +319,10 @@ LIVE_BOOTLOADER="${LIVE_BOOTLOADER}"
# (Default: ${LIVE_DEBIAN_INSTALLER})
LIVE_DEBIAN_INSTALLER="${LIVE_DEBIAN_INSTALLER}"
+# \$LIVE_LIVE_INSTALLER: set debian-installer + live-installer
+# (Default: ${LIVE_LIVE_INSTALLER})
+LIVE_LIVE_INSTALLER="${LIVE_LIVE_INSTALLER}"
+
# \$LIVE_ENCRYPTION: set encrytion
# (Default: empty)
LIVE_ENCRYPTION="${LIVE_ENCRYPTION}"
diff --git a/helpers/make-live b/helpers/make-live
index 6681058..fee621e 100755
--- a/helpers/make-live
+++ b/helpers/make-live
@@ -79,7 +79,7 @@ Local_arguments ()
;;
--binary-indices)
- LH_BINARY_INDICES="${2}"; shift 2
+ LIVE_BINARY_INDICES="${2}"; shift 2
;;
--apt-pdiffs)
@@ -369,7 +369,7 @@ Main ()
Local_arguments "${@}"
# Configuring (this is really shit!)
- LH_MODE="${LH_MODE}" LH_CONFIG="${LH_CONFIG}" LH_APT="${LH_APT}" LH_APT_FTPPROXY="${LH_APT_FTPPROXY}" LH_APT_HTTPPROXY="${LH_APT_HTTPPROXY}" LH_BINARY_INDICES="${LH_BINARY_INDICES}" LH_APT_PDIFFS="${LH_APT_PDIFFS}" LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS}" LH_APT_SECURE="${LH_APT_SECURE}" LH_BOOTSTRAP="${LH_BOOTSTRAP}" LH_CACHE="${LH_CACHE}" LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}" LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}" LH_DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}" LH_GENISOIMAGE="${LH_GENISOIMAGE}" LH_LOSETUP="${LH_LOSETUP}" LH_TASKSEL="${LH_TASKSEL}" LIVE_ROOT="${LIVE_ROOT}" LIVE_ARCHITECTURE="${LIVE_ARCHITECTURE}" LIVE_DISTRIBUTION="${LIVE_DISTRIBUTION}" LIVE_DISTRIBUTION_CONFIG="${LIVE_DISTRIBUTION_CONFIG}" LIVE_BOOTSTRAP_FLAVOUR="${LIVE_BOOTSTRAP_FLAVOUR}" LIVE_MIRROR_BOOTSTRAP="${LIVE_MIRROR_BOOTSTRAP}" LIVE_MIRROR_BOOTSTRAP_SECURITY="${LIVE_MIRROR_BOOTSTRAP_SECURITY}" LIVE_MIRROR_BINARY="${LIVE_MIRROR_BINARY}" LIVE_MIRROR_BINARY_SECURITY="${LIVE_MIRROR_BINARY_SECURITY}" LIVE_SECTIONS="${LIVE_SECTIONS}" LIVE_INTERACTIVE="${LIVE_INTERACTIVE}" LIVE_LINUX_FLAVOURS="${LIVE_LINUX_FLAVOURS}" LIVE_LINUX_PACKAGES="${LIVE_LINUX_PACKAGES}" LIVE_KEYRING_PACKAGES="${LIVE_KEYRING_PACKAGES}" LIVE_HOOKS="${LIVE_HOOKS}" LIVE_LANGUAGE="${LIVE_LANGUAGE}" LIVE_PACKAGES="${LIVE_PACKAGES}" LIVE_PACKAGES_LISTS="${LIVE_PACKAGES_LISTS}" LIVE_TASKS="${LIVE_TASKS}" LIVE_SECURITY="${LIVE_SECURITY}" LIVE_SYMLINKS="${LIVE_SYMLINKS}" LIVE_SYSVINIT="${LIVE_SYSVINIT}" LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND}" LIVE_ENCRYPTION="${LIVE_ENCRYPTION}" LIVE_USERNAME="${LIVE_USERNAME}" LIVE_HOSTNAME="${LIVE_HOSTNAME}" LIVE_CHROOT_FILESYSTEM="${LIVE_CHROOT_FILESYSTEM}" LIVE_MEMTEST="${LIVE_MEMTEST}" LIVE_ISO_APPLICATION="${LIVE_ISO_APPLICATION}" LIVE_ISO_PREPARER="${LIVE_ISO_PREPARER}" LIVE_ISO_PUBLISHER="${LIVE_ISO_PUBLISHER}" LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}" LIVE_NET_SERVER="${LIVE_NET_SERVER}" LIVE_NET_PATH="${LIVE_NET_PATH}" LIVE_SOURCE="${LIVE_SOURCE}" LIVE_BOOTLOADER="${LIVE_BOOTLOADER}" LIVE_GRUB_SPLASH="${LIVE_GRUB_SPLASH}" LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}" LIVE_BINARY_IMAGES="${LIVE_BINARY_IMAGES}" LIVE_SOURCE_IMAGES="${LIVE_SOURCE_IMAGES}" LIVE_INCLUDES="${LIVE_INCLUDES}" LIVE_TEMPLATES="${LIVE_TEMPLATES}" LH_ROOT_COMMAND="${LH_ROOT_COMMAND}" LH_INITRAMFS="${LH_INITRAMFS}" lh_config newconfig
+ LH_MODE="${LH_MODE}" LH_CONFIG="${LH_CONFIG}" LH_APT="${LH_APT}" LH_APT_FTPPROXY="${LH_APT_FTPPROXY}" LH_APT_HTTPPROXY="${LH_APT_HTTPPROXY}" LIVE_BINARY_INDICES="${LIVE_BINARY_INDICES}" LH_APT_PDIFFS="${LH_APT_PDIFFS}" LH_APT_RECOMMENDS="${LH_APT_RECOMMENDS}" LH_APT_SECURE="${LH_APT_SECURE}" LH_BOOTSTRAP="${LH_BOOTSTRAP}" LH_CACHE="${LH_CACHE}" LH_DEBCONF_FRONTEND="${LH_DEBCONF_FRONTEND}" LH_DEBCONF_PRIORITY="${LH_DEBCONF_PRIORITY}" LH_DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}" LH_GENISOIMAGE="${LH_GENISOIMAGE}" LH_LOSETUP="${LH_LOSETUP}" LH_TASKSEL="${LH_TASKSEL}" LIVE_ROOT="${LIVE_ROOT}" LIVE_ARCHITECTURE="${LIVE_ARCHITECTURE}" LIVE_DISTRIBUTION="${LIVE_DISTRIBUTION}" LIVE_DISTRIBUTION_CONFIG="${LIVE_DISTRIBUTION_CONFIG}" LIVE_BOOTSTRAP_FLAVOUR="${LIVE_BOOTSTRAP_FLAVOUR}" LIVE_MIRROR_BOOTSTRAP="${LIVE_MIRROR_BOOTSTRAP}" LIVE_MIRROR_BOOTSTRAP_SECURITY="${LIVE_MIRROR_BOOTSTRAP_SECURITY}" LIVE_MIRROR_BINARY="${LIVE_MIRROR_BINARY}" LIVE_MIRROR_BINARY_SECURITY="${LIVE_MIRROR_BINARY_SECURITY}" LIVE_SECTIONS="${LIVE_SECTIONS}" LIVE_INTERACTIVE="${LIVE_INTERACTIVE}" LIVE_LINUX_FLAVOURS="${LIVE_LINUX_FLAVOURS}" LIVE_LINUX_PACKAGES="${LIVE_LINUX_PACKAGES}" LIVE_KEYRING_PACKAGES="${LIVE_KEYRING_PACKAGES}" LIVE_HOOKS="${LIVE_HOOKS}" LIVE_LANGUAGE="${LIVE_LANGUAGE}" LIVE_PACKAGES="${LIVE_PACKAGES}" LIVE_PACKAGES_LISTS="${LIVE_PACKAGES_LISTS}" LIVE_TASKS="${LIVE_TASKS}" LIVE_SECURITY="${LIVE_SECURITY}" LIVE_SYMLINKS="${LIVE_SYMLINKS}" LIVE_SYSVINIT="${LIVE_SYSVINIT}" LIVE_BOOTAPPEND="${LIVE_BOOTAPPEND}" LIVE_ENCRYPTION="${LIVE_ENCRYPTION}" LIVE_USERNAME="${LIVE_USERNAME}" LIVE_HOSTNAME="${LIVE_HOSTNAME}" LIVE_CHROOT_FILESYSTEM="${LIVE_CHROOT_FILESYSTEM}" LIVE_MEMTEST="${LIVE_MEMTEST}" LIVE_ISO_APPLICATION="${LIVE_ISO_APPLICATION}" LIVE_ISO_PREPARER="${LIVE_ISO_PREPARER}" LIVE_ISO_PUBLISHER="${LIVE_ISO_PUBLISHER}" LIVE_ISO_VOLUME="${LIVE_ISO_VOLUME}" LIVE_NET_SERVER="${LIVE_NET_SERVER}" LIVE_NET_PATH="${LIVE_NET_PATH}" LIVE_SOURCE="${LIVE_SOURCE}" LIVE_BOOTLOADER="${LIVE_BOOTLOADER}" LIVE_GRUB_SPLASH="${LIVE_GRUB_SPLASH}" LIVE_SYSLINUX_SPLASH="${LIVE_SYSLINUX_SPLASH}" LIVE_BINARY_IMAGES="${LIVE_BINARY_IMAGES}" LIVE_SOURCE_IMAGES="${LIVE_SOURCE_IMAGES}" LIVE_INCLUDES="${LIVE_INCLUDES}" LIVE_TEMPLATES="${LIVE_TEMPLATES}" LH_ROOT_COMMAND="${LH_ROOT_COMMAND}" LH_INITRAMFS="${LH_INITRAMFS}" lh_config newconfig
if [ "${LH_BREAKPOINTS}" = "enabled" ]
then