From 44b9b0a6501476de594ce3783cea5df0c141478c Mon Sep 17 00:00:00 2001 From: Raphaƫl Hertzog Date: Thu, 19 Dec 2019 18:18:44 +0100 Subject: Support --distribution-binary and --distribution-chroot This makes it possible to build an image against a first distribution (--distribution-chroot) and have the resulting image point to another distribution (--distribution-binary). We can use this to build against a snapshot and have the result use the original distribution that was snapshotted. Closes: #888507 --- scripts/build/chroot_archives | 52 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'scripts/build/chroot_archives') diff --git a/scripts/build/chroot_archives b/scripts/build/chroot_archives index 11a5c4a80..9ca6a7892 100755 --- a/scripts/build/chroot_archives +++ b/scripts/build/chroot_archives @@ -64,19 +64,19 @@ then fi cat > chroot/etc/apt/${_PARENT_FILE} << EOF -deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION} ${LB_PARENT_ARCHIVE_AREAS} +deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT} ${LB_PARENT_ARCHIVE_AREAS} EOF if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION} ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT} ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} fi if [ "${LB_DERIVATIVE}" = "true" ] then rm -f chroot/etc/apt/sources.list.d/${LB_MODE}.list - _DISTRIBUTION="$(echo ${LB_DISTRIBUTION} | sed -e 's|-backports||')" + _DISTRIBUTION="$(echo ${LB_DISTRIBUTION_CHROOT} | sed -e 's|-backports||')" echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list @@ -90,17 +90,17 @@ EOF then case "${LB_MODE}" in debian|progress-linux) - case "${LB_PARENT_DISTRIBUTION}" in + case "${LB_PARENT_DISTRIBUTION_CHROOT}" in sid) ;; *) - echo "deb ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION_CHROOT}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb-src ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION_CHROOT}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} fi ;; esac @@ -130,11 +130,11 @@ EOF if [ "${LB_UPDATES}" = "true" ] then - echo "deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} fi if [ "${LB_DERIVATIVE}" = "true" ] @@ -152,13 +152,13 @@ EOF then case "${LB_MODE}" in debian) - if [ "${LB_PARENT_DISTRIBUTION}" != "sid" ] + if [ "${LB_PARENT_DISTRIBUTION_CHROOT}" != "sid" ] then - echo "deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} fi fi ;; @@ -180,8 +180,8 @@ EOF do if [ -e "${FILE}" ] then - sed -e "s|@DISTRIBUTION@|${LB_DISTRIBUTION}|g" \ - -e "s|@PARENT_DISTRIBUTION@|${LB_PARENT_DISTRIBUTION}|g" \ + sed -e "s|@DISTRIBUTION@|${LB_DISTRIBUTION_CHROOT}|g" \ + -e "s|@PARENT_DISTRIBUTION@|${LB_PARENT_DISTRIBUTION_CHROOT}|g" \ -e "s|@ARCHIVE_AREAS@|${LB_ARCHIVE_AREAS}|g" \ -e "s|@PARENT_ARCHIVE_AREAS@|${LB_PARENT_ARCHIVE_AREAS}|g" \ "${FILE}" > "chroot/etc/apt/sources.list.d/$(basename ${FILE} .chroot)" @@ -460,19 +460,19 @@ EOF # Configure custom sources.list cat > chroot/etc/apt/${_PARENT_FILE} << EOF -deb ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION} ${LB_PARENT_ARCHIVE_AREAS} +deb ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION_BINARY} ${LB_PARENT_ARCHIVE_AREAS} EOF if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] then - echo "deb-src ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION} ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb-src ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION_BINARY} ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} fi if [ "${LB_DERIVATIVE}" = "true" ] then rm -f chroot/etc/apt/sources.list.d/${LB_MODE}.list - _DISTRIBUTION="$(echo ${LB_DISTRIBUTION} | sed -e 's|-backports||')" + _DISTRIBUTION="$(echo ${LB_DISTRIBUTION_BINARY} | sed -e 's|-backports||')" echo "deb ${LB_MIRROR_BINARY} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list @@ -486,17 +486,17 @@ EOF then case "${LB_MODE}" in debian|progress-linux) - case "${LB_PARENT_DISTRIBUTION}" in + case "${LB_PARENT_DISTRIBUTION_BINARY}" in sid) ;; *) - echo "deb ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION_BINARY}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] then - echo "deb-src ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb-src ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION_BINARY}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} fi ;; esac @@ -526,11 +526,11 @@ EOF if [ "${LB_UPDATES}" = "true" ] then - echo "deb ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION_BINARY}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] then - echo "deb-src ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb-src ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION_BINARY}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} fi if [ "${LB_DERIVATIVE}" = "true" ] @@ -548,13 +548,13 @@ EOF then case "${LB_MODE}" in debian) - if [ "${LB_PARENT_DISTRIBUTION}" != "sid" ] + if [ "${LB_PARENT_DISTRIBUTION_BINARY}" != "sid" ] then - echo "deb ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION_BINARY}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] then - echo "deb-src ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} + echo "deb-src ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION_BINARY}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} fi fi ;; @@ -603,8 +603,8 @@ EOF do if [ -e "${FILE}" ] then - sed -e "s|@DISTRIBUTION@|${LB_DISTRIBUTION}|g" \ - -e "s|@PARENT_DISTRIBUTION@|${LB_PARENT_DISTRIBUTION}|g" \ + sed -e "s|@DISTRIBUTION@|${LB_DISTRIBUTION_BINARY}|g" \ + -e "s|@PARENT_DISTRIBUTION@|${LB_PARENT_DISTRIBUTION_BINARY}|g" \ -e "s|@ARCHIVE_AREAS@|${LB_ARCHIVE_AREAS}|g" \ -e "s|@PARENT_ARCHIVE_AREAS@|${LB_PARENT_ARCHIVE_AREAS}|g" \ "${FILE}" > "chroot/etc/apt/sources.list.d/$(basename ${FILE} .binary)" -- cgit v1.2.3