lh_binary_debian-installer: Only create package pools when necessary
There is no need to create a package pool when creating a netboot Debian Live image or when the LH_DEBIAN_INSTALLER is set to "businesscard". Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
This commit is contained in:
parent
762613f277
commit
cf25064250
|
@ -229,7 +229,26 @@ then
|
||||||
wget ${WGET_OPTIONS} --no-clobber -O "${DESTDIR}"/"${INITRD_GI}" ${URL}/${DI_REMOTE_BASE_GTK}/initrd.gz
|
wget ${WGET_OPTIONS} --no-clobber -O "${DESTDIR}"/"${INITRD_GI}" ${URL}/${DI_REMOTE_BASE_GTK}/initrd.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${LH_DEBIAN_INSTALLER}" != "netboot" ]; then
|
# Only download additional packages if appropriate
|
||||||
|
case "${LH_DEBIAN_INSTALLER}" in
|
||||||
|
enabled|cdrom|netinst)
|
||||||
|
case "${LH_BINARY_IMAGES}" in
|
||||||
|
net)
|
||||||
|
DI_PACKAGE_POOL="no"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
DI_PACKAGE_POOL="yes"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
DI_PACKAGE_POOL="no"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ "${DI_PACKAGE_POOL}" = "yes" ]
|
||||||
|
then
|
||||||
# Downloading additional packages
|
# Downloading additional packages
|
||||||
mkdir -p chroot/binary.deb/archives/partial
|
mkdir -p chroot/binary.deb/archives/partial
|
||||||
mv chroot/var/lib/dpkg/status chroot/var/lib/dpkg/status.tmp
|
mv chroot/var/lib/dpkg/status chroot/var/lib/dpkg/status.tmp
|
||||||
|
@ -262,173 +281,174 @@ if [ "${LH_DEBIAN_INSTALLER}" != "netboot" ]; then
|
||||||
Install_file "${FILE}" "binary/pool/main"
|
Install_file "${FILE}" "binary/pool/main"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# Including base debian packages
|
# Including base debian packages
|
||||||
if [ -d cache/packages_bootstrap ]
|
if [ -d cache/packages_bootstrap ]
|
||||||
then
|
|
||||||
for FILE in cache/packages_bootstrap/*.deb
|
|
||||||
do
|
|
||||||
Install_file "${FILE}" "binary/pool/main"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
Echo_error "E: Could not find cache/packages_bootstrap"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Including local debs
|
|
||||||
if ls ../config/binary_local-debs/*_"${LH_ARCHITECTURE}".udeb > /dev/null 2>&1
|
|
||||||
then
|
|
||||||
for FILE in ../config/binary_local-debs/*_"${LH_ARCHITECTURE}".deb
|
|
||||||
do
|
|
||||||
Install_file "${FILE}" "binary/pool/main"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ls ../config/binary_local-debs/*_all.udeb > /dev/null 2>&1
|
|
||||||
then
|
|
||||||
for FILE in ../config/binary_local-debs/*_all.deb
|
|
||||||
do
|
|
||||||
Install_file "${FILE}" "binary/pool/main"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Generating deb indices
|
|
||||||
mkdir -p binary/dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}
|
|
||||||
|
|
||||||
cd binary
|
|
||||||
apt-ftparchive packages pool/main > dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Packages
|
|
||||||
gzip -9 -c dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Packages > dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Packages.gz
|
|
||||||
cd "${OLDPWD}"
|
|
||||||
|
|
||||||
# Fetching release
|
|
||||||
wget ${WGET_OPTIONS} "${LH_MIRROR_CHROOT}"/dists/"${LH_DISTRIBUTION}"/main/binary-"${LH_ARCHITECTURE}"/Release -O binary/dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Release
|
|
||||||
|
|
||||||
mkdir binary.udeb
|
|
||||||
cd binary.udeb
|
|
||||||
|
|
||||||
# Downloading udeb indices
|
|
||||||
wget ${WGET_OPTIONS} "${LH_MIRROR_CHROOT}"/dists/"${LH_DISTRIBUTION}"/main/debian-installer/binary-"${LH_ARCHITECTURE}"/Packages.gz
|
|
||||||
gunzip -c Packages.gz > Packages
|
|
||||||
|
|
||||||
# Sorting udebs
|
|
||||||
UDEBS="$(awk '/Filename: / { print $2 }' Packages)"
|
|
||||||
|
|
||||||
# Downloading udebs
|
|
||||||
for UDEB in ${UDEBS}
|
|
||||||
do
|
|
||||||
if [ -f ../cache/packages_debian-installer.udeb/"$(basename ${UDEB})" ]
|
|
||||||
then
|
then
|
||||||
# Copying cached udebs
|
for FILE in cache/packages_bootstrap/*.deb
|
||||||
cp ../cache/packages_debian-installer.udeb/"$(basename ${UDEB})" ./
|
do
|
||||||
|
Install_file "${FILE}" "binary/pool/main"
|
||||||
|
done
|
||||||
else
|
else
|
||||||
# Downloading udebs
|
Echo_error "E: Could not find cache/packages_bootstrap"
|
||||||
wget ${WGET_OPTIONS} "${LH_MIRROR_CHROOT}"/${UDEB}
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
|
|
||||||
# Caching udebs
|
# Including local debs
|
||||||
rm -rf ../cache/packages_debian-installer.udeb
|
if ls ../config/binary_local-debs/*_"${LH_ARCHITECTURE}".udeb > /dev/null 2>&1
|
||||||
mkdir -p ../cache/packages_debian-installer.udeb
|
|
||||||
cp *.udeb ../cache/packages_debian-installer.udeb
|
|
||||||
|
|
||||||
# Including local udebs
|
|
||||||
if ls ../config/binary_local-udebs/*_"${LH_ARCHITECTURE}".udeb > /dev/null 2>&1
|
|
||||||
then
|
|
||||||
for FILE in ../config/binary_local-udebs/*_"${LH_ARCHITECTURE}".udeb
|
|
||||||
do
|
|
||||||
Install_file "${FILE}" "pool/main"
|
|
||||||
|
|
||||||
# Prefer local udebs over downloaded udebs
|
|
||||||
rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
if ls ../config/binary_local-udebs/*_all.udeb > /dev/null 2>&1
|
|
||||||
then
|
|
||||||
for FILE in ../config/binary_local-udebs/*_all.udeb
|
|
||||||
do
|
|
||||||
Install_file "${FILE}" "pool/main"
|
|
||||||
|
|
||||||
# Prefer local udebs over downloaded udebs
|
|
||||||
rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
# Excluding udebs
|
|
||||||
grep -v "^#" "${LH_BASE}"/data/debian-cd/"${LH_DISTRIBUTION}"/udeb_exclude > exclude
|
|
||||||
grep -v "^#" "${LH_BASE}"/data/debian-cd/"${LH_DISTRIBUTION}"/exclude-udebs >> exclude
|
|
||||||
grep -v "^#" "${LH_BASE}"/data/debian-cd/"${LH_DISTRIBUTION}"/exclude-udebs-${LH_ARCHITECTURE} >> exclude
|
|
||||||
|
|
||||||
# Local exclude file
|
|
||||||
if [ -e ../config/binary_debian-installer/udeb_exclude ]
|
|
||||||
then
|
|
||||||
cat ../config/binary_debian-installer/udeb_exclude >> exclude
|
|
||||||
fi
|
|
||||||
|
|
||||||
for EXCLUDE in $(cat exclude)
|
|
||||||
do
|
|
||||||
rm -f "${EXCLUDE}"_*.udeb
|
|
||||||
done
|
|
||||||
|
|
||||||
# Enable live-installer
|
|
||||||
if [ "${LH_DEBIAN_INSTALLER}" = "live" ]
|
|
||||||
then
|
|
||||||
# Remove local udebs
|
|
||||||
rm -f pool/main/b/base-installer/bootstrap-base_*.udeb
|
|
||||||
|
|
||||||
# Remove d-i udebs
|
|
||||||
rm -f bootstrap-base_*.udeb
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Moving udebs
|
|
||||||
for UDEB in ${UDEBS}
|
|
||||||
do
|
|
||||||
if [ -f "$(basename ${UDEB})" ]
|
|
||||||
then
|
then
|
||||||
mkdir -p $(dirname ${UDEB})
|
for FILE in ../config/binary_local-debs/*_"${LH_ARCHITECTURE}".deb
|
||||||
mv "$(basename ${UDEB})" "$(dirname ${UDEB})"
|
do
|
||||||
|
Install_file "${FILE}" "binary/pool/main"
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
|
|
||||||
# Creating udeb indices
|
if ls ../config/binary_local-debs/*_all.udeb > /dev/null 2>&1
|
||||||
mkdir -p dists/"${LH_DISTRIBUTION}"/main/debian-installer/binary-"${LH_ARCHITECTURE}"
|
then
|
||||||
apt-ftparchive packages pool/main > dists/"${LH_DISTRIBUTION}"/main/debian-installer/binary-"${LH_ARCHITECTURE}"/Packages
|
for FILE in ../config/binary_local-debs/*_all.deb
|
||||||
gzip -9 -c dists/${LH_DISTRIBUTION}/main/debian-installer/binary-${LH_ARCHITECTURE}/Packages > dists/${LH_DISTRIBUTION}/main/debian-installer/binary-${LH_ARCHITECTURE}/Packages.gz
|
do
|
||||||
|
Install_file "${FILE}" "binary/pool/main"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
rm -f Packages* exclude
|
# Generating deb indices
|
||||||
find . | cpio -dmpu "${OLDPWD}"/binary
|
mkdir -p binary/dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}
|
||||||
cd "${OLDPWD}"
|
|
||||||
|
|
||||||
rm -rf binary.udeb
|
cd binary
|
||||||
rm -rf binary.deb
|
apt-ftparchive packages pool/main > dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Packages
|
||||||
|
gzip -9 -c dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Packages > dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Packages.gz
|
||||||
|
cd "${OLDPWD}"
|
||||||
|
|
||||||
# Generating release file
|
# Fetching release
|
||||||
apt-ftparchive \
|
wget ${WGET_OPTIONS} "${LH_MIRROR_CHROOT}"/dists/"${LH_DISTRIBUTION}"/main/binary-"${LH_ARCHITECTURE}"/Release -O binary/dists/${LH_DISTRIBUTION}/main/binary-${LH_ARCHITECTURE}/Release
|
||||||
-o APT::FTPArchive::Release::Origin="Debian" \
|
|
||||||
-o APT::FTPArchive::Release::Label="Debian" \
|
|
||||||
-o APT::FTPArchive::Release::Suite="${LH_DISTRIBUTION}" \
|
|
||||||
-o APT::FTPArchive::Release::Version="4.0" \
|
|
||||||
-o APT::FTPArchive::Release::Codename="${LH_DISTRIBUTION}" \
|
|
||||||
-o APT::FTPArchive::Release::Date="$(date -R)" \
|
|
||||||
-o APT::FTPArchive::Release::Architectures="${LH_ARCHITECTURE}" \
|
|
||||||
-o APT::FTPArchive::Release::Components="main" \
|
|
||||||
-o APT::FTPArchive::Release::Description="Last updated: $(date -R)" \
|
|
||||||
release binary/dists/${LH_DISTRIBUTION} > binary/dists/${LH_DISTRIBUTION}/Release
|
|
||||||
|
|
||||||
# Creating dist symlinks
|
mkdir binary.udeb
|
||||||
for DISTRIBUTION in frozen stable testing unstable
|
cd binary.udeb
|
||||||
do
|
|
||||||
ln -s ${LH_DISTRIBUTION} binary/dists/${DISTRIBUTION}
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "${LH_BINARY_IMAGES}" != "usb-hdd" ]
|
# Downloading udeb indices
|
||||||
then
|
wget ${WGET_OPTIONS} "${LH_MIRROR_CHROOT}"/dists/"${LH_DISTRIBUTION}"/main/debian-installer/binary-"${LH_ARCHITECTURE}"/Packages.gz
|
||||||
ln -s . binary/debian
|
gunzip -c Packages.gz > Packages
|
||||||
fi
|
|
||||||
|
|
||||||
# Including preseeding files
|
# Sorting udebs
|
||||||
if [ -e config/binary_debian-installer/preseed*.cfg ]
|
UDEBS="$(awk '/Filename: / { print $2 }' Packages)"
|
||||||
then
|
|
||||||
cp config/binary_debian-installer/preseed*.cfg binary/install
|
# Downloading udebs
|
||||||
|
for UDEB in ${UDEBS}
|
||||||
|
do
|
||||||
|
if [ -f ../cache/packages_debian-installer.udeb/"$(basename ${UDEB})" ]
|
||||||
|
then
|
||||||
|
# Copying cached udebs
|
||||||
|
cp ../cache/packages_debian-installer.udeb/"$(basename ${UDEB})" ./
|
||||||
|
else
|
||||||
|
# Downloading udebs
|
||||||
|
wget ${WGET_OPTIONS} "${LH_MIRROR_CHROOT}"/${UDEB}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Caching udebs
|
||||||
|
rm -rf ../cache/packages_debian-installer.udeb
|
||||||
|
mkdir -p ../cache/packages_debian-installer.udeb
|
||||||
|
cp *.udeb ../cache/packages_debian-installer.udeb
|
||||||
|
|
||||||
|
# Including local udebs
|
||||||
|
if ls ../config/binary_local-udebs/*_"${LH_ARCHITECTURE}".udeb > /dev/null 2>&1
|
||||||
|
then
|
||||||
|
for FILE in ../config/binary_local-udebs/*_"${LH_ARCHITECTURE}".udeb
|
||||||
|
do
|
||||||
|
Install_file "${FILE}" "pool/main"
|
||||||
|
|
||||||
|
# Prefer local udebs over downloaded udebs
|
||||||
|
rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
if ls ../config/binary_local-udebs/*_all.udeb > /dev/null 2>&1
|
||||||
|
then
|
||||||
|
for FILE in ../config/binary_local-udebs/*_all.udeb
|
||||||
|
do
|
||||||
|
Install_file "${FILE}" "pool/main"
|
||||||
|
|
||||||
|
# Prefer local udebs over downloaded udebs
|
||||||
|
rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Excluding udebs
|
||||||
|
grep -v "^#" "${LH_BASE}"/data/debian-cd/"${LH_DISTRIBUTION}"/udeb_exclude > exclude
|
||||||
|
grep -v "^#" "${LH_BASE}"/data/debian-cd/"${LH_DISTRIBUTION}"/exclude-udebs >> exclude
|
||||||
|
grep -v "^#" "${LH_BASE}"/data/debian-cd/"${LH_DISTRIBUTION}"/exclude-udebs-${LH_ARCHITECTURE} >> exclude
|
||||||
|
|
||||||
|
# Local exclude file
|
||||||
|
if [ -e ../config/binary_debian-installer/udeb_exclude ]
|
||||||
|
then
|
||||||
|
cat ../config/binary_debian-installer/udeb_exclude >> exclude
|
||||||
|
fi
|
||||||
|
|
||||||
|
for EXCLUDE in $(cat exclude)
|
||||||
|
do
|
||||||
|
rm -f "${EXCLUDE}"_*.udeb
|
||||||
|
done
|
||||||
|
|
||||||
|
# Enable live-installer
|
||||||
|
if [ "${LH_DEBIAN_INSTALLER}" = "live" ]
|
||||||
|
then
|
||||||
|
# Remove local udebs
|
||||||
|
rm -f pool/main/b/base-installer/bootstrap-base_*.udeb
|
||||||
|
|
||||||
|
# Remove d-i udebs
|
||||||
|
rm -f bootstrap-base_*.udeb
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Moving udebs
|
||||||
|
for UDEB in ${UDEBS}
|
||||||
|
do
|
||||||
|
if [ -f "$(basename ${UDEB})" ]
|
||||||
|
then
|
||||||
|
mkdir -p $(dirname ${UDEB})
|
||||||
|
mv "$(basename ${UDEB})" "$(dirname ${UDEB})"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Creating udeb indices
|
||||||
|
mkdir -p dists/"${LH_DISTRIBUTION}"/main/debian-installer/binary-"${LH_ARCHITECTURE}"
|
||||||
|
apt-ftparchive packages pool/main > dists/"${LH_DISTRIBUTION}"/main/debian-installer/binary-"${LH_ARCHITECTURE}"/Packages
|
||||||
|
gzip -9 -c dists/${LH_DISTRIBUTION}/main/debian-installer/binary-${LH_ARCHITECTURE}/Packages > dists/${LH_DISTRIBUTION}/main/debian-installer/binary-${LH_ARCHITECTURE}/Packages.gz
|
||||||
|
|
||||||
|
rm -f Packages* exclude
|
||||||
|
find . | cpio -dmpu "${OLDPWD}"/binary
|
||||||
|
cd "${OLDPWD}"
|
||||||
|
|
||||||
|
rm -rf binary.udeb
|
||||||
|
rm -rf binary.deb
|
||||||
|
|
||||||
|
# Generating release file
|
||||||
|
apt-ftparchive \
|
||||||
|
-o APT::FTPArchive::Release::Origin="Debian" \
|
||||||
|
-o APT::FTPArchive::Release::Label="Debian" \
|
||||||
|
-o APT::FTPArchive::Release::Suite="${LH_DISTRIBUTION}" \
|
||||||
|
-o APT::FTPArchive::Release::Version="4.0" \
|
||||||
|
-o APT::FTPArchive::Release::Codename="${LH_DISTRIBUTION}" \
|
||||||
|
-o APT::FTPArchive::Release::Date="$(date -R)" \
|
||||||
|
-o APT::FTPArchive::Release::Architectures="${LH_ARCHITECTURE}" \
|
||||||
|
-o APT::FTPArchive::Release::Components="main" \
|
||||||
|
-o APT::FTPArchive::Release::Description="Last updated: $(date -R)" \
|
||||||
|
release binary/dists/${LH_DISTRIBUTION} > binary/dists/${LH_DISTRIBUTION}/Release
|
||||||
|
|
||||||
|
# Creating dist symlinks
|
||||||
|
for DISTRIBUTION in frozen stable testing unstable
|
||||||
|
do
|
||||||
|
ln -s ${LH_DISTRIBUTION} binary/dists/${DISTRIBUTION}
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "${LH_BINARY_IMAGES}" != "usb-hdd" ]
|
||||||
|
then
|
||||||
|
ln -s . binary/debian
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Including preseeding files
|
||||||
|
if [ -e config/binary_debian-installer/preseed*.cfg ]
|
||||||
|
then
|
||||||
|
cp config/binary_debian-installer/preseed*.cfg binary/install
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Creating stage file
|
# Creating stage file
|
||||||
|
|
Loading…
Reference in New Issue