Updating image autobuild script.

This commit is contained in:
Daniel Baumann 2010-02-20 14:18:57 +01:00
parent 45dc146eac
commit aaef30f52e
1 changed files with 124 additions and 62 deletions

View File

@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/sh
set -e
# Static variables
DISTRIBUTIONS="${DISTRIBUTIONS:-lenny squeeze sid}"
@ -12,75 +14,130 @@ MIRROR_SECURITY="${MIRROR_SECURITY:-http://security.debian.org/}"
ARCHITECTURE="$(dpkg --print-architecture)"
DATE="$(date +%Y%m%d)"
Set_defaults ()
{
# Distribution defaults
APT_RECOMMENDS="true"
BINARY_INDICES="true"
DEBIAN_INSTALLER="live"
DEBIAN_INSTALLER_GUI="true"
PACKAGES="--packages live-installer-launcher"
TASKSEL="tasksel"
# Distribution specific options (ugly!)
case "${DISTRIBUTION}" in
lenny)
APT_RECOMMENDS="false"
BINARY_INDICES="true"
DEBIAN_INSTALLER="false"
PACKAGES=""
TASKSEL="aptitude"
case "${ARCHITECTURE}" in
amd64)
case "${FLAVOUR}" in
gnome-desktop)
BINARY_INDICES="false"
mkdir -p config/chroot_local-hooks
cd config/chroot_local-hooks
echo "apt-get remove --yes --purge openoffice.org-help-en-us" > package-removals
echo "apt-get remove --yes --purge epiphany-browser epiphany-browser-data epiphany-extensions epiphany-gecko" >> package-removals
echo "apt-get remove --yes --purge gnome-user-guide" >> package-removals
cd -
;;
kde-desktop)
BINARY_INDICES="false"
;;
esac
;;
i386)
case "${FLAVOUR}" in
gnome-desktop|kde-desktop)
BINARY_INDICES="false"
KERNEL="-k 686"
;;
esac
;;
esac
;;
squeeze)
DEBIAN_INSTALLER_GUI="false"
LIVE_INSTALLER="16"
LIVE_INITRAMFS="1.173.3-1"
mkdir -p config/binary_local-udebs
cd config/binary_local-udebs
wget -c http://live.debian.net/archive/packages/live-installer/${LIVE_INSTALLER}/live-installer_${LIVE_INSTALLER}.dsc
wget -c http://live.debian.net/archive/packages/live-installer/${LIVE_INSTALLER}/live-installer_${LIVE_INSTALLER}.tar.gz
wget -c http://live.debian.net/archive/packages/live-installer/${LIVE_INSTALLER}/live-installer_${LIVE_INSTALLER}_i386.udeb
cd -
mkdir -p config/chroot_local-packages
cd config/chroot_local-packages
wget -c http://live.debian.net/archive/packages/live-installer/${LIVE_INSTALLER}/live-installer_${LIVE_INSTALLER}.dsc
wget -c http://live.debian.net/archive/packages/live-installer/${LIVE_INSTALLER}/live-installer_${LIVE_INSTALLER}.tar.gz
wget -c http://live.debian.net/archive/packages/live-installer/${LIVE_INSTALLER}/live-installer-launcher_${LIVE_INSTALLER}_all.deb
wget -c http://live.debian.net/archive/packages/live-initramfs/${LIVE_INITRAMFS}/live-initramfs_${LIVE_INITRAMFS}.diff.gz
wget -c http://live.debian.net/archive/packages/live-initramfs/${LIVE_INITRAMFS}/live-initramfs_${LIVE_INITRAMFS}.dsc
wget -c http://live.debian.net/archive/packages/live-initramfs/${LIVE_INITRAMFS}/live-initramfs_${LIVE_INITRAMFS}_all.deb
wget -c http://live.debian.net/archive/packages/live-initramfs/${LIVE_INITRAMFS}/live-initramfs_$(echo ${LIVE_INITRAMFS} | awk -F- '{ print $1 }').orig.tar.gz
cd -
;;
esac
}
# Build images
for DISTRIBUTION in ${DISTRIBUTIONS}
do
rm -rf cache/stages*
for FLAVOUR in ${FLAVOURS}
do
mkdir -p config
if [ -e .stage ]
then
lh clean
fi
rm -rf config
if [ -e config ]
then
rm -f config/* || true
rmdir --ignore-fail-on-non-empty config/* || true
fi
rm -rf cache/packages*
rm -rf cache/stages_rootfs
case "${ARCHITECTURE}" in
amd64)
case "${FLAVOUR}" in
gnome-desktop)
mkdir -p config/chroot_local-hooks
echo "apt-get remove --yes --purge openoffice.org-help-en-us" > config/chroot_local-hooks/package-removals
echo "apt-get remove --yes --purge epiphany-browser epiphany-browser-data epiphany-extensions epiphany-gecko" >> config/chroot_local-hooks/package-removals
echo "apt-get remove --yes --purge gnome-user-guide" >> config/chroot_local-hooks/package-removals
Set_defaults
INDICES="none"
;;
lh config \
--apt-recommends ${APT_RECOMMENDS} \
--binary-indices ${BINARY_INDICES} \
--cache-stages "bootstrap rootfs" \
--debian-installer ${DEBIAN_INSTALLER} \
--debian-installer-gui ${DEBIAN_INSTALLER_GUI} \
--distribution ${DISTRIBUTION} \
--mirror-bootstrap ${MIRROR} \
--mirror-chroot ${MIRROR} \
--mirror-chroot-security ${MIRROR_SECURITY} \
${PACKAGES} \
--packages-lists ${FLAVOUR} \
--source ${SOURCE} \
--tasksel ${TASKSEL} ${KERNEL}
kde-desktop)
INDICES="none"
;;
esac
;;
i386)
case "${FLAVOUR}" in
standard|rescue|lxde-desktop|xfce-desktop)
INDICES="true"
;;
gnome-desktop|kde-desktop)
KERNEL="-k 686"
INDICES="none"
;;
esac
;;
esac
if [ "${SOURCE}" = "true" ]
# TEMPORARY HACK until memtest86+ maintainers fixes his package
if [ ${FLAVOUR} = rescue ]
then
lh config -d ${DISTRIBUTION} -p ${FLAVOUR} --cache-stages "bootstrap rootfs" --apt-recommends false --binary-indices ${INDICES} --tasksel aptitude ${KERNEL} --source true --mirror-bootstrap ${MIRROR} --mirror-chroot ${MIRROR} --mirror-chroot-security ${MIRROR_SECURITY}
else
lh config -d ${DISTRIBUTION} -p ${FLAVOUR} --cache-stages "bootstrap rootfs" --apt-recommends false --binary-indices ${INDICES} --tasksel aptitude ${KERNEL} --source false --mirror-bootstrap ${MIRROR} --mirror-chroot ${MIRROR} --mirror-chroot-security ${MIRROR_SECURITY}
fi
if [ "${DISTRIBUTION}" = "sid" ]
then
echo 'deb http://live.debian.net/ sid/snapshots main' > config/chroot_sources/debian-live_sid-snapshots.chroot
echo 'deb http://live.debian.net/ sid/snapshots main' > config/chroot_sources/debian-live_sid-snapshots.boot
wget http://live.debian.net/debian/project/openpgp/archive-key.asc -O config/chroot_sources/debian-live_sid-snapshots.chroot.gpg
wget http://live.debian.net/debian/project/openpgp/archive-key.asc -O config/chroot_sources/debian-live_sid-snapshots.binary.gpg
lh config --memtest none
fi
lh build 2>&1 | tee debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.iso.log
mv binary.iso debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.iso
mv binary*.iso debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.iso
mv binary.list debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.iso.list
mv binary.packages debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.iso.packages
@ -90,22 +147,27 @@ do
mv source.list debian-live-${DISTRIBUTION}-source-${FLAVOUR}.tar.gz.list
fi
lh clean --binary
lh config -b usb-hdd
lh binary 2>&1 | tee debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.img.log
if [ "${DISTRIBUTION}" = "lenny" ]
then
lh clean --binary
lh config -binary-images usb-hdd
lh binary 2>&1 | tee debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.img.log
mv binary.img debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.img
mv binary.list debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.img.list
mv binary.packages debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.img.packages
mv binary.img debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.img
mv binary.list debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.img.list
mv binary.packages debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.img.packages
fi
lh clean --binary
lh config -b net
lh binary 2>&1 | tee debian-live-${DISTRIBUTION}-i386-${FLAVOUR}-net.tar.gz.log
lh clean
rm -rf cache/stages_rootfs
lh config --binary-images net
mv binary-net.tar.gz debian-live-${DISTRIBUTION}-i386-${FLAVOUR}-net.tar.gz
mv binary.list debian-live-${DISTRIBUTION}-i386-${FLAVOUR}-net.tar.gz.list
mv binary.packages debian-live-${DISTRIBUTION}-i386-${FLAVOUR}-net.tar.gz.packages
lh build 2>&1 | tee debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}-net.tar.gz.log
mv binary/*/filesystem.squashfs debian-live-${DISTRIBUTION}-i386-${FLAVOUR}.squashfs
mv binary-net.tar.gz debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}-net.tar.gz
mv binary.list debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}-net.tar.gz.list
mv binary.packages debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}-net.tar.gz.packages
mv binary/*/filesystem.squashfs debian-live-${DISTRIBUTION}-${ARCHITECTURE}-${FLAVOUR}.squashfs
done
done