diff options
author | Daniel Baumann <daniel@debian.org> | 2012-11-22 17:07:35 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2012-11-22 17:07:49 +0100 |
commit | 11d97a6a5f17fe2c500a798aa4a32fa6889e409c (patch) | |
tree | 4287937d71c41a6228187a279cad3fabb830b6d5 /scripts/build | |
parent | 8f90c22f7dcccb6902a9af36d53e0aacf4c4e12c (diff) | |
download | vyos-live-build-11d97a6a5f17fe2c500a798aa4a32fa6889e409c.tar.gz vyos-live-build-11d97a6a5f17fe2c500a798aa4a32fa6889e409c.zip |
Adding backwards compatible handling for squeeze and the ubuntus for old-style Contents files in the archive.
Diffstat (limited to 'scripts/build')
-rwxr-xr-x | scripts/build/binary_debian-installer | 44 | ||||
-rwxr-xr-x | scripts/build/chroot_linux-image | 44 |
2 files changed, 62 insertions, 26 deletions
diff --git a/scripts/build/binary_debian-installer b/scripts/build/binary_debian-installer index e18c32d2d..2a180dca8 100755 --- a/scripts/build/binary_debian-installer +++ b/scripts/build/binary_debian-installer @@ -418,29 +418,47 @@ then FIRMWARE_PACKAGES="" - for _PARENT_ARCHIVE_AREA in ${LB_PARENT_ARCHIVE_AREAS} - do - wget ${WGET_OPTIONS} ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/${_PARENT_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz -O - | gunzip -c > cache/contents.binary/contents.${LB_PARENT_DISTRIBUTION}.${_PARENT_ARCHIVE_AREA}.${LB_ARCHITECTURES} + if [ "${_PARENT_DISTRIBUTION}" = "squeeze" ] || [ "${LB_MODE}" = "ubuntu" ] || [ "${LB_MODE}" = "kubuntu" ] + then + _CONTENTS="${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz" + else + _CONTENTS="$(for _PARENT_ARCHIVE_AREA in ${LB_PARENT_ARCHIVE_AREAS}; do echo ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/${_PARENT_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz; done)" + fi - FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.binary/contents.${LB_PARENT_DISTRIBUTION}.${_PARENT_ARCHIVE_AREA}.${LB_ARCHITECTURES} | sort -u)" + rm -f cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LB_ARCHITECTURES} - if [ "${_PARENT_ARCHIVE_AREA}" = "non-free" ] - then - # FIXME: should check that we're building on debian through e.g. a 'derivative-is-based-on' variable or somesuch. - # Manually add firmware-linux/non-free meta package - FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux" - fi + for _CONTENT in ${_CONTENTS} + do + 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}.${LB_ARCHITECTURES} | sort -u)" done + if echo ${LB_PARENT_ARCHIVE_AREAS} | grep -qs "non-free" + then + # FIXME: should check that we're building on debian through e.g. a 'derivative-is-based-on' variable or somesuch. + # Manually add firmware-linux/non-free meta package + FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux" + fi + 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). - for _ARCHIVE_AREA in ${LB_ARCHIVE_AREAS} + if [ "${_PARENT_DISTRIBUTION}" = "squeeze" ] || [ "${LB_MODE}" = "ubuntu" ] || [ "${LB_MODE}" = "kubuntu" ] + then + _CONTENTS="${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz" + else + _CONTENTS="$(for _ARCHIVE_AREA in ${LB_ARCHIVE_AREAS}; do echo ${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/${_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz; done)" + fi + + rm -f cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES} + + for _CONTENT in ${_CONTENTS} do - wget ${WGET_OPTIONS} ${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/${_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz -O - | gunzip -c > cache/contents.binary/contents.${LB_DISTRIBUTION}.${_ARCHIVE_AREA}.${LB_ARCHITECTURES} + 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.binary/contents.${LB_DISTRIBUTION}.${_ARCHIVE_AREA}.${LB_ARCHITECTURES} | sort -u)" + FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES} | sort -u)" done fi diff --git a/scripts/build/chroot_linux-image b/scripts/build/chroot_linux-image index 6e46b8542..ced454915 100755 --- a/scripts/build/chroot_linux-image +++ b/scripts/build/chroot_linux-image @@ -63,29 +63,47 @@ then FIRMWARE_PACKAGES="" - for _PARENT_ARCHIVE_AREA in ${LB_PARENT_ARCHIVE_AREAS} - do - wget ${WGET_OPTIONS} ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/${_PARENT_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz -O - | gunzip -c > cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${_PARENT_ARCHIVE_AREA}.${LB_ARCHITECTURES} + if [ "${_PARENT_DISTRIBUTION}" = "squeeze" ] || [ "${LB_MODE}" = "ubuntu" ] || [ "${LB_MODE}" = "kubuntu" ] + then + _CONTENTS="${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz" + else + _CONTENTS="$(for _PARENT_ARCHIVE_AREA in ${LB_PARENT_ARCHIVE_AREAS}; do echo ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/${_PARENT_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz; done)" + fi - FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${_PARENT_ARCHIVE_AREA}.${LB_ARCHITECTURES} | sort -u)" + rm -f cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION}.${LB_ARCHITECTURES} - if [ "${_PARENT_ARCHIVE_AREA}" = "non-free" ] - then - # FIXME: should check that we're building on debian through e.g. a 'derivative-is-based-on' variable or somesuch. - # Manually add firmware-linux/non-free meta package - FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux" - fi + for _CONTENT in ${_CONTENTS} + do + 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}.${LB_ARCHITECTURES} | sort -u)" done + if echo ${LB_PARENT_ARCHIVE_AREAS} | grep -qs "non-free" + then + # FIXME: should check that we're building on debian through e.g. a 'derivative-is-based-on' variable or somesuch. + # Manually add firmware-linux/non-free meta package + FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux" + fi + 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). - for _ARCHIVE_AREA in ${LB_ARCHIVE_AREAS} + if [ "${_PARENT_DISTRIBUTION}" = "squeeze" ] || [ "${LB_MODE}" = "ubuntu" ] || [ "${LB_MODE}" = "kubuntu" ] + then + _CONTENTS="${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz" + else + _CONTENTS="$(for _ARCHIVE_AREA in ${LB_ARCHIVE_AREAS}; do echo ${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/${_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz; done)" + fi + + rm -f cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES} + + for _CONTENT in ${_CONTENTS} do - wget ${WGET_OPTIONS} ${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/${_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz -O - | gunzip -c > cache/contents.chroot/contents.${LB_DISTRIBUTION}.${_ARCHIVE_AREA}.${LB_ARCHITECTURES} + 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}.${_ARCHIVE_AREA}.${LB_ARCHITECTURES} | sort -u)" + FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.chroot/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES} | sort -u)" done fi |