summaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/02defaults.sh5
-rw-r--r--src/scripts/11bootstrap.sh7
-rw-r--r--src/scripts/13chroot.sh30
-rw-r--r--src/scripts/21image.sh22
-rw-r--r--src/scripts/22iso.sh34
-rw-r--r--src/scripts/23net.sh30
-rw-r--r--src/scripts/24.usb.sh102
7 files changed, 186 insertions, 44 deletions
diff --git a/src/scripts/02defaults.sh b/src/scripts/02defaults.sh
index 924ad65..e0590f4 100644
--- a/src/scripts/02defaults.sh
+++ b/src/scripts/02defaults.sh
@@ -188,6 +188,9 @@ Defaults ()
if [ "${LIVE_FLAVOUR}" = "minimal" ]
then
LIVE_PACKAGE_LIST="${BASE}/lists/minimal"
+ elif [ "${LIVE_FLAVOUR}" = "mini" ]
+ then
+ LIVE_PACKAGE_LISTS="${BASE}/lists/mini"
else
LIVE_PACKAGE_LIST="${BASE}/lists/standard"
fi
@@ -257,7 +260,7 @@ Defaults ()
fi
# Set package indices
- if [ -z "${LIVE_GENERIC_INDICES}" ] && [ "${LIVE_FLAVOUR}" != "minimal" ]
+ if [ -z "${LIVE_GENERIC_INDICES}" ] && [ "${LIVE_FLAVOUR}" != "minimal" ] && [ "${LIVE_FLAVOUR}" != "mini" ]
then
LIVE_GENERIC_INDICES="yes"
fi
diff --git a/src/scripts/11bootstrap.sh b/src/scripts/11bootstrap.sh
index 224ac19..bc3a2ab 100644
--- a/src/scripts/11bootstrap.sh
+++ b/src/scripts/11bootstrap.sh
@@ -24,7 +24,12 @@ Bootstrap ()
fi
# Bootstrap system
- cdebootstrap --arch="${LIVE_ARCHITECTURE}" --flavour="${LIVE_FLAVOUR}" ${SUITE_CONFIG} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
+ if [ "${LIVE_FLAVOUR}" = "mini" ]
+ then
+ cdebootstrap --arch="${LIVE_ARCHITECTURE}" --flavour=minimal ${SUITE_CONFIG} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
+ else
+ cdebootstrap --arch="${LIVE_ARCHITECTURE}" --flavour="${LIVE_FLAVOUR}" ${SUITE_CONFIG} "${LIVE_DISTRIBUTION}" "${LIVE_CHROOT}" "${LIVE_MIRROR}"
+ fi
# Remove unused packages
Chroot_exec "dpkg -P cdebootstrap-helper-diverts"
diff --git a/src/scripts/13chroot.sh b/src/scripts/13chroot.sh
index 5a5298e..9403448 100644
--- a/src/scripts/13chroot.sh
+++ b/src/scripts/13chroot.sh
@@ -50,7 +50,7 @@ EOF
if [ "${LIVE_DISTRIBUTION}" = "unstable" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_UNSTABLE}" ] || \
[ "${LIVE_DISTRIBUTION}" = "testing" ] || [ "${LIVE_DISTRIBUTION}" = "${CODENAME_TESTING}" ]
then
- if [ "${LIVE_FLAVOUR}" != "minimal" ]
+ if [ "${LIVE_FLAVOUR}" != "minimal" ] || [ "${LIVE_FLAVOUR}" != "mini" ]
then
Chroot_exec "apt-get install --yes --force-yes ${LIVE_REPOSITORY_KEYRING}"
@@ -229,7 +229,7 @@ EOF
rm -rf "${LIVE_CHROOT}"/var/cache/apt
mkdir -p "${LIVE_CHROOT}"/var/cache/apt/archives/partial
- if [ "${LIVE_FLAVOUR}" = "minimal" ]
+ if [ "${LIVE_FLAVOUR}" = "minimal" ] || [ "${LIVE_FLAVOUR}" = "mini" ]
then
rm -rf "${LIVE_CHROOT}"/var/lib/apt/lists/*
rm -f "${LIVE_CHROOT}"/var/lib/dpkg/available-old
@@ -257,4 +257,30 @@ EOF
# Touching stage file
touch "${LIVE_ROOT}"/.stage/chroot
fi
+
+ # Check depends
+ if [ "`grep dosfstools ${LIVE_ROOT}/packages.txt`" ]
+ then
+ KEEP_DOSFSTOOLS="true"
+ fi
+
+ if [ "`grep memtest86+ ${LIVE_ROOT}/packages.txt`" ]
+ then
+ KEEP_MEMTEST86="true"
+ fi
+
+ if [ "`grep mtools ${LIVE_ROOT}/packages.txt`" ]
+ then
+ KEEP_MTOOLS="true"
+ fi
+
+ if [ "`grep parted ${LIVE_ROOT}/packages.txt`" ]
+ then
+ KEEP_PARTED="true"
+ fi
+
+ if [ "`grep syslinux ${LIVE_ROOT}/packages.txt`" ]
+ then
+ KEEP_SYSLINUX="true"
+ fi
}
diff --git a/src/scripts/21image.sh b/src/scripts/21image.sh
index 934bc70..9fc4fe2 100644
--- a/src/scripts/21image.sh
+++ b/src/scripts/21image.sh
@@ -166,10 +166,6 @@ Syslinux ()
{
if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
then
- # Install syslinux
- Patch_network apply
- Chroot_exec "aptitude install --assume-yes syslinux"
-
case "${1}" in
iso)
# Copy syslinux
@@ -223,10 +219,6 @@ Syslinux ()
sed -i -e "s/LIVE_VERSION/${VERSION}/" "${LIVE_ROOT}"/tftpboot/pxelinux.cfg/f10.txt
;;
esac
-
- # Remove syslinux
- Chroot_exec "aptitude purge --assume-yes syslinux"
- Patch_network deapply
fi
}
@@ -238,7 +230,7 @@ Linuximage ()
case "${1}" in
iso)
# Copy linux-image
- if [ "${LIVE_FLAVOUR}" = "minimal" ]
+ if [ "${LIVE_FLAVOUR}" = "minimal" ] || [ "${LIVE_FLAVOUR}" = "mini" ]
then
mv "${LIVE_CHROOT}"/boot/vmlinuz* "${LIVE_ROOT}"/binary/isolinux/vmlinuz
mv "${LIVE_CHROOT}"/boot/initrd.img* "${LIVE_ROOT}"/binary/isolinux/initrd.gz
@@ -251,7 +243,7 @@ Linuximage ()
net)
# Copy linux-image
- if [ "${LIVE_FLAVOUR}" = "minimal" ]
+ if [ "${LIVE_FLAVOUR}" = "minimal" ] || [ "${LIVE_FLAVOUR}" = "mini" ]
then
mv "${LIVE_ROOT}"/chroot/boot/vmlinuz* "${LIVE_ROOT}"/tftpboot/vmlinuz
mv "${LIVE_ROOT}"/chroot/boot/initrd.img* "${LIVE_ROOT}"/tftpboot/initrd.gz
@@ -267,10 +259,6 @@ Memtest ()
{
if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
then
- # Install memtest
- Patch_network apply
- Chroot_exec "aptitude install --assume-yes memtest86+"
-
case "$1" in
iso)
# Copy memtest
@@ -282,10 +270,6 @@ Memtest ()
cp "${LIVE_ROOT}"/chroot/boot/memtest86+.bin "${LIVE_ROOT}"/tftpboot/memtest
;;
esac
-
- # Remove memtest
- Chroot_exec "aptitude purge --assume-yes memtest86+"
- Patch_network deapply
fi
}
@@ -306,7 +290,7 @@ Md5sum ()
mv "${LIVE_ROOT}"/md5sum.txt "${LIVE_ROOT}"/binary
}
-Mkisofs ()
+Genisoimage ()
{
case "${1}" in
binary)
diff --git a/src/scripts/22iso.sh b/src/scripts/22iso.sh
index 6f60a5f..c99b774 100644
--- a/src/scripts/22iso.sh
+++ b/src/scripts/22iso.sh
@@ -66,6 +66,20 @@ Iso ()
# Switching package indices to custom
Indices custom
+ # Install depends
+ if [ -z "${KEEP_MEMTEST86}" ]
+ then
+ if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
+ then
+ Chroot_exec "aptitude install --assume-yes memtest86+"
+ fi
+ fi
+
+ if [ -z "${KEEP_SYSLINUX}" ]
+ then
+ Chroot_exec "aptitude install --assume-yes syslinux"
+ fi
+
# Installing syslinux
Syslinux iso
@@ -75,6 +89,20 @@ Iso ()
# Installing memtest
Memtest iso
+ # Remove depends
+ if [ -z "${KEEP_MEMTEST86}" ]
+ then
+ if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
+ then
+ Chroot_exec "aptitude purge --assume-yes memtest86+"
+ fi
+ fi
+
+ if [ -z "${KEEP_SYSLINUX}" ]
+ then
+ Chroot_exec "aptitude purge --assume-yes syslinux"
+ fi
+
# Deconfigure network
Patch_network deapply
@@ -83,7 +111,7 @@ Iso ()
Patch_chroot deapply
# Installing templates
- if [ "${LIVE_FLAVOUR}" != "minimal" ]
+ if [ "${LIVE_FLAVOUR}" != "minimal" ] || [ "${LIVE_FLAVOUR}" != "mini" ]
then
cp -r "${LIVE_TEMPLATES}"/iso/* "${LIVE_ROOT}"/binary
cp -r "${LIVE_TEMPLATES}"/common/* "${LIVE_ROOT}"/binary
@@ -93,7 +121,7 @@ Iso ()
Md5sum
# Creating image
- Mkisofs binary
+ Genisoimage binary
# Touching stage file
touch "${LIVE_ROOT}"/.stage/image_binary
@@ -119,7 +147,7 @@ Iso ()
Patch_chroot deapply
# Creating image
- Mkisofs source
+ Genisoimage source
# Touching stage file
touch "${LIVE_ROOT}"/.stage/image_source
diff --git a/src/scripts/23net.sh b/src/scripts/23net.sh
index f9c2089..ef837f4 100644
--- a/src/scripts/23net.sh
+++ b/src/scripts/23net.sh
@@ -93,6 +93,22 @@ EOF
# Switching package indices to custom
Indices custom
+ # Install depends
+ if [ -z "${KEEP_MEMTEST86}" ]
+ then
+ if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
+ then
+ Patch_network apply
+ Chroot_exec "aptitude install --assume-yes memtest86+"
+ fi
+ fi
+
+ if [ -z "${KEEP_SYSLINUX}" ]
+ then
+ Patch_network apply
+ Chroot_exec "aptitude install --assume-yes syslinux"
+ fi
+
# Installing syslinux
Syslinux net
@@ -102,6 +118,20 @@ EOF
# Installing memtest
Memtest net
+ # Remove depends
+ if [ -z "${KEEP_SYSLINUX}" ]
+ then
+ if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
+ then
+ Chroot_exec "aptitude purge --assume-yes syslinux"
+ fi
+ fi
+
+ if [ -z "${KEEP_SYSLINUX}" ]
+ then
+ Chroot_exec "aptitude purge --assume-yes syslinux"
+ fi
+
# Deconfigure network
Patch_network deapply
diff --git a/src/scripts/24.usb.sh b/src/scripts/24.usb.sh
index cc51fda..200ca35 100644
--- a/src/scripts/24.usb.sh
+++ b/src/scripts/24.usb.sh
@@ -20,6 +20,7 @@ Usb ()
# Configure network
Patch_network apply
+ # Manifest
mkdir -p "${LIVE_ROOT}"/binary/casper
for MANIFEST in "${LIVE_ROOT}"/filesystem.manifest*
do
@@ -50,6 +51,9 @@ Usb ()
# Generating rootfs image
Genrootfs
+ # Mount proc
+ mount proc-live -t proc "${LIVE_CHROOT}"/proc
+
# Configure chroot
Patch_chroot apply
Patch_runlevel apply
@@ -66,6 +70,35 @@ Usb ()
# Switching package indices to custom
Indices custom
+ # Install depends
+ if [ -z "${KEEP_DOSFSTOOLS}" ]
+ then
+ Chroot_exec "aptitude install --assume-yes dosfstools"
+ fi
+
+ if [ -z "${KEEP_MEMTEST86}" ]
+ then
+ if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
+ then
+ Chroot_exec "aptitude install --assume-yes memtest86+"
+ fi
+ fi
+
+ if [ -z "${KEEP_MTOOLS}" ]
+ then
+ Chroot_exec "aptitude install --assume-yes mtools"
+ fi
+
+ if [ -z "${KEEP_PARTED}" ]
+ then
+ Chroot_exec "aptitude install --assume-yes parted"
+ fi
+
+ if [ -z "${KEEP_SYSLINUX}" ]
+ then
+ Chroot_exec "aptitude install --assume-yes syslinux"
+ fi
+
# Installing syslinux
Syslinux iso
@@ -75,51 +108,84 @@ Usb ()
# Installing memtest
Memtest iso
- # Deconfigure network
- Patch_network deapply
-
- # Deconfigure chroot
- Patch_runlevel deapply
- Patch_chroot deapply
-
# Calculating md5sums
Md5sum
# Creating image
+
+ # USB hacks
mv "${LIVE_ROOT}"/binary/isolinux/isolinux.cfg "${LIVE_ROOT}"/binary/syslinux.cfg
mv "${LIVE_ROOT}"/binary/isolinux/isolinux.bin "${LIVE_ROOT}"/binary/syslinux.bin
mv "${LIVE_ROOT}"/binary/isolinux/* "${LIVE_ROOT}"/binary
+ rmdir "${LIVE_ROOT}"/binary/isolinux/
# Everything which comes here needs to be cleaned up,
- # especially all the parted/syslinux stuff should be done
- # from within the chroot, not on the host system, will do that later.
-
DU_DIM="`du -ms ${LIVE_ROOT}/binary | cut -f1`"
REAL_DIM="`expr ${DU_DIM} + ${DU_DIM} / 20`" # Just 5% more to be sure, need something more sophistcated here...
dd if=/dev/zero of="${LIVE_ROOT}"/binary.img bs=1024k count=${REAL_DIM}
echo "!!! The following error/warning messages can be ignored !!!"
losetup_p "${LIVE_ROOT}"/binary.img 0
- parted -s ${FREELO} mklabel msdos
set +e
- parted -s ${FREELO} mkpartfs primary fat16 0.0 100%
- parted -s ${FREELO} set 1 boot on
- parted -s ${FREELO} set 1 lba off
+ Chroot_exec "parted -s ${FREELO} mklabel msdos"
+ Chroot_exec "parted -s ${FREELO} mkpartfs primary fat16 0.0 100%"
+ Chroot_exec "parted -s ${FREELO} set 1 boot on"
+ Chroot_exec "parted -s ${FREELO} set 1 lba off"
set -e
- cat /usr/lib/syslinux/mbr.bin > ${FREELO}
+ cat "${LIVE_CHROOT}"/usr/lib/syslinux/mbr.bin > ${FREELO}
losetup -d ${FREELO}
- echo "!!! The above error/warning messages can be ignored !!!"
losetup_p "${LIVE_ROOT}"/binary.img 1
- mkfs.msdos -n DEBIAN_LIVE ${FREELO}
+ Chroot_exec "mkfs.msdos -n DEBIAN_LIVE ${FREELO}"
mkdir "${LIVE_ROOT}"/binary.tmp
mount ${FREELO} "${LIVE_ROOT}"/binary.tmp
cp -r "${LIVE_ROOT}"/binary/* "${LIVE_ROOT}"/binary.tmp
umount "${LIVE_ROOT}"/binary.tmp
rmdir "${LIVE_ROOT}"/binary.tmp
- syslinux ${FREELO}
+ Chroot_exec "syslinux ${FREELO}"
losetup -d ${FREELO}
+ echo "!!! The above error/warning messages can be ignored !!!"
+
+ # Remove depends
+ if [ -z "${KEEP_DOSFSTOOLS}" ]
+ then
+ Chroot_exec "aptitude purge --assume-yes dosfstools"
+ fi
+
+ if [ -z "${KEEP_MEMTEST86}" ]
+ then
+ if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
+ then
+ Chroot_exec "aptitude purge --assume-yes memtest86+"
+ fi
+ fi
+
+ if [ -z "${KEEP_MTOOLS}" ]
+ then
+ Chroot_exec "aptitude purge --assume-yes mtools"
+ fi
+
+ if [ -z "${KEEP_PARTED}" ]
+ then
+ Chroot_exec "aptitude purge --assume-yes parted"
+ fi
+
+ if [ -z "${KEEP_SYSLINUX}" ]
+ then
+ Chroot_exec "aptitude purge --assume-yes syslinux"
+ fi
+
+ # Deconfigure network
+ Patch_network deapply
+
+ # Deconfigure chroot
+ Patch_runlevel deapply
+ Patch_chroot deapply
+
+ # Unmount proc
+ umount "${LIVE_CHROOT}"/proc
+
# Touching stage file
touch "${LIVE_ROOT}"/.stage/image_binary
fi