diff options
author | Daniel Baumann <daniel@debian.org> | 2012-06-04 10:41:57 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2012-06-04 11:55:18 +0200 |
commit | ead507b47ce7f51ff89fc2701c54e681447f096e (patch) | |
tree | 52e346b368ee4b40f8d15a575695bf7be31a4e11 /scripts/build/lb_chroot_linux-image | |
parent | 4007e00a56c2664a23acbcac98299e6729d7b289 (diff) | |
download | vyos-live-build-ead507b47ce7f51ff89fc2701c54e681447f096e.tar.gz vyos-live-build-ead507b47ce7f51ff89fc2701c54e681447f096e.zip |
Making firmware package assembling a bit more robust.
Diffstat (limited to 'scripts/build/lb_chroot_linux-image')
-rwxr-xr-x | scripts/build/lb_chroot_linux-image | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/scripts/build/lb_chroot_linux-image b/scripts/build/lb_chroot_linux-image index 1dd4544f6..b538e43a4 100755 --- a/scripts/build/lb_chroot_linux-image +++ b/scripts/build/lb_chroot_linux-image @@ -53,24 +53,33 @@ then done done + # Include firmware packages if [ "${LB_FIRMWARE_CHROOT}" = "true" ] then # Assumption: firmware packages install files into /lib/firmware # Get all firmware packages names - FIRMWARE_PACKAGES="$(wget ${WGET_OPTIONS} ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz -O - | gunzip -c | awk '/^lib\/firmware/ { print $2 }' | sort -u)" + mkdir -p cache/contents.chroot + wget ${WGET_OPTIONS} ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz -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)" if [ "${LB_DERIVATIVE}" = "true" ] then - FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(wget ${WGET_OPTIONS} ${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz -O - | gunzip -c | awk '/^lib\/firmware/ { print $2 }' | sort -u)" + wget {WGET_OPTIONS} ${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz -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}.${LB_ARCHITECTURES} | sort -u)" fi # Filter out contrib packages if contrib is not enabled if ! echo ${LB_ARCHIVE_AREAS} | grep -qs contrib then + _FIRMWARE_PACKAGES="" + for _PACKAGE in ${FIRMWARE_PACKAGES} do - _FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES} $(echo ${_PACKAGE} | grep -v '^contrib/')" + _FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES} $(echo ${_PACKAGE} | sed -e 's|^contrib/.*$||')" done FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES}" @@ -79,9 +88,11 @@ then # Filter out non-free packages if non-free is not enabled if ! echo ${LB_ARCHIVE_AREAS} | grep -qs non-free then + _FIRMWARE_PACKAGES="" + for _PACKAGE in ${FIRMWARE_PACKAGES} do - _FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES} $(echo ${_PACKAGE} | grep -v '^non-free/')" + _FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES} $(echo ${_PACKAGE} | sed -e 's|^non-free/.*$||')" done FIRMWARE_PACKAGES="${_FIRMWARE_PACKAGES}" |