Making firmware package assembling a bit more robust.
This commit is contained in:
parent
4007e00a56
commit
ead507b47c
|
@ -413,19 +413,27 @@ 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.binary
|
||||
wget ${WGET_OPTIONS} ${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION}/Contents-${LB_ARCHITECTURES}.gz -O - | gunzip -c > cache/contents.binary/contents.${LB_PARENT_DISTRIBUTION}.${LB_ARCHITECTURES}
|
||||
|
||||
FIRMWARE_PACKAGES=""
|
||||
FIRMWARE_PACKAGES="$(awk '/^lib\/firmware/ { print $2 }' cache/contents.binary/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.binary/contents.${LB_DISTRIBUTION}.${LB_ARCHITECTURES}
|
||||
|
||||
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' cache/contents.binary/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}"
|
||||
|
@ -434,9 +442,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}"
|
||||
|
|
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue