summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfunctions/firmwarelists.sh37
-rwxr-xr-xscripts/build/chroot_firmware29
-rwxr-xr-xscripts/build/installer_debian-installer31
3 files changed, 42 insertions, 55 deletions
diff --git a/functions/firmwarelists.sh b/functions/firmwarelists.sh
new file mode 100755
index 000000000..5c552fc98
--- /dev/null
+++ b/functions/firmwarelists.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+## live-build(7) - System Build Scripts
+## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
+##
+## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+## This is free software, and you are welcome to redistribute it
+## under certain conditions; see COPYING for details.
+
+# Updates FIRMWARE_PACKAGES with list of packages determined from specified
+# archive areas of specified distro, based upon reading archive content file.
+#
+# Shared by chroot_firmware and installer_debian-installer
+#
+# Assumption: firmware packages install files into /lib/firmware
+Firmware_List_From_Contents () {
+ local MIRROR_CHROOT="${1}"
+ local DISTRO_CHROOT="${2}"
+ local ARCHIVE_AREAS="${3}"
+
+ local CONTENTS_FILE="cache/contents.chroot/contents.${DISTRO_CHROOT}.${LB_ARCHITECTURES}"
+
+ # Ensure fresh
+ rm -f "${CONTENTS_FILE}"
+
+ for _ARCHIVE_AREA in ${ARCHIVE_AREAS}
+ do
+ local CONTENTS_URL="${MIRROR_CHROOT}/dists/${DISTRO_CHROOT}/${_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz"
+
+ wget ${WGET_OPTIONS} "${CONTENTS_URL}" -O - | gunzip -c >> "${CONTENTS_FILE}"
+ done
+
+ FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' "${CONTENTS_FILE}" | sort -u)"
+
+ # Don't waste disk space preserving since always getting fresh
+ rm -f "${CONTENTS_FILE}"
+}
diff --git a/scripts/build/chroot_firmware b/scripts/build/chroot_firmware
index e644a5584..5686de624 100755
--- a/scripts/build/chroot_firmware
+++ b/scripts/build/chroot_firmware
@@ -52,25 +52,13 @@ Check_package host /usr/bin/wget wget
#esac
# Include firmware packages
-# Assumption: firmware packages install files into /lib/firmware
# Get all firmware packages names
mkdir -p cache/contents.chroot
FIRMWARE_PACKAGES=""
-CONTENTS_FILE="cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION_CHROOT}.${LB_ARCHITECTURES}"
-
-rm -f "${CONTENTS_FILE}"
-
-for _PARENT_ARCHIVE_AREA in ${LB_PARENT_ARCHIVE_AREAS}
-do
- CONTENTS_URL="${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION_CHROOT}/${_PARENT_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz"
-
- wget ${WGET_OPTIONS} "${CONTENTS_URL}" -O - | gunzip -c >> "${CONTENTS_FILE}"
-done
-
-FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' "${CONTENTS_FILE}" | sort -u)"
+Firmware_List_From_Contents "${LB_PARENT_MIRROR_CHROOT}" "${LB_PARENT_DISTRIBUTION_CHROOT}" "${LB_PARENT_ARCHIVE_AREAS}"
if echo ${LB_PARENT_ARCHIVE_AREAS} | grep -qs "non-free"
then
@@ -93,22 +81,9 @@ 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).
- CONTENTS_FILE="cache/contents.chroot/contents.${LB_DISTRIBUTION_CHROOT}.${LB_ARCHITECTURES}"
-
- rm -f "${CONTENTS_FILE}"
-
- for _ARCHIVE_AREA in ${LB_ARCHIVE_AREAS}
- do
- CONTENTS_URL="${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION_CHROOT}/${_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz"
-
- wget ${WGET_OPTIONS} "${CONTENTS_URL}" -O - | gunzip -c >> "${CONTENTS_FILE}"
- done
-
- FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' "${CONTENTS_FILE}" | sort -u)"
+ Firmware_List_From_Contents "${LB_MIRROR_CHROOT}" "${LB_DISTRIBUTION_CHROOT}" "${LB_ARCHIVE_AREAS}"
fi
-rm -f "${CONTENTS_FILE}"
-
# Drop section and keep package names only
for _PACKAGE in ${FIRMWARE_PACKAGES}
do
diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer
index dcfd1792b..96e4e7b5c 100755
--- a/scripts/build/installer_debian-installer
+++ b/scripts/build/installer_debian-installer
@@ -337,28 +337,16 @@ then
DI_PACKAGES="${DI_PACKAGES} console-setup keyboard-configuration kbd"
;;
esac
+
# Include firmware packages
if [ "${LB_FIRMWARE_BINARY}" = "true" ]
then
- # Assumption: firmware packages install files into /lib/firmware
-
# Get all firmware packages names
mkdir -p cache/contents.binary
FIRMWARE_PACKAGES=""
- CONTENTS_FILE="cache/contents.chroot/contents.${LB_PARENT_DISTRIBUTION_CHROOT}.${LB_ARCHITECTURES}"
-
- rm -f "${CONTENTS_FILE}"
-
- for _PARENT_ARCHIVE_AREA in ${LB_PARENT_ARCHIVE_AREAS}
- do
- CONTENTS_URL="${LB_PARENT_MIRROR_CHROOT}/dists/${LB_PARENT_DISTRIBUTION_CHROOT}/${_PARENT_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz"
-
- wget ${WGET_OPTIONS} "${CONTENTS_URL}" -O - | gunzip -c >> "${CONTENTS_FILE}"
- done
-
- FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' "${CONTENTS_FILE}" | sort -u)"
+ Firmware_List_From_Contents "${LB_PARENT_MIRROR_CHROOT}" "${LB_PARENT_DISTRIBUTION_CHROOT}" "${LB_PARENT_ARCHIVE_AREAS}"
if echo ${LB_PARENT_ARCHIVE_AREAS} | grep -qs "non-free"
then
@@ -381,22 +369,9 @@ then
then
# FIXME: account for the fact that PARENT_DISTRIBUTION and DISTRIBUTION might be the same (to not have overlapping cache files for contents).
- CONTENTS_FILE="cache/contents.chroot/contents.${LB_DISTRIBUTION_CHROOT}.${LB_ARCHITECTURES}"
-
- rm -f "${CONTENTS_FILE}"
-
- for _ARCHIVE_AREA in ${LB_ARCHIVE_AREAS}
- do
- CONTENTS_URL="${LB_MIRROR_CHROOT}/dists/${LB_DISTRIBUTION_CHROOT}/${_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURES}.gz"
-
- wget ${WGET_OPTIONS} "${CONTENTS_URL}" -O - | gunzip -c >> "${CONTENTS_FILE}"
- done
-
- FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} $(awk '/^lib\/firmware/ { print $2 }' "${CONTENTS_FILE}" | sort -u)"
+ Firmware_List_From_Contents "${LB_MIRROR_CHROOT}" "${LB_DISTRIBUTION_CHROOT}" "${LB_ARCHIVE_AREAS}"
fi
- rm -f "${CONTENTS_FILE}"
-
# Drop section and keep package names only
for _PACKAGE in ${FIRMWARE_PACKAGES}
do