From e15cf4008c52c958c3b74bbdc045ba8c1df3414d Mon Sep 17 00:00:00 2001 From: Date Huang Date: Sun, 27 Aug 2023 21:38:43 +0800 Subject: T5512: linux-firmware: expand asterisk in modinfo firmware fields Signed-off-by: Date Huang --- packages/linux-kernel/build-linux-firmware.sh | 46 +++++++++++++-------------- 1 file 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" -- cgit v1.2.3