diff options
author | Raphaël Hertzog <raphael@offensive-security.com> | 2019-12-19 19:07:59 +0100 |
---|---|---|
committer | Raphaël Hertzog <raphael@offensive-security.com> | 2019-12-19 19:07:59 +0100 |
commit | 30b9a391ac42ed735b33bf1e374a145b577620a7 (patch) | |
tree | 1e44c95b5955794dc7434ca5e3517802392d1c43 | |
parent | cba349e5d0916cedabd23d953695a1fd9523ea3c (diff) | |
download | vyos-live-build-30b9a391ac42ed735b33bf1e374a145b577620a7.tar.gz vyos-live-build-30b9a391ac42ed735b33bf1e374a145b577620a7.zip |
Fix "--debian-installer cdrom" and its interaction with binary_package-lists
apt-ftparchive is not able to differentiate between .deb and .udeb so
we have to install them in different pool directories so that we can
regenerate the Packages files without having the .udeb show up
unexpectedly.
Since binary_package-lists can overwrite the Packages files generated
in installer_debian-installer we have to ensure that it also updates
the Release file created formerly.
Ideally we should find a way to avoid the duplication of this logic.
Gbp-Dch: Full
-rwxr-xr-x | scripts/build/binary_package-lists | 24 | ||||
-rwxr-xr-x | scripts/build/installer_debian-installer | 12 |
2 files changed, 30 insertions, 6 deletions
diff --git a/scripts/build/binary_package-lists b/scripts/build/binary_package-lists index 54725b580..599ab884a 100755 --- a/scripts/build/binary_package-lists +++ b/scripts/build/binary_package-lists @@ -129,6 +129,15 @@ then mv "${FILE}" binary/${POOL}/${SECTION}/"${LETTER}"/"${SOURCE}" done + if [ -e chroot/etc/os-release ] + then + _VERSION="$(. chroot/etc/os-release && echo ${VERSION_ID})" + fi + + if [ -n "${_VERSION}" ]; then + _LB_APT_VERSION_OPT='-o APT::FTPArchive::Release::Version="'"${_VERSION}"'"' + fi + cd binary for SECTION in ${POOL}/* @@ -144,6 +153,21 @@ then gzip -9 -c ${DISTS}/${LB_PARENT_DISTRIBUTION_BINARY}/${SECTION}/binary-${LB_ARCHITECTURES}/Packages > ${DISTS}/${LB_PARENT_DISTRIBUTION_BINARY}/${SECTION}/binary-${LB_ARCHITECTURES}/Packages.gz done + if [ -d dists/${LB_PARENT_DISTRIBUTION_BINARY} ]; then + apt-ftparchive \ + -o APT::FTPArchive::Release::Origin="Debian" \ + -o APT::FTPArchive::Release::Label="Debian" \ + -o APT::FTPArchive::Release::Suite="${LB_PARENT_DISTRIBUTION_BINARY}" \ + ${_LB_APT_VERSION_OPT} \ + -o APT::FTPArchive::Release::Codename="${LB_PARENT_DISTRIBUTION_BINARY}" \ + -o APT::FTPArchive::Release::Date="$(date -R)" \ + -o APT::FTPArchive::Release::Architectures="${LB_ARCHITECTURES}" \ + -o APT::FTPArchive::Release::Components="${LB_PARENT_ARCHIVE_AREAS}" \ + -o APT::FTPArchive::Release::Description="Last updated: $(date -R)" \ + release dists/${LB_PARENT_DISTRIBUTION_BINARY} \ + > dists/${LB_PARENT_DISTRIBUTION_BINARY}/Release + fi + cd "${OLDPWD}" rm -f chroot/bin/Packages diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer index e91ca7fe9..e9843d672 100755 --- a/scripts/build/installer_debian-installer +++ b/scripts/build/installer_debian-installer @@ -514,7 +514,7 @@ then fi # Udeb handling - mkdir binary.udeb + mkdir -p binary.udeb/pool-udeb/main cd binary.udeb # Downloading udeb indices @@ -570,7 +570,7 @@ then do if [ -e "${FILE}" ] then - Install_file "${FILE}" "pool" + Install_file "${FILE}" "pool-udeb" # Prefer local udebs over downloaded udebs rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb @@ -584,7 +584,7 @@ then do if [ -e "${FILE}" ] then - Install_file "${FILE}" "pool" + Install_file "${FILE}" "pool-udeb" # Prefer local udebs over downloaded udebs rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb @@ -629,8 +629,8 @@ then do if [ -f "$(basename ${UDEB})" ] then - mkdir -p $(dirname ${UDEB}) - mv "$(basename ${UDEB})" "$(dirname ${UDEB})" + Install_file "$(basename ${UDEB})" "pool-udeb" + rm "$(basename ${UDEB})" fi done @@ -639,7 +639,7 @@ then cd "${OLDPWD}" mv binary.udeb chroot/root - echo "cd /root/binary.udeb && apt-ftparchive packages pool/main > dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/main/debian-installer/binary-${LB_ARCHITECTURES}/Packages" > chroot/binary.sh + echo "cd /root/binary.udeb && apt-ftparchive packages pool-udeb/main > dists/${LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION}/main/debian-installer/binary-${LB_ARCHITECTURES}/Packages" > chroot/binary.sh Chroot chroot "sh binary.sh" rm -f chroot/binary.sh mv chroot/root/binary.udeb ./ |