2010-02-20 12:18:57 -01:00
#!/bin/sh
set -e
2008-04-17 10:13:49 +00:00
2008-04-22 16:19:19 +00:00
# Static variables
2009-11-16 10:40:43 -01:00
DISTRIBUTIONS = " ${ DISTRIBUTIONS :- lenny squeeze sid } "
2008-11-30 09:37:06 -01:00
FLAVOURS = " ${ FLAVOURS :- standard rescue gnome-desktop kde-desktop lxde-desktop xfce-desktop } "
2009-12-13 19:17:45 -01:00
SOURCE = " ${ SOURCE :- true } "
2008-04-17 10:13:49 +00:00
2010-01-31 15:33:15 -01:00
MIRROR = " ${ MIRROR :- http : //cdn.debian.net/debian/ } "
MIRROR_SECURITY = " ${ MIRROR_SECURITY :- http : //security.debian.org/ } "
2008-04-22 16:23:34 +00:00
2008-04-22 16:19:19 +00:00
# Dynamic variables
2008-04-21 21:22:46 +00:00
ARCHITECTURE = " $( dpkg --print-architecture) "
2008-04-17 10:13:49 +00:00
DATE = " $( date +%Y%m%d) "
2010-02-20 12:18:57 -01:00
Set_defaults ( )
{
# Distribution defaults
APT_RECOMMENDS = "true"
BINARY_INDICES = "true"
DEBIAN_INSTALLER = "live"
TASKSEL = "tasksel"
# Distribution specific options (ugly!)
case " ${ DISTRIBUTION } " in
lenny)
APT_RECOMMENDS = "false"
BINARY_INDICES = "true"
DEBIAN_INSTALLER = "false"
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)
2010-07-17 15:45:40 +00:00
DEBIAN_INSTALLER_DISTRIBUTION = "daily"
2010-02-20 12:18:57 -01:00
2010-09-27 08:12:40 +00:00
LIVE_BOOT = "2.0.6-1"
LIVE_CONFIG = "2.0.7-1"
LIVE_INSTALLER = "26"
DI_LAUNCHER = "3"
mkdir -p config/chroot_local-packages
cd config/chroot_local-packages
# live-boot
if [ -n " ${ LIVE_BOOT } " ]
then
wget -c http://live.debian.net/archive/packages/live-boot/${ LIVE_BOOT } /live-boot_${ LIVE_BOOT } .dsc
wget -c http://live.debian.net/archive/packages/live-boot/${ LIVE_BOOT } /live-boot_${ LIVE_BOOT } .diff.gz
wget -c http://live.debian.net/archive/packages/live-boot/${ LIVE_BOOT } /live-boot_$( echo ${ LIVE_BOOT } | awk -F- '{ print $1 }' ) .orig.tar.gz
wget -c http://live.debian.net/archive/packages/live-boot/${ LIVE_BOOT } /live-boot_${ LIVE_BOOT } _all.deb
wget -c http://live.debian.net/archive/packages/live-boot/${ LIVE_BOOT } /live-boot-initramfs-tools_${ LIVE_BOOT } _all.deb
wget -c http://live.debian.net/archive/packages/live-boot/${ LIVE_BOOT } /live-initramfs_${ LIVE_BOOT } _all.deb
fi
# live-config
if [ -n " ${ LIVE_CONFIG } " ]
then
wget -c http://live.debian.net/archive/packages/live-config/${ LIVE_CONFIG } /live-config_${ LIVE_CONFIG } .dsc
wget -c http://live.debian.net/archive/packages/live-config/${ LIVE_CONFIG } /live-config_${ LIVE_CONFIG } .diff.gz
wget -c http://live.debian.net/archive/packages/live-config/${ LIVE_CONFIG } /live-config_$( echo ${ LIVE_CONFIG } | awk -F- '{ print $1 }' ) .orig.tar.gz
wget -c http://live.debian.net/archive/packages/live-config/${ LIVE_CONFIG } /live-config_${ LIVE_CONFIG } _all.deb
wget -c http://live.debian.net/archive/packages/live-config/${ LIVE_CONFIG } /live-config-sysvinit_${ LIVE_CONFIG } _all.deb
fi
cd ${ OLDPWD }
2010-02-20 12:18:57 -01:00
mkdir -p config/binary_local-udebs
cd config/binary_local-udebs
2010-09-27 08:12:40 +00:00
# live-installer
if [ -n " ${ LIVE_INSTALLER } " ]
then
wget -c http://ftp.debian.org/debian/pool/main/l/live-installer/live-installer_${ LIVE_INSTALLER } .dsc
wget -c http://ftp.debian.org/debian/pool/main/l/live-installer/live-installer_${ LIVE_INSTALLER } .tar.gz
wget -c http://ftp.debian.org/debian/pool/main/l/live-installer/live-installer_${ LIVE_INSTALLER } _${ ARCHITECTURE } .udeb
2010-09-27 08:26:22 +00:00
wget -c http://ftp.debian.org/debian/pool/main/b/base-installer/base-installer_1.113.dsc
wget -c http://ftp.debian.org/debian/pool/main/b/base-installer/base-installer_1.113.tar.gz
wget -c http://ftp.debian.org/debian/pool/main/b/base-installer/base-installer_1.113_all.udeb
wget -c http://ftp.debian.org/debian/pool/main/b/base-installer/bootstrap-base_1.113_${ ARCHITECTURE } .udeb
2010-09-27 08:12:40 +00:00
fi
2010-02-20 12:18:57 -01:00
cd -
mkdir -p config/chroot_local-packages
cd config/chroot_local-packages
2010-07-17 15:45:40 +00:00
2010-09-27 08:12:40 +00:00
# debian-installer-launcher
if [ -n " ${ DI_LAUNCHER } " ]
then
wget http://ftp.debian.org/debian/pool/main/d/debian-installer-launcher/debian-installer-launcher_${ DI_LAUNCHER } .dsc
wget http://ftp.debian.org/debian/pool/main/d/debian-installer-launcher/debian-installer-launcher_${ DI_LAUNCHER } .tar.gz
wget http://ftp.debian.org/debian/pool/main/d/debian-installer-launcher/debian-installer-launcher_${ DI_LAUNCHER } _all.deb
fi
2010-07-17 15:45:40 +00:00
2010-02-20 12:18:57 -01:00
cd -
; ;
esac
}
# Build images
2008-04-22 16:19:19 +00:00
for DISTRIBUTION in ${ DISTRIBUTIONS }
2008-04-17 10:13:49 +00:00
do
rm -rf cache/stages*
2008-04-22 16:19:19 +00:00
for FLAVOUR in ${ FLAVOURS }
2008-04-17 10:13:49 +00:00
do
if [ -e .stage ]
then
2010-09-02 12:45:03 +00:00
lb clean
2008-04-17 10:13:49 +00:00
fi
2010-02-20 12:18:57 -01:00
if [ -e config ]
2008-04-22 15:57:28 +00:00
then
2010-02-20 12:18:57 -01:00
rm -f config/* || true
rmdir --ignore-fail-on-non-empty config/* || true
2008-04-22 15:57:28 +00:00
fi
2008-04-17 10:13:49 +00:00
2010-02-20 12:18:57 -01:00
rm -rf cache/packages*
rm -rf cache/stages_rootfs
2008-04-17 10:13:49 +00:00
2010-02-20 12:18:57 -01:00
Set_defaults
2010-09-02 12:45:03 +00:00
lb config \
2010-02-20 12:18:57 -01:00
--apt-recommends ${ APT_RECOMMENDS } \
--binary-indices ${ BINARY_INDICES } \
2010-09-27 08:26:22 +00:00
--bootstrap cdebootstrap \
2010-02-20 12:18:57 -01:00
--cache-stages "bootstrap rootfs" \
--debian-installer ${ DEBIAN_INSTALLER } \
2010-07-17 15:45:40 +00:00
--debian-installer-distribution ${ DEBIAN_INSTALLER_DISTRIBUTION } \
2010-02-20 12:18:57 -01:00
--distribution ${ DISTRIBUTION } \
--mirror-bootstrap ${ MIRROR } \
--mirror-chroot ${ MIRROR } \
--mirror-chroot-security ${ MIRROR_SECURITY } \
--packages-lists ${ FLAVOUR } \
--tasksel ${ TASKSEL } ${ KERNEL }
2010-09-02 12:45:03 +00:00
lb build 2>& 1 | tee debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } -${ FLAVOUR } .iso.log
2008-04-17 10:13:49 +00:00
2010-02-20 12:18:57 -01:00
mv binary*.iso debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } -${ FLAVOUR } .iso
2008-04-21 21:22:46 +00:00
mv binary.list debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } -${ FLAVOUR } .iso.list
mv binary.packages debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } -${ FLAVOUR } .iso.packages
2008-04-22 15:57:28 +00:00
2010-09-27 08:12:40 +00:00
if [ " ${ ARCHITECTURE } " != "powerpc" ]
2010-02-20 12:18:57 -01:00
then
2010-09-02 12:45:03 +00:00
lb clean --binary
lb config -binary-images usb-hdd
lb binary 2>& 1 | tee debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } -${ FLAVOUR } .img.log
2010-02-20 12:18:57 -01:00
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
2008-04-17 10:13:49 +00:00
2010-07-17 15:45:40 +00:00
if [ " ${ ARCHITECTURE } " != "powerpc" ]
then
2010-09-02 12:45:03 +00:00
lb clean
2010-07-17 15:45:40 +00:00
rm -rf cache/stages_rootfs
2010-09-02 12:45:03 +00:00
lb config --binary-images net
2008-04-28 15:36:06 +00:00
2010-09-02 12:45:03 +00:00
lb build 2>& 1 | tee debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } -${ FLAVOUR } .tar.gz.log
2008-04-28 15:36:06 +00:00
2010-07-17 15:45:40 +00:00
mv binary-net.tar.gz debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } -${ FLAVOUR } .tar.gz
mv binary.list debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } -${ FLAVOUR } .tar.gz.list
mv binary.packages debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } -${ FLAVOUR } .tar.gz.packages
2008-04-28 15:36:06 +00:00
2010-07-17 15:45:40 +00:00
mv binary/*/filesystem.squashfs debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } -${ FLAVOUR } .squashfs
for memtest in tftpboot/debian-live/${ ARCHITECTURE } /memtest*; do cp -f ${ memtest } debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } .$( basename ${ memtest } ) ; done || true
for kernel in tftpboot/debian-live/${ ARCHITECTURE } /vmlinuz*; do cp -f ${ kernel } debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } .$( basename ${ kernel } ) ; done
for initrd in tftpboot/debian-live/${ ARCHITECTURE } /initrd*; do cp ${ initrd } debian-live-${ DISTRIBUTION } -${ ARCHITECTURE } -${ FLAVOUR } .$( basename ${ initrd } ) ; done
fi
2010-03-12 16:33:22 -01:00
if [ " ${ SOURCE } " = "true" ]
then
2010-09-02 12:45:03 +00:00
lb config --source true
2010-03-12 16:33:22 -01:00
2010-09-02 12:45:03 +00:00
lb source 2>& 1 | tee debian-live-${ DISTRIBUTION } -source-${ FLAVOUR } .log
2010-03-12 16:33:22 -01:00
2010-05-09 11:46:21 +00:00
mv source.debian.tar.gz debian-live-${ DISTRIBUTION } -source-${ FLAVOUR } .debian.tar.gz
mv source.debian.list debian-live-${ DISTRIBUTION } -source-${ FLAVOUR } .debian.tar.gz.list
mv source.debian-live.tar.gz debian-live-${ DISTRIBUTION } -source-${ FLAVOUR } .debian-live.tar.gz
mv source.debian-live.list debian-live-${ DISTRIBUTION } -source-${ FLAVOUR } .debian-live.tar.gz.list
2010-03-12 16:33:22 -01:00
fi
2008-04-17 10:13:49 +00:00
done
done