summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-08-27 21:02:10 +0200
committerGitHub <noreply@github.com>2023-08-27 21:02:10 +0200
commitac5a48ecda28806c1884556294c35f7daa4222be (patch)
tree705992f97ab138c66a7de4dc0e9b0846296b90e9
parentaadf6f1311a768a36d460f4010f1c3e048293090 (diff)
parente15cf4008c52c958c3b74bbdc045ba8c1df3414d (diff)
downloadvyos-build-ac5a48ecda28806c1884556294c35f7daa4222be.tar.gz
vyos-build-ac5a48ecda28806c1884556294c35f7daa4222be.zip
Merge pull request #382 from tjjh89017/T5512
T5512: linux-firmware: expand asterisk in modinfo firmware fields
-rwxr-xr-xpackages/linux-kernel/build-linux-firmware.sh46
1 files changed, 23 insertions, 23 deletions
diff --git a/packages/linux-kernel/build-linux-firmware.sh b/packages/linux-kernel/build-linux-firmware.sh
index 83501e6e..d4d263e2 100755
--- a/packages/linux-kernel/build-linux-firmware.sh
+++ b/packages/linux-kernel/build-linux-firmware.sh
@@ -55,32 +55,32 @@ mkdir -p "${LINUX_FIRMWARE_BUILD_DIR}"
# Copy firmware file from linux firmware build directory into
# assembly folder for the vyos-firmware package
SED_REPLACE="s@${CWD}/${LINUX_FIRMWARE}/@@"
-for FILE in ${FW_FILES}; do
- # If file is a symlink install the symlink target as well
- if [ -h "${LINUX_FIRMWARE_BUILD_DIR}/${FILE}" ]; then
- TARGET="$(realpath --relative-to="${LINUX_FIRMWARE_BUILD_DIR}" "${LINUX_FIRMWARE_BUILD_DIR}/${FILE}")"
+for FILE_PATTERN in ${FW_FILES}; do
+ find "${LINUX_FIRMWARE_BUILD_DIR}" -path "*/${FILE_PATTERN}" -print0 | while IFS= read -r -d $'\0' FILE; do
+ TARGET="$(realpath --relative-to="${LINUX_FIRMWARE_BUILD_DIR}" "${FILE}")"
TARGET_DIR="${VYOS_FIRMWARE_DIR}/lib/firmware/$(dirname "${TARGET}")"
-
- if [ ! -f "${TARGET_DIR}/$(basename "${TARGET}")" ]; then
- if [ -f "${LINUX_FIRMWARE_BUILD_DIR}/${TARGET}" ]; then
- mkdir -p "${TARGET_DIR}"
-
- echo "I: install firmware: ${TARGET}"
- cp "${CWD}/${LINUX_FIRMWARE_BUILD_DIR}/${TARGET}" "${TARGET_DIR}"
- else
- echo "I: firmware file not found: ${TARGET}"
+ # If file is a symlink install the symlink target as well
+ if [ -h "${FILE}" ]; then
+ if [ ! -f "${TARGET_DIR}/$(basename "${TARGET}")" ]; then
+ if [ -f "${LINUX_FIRMWARE_BUILD_DIR}/${TARGET}" ]; then
+ mkdir -p "${TARGET_DIR}"
+
+ echo "I: install firmware: ${TARGET}"
+ cp "${CWD}/${LINUX_FIRMWARE_BUILD_DIR}/${TARGET}" "${TARGET_DIR}"
+ else
+ echo "I: firmware file not found: ${TARGET}"
+ fi
fi
fi
- fi
-
- if [ -f ${LINUX_FIRMWARE_BUILD_DIR}/${FILE} ]; then
- FW_DIR="${VYOS_FIRMWARE_DIR}/lib/firmware/$(dirname ${FILE})"
- mkdir -p "${FW_DIR}"
- echo "I: install firmware: ${FILE}"
- cp -P "${CWD}/${LINUX_FIRMWARE_BUILD_DIR}/${FILE}" "${FW_DIR}"
- else
- echo "I: firmware file not found: ${FILE}"
- fi
+
+ if [ -f "${FILE}" ]; then
+ mkdir -p "${TARGET_DIR}"
+ echo "I: install firmware: ${TARGET}"
+ cp -P "${CWD}/${LINUX_FIRMWARE_BUILD_DIR}/${TARGET}" "${TARGET_DIR}"
+ else
+ echo "I: firmware file not found: ${TARGET}"
+ fi
+ done
done
echo "I: Create linux-firmware package"