summaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/02defaults.sh38
-rw-r--r--src/scripts/13hack.sh2
-rw-r--r--src/scripts/14chroot.sh15
-rw-r--r--src/scripts/21image.sh299
-rw-r--r--src/scripts/22iso.sh65
-rw-r--r--src/scripts/23net.sh98
6 files changed, 341 insertions, 176 deletions
diff --git a/src/scripts/02defaults.sh b/src/scripts/02defaults.sh
index 99a8d3b..78831e7 100644
--- a/src/scripts/02defaults.sh
+++ b/src/scripts/02defaults.sh
@@ -40,7 +40,7 @@ Defaults ()
# Set bootstrap architecture
if [ -z "${LIVE_ARCHITECTURE}" ]
then
- LIVE_ARCHITECTURE="`dpkg-architecture -qDEB_BUILD_ARCH`"
+ LIVE_ARCHITECTURE="`dpkg --print-architecture`"
fi
# Set chroot directory
@@ -52,7 +52,7 @@ Defaults ()
# Set debian distribution
if [ -z "${LIVE_DISTRIBUTION}" ]
then
- LIVE_DISTRIBUTION="${CODENAME_UNSTABLE}"
+ LIVE_DISTRIBUTION="unstable"
fi
# Set bootstrap flavour
@@ -79,7 +79,7 @@ Defaults ()
;;
amd64)
- if [ "${LIVE_DISTRIBUTION}" = "${CODENAME_UNSTABLE}" ]
+ if [ "${LIVE_DISTRIBUTION}" = "unstable" ]
then
LIVE_KERNEL="amd64"
else
@@ -97,7 +97,7 @@ Defaults ()
;;
i386)
- if [ "${LIVE_DISTRIBUTION}" = "${CODENAME_STABLE}" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_OLDSTABLE}" ]
+ if [ "${LIVE_DISTRIBUTION}" = "oldstable" ] || [ "${LIVE_DISTRIBUTION}" = "stable" ]
then
LIVE_KERNEL="386"
else
@@ -145,6 +145,24 @@ Defaults ()
LIVE_MIRROR_SECURITY="http://security.debian.org/"
fi
+ # Check for package lists
+ if [ -z "${LIVE_PACKAGE_LIST}" ]
+ then
+ LIVE_PACKAGE_LIST="${BASE}/lists/standard"
+ else
+ if [ "${LIVE_FLAVOUR}" = "minimal" ]
+ then
+ LIVE_PACKAGE_LIST="${BASE}/lists/minimal"
+ fi
+
+ if [ -r "${BASE}/lists/${LIVE_PACKAGE_LIST}" ]
+ then
+ LIVE_PACKAGE_LIST="${BASE}/lists/${LIVE_PACKAGE_LIST}"
+ else
+ LIVE_PACKAGE_LIST="${BASE}/lists/standard"
+ fi
+ fi
+
# Set debian sections
if [ -z "${LIVE_SECTION}" ]
then
@@ -168,4 +186,16 @@ Defaults ()
then
LIVE_TEMPLATES="${BASE}/templates"
fi
+
+ # Set package indices
+ if [ -z "${LIVE_GENERIC_INDICES}" ]
+ then
+ LIVE_GENERIC_INDICES="yes"
+ fi
+
+ # Set source image
+ if [ -z "${LIVE_SOURCE}" ]
+ then
+ LIVE_SOURCE="no"
+ fi
}
diff --git a/src/scripts/13hack.sh b/src/scripts/13hack.sh
index 74bb5ad..3468c57 100644
--- a/src/scripts/13hack.sh
+++ b/src/scripts/13hack.sh
@@ -11,7 +11,7 @@
Hack_xorg ()
{
- if [ -f "${LIVE_CHROOT}/etc/X11/xorg.conf" ]
+ if [ -f "${LIVE_CHROOT}/etc/X11/xorg.conf" ] #&& [ "${LIVE_DISTRIBUTION_EXPERIMENTAL}" != "yes" ]
then
# Comment "BusID" line and set driver to "vesa"
sed -i -e 's/\(^.*BusID.*\)/#\1/g' -e '/Section "Device"/,/EndSection/ s/\(.*Driver.*"\).*\(".*\)/\1vesa\2/g' "${LIVE_CHROOT}"/etc/X11/xorg.conf
diff --git a/src/scripts/14chroot.sh b/src/scripts/14chroot.sh
index 5f3ff9c..55ffa9a 100644
--- a/src/scripts/14chroot.sh
+++ b/src/scripts/14chroot.sh
@@ -21,7 +21,7 @@ Chroot ()
then
# Configure chroot
Patch_chroot apply
- #Patch_runlevel apply
+ Patch_runlevel apply
# Configure network
Patch_network apply
@@ -30,7 +30,7 @@ Chroot ()
Indices custom
# Install secure apt
- if [ "${LIVE_DISTRIBUTION}" = "${CODENAME_TESTING}" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_UNSTABLE}" ]
+ if [ "${LIVE_DISTRIBUTION}" = "testing" ] || [ "${LIVE_DISTRIBUTION}" = "unstable" ]
then
Chroot_exec "apt-get install --yes --force-yes debian-archive-keyring"
fi
@@ -44,16 +44,15 @@ Chroot ()
# Install linux-image, modules and casper
Chroot_exec "apt-get install --yes linux-image-2.6-${LIVE_KERNEL} squashfs-modules-2.6-${LIVE_KERNEL} unionfs-modules-2.6-${LIVE_KERNEL} casper"
- # Rebuild initial ramdisk
- Chroot_exec "dpkg-reconfigure `basename ${LIVE_CHROOT}/var/lib/dpkg/info/linux-image-2.6.*-${LIVE_KERNEL}.postinst .postinst`"
-
# Deconfigure linux-image
Patch_linux deapply
# Install packages list
if [ -n "${LIVE_PACKAGE_LIST}" ]
then
- Chroot_exec "apt-get install --yes `cat ${LIVE_PACKAGE_LIST}`"
+ grep -v "^#" "${LIVE_PACKAGE_LIST}" > "${LIVE_CHROOT}"/root/"`basename ${LIVE_PACKAGE_LIST}`"
+ Chroot_exec "xargs --arg-file=/root/`basename ${LIVE_PACKAGE_LIST}` apt-get install --yes"
+ rm -f "${LIVE_CHROOT}"/root/"`basename ${LIVE_PACKAGE_LIST}`"
fi
# Install extra packages
@@ -93,12 +92,10 @@ Chroot ()
Patch_network deapply
# Deconfigure chroot
- #Patch_runlevel deapply
+ Patch_runlevel deapply
Patch_chroot deapply
# Touching stage file
touch "${LIVE_ROOT}"/.stage/chroot
-
- echo "done."
fi
}
diff --git a/src/scripts/21image.sh b/src/scripts/21image.sh
index 0f483a6..10c56e2 100644
--- a/src/scripts/21image.sh
+++ b/src/scripts/21image.sh
@@ -12,42 +12,86 @@
Indices ()
{
case "${1}" in
- default)
- # Configure default sources.list
- echo "deb http://ftp.debian.org/debian/ ${LIVE_DISTRIBUTION} ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
-
+ custom)
+ # Configure custom sources.list
case "${LIVE_DISTRIBUTION}" in
- "${CODENAME_TESTING}")
- echo "deb http://ftp.debian.org/debian/ ${CODENAME_TESTING}-proposed-updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb http://security.debian.org/ ${CODENAME_TESTING}/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ oldstable)
+ echo "deb ${LIVE_MIRROR} oldstable ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src ${LIVE_MIRROR} oldstable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb ${LIVE_MIRROR_SECURITY} oldstable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src ${LIVE_MIRROR_SECURITY} oldstable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
;;
- "${CODENAME_STABLE}")
- echo "deb ${LIVE_MIRROR_SECURITY} ${CODENAME_STABLE}/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ stable)
+ echo "deb ${LIVE_MIRROR} stable ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src ${LIVE_MIRROR} stable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb ${LIVE_MIRROR_SECURITY} stable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src ${LIVE_MIRROR_SECURITY} stable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
;;
- "${CODENAME_OLDSTABLE}")
- echo "deb ${LIVE_MIRROR_SECURITY} ${CODENAME_OLDSTABLE}/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ testing)
+ echo "deb ${LIVE_MIRROR} testing ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src ${LIVE_MIRROR} testing ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb ${LIVE_MIRROR} testing-proposed-updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src ${LIVE_MIRROR} testing-proposed-updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb ${LIVE_MIRROR_SECURITY} testing/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src ${LIVE_MIRROR_SECURITY} testing/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ ;;
+
+ unstable)
+ echo "deb ${LIVE_MIRROR} unstable ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src ${LIVE_MIRROR} unstable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+
+ if [ "${LIVE_DISTRIBUTION_EXPERIMENTAL}" = "yes" ]
+ then
+ echo "deb ${LIVE_MIRROR} experimental ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src ${LIVE_MIRROR} experimental ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+
+cat > "${LIVE_CHROOT}"/etc/apt/preferences << EOF
+Package: *
+Pin: release a=experimental
+Pin-Priority: 999
+EOF
+ fi
;;
esac
;;
- custom)
- # Configure custom sources.list
- echo "deb ${LIVE_MIRROR} ${LIVE_DISTRIBUTION} ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
-
+ default)
+ # Configure default sources.list
case "${LIVE_DISTRIBUTION}" in
- "${CODENAME_TESTING}")
- echo "deb ${LIVE_MIRROR} ${CODENAME_TESTING}-proposed-updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
- echo "deb ${LIVE_MIRROR_SECURITY} ${CODENAME_TESTING}/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ oldstable)
+ echo "deb http://ftp.debian.org/debian/ oldstable ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src http://ftp.debian.org/debian/ oldstable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb http://security.debian.org/ oldstable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src http://security.debian.org/ oldstable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
;;
- "${CODENAME_STABLE}")
- echo "deb ${LIVE_MIRROR_SECURITY} ${CODENAME_STABLE}/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ stable)
+ echo "deb http://ftp.debian.org/debian/ stable ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src http://ftp.debian.org/debian/ stable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb http://security.debian.org/ stable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src http://security.debian.org/ stable/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
;;
- "${CODENAME_OLDSTABLE}")
- echo "deb ${LIVE_MIRROR_SECURITY} ${CODENAME_OLDSTABLE}/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ testing)
+ echo "deb http://ftp.debian.org/debian/ testing ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src http://ftp.debian.org/debian/ testing ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb http://ftp.debian.org/debian/ testing-proposed-updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src http://ftp.debian.org/debian/ testing-proposed-updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb http://security.debian.org/ testing/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src http://security.debian.org/ testing/updates ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ ;;
+
+ unstable)
+ echo "deb http://ftp.debian.org/debian/ unstable ${LIVE_SECTION}" > "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src http://ftp.debian.org/debian/ unstable ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+
+ if [ "${LIVE_DISTRIBUTION_EXPERIMENTAL}" = "yes" ]
+ then
+ echo "deb http://ftp.debian.org/debian/ experimental ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ echo "deb-src http://ftp.debian.org/debian/ experimental ${LIVE_SECTION}" >> "${LIVE_CHROOT}"/etc/apt/sources.list
+ fi
;;
esac
;;
@@ -55,79 +99,13 @@ Indices ()
# Update indices
Chroot_exec "apt-get update"
-}
-Md5sum ()
-{
- # Calculating md5sums
- cd "${LIVE_ROOT}"/image
- find . -type f -print0 | xargs -0 md5sum > "${LIVE_ROOT}"/md5sum.txt
- cd "${OLDPWD}"
-
- if [ -d "${LIVE_INCLUDE_IMAGE}" ]
- then
- cd "${LIVE_INCLUDE_IMAGE}"
- find . -type f -print0 | xargs -0 md5sum >> "${LIVE_ROOT}"/md5sum.txt
- cd "${OLDPWD}"
- fi
-
- mv "${LIVE_ROOT}"/md5sum.txt "${LIVE_ROOT}"/image
-}
-
-Mkisofs ()
-{
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
+ if [ "${LIVE_DISTRIBUTION_EXPERIMENTAL}" = "yes" ]
then
- mkisofs -A "Debian Live" -p "Debian Live; http://live.debian.net/; live@lists.debian-unofficial.org" -publisher "Debian Live; http://live.debian.net/; live@lists.debian-unofficial.org" -o "${LIVE_ROOT}"/image.iso -r -J -l -V "Debian Live `date +%Y%m%d`" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "${LIVE_ROOT}"/image ${LIVE_INCLUDE_IMAGE}
- else
- echo "W: Bootloader on your architecture not yet supported (Continuing in 5 seconds)."
- sleep 5
-
- # Create image
- mkisofs -o "${LIVE_ROOT}"/image.iso -r -J -l -V "Debian Live `date +%Y%m%d`" "${LIVE_ROOT}"/image ${LIVE_INCLUDE_IMAGE}
- fi
-}
-
-Linuximage ()
-{
- case "${1}" in
- iso)
- # Copy linux-image
- cp "${LIVE_CHROOT}"/boot/vmlinuz-* "${LIVE_ROOT}"/image/isolinux/vmlinuz
- cp "${LIVE_CHROOT}"/boot/initrd.img-* "${LIVE_ROOT}"/image/isolinux/initrd.gz
- ;;
-
- net)
- # Copy linux-image
- cp "${LIVE_ROOT}"/chroot/boot/vmlinuz-* "${LIVE_ROOT}"/tftpboot/vmlinuz
- cp "${LIVE_ROOT}"/chroot/boot/initrd.img-* "${LIVE_ROOT}"/tftpboot/initrd.gz
- ;;
- esac
-}
-
-Memtest ()
-{
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
- then
- # Install memtest
- Patch_network apply
- Chroot_exec "apt-get install --yes memtest86+"
-
- case "$1" in
- iso)
- # Copy memtest
- cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin "${LIVE_ROOT}"/image/isolinux/memtest
- ;;
-
- net)
- # Copy memtest
- cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin "${LIVE_ROOT}"/tftpboot/memtest
- ;;
- esac
-
- # Remove memtest
- Chroot_exec "apt-get remove --purge --yes memtest86+"
- Patch_network deapply
+ # experimental is sometimes broken,
+ # therefore this is intentionally kept interactive.
+ Chroot_exec "apt-get upgrade" || return 0
+ Chroot_exec "apt-get dist-upgrade" || return 0
fi
}
@@ -138,22 +116,22 @@ Genrootfs ()
DU_DIM="`du -ks ${LIVE_CHROOT} | cut -f1`"
REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here...
- genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root="${LIVE_CHROOT}" "${LIVE_ROOT}"/image/casper/filesystem.ext2
+ genext2fs --size-in-blocks=${REAL_DIM} --reserved-blocks=0 --root="${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.ext2
;;
plain)
cd "${LIVE_CHROOT}"
- find . | cpio -pumd "${LIVE_ROOT}"/image/casper/filesystem.dir
+ find . | cpio -pumd "${LIVE_ROOT}"/binary/casper/filesystem.dir
cd "${OLDPWD}"
;;
squashfs)
- if [ -f "${LIVE_ROOT}"/image/casper/filesystem.squashfs ]
+ if [ -f "${LIVE_ROOT}"/binary/casper/filesystem.squashfs ]
then
- rm "${LIVE_ROOT}"/image/casper/filesystem.squashfs
+ rm "${LIVE_ROOT}"/binary/casper/filesystem.squashfs
fi
- mksquashfs "${LIVE_CHROOT}" "${LIVE_ROOT}"/image/casper/filesystem.squashfs
+ mksquashfs "${LIVE_CHROOT}" "${LIVE_ROOT}"/binary/casper/filesystem.squashfs
;;
esac
}
@@ -169,18 +147,18 @@ Syslinux ()
case "${1}" in
iso)
# Copy syslinux
- mkdir -p "${LIVE_ROOT}"/image/isolinux
- cp "${LIVE_CHROOT}"/usr/lib/syslinux/isolinux.bin "${LIVE_ROOT}"/image/isolinux
+ mkdir -p "${LIVE_ROOT}"/binary/isolinux
+ cp "${LIVE_CHROOT}"/usr/lib/syslinux/isolinux.bin "${LIVE_ROOT}"/binary/isolinux
# Install syslinux templates
cp -r "${LIVE_TEMPLATES}"/syslinux/* \
- "${LIVE_ROOT}"/image/isolinux
- rm -f "${LIVE_ROOT}"/image/isolinux/pxelinux.cfg
+ "${LIVE_ROOT}"/binary/isolinux
+ rm -f "${LIVE_ROOT}"/binary/isolinux/pxelinux.cfg
# Configure syslinux templates
- sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/image/isolinux/isolinux.cfg
- sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" "${LIVE_ROOT}"/image/isolinux/f1.txt
- sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/image/isolinux/f10.txt
+ sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg
+ sed -i -e "s/LIVE_DATE/`date +%Y%m%d`/" "${LIVE_ROOT}"/binary/isolinux/f1.txt
+ sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/binary/isolinux/f10.txt
;;
net)
@@ -207,3 +185,114 @@ Syslinux ()
Patch_network deapply
fi
}
+
+Linuximage ()
+{
+ case "${1}" in
+ iso)
+ # Copy linux-image
+ cp "${LIVE_CHROOT}"/boot/vmlinuz-* "${LIVE_ROOT}"/binary/isolinux/vmlinuz
+ cp "${LIVE_CHROOT}"/boot/initrd.img-* "${LIVE_ROOT}"/binary/isolinux/initrd.gz
+ ;;
+
+ net)
+ # Copy linux-image
+ cp "${LIVE_ROOT}"/chroot/boot/vmlinuz-* "${LIVE_ROOT}"/tftpboot/vmlinuz
+ cp "${LIVE_ROOT}"/chroot/boot/initrd.img-* "${LIVE_ROOT}"/tftpboot/initrd.gz
+ ;;
+ esac
+}
+
+Memtest ()
+{
+ if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
+ then
+ # Install memtest
+ Patch_network apply
+ Chroot_exec "apt-get install --yes memtest86+"
+
+ case "$1" in
+ iso)
+ # Copy memtest
+ cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin "${LIVE_ROOT}"/binary/isolinux/memtest
+ ;;
+
+ net)
+ # Copy memtest
+ cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin "${LIVE_ROOT}"/tftpboot/memtest
+ ;;
+ esac
+
+ # Remove memtest
+ Chroot_exec "apt-get remove --purge --yes memtest86+"
+ Patch_network deapply
+ fi
+}
+
+Md5sum ()
+{
+ # Calculating md5sums
+ cd "${LIVE_ROOT}"/binary
+ find . -type f -print0 | xargs -0 md5sum > "${LIVE_ROOT}"/md5sum.txt
+ cd "${OLDPWD}"
+
+ if [ -d "${LIVE_INCLUDE_IMAGE}" ]
+ then
+ cd "${LIVE_INCLUDE_IMAGE}"
+ find . -type f -print0 | xargs -0 md5sum >> "${LIVE_ROOT}"/md5sum.txt
+ cd "${OLDPWD}"
+ fi
+
+ mv "${LIVE_ROOT}"/md5sum.txt "${LIVE_ROOT}"/binary
+}
+
+Mkisofs ()
+{
+ case "${1}" in
+ binary)
+ if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
+ then
+ # Create image
+ mkisofs -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"binary.iso -r -J -l -V "Debian Live `date +%Y%m%d`" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "${LIVE_ROOT}"/binary ${LIVE_INCLUDE_IMAGE}
+ else
+ echo "W: Bootloader on your architecture not yet supported (Continuing in 5 seconds)."
+ sleep 5
+
+ # Create image
+ mkisofs -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"binary.iso -r -J -l -V "Debian Live `date +%Y%m%d`" "${LIVE_ROOT}"/binary ${LIVE_INCLUDE_IMAGE}
+ fi
+ ;;
+
+ source)
+ # Create image
+ mkisofs -A "Debian Live" -p "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -publisher "Debian Live; http://debian-live.alioth.debian.org/; debian-live-devel@lists.alioth.debian.org" -o "${LIVE_ROOT}"/"${LIVE_IMAGE}"source.iso -r -J -l -V "Debian Live `date +%Y%m%d`" "${LIVE_ROOT}"/source
+ ;;
+ esac
+}
+
+Sources ()
+{
+ # Download sources
+ Chroot_exec "dpkg --get-selections" | awk '{ print $1 }' > "${LIVE_CHROOT}"/root/dpkg-selection.txt
+ Chroot_exec "xargs --arg-file=/root/dpkg-selection.txt apt-get source --download-only"
+ rm -f "${LIVE_CHROOT}"/root/dpkg-selection.txt
+
+ # Sort sources
+ for DSC in "${LIVE_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 "${LIVE_ROOT}"/source/"${LETTER}"/"${SOURCE}"
+
+ # Move sources
+ mv "${LIVE_CHROOT}"/"${SOURCE}"_* "${LIVE_ROOT}"/source/"${LETTER}"/"${SOURCE}"
+ done
+}
diff --git a/src/scripts/22iso.sh b/src/scripts/22iso.sh
index 8f5b8c2..07b1f91 100644
--- a/src/scripts/22iso.sh
+++ b/src/scripts/22iso.sh
@@ -11,32 +11,59 @@
Iso ()
{
- mkdir -p "${LIVE_ROOT}"/image/casper
+ if [ ! -f "${LIVE_ROOT}"/.stage/image_binary ]
+ then
+ mkdir -p "${LIVE_ROOT}"/binary/casper
- # Switching package indices to default
- Indices default
+ # Switching package indices to default
+ if [ "${LIVE_GENERIC_INDICES}" = "yes" ]
+ then
+ Indices default
+ fi
- # Generating rootfs image
- Genrootfs
+ # Generating rootfs image
+ Genrootfs
- # Switching package indices to custom
- Indices custom
+ # Switching package indices to custom
+ if [ "${LIVE_GENERIC_INDICES}" = "yes" ]
+ then
+ Indices custom
+ fi
- # Installing syslinux
- Syslinux iso
+ # Installing syslinux
+ Syslinux iso
- # Installing linux-image
- Linuximage iso
+ # Installing linux-image
+ Linuximage iso
- # Installing memtest
- Memtest iso
+ # Installing memtest
+ Memtest iso
- # Installing templates
- cp -r "${LIVE_TEMPLATES}"/iso/* "${LIVE_ROOT}"/image
+ # Installing templates
+ if [ "${LIVE_FLAVOUR}" != "minimal" ]
+ then
+ cp -r "${LIVE_TEMPLATES}"/iso/* "${LIVE_ROOT}"/binary
+ fi
- # Calculating md5sums
- Md5sum
+ # Calculating md5sums
+ Md5sum
- # Creating image
- Mkisofs
+ # Creating image
+ Mkisofs binary
+
+ # Touching stage file
+ touch "${LIVE_ROOT}"/.stage/image_binary
+ fi
+
+ if [ ! -f "${LIVE_ROOT}"/.stage/image_source ] && [ "${LIVE_SOURCE}" = "yes" ]
+ then
+ # Downloading sources
+ Sources
+
+ # Creating image
+ Mkisofs source
+
+ # Touching stage file
+ touch "${LIVE_ROOT}"/.stage/image_source
+ fi
}
diff --git a/src/scripts/23net.sh b/src/scripts/23net.sh
index 1441183..563420b 100644
--- a/src/scripts/23net.sh
+++ b/src/scripts/23net.sh
@@ -11,51 +11,73 @@
Net ()
{
- # Installing smbfs
- Chroot_exec "apt-get install --yes smbfs"
-
- if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
+ if [ ! -f "${LIVE_ROOT}"/.stage/image_binary ]
then
- if [ ! -d "${LIVE_CHROOT}"/etc/initramfs-tools ]
- then
- mkdir "${LIVE_CHROOT}"/etc/initramfs-tools
- fi
+ # Installing smbfs
+ Chroot_exec "apt-get install --yes smbfs"
+
+ if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
+ then
+ if [ ! -d "${LIVE_CHROOT}"/etc/initramfs-tools ]
+ then
+ mkdir "${LIVE_CHROOT}"/etc/initramfs-tools
+ fi
- # Configuring initramfs for NFS
+ # Configuring initramfs for NFS
cat >> "${LIVE_CHROOT}"/etc/initramfs-tools/initramfs.conf << EOF
MODULES=netboot
BOOT=nfs
NFSROOT=auto
EOF
- Chroot_exec "update-initramfs -tu"
- fi
+ Chroot_exec "update-initramfs -tu"
+ fi
- # Switching package indices to default
- Indices default
+ # Switching package indices to default
+ if [ "${LIVE_GENERIC_INDICES}" = "yes" ]
+ then
+ Indices default
+ fi
- # Generating rootfs image
- Genrootfs
-
- # Switching package indices to custom
- Indices custom
-
- # Installing syslinux
- Syslinux net
-
- # Installing linux-image
- Linuximage net
-
- # Installing memtest
- Memtest net
-
- # Creating tarball
- LIVE_BASENAME=`basename "${LIVE_ROOT}"`
- LIVE_BASE_SERVER_PATH=`basename "${LIVE_SERVER_PATH}"`
- cd "${LIVE_ROOT}" && \
- mv image "${LIVE_BASE_SERVER_PATH}" && \
- cd .. && \
- tar cfz netboot.tar.gz "${LIVE_BASENAME}/${LIVE_BASE_SERVER_PATH}" "${LIVE_BASENAME}/tftpboot" && \
- mv netboot.tar.gz "${LIVE_ROOT}" && \
- cd "${OLDPWD}" && \
- mv "${LIVE_BASE_SERVER_PATH}" image
+ # Generating rootfs image
+ Genrootfs
+
+ # Switching package indices to custom
+ if [ "${LIVE_GENERIC_INDICES}" = "yes" ]
+ then
+ Indices custom
+ fi
+
+ # Installing syslinux
+ Syslinux net
+
+ # Installing linux-image
+ Linuximage net
+
+ # Installing memtest
+ Memtest net
+
+ # Creating tarball
+ cd "${LIVE_ROOT}" && \
+ mv binary "`basename ${LIVE_SERVER_PATH}`" && \
+ cd .. && \
+ tar cfz binary.tar.gz "`basename ${LIVE_ROOT}`/`basename ${LIVE_SERVER_PATH}`" "`basename ${LIVE_ROOT}`/tftpboot" && \
+ mv binary.tar.gz "${LIVE_ROOT}" && \
+ cd "${OLDPWD}" && \
+ mv "`basename ${LIVE_SERVER_PATH}`" binary
+
+ # Touching stage file
+ touch "${LIVE_ROOT}"/.stage/image_binary
+ fi
+
+ if [ ! -f "${LIVE_ROOT}"/.stage/image_source ] && [ "${LIVE_SOURCE}" = "yes" ]
+ then
+ # Downloading sources
+ Sources
+
+ # Creating tarball
+ tar cfz source.tar.gz "${LIVE_ROOT}"/source
+
+ # Touching stage file
+ touch "${LIVE_ROOT}"/.stage/image_source
+ fi
}