diff options
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}" |