Commit 3dfdecde authored by Raphaël Hertzog's avatar Raphaël Hertzog
Browse files

Imported Upstream version 4.0.4

parent b6004d1c
......@@ -65,7 +65,7 @@ Set_defaults
Check_defaults
Echo_message "live-build ${LIVE_BUILD_VERSION}"
Echo_message "Building config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LIVE_IMAGE_ARCHITECTURE} system"
Echo_message "Building config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LB_ARCHITECTURES} system"
# Bootstrapping system
lb bootstrap ${@}
......
......@@ -75,11 +75,11 @@ EOF
_DISTRIBUTION="$(echo ${LB_DISTRIBUTION} | sed -e 's|-backports||')"
echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION} ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ]
then
echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION} ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
fi
fi
......@@ -104,20 +104,20 @@ EOF
if [ "${LB_MODE}" = progress-linux ]
then
echo "deb ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}-security ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ]
then
echo "deb-src ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}-security ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb-src ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
fi
else
if [ "${LB_DERIVATIVE}" = "true" ]
then
echo "deb ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}/updates ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ]
then
echo "deb-src ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}/updates ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb-src ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
fi
fi
fi
......@@ -145,11 +145,11 @@ EOF
if [ "${LB_DERIVATIVE}" = "true" ]
then
echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-updates ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ]
then
echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-updates ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
fi
fi
fi
......@@ -172,11 +172,11 @@ EOF
if [ "${LB_DERIVATIVE}" = "true" ]
then
echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-backports ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ]
then
echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-backports ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
fi
fi
fi
......@@ -188,7 +188,7 @@ EOF
then
sed -e "s|@DISTRIBUTION@|${LB_DISTRIBUTION}|g" \
-e "s|@PARENT_DISTRIBUTION@|${LB_PARENT_DISTRIBUTION}|g" \
-e "s|@ARCHIVE_AREAS@|${LIVE_IMAGE_ARCHIVE_AREAS}|g" \
-e "s|@ARCHIVE_AREAS@|${LB_ARCHIVE_AREAS}|g" \
-e "s|@PARENT_ARCHIVE_AREAS@|${LIVE_IMAGE_PARENT_ARCHIVE_AREAS}|g" \
"${FILE}" > "chroot/etc/apt/sources.list.d/$(basename ${FILE} .chroot)"
......@@ -205,7 +205,7 @@ EOF
do
if [ -e "${FILE}" ]
then
cp ${FILE} chroot/etc/apt/conf.d/$(basename ${FILE} .chroot)
cp ${FILE} chroot/etc/apt/apt.conf.d/$(basename ${FILE} .chroot)
fi
done
......@@ -231,9 +231,9 @@ EOF
fi
# Copy packages
if Find_files config/packages.chroot/*_"${LIVE_IMAGE_ARCHITECTURE}".deb || Find_files config/packages/*_"${LIVE_IMAGE_ARCHITECTURE}".deb
if Find_files config/packages.chroot/*_"${LB_ARCHITECTURES}".deb || Find_files config/packages/*_"${LB_ARCHITECTURES}".deb
then
for FILE in config/packages.chroot/*_"${LIVE_IMAGE_ARCHITECTURE}".deb config/packages/*_"${LIVE_IMAGE_ARCHITECTURE}".deb
for FILE in config/packages.chroot/*_"${LB_ARCHITECTURES}".deb config/packages/*_"${LB_ARCHITECTURES}".deb
do
if [ -L "${FILE}" ]
then
......@@ -456,8 +456,8 @@ EOF
done
fi
# Installing aptitude (FIXME)
if [ "${LB_APT}" = "aptitude" ] && [ ! -x /usr/bin/aptitude ]
# Installing aptitude
if [ "${LB_APT}" = "aptitude" ] && [ ! -x /chroot/usr/bin/aptitude ]
then
Chroot chroot "apt-get ${APT_OPTIONS} update"
Chroot chroot "apt-get ${APT_OPTIONS} install aptitude"
......@@ -567,11 +567,11 @@ EOF
_DISTRIBUTION="$(echo ${LB_DISTRIBUTION} | sed -e 's|-backports||')"
echo "deb ${LB_MIRROR_BINARY} ${_DISTRIBUTION} ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb ${LB_MIRROR_BINARY} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ]
then
echo "deb-src ${LB_MIRROR_BINARY} ${_DISTRIBUTION} ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb-src ${LB_MIRROR_BINARY} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
fi
fi
......@@ -596,20 +596,20 @@ EOF
if [ "${LB_MODE}" = progress-linux ]
then
echo "deb ${LB_MIRROR_BINARY_SECURITY} ${_DISTRIBUTION}-security ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb ${LB_MIRROR_BINARY_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ]
then
echo "deb-src ${LB_MIRROR_BINARY_SECURITY} ${_DISTRIBUTION}-security ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb-src ${LB_MIRROR_BINARY_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
fi
else
if [ "${LB_DERIVATIVE}" = "true" ]
then
echo "deb ${LB_MIRROR_BINARY_SECURITY} ${_DISTRIBUTION}/updates ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb ${LB_MIRROR_BINARY_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ]
then
echo "deb-src ${LB_MIRROR_BINARY_SECURITY} ${_DISTRIBUTION}/updates ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb-src ${LB_MIRROR_BINARY_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
fi
fi
fi
......@@ -637,11 +637,11 @@ EOF
if [ "${LB_DERIVATIVE}" = "true" ]
then
echo "deb ${LB_MIRROR_BINARY} ${_DISTRIBUTION}-updates ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb ${LB_MIRROR_BINARY} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ]
then
echo "deb-src ${LB_MIRROR_BINARY} ${_DISTRIBUTION}-updates ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb-src ${LB_MIRROR_BINARY} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
fi
fi
fi
......@@ -664,11 +664,11 @@ EOF
if [ "${LB_DERIVATIVE}" = "true" ]
then
echo "deb ${LB_MIRROR_BINARY} ${_DISTRIBUTION}-backports ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb ${LB_MIRROR_BINARY} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ]
then
echo "deb-src ${LB_MIRROR_BINARY} ${_DISTRIBUTION}-backports ${LIVE_IMAGE_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
echo "deb-src ${LB_MIRROR_BINARY} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list
fi
fi
fi
......@@ -687,7 +687,7 @@ EOF
do
if [ -e "${FILE}" ]
then
rm -f "chroot/etc/apt/conf.d/$(basename ${FILE} .chroot)"
rm -f "chroot/etc/apt/apt.conf.d/$(basename ${FILE} .chroot)"
fi
done
......@@ -707,7 +707,7 @@ EOF
then
sed -e "s|@DISTRIBUTION@|${LB_DISTRIBUTION}|g" \
-e "s|@PARENT_DISTRIBUTION@|${LB_PARENT_DISTRIBUTION}|g" \
-e "s|@ARCHIVE_AREAS@|${LIVE_IMAGE_ARCHIVE_AREAS}|g" \
-e "s|@ARCHIVE_AREAS@|${LB_ARCHIVE_AREAS}|g" \
-e "s|@PARENT_ARCHIVE_AREAS@|${LIVE_IMAGE_PARENT_ARCHIVE_AREAS}|g" \
"${FILE}" > "chroot/etc/apt/sources.list.d/$(basename ${FILE} .binary)"
......@@ -724,7 +724,7 @@ EOF
do
if [ -e "${FILE}" ]
then
cp ${FILE} chroot/etc/apt/conf.d/$(basename ${FILE} .binary)
cp ${FILE} chroot/etc/apt/apt.conf.d/$(basename ${FILE} .binary)
fi
done
......
......@@ -56,15 +56,15 @@ mkdir -p cache/contents.chroot
FIRMWARE_PACKAGES=""
_CONTENTS="$(for _PARENT_ARCHIVE_AREA in ${LIVE_IMAGE_PARENT_ARCHIVE_AREAS}; do echo ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/${_PARENT_ARCHIVE_AREA}/Contents-${LIVE_IMAGE_ARCHITECTURE}.gz; done)"
_CONTENTS="$(for _PARENT_ARCHIVE_AREA in ${LIVE_IMAGE_PARENT_ARCHIVE_AREAS}; do echo ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/${_PARENT_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz; done)"
rm -f cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LIVE_IMAGE_ARCHITECTURE}
rm -f cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LB_ARCHITECTURES}
for _CONTENT in ${_CONTENTS}
do
wget ${WGET_OPTIONS} ${_CONTENT} -O - | gunzip -c >> cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LIVE_IMAGE_ARCHITECTURE}
wget ${WGET_OPTIONS} ${_CONTENT} -O - | gunzip -c >> cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LB_ARCHITECTURES}
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LIVE_IMAGE_ARCHITECTURE} | sort -u)"
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LB_ARCHITECTURES} | sort -u)"
done
if echo ${LIVE_IMAGE_PARENT_ARCHIVE_AREAS} | grep -qs "non-free"
......@@ -78,18 +78,21 @@ if [ "${LB_DERIVATIVE}" = "true" ]
then
# FIXME: account for the fact that PARENT_DISTRIBUTION and DISTRIBUTION might be the same (to not have overlapping cache files for contents).
_CONTENTS="$(for _ARCHIVE_AREA in ${LIVE_IMAGE_ARCHIVE_AREAS}; do echo ${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/${_ARCHIVE_AREA}/Contents-${LIVE_IMAGE_ARCHITECTURE}.gz; done)"
_CONTENTS="$(for _ARCHIVE_AREA in ${LB_ARCHIVE_AREAS}; do echo ${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/${_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz; done)"
rm -f cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LIVE_IMAGE_ARCHITECTURE}
rm -f cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES}
for _CONTENT in ${_CONTENTS}
do
wget ${WGET_OPTIONS} ${_CONTENT} -O - | gunzip -c >> cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LIVE_IMAGE_ARCHITECTURE}
wget ${WGET_OPTIONS} ${_CONTENT} -O - | gunzip -c >> cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES}
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LIVE_IMAGE_ARCHITECTURE} | sort -u)"
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES} | sort -u)"
done
fi
# Remove broken packages
FIRMWARE_PACKAGES="$(echo ${FIRMWARE_PACKAGES} | grep -v prism2-usb-firmware-installer || true)"
# Drop section and keep package names only
for _PACKAGE in ${FIRMWARE_PACKAGES}
do
......
......@@ -46,5 +46,5 @@ then
cd "${OLDPWD}"
# Creating stage file
Create_stagefile .build/chroot_includes
Create_stagefile .build/includs.chroot
fi
......@@ -93,9 +93,9 @@ done
for _PACKAGE_ARCHITECTURE in $(Discover_package_architectures "chroot/root/packages.chroot")
do
# If this is a foreign architecture, append to packages.foreign-architectures
if [ "${_PACKAGE_ARCHITECTURE}" != "${LIVE_IMAGE_ARCHITECTURE}" ]
if [ "${_PACKAGE_ARCHITECTURE}" != "${LB_ARCHITECTURES}" ]
then
Echo_message "Accepting foreign architecture: ${_PACKAGE_ARCHITECTURE}, live image architecture is: ${LIVE_IMAGE_ARCHITECTURE}"
Echo_message "Accepting foreign architecture: ${_PACKAGE_ARCHITECTURE}, live image architecture is: ${LB_ARCHITECTURES}"
echo "${_PACKAGE_ARCHITECTURE}" >> chroot/root/packages.foreign-architectures
fi
done
......@@ -112,7 +112,7 @@ case "${LB_BUILD_WITH_CHROOT}" in
fi
# Saving cache
Save_cache cache/packages.binary
Save_cache cache/packages.chroot
;;
esac
......
......@@ -32,7 +32,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--bootappend-install PARAMETER|\"PARAMETERS\"]\n\
\t [--bootappend-live PARAMETER|\"PARAMETERS\"]\n\
\t [--bootappend-live-failsafe PARAMETER|\"PARAMETERS\"]\n\
\t [--bootloader grub|syslinux]\n\
\t [--bootloader grub|grub2|syslinux]\n\
\t [--bootstrap cdebootstrap|cdebootstrap-static|debootstrap]\n\
\t [--cache true|false]\n\
\t [--cache-indices true|false]\n\
......@@ -64,7 +64,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--ignore-system-defaults]\n\
\t [--initramfs auto|none|live-boot|casper]\n\
\t [--initramfs-compression bzip2|gzip|lzma]\n\
\t [--initsystem sysvinit|runit|systemd|upstart|none]\n\
\t [--initsystem sysvinit|systemd|upstart|none]\n\
\t [--image-name [NAME]\n\
\t [--interactive shell]\n\
\t [--isohybrid-options OPTION|\"OPTIONS\"]\n\
......@@ -347,7 +347,7 @@ Local_arguments ()
# config/bootstrap
-a|--architectures)
LIVE_IMAGE_ARCHITECTURE="${2}"
LB_ARCHITECTURES="${2}"
shift 2
;;
......@@ -422,7 +422,7 @@ Local_arguments ()
;;
--archive-areas)
LIVE_IMAGE_ARCHIVE_AREAS="${2}"
LB_ARCHIVE_AREAS="${2}"
shift 2
;;
......@@ -883,10 +883,10 @@ Check_defaults
if [ ! -e config ]
then
Echo_message "Creating config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LIVE_IMAGE_ARCHITECTURE} system"
Echo_message "Creating config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LB_ARCHITECTURES} system"
mkdir config
else
Echo_message "Updating config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LIVE_IMAGE_ARCHITECTURE} system"
Echo_message "Updating config tree for a ${LB_MODE}/${LB_DISTRIBUTION}/${LB_ARCHITECTURES} system"
fi
# Creating live-build configuration
......@@ -1353,28 +1353,52 @@ done
if [ ! -e config/package-lists/live.list.chroot ]
then
cat > config/package-lists/live.list.chroot << EOF
live-boot
live-config
EOF
case "${LB_PARENT_DISTRIBUTION}" in
wheezy)
echo "live-config-sysvinit" >> config/package-lists/live.list.chroot
;;
*)
echo "live-config-systemd" >> config/package-lists/live.list.chroot
;;
mkdir -p config/package-lists
case "${LB_INITRAMFS}" in
live-boot)
echo "live-boot" > config/package-lists/live.list.chroot
echo "live-config" >> config/package-lists/live.list.chroot
case "${LB_PARENT_DISTRIBUTION}" in
wheezy)
echo "live-config-sysvinit" >> config/package-lists/live.list.chroot
;;
*)
case "${LB_INITSYSTEM}" in
none)
# do nothing
;;
systemd)
echo "live-config-systemd" >> config/package-lists/live.list.chroot
echo "dbus" >> config/package-lists/live.list.chroot
;;
sysvinit|upstart)
echo "live-config-${LB_INITSYSTEM}" >> config/package-lists/live.list.chroot
echo "sysvinit-core" >> config/package-lists/live.list.chroot
;;
esac
;;
esac
;;
casper)
echo "casper" > config/package-lists/live.list.chroot
;;
*)
;;
esac
fi
cat > config/build << EOF
[Image]
Architecture: ${LIVE_IMAGE_ARCHITECTURE}
Archive-Areas: ${LIVE_IMAGE_ARCHIVE_AREAS}
Architecture: ${LB_ARCHITECTURES}
Archive-Areas: ${LB_ARCHIVE_AREAS}
Distribution: ${LB_DISTRIBUTION}
Mirror-Bootstrap: ${LB_MIRROR_BOOTSTRAP}
EOF
......@@ -1384,7 +1408,7 @@ then
cat >> config/build << EOF
Parent-Archive-Areas: ${LIVE_IMAGE_ARCHIVE_AREAS}
Parent-Archive-Areas: ${LB_ARCHIVE_AREAS}
Parent-Distribution: ${LB_PARENT_DISTRIBUTION}
Parent-Mirror-Bootstrap: ${LB_PARENT_MIRROR_BOOTSTRAP}
EOF
......
......@@ -76,7 +76,7 @@ Install_package
# Setting destination directory
case "${LIVE_IMAGE_TYPE}" in
netboot)
DESTDIR="tftpboot/debian-install/${LIVE_IMAGE_ARCHITECTURE}"
DESTDIR="tftpboot/debian-install/${LB_ARCHITECTURES}"
;;
hdd*|tar)
......@@ -107,9 +107,9 @@ case "${LB_DEBIAN_INSTALLER}" in
esac
# Set architecture-specific variables
case "${LIVE_IMAGE_ARCHITECTURE}" in
case "${LB_ARCHITECTURES}" in
armel)
DEFAULT_FLAVOUR="$(echo ${LH_LINUX_FLAVOURS} | awk '{ print $1 }')"
DEFAULT_FLAVOUR="$(echo ${LB_LINUX_FLAVOURS} | awk '{ print $1 }')"
case "${DI_IMAGE_TYPE}" in
cdrom)
DI_REMOTE_BASE="${DEFAULT_FLAVOUR}/cdrom"
......@@ -127,11 +127,11 @@ case "${LIVE_IMAGE_ARCHITECTURE}" in
powerpc)
case "${DI_IMAGE_TYPE}" in
cdrom)
DI_REMOTE_BASE="${LIVE_IMAGE_ARCHITECTURE}/cdrom"
DI_REMOTE_BASE="${LB_ARCHITECTURES}/cdrom"
;;
netboot)
DI_REMOTE_BASE="${LIVE_IMAGE_ARCHITECTURE}/netboot"
DI_REMOTE_BASE="${LB_ARCHITECTURES}/netboot"
;;
esac
......@@ -149,8 +149,8 @@ case "${LIVE_IMAGE_ARCHITECTURE}" in
*)
case "${DI_IMAGE_TYPE}" in
netboot)
DI_REMOTE_BASE="netboot/debian-installer/${LIVE_IMAGE_ARCHITECTURE}"
DI_REMOTE_BASE_GTK="netboot/gtk/debian-installer/${LIVE_IMAGE_ARCHITECTURE}"
DI_REMOTE_BASE="netboot/debian-installer/${LB_ARCHITECTURES}"
DI_REMOTE_BASE_GTK="netboot/gtk/debian-installer/${LB_ARCHITECTURES}"
DI_REMOTE_KERNEL="linux"
;;
......@@ -255,9 +255,9 @@ case "${LB_DERIVATIVE}" in
LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="sid"
# Debian Installer daily builds
URL="http://d-i.debian.org/daily-images/${LIVE_IMAGE_ARCHITECTURE}/daily/"
URL="http://d-i.debian.org/daily-images/${LB_ARCHITECTURES}/daily/"
else
URL="${LB_MIRROR_DEBIAN_INSTALLER}/dists/${LB_DEBIAN_INSTALLER_DISTRIBUTION}/main/installer-${LIVE_IMAGE_ARCHITECTURE}/current/images/"
URL="${LB_MIRROR_DEBIAN_INSTALLER}/dists/${LB_DEBIAN_INSTALLER_DISTRIBUTION}/main/installer-${LB_ARCHITECTURES}/current/images/"
fi
;;
......@@ -267,23 +267,23 @@ case "${LB_DERIVATIVE}" in
LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION="sid"
# Debian Installer daily builds
URL="http://d-i.debian.org/daily-images/${LIVE_IMAGE_ARCHITECTURE}/daily/"
URL="http://d-i.debian.org/daily-images/${LB_ARCHITECTURES}/daily/"
else
URL="${LB_PARENT_MIRROR_DEBIAN_INSTALLER}/dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/main/installer-${LIVE_IMAGE_ARCHITECTURE}/current/images/"
URL="${LB_PARENT_MIRROR_DEBIAN_INSTALLER}/dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/main/installer-${LB_ARCHITECTURES}/current/images/"
fi
if [ "${LB_MODE}" = "progress-linux" ]
then
# FIXME: normal derivatives probably don't rebuild d-i,
# but progress-linux does.
URL="${LB_MIRROR_DEBIAN_INSTALLER}/dists/${LB_DEBIAN_INSTALLER_DISTRIBUTION}/main/installer-${LIVE_IMAGE_ARCHITECTURE}/current/images/"
URL="${LB_MIRROR_DEBIAN_INSTALLER}/dists/${LB_DEBIAN_INSTALLER_DISTRIBUTION}/main/installer-${LB_ARCHITECTURES}/current/images/"
fi
;;
esac
mkdir -p "${DESTDIR_DI}"
if [ "${LIVE_IMAGE_ARCHITECTURE}" = "sparc" ] && [ "${DI_IMAGE_TYPE}" = "netboot" ]
if [ "${LB_ARCHITECTURES}" = "sparc" ] && [ "${DI_IMAGE_TYPE}" = "netboot" ]
then
# There are no prepared kernel/initrd pairs for sparc netboot so we
# must unpack them from a mini.iso
......@@ -306,7 +306,7 @@ else
DOWNLOAD_GTK_INSTALLER=0
if [ "${LB_DEBIAN_INSTALLER_GUI}" = "true" ]
then
case "${LIVE_IMAGE_ARCHITECTURE}" in
case "${LB_ARCHITECTURES}" in
amd64|i386)
DOWNLOAD_GTK_INSTALLER=1
;;
......@@ -337,7 +337,7 @@ then
mv chroot/var/lib/dpkg/status chroot/var/lib/dpkg/status.tmp
touch chroot/var/lib/dpkg/status
case "${LIVE_IMAGE_ARCHITECTURE}" in
case "${LB_ARCHITECTURES}" in
amd64)
DI_REQ_PACKAGES="lilo grub-pc"
......@@ -419,15 +419,15 @@ then
FIRMWARE_PACKAGES=""
_CONTENTS="$(for _PARENT_ARCHIVE_AREA in ${LIVE_IMAGE_PARENT_ARCHIVE_AREAS}; do echo ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/${_PARENT_ARCHIVE_AREA}/Contents-${LIVE_IMAGE_ARCHITECTURE}.gz; done)"
_CONTENTS="$(for _PARENT_ARCHIVE_AREA in ${LIVE_IMAGE_PARENT_ARCHIVE_AREAS}; do echo ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/${_PARENT_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz; done)"
rm -f cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LIVE_IMAGE_ARCHITECTURE}
rm -f cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LB_ARCHITECTURES}
for _CONTENT in ${_CONTENTS}
do
wget ${WGET_OPTIONS} ${_CONTENT} -O - | gunzip -c >> cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LIVE_IMAGE_ARCHITECTURE}
wget ${WGET_OPTIONS} ${_CONTENT} -O - | gunzip -c >> cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LB_ARCHITECTURES}
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LIVE_IMAGE_ARCHITECTURE} | sort -u)"
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LB_ARCHITECTURES} | sort -u)"
done
if echo ${LIVE_IMAGE_PARENT_ARCHIVE_AREAS} | grep -qs "non-free"
......@@ -441,15 +441,15 @@ then
then
# FIXME: account for the fact that PARENT_DISTRIBUTION and DISTRIBUTION might be the same (to not have overlapping cache files for contents).
_CONTENTS="$(for _ARCHIVE_AREA in ${LIVE_IMAGE_ARCHIVE_AREAS}; do echo ${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/${_ARCHIVE_AREA}/Contents-${LIVE_IMAGE_ARCHITECTURE}.gz; done)"
_CONTENTS="$(for _ARCHIVE_AREA in ${LB_ARCHIVE_AREAS}; do echo ${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/${_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz; done)"
rm -f cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LIVE_IMAGE_ARCHITECTURE}
rm -f cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES}
for _CONTENT in ${_CONTENTS}
do
wget ${WGET_OPTIONS} ${_CONTENT} -O - | gunzip -c >> cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LIVE_IMAGE_ARCHITECTURE}
wget ${WGET_OPTIONS} ${_CONTENT} -O - | gunzip -c >> cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES}
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LIVE_IMAGE_ARCHITECTURE} | sort -u)"
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES} | sort -u)"
done
fi
......@@ -493,7 +493,7 @@ then
mv chroot/binary.deb ./
for _ARCHIVE_AREA in $(echo ${LIVE_IMAGE_PARENT_ARCHIVE_AREAS} ${LIVE_IMAGE_ARCHIVE_AREAS})
for _ARCHIVE_AREA in $(echo ${LIVE_IMAGE_PARENT_ARCHIVE_AREAS} ${LB_ARCHIVE_AREAS})
do
mkdir -p binary/pool/${_ARCHIVE_AREA}
done
......@@ -523,9 +523,9 @@ then
fi
# Including local debs
if Find_files config/packages.binary/*_"${LIVE_IMAGE_ARCHITECTURE}".deb || Find_files config/packages/*_"${LIVE_IMAGE_ARCHITECTURE}".deb
if Find_files config/packages.binary/*_"${LB_ARCHITECTURES}".deb || Find_files config/packages/*_"${LB_ARCHITECTURES}".deb
then
for FILE in config/packages.binary/*_"${LIVE_IMAGE_ARCHITECTURE}".deb config/packages/*_"${LIVE_IMAGE_ARCHITECTURE}".deb
for FILE in config/packages.binary/*_"${LB_ARCHITECTURES}".deb config/packages/*_"${LB_ARCHITECTURES}".deb
do
if [ -e "${FILE}" ]
then
......@@ -548,18 +548,18 @@ then
# Generating deb indices
for _ARCHIVE_AREA in $(cd binary/pool && ls)
do
mkdir -p binary/dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/${_ARCHIVE_AREA}/binary-${LIVE_IMAGE_ARCHITECTURE}
mkdir -p binary/dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/${_ARCHIVE_AREA}/binary-${LB_ARCHITECTURES}
mv binary chroot/root
echo "cd /root/binary && apt-ftparchive packages pool/${_ARCHIVE_AREA} > dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/${_ARCHIVE_AREA}/binary-${LIVE_IMAGE_ARCHITECTURE}/Packages" > chroot/binary.sh
echo "cd /root/binary && apt-ftparchive packages pool/${_ARCHIVE_AREA} > dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/${_ARCHIVE_AREA}/binary-${LB_ARCHITECTURES}/Packages" > chroot/binary.sh
Chroot chroot "sh binary.sh"
rm -f chroot/binary.sh
mv chroot/root/binary ./
gzip -9 -c binary/dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/${_ARCHIVE_AREA}/binary-${LIVE_IMAGE_ARCHITECTURE}/Packages > binary/dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/${_ARCHIVE_AREA}/binary-${LIVE_IMAGE_ARCHITECTURE}/Packages.gz
gzip -9 -c binary/dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/${_ARCHIVE_AREA}/binary-${LB_ARCHITECTURES}/Packages > binary/dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/${_ARCHIVE_AREA}/binary-${LB_ARCHITECTURES}/Packages.gz
# Fetching release
Download_file binary/dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/${_ARCHIVE_AREA}/binary-${LIVE_IMAGE_ARCHITECTURE}/Release "${LB_PARENT_MIRROR_CHROOT}"/dists/"${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}"/${_ARCHIVE_AREA}/binary-"${LIVE_IMAGE_ARCHITECTURE}"/Release
Download_file binary/dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/${_ARCHIVE_AREA}/binary-${LB_ARCHITECTURES}/Release "${LB_PARENT_MIRROR_CHROOT}"/dists/"${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}"/${_ARCHIVE_AREA}/binary-"${LB_ARCHITECTURES}"/Release
done
# Symlink firmware packages to /firmware
......@@ -584,12 +584,12 @@ then
cd binary.udeb
# Downloading udeb indices
Download_file Packages.gz "${LB_PARENT_MIRROR_CHROOT}"/dists/"${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_IMAGE_ARCHITECTURE}"/Packages.gz
Download_file Packages.gz "${LB_PARENT_MIRROR_CHROOT}"/dists/"${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}"/main/debian-installer/binary-"${LB_ARCHITECTURES}"/Packages.gz
gunzip -c Packages.gz > Packages
if [ "${LB_DERIVATIVE}" = "true" ]
then
Download_file Packages.derivative.gz "${LB_MIRROR_CHROOT}"/dists/"${LB_DEBIAN_INSTALLER_DISTRIBUTION}"/main/debian-installer/binary-"${LIVE_IMAGE_ARCHITECTURE}"/Packages.gz
Download_file Packages.derivative.gz "${LB_MIRROR_CHROOT}"/dists/"${LB_DEBIAN_INSTALLER_DISTRIBUTION}"/main/debian-installer/binary-"${LB_ARCHITECTURES}"/Packages.gz
gunzip -c Packages.derivative.gz > Packages.derivative
fi
......@@ -630,9 +630,9 @@ then