diff options
author | Date Huang <tjjh89017@hotmail.com> | 2023-08-27 21:38:43 +0800 |
---|---|---|
committer | Date Huang <tjjh89017@hotmail.com> | 2023-08-27 21:38:43 +0800 |
commit | e15cf4008c52c958c3b74bbdc045ba8c1df3414d (patch) | |
tree | 716d07fa83329e2d216c0bca616ef05bee1828f5 /packages | |
parent | 3ff0f40fdf5175181b7b4e5c4662bfaa818a2b5c (diff) | |
download | vyos-build-e15cf4008c52c958c3b74bbdc045ba8c1df3414d.tar.gz vyos-build-e15cf4008c52c958c3b74bbdc045ba8c1df3414d.zip |
T5512: linux-firmware: expand asterisk in modinfo firmware fields
Signed-off-by: Date Huang <tjjh89017@hotmail.com>
Diffstat (limited to 'packages')
-rwxr-xr-x | packages/linux-kernel/build-linux-firmware.sh | 46 |
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" |