summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-08-31 17:13:47 +0200
committerGitHub <noreply@github.com>2023-08-31 17:13:47 +0200
commit7de1a67d801bb045469028168418e6195d3f25ea (patch)
tree8dadaa9a23d41c8109ba31c134c4e08406fa5c0e
parent50ca4b0bbecfd8f63d08bf54943c133ce1b1f3cb (diff)
parent3708563e64a05ec6300583432be9d4ed4f8647ed (diff)
downloadvyos-build-7de1a67d801bb045469028168418e6195d3f25ea.tar.gz
vyos-build-7de1a67d801bb045469028168418e6195d3f25ea.zip
Merge pull request #386 from JalenLin/current
T5529: Fix missing symbolic link in linux-firmware package.
-rwxr-xr-xpackages/linux-kernel/build-linux-firmware.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/linux-kernel/build-linux-firmware.sh b/packages/linux-kernel/build-linux-firmware.sh
index d4d263e2..39cb243b 100755
--- a/packages/linux-kernel/build-linux-firmware.sh
+++ b/packages/linux-kernel/build-linux-firmware.sh
@@ -57,7 +57,7 @@ mkdir -p "${LINUX_FIRMWARE_BUILD_DIR}"
SED_REPLACE="s@${CWD}/${LINUX_FIRMWARE}/@@"
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="$(echo "${FILE}" | sed "s/${LINUX_FIRMWARE_BUILD_DIR}\///g")"
TARGET_DIR="${VYOS_FIRMWARE_DIR}/lib/firmware/$(dirname "${TARGET}")"
# If file is a symlink install the symlink target as well
if [ -h "${FILE}" ]; then
@@ -67,7 +67,15 @@ for FILE_PATTERN in ${FW_FILES}; do
echo "I: install firmware: ${TARGET}"
cp "${CWD}/${LINUX_FIRMWARE_BUILD_DIR}/${TARGET}" "${TARGET_DIR}"
- else
+ # If file links to other folder which this script not cover. Create folder and copy together.
+ if [ -L "${LINUX_FIRMWARE_BUILD_DIR}/${TARGET}" ]; then
+ REALPATH_TARGET=$(realpath --relative-to="${CWD}/${LINUX_FIRMWARE_BUILD_DIR}" "${CWD}/${LINUX_FIRMWARE_BUILD_DIR}/${TARGET}")
+ REALPATH_TARGET_DIR="${VYOS_FIRMWARE_DIR}/lib/firmware/$(dirname "${REALPATH_TARGET}")"
+ mkdir -p "${REALPATH_TARGET_DIR}"
+ echo "I: install firmware: ${REALPATH_TARGET}"
+ cp "${CWD}/${LINUX_FIRMWARE_BUILD_DIR}/${REALPATH_TARGET}" "${REALPATH_TARGET_DIR}"
+ fi
+ else
echo "I: firmware file not found: ${TARGET}"
fi
fi