--- a/copy-firmware.sh 2024-10-19 13:21:08.888499335 -0000 +++ b/copy-firmware.sh 2024-10-19 13:23:16.775386475 -0000 @@ -46,6 +46,17 @@ while test $# -gt 0; do shift ;; + --firmware-list) + if [ -n "$2" ]; then + FIRMWARE_LIST=`cat $2` + shift 2 + else + echo "ERROR: '--firmware-list' requires a non-empty option argument of firmware files to install" + exit 1 + fi + ;; + + *) if test -n "$destdir"; then err "unknown command-line options: $*" @@ -70,6 +81,7 @@ $verbose "Checking that WHENCE file is f # shellcheck disable=SC2162 # file/folder name can include escaped symbols grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): */\1 /;s/"//g' | while read k f; do + [ -n "${FIRMWARE_LIST}" ] && if ! echo "${FIRMWARE_LIST}" | grep -q "${f}"; then continue; fi install -d "$destdir/$(dirname "$f")" $verbose "copying/compressing file $f$compext" if test "$compress" != "cat" && test "$k" = "RawFile"; then @@ -82,6 +94,7 @@ done # shellcheck disable=SC2162 # file/folder name can include escaped symbols grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read l t; do + [ -n "${FIRMWARE_LIST}" ] && if ! echo "${FIRMWARE_LIST}" | grep -q "${t}"; then continue; fi directory="$destdir/$(dirname "$l")" install -d "$directory" target="$(cd "$directory" && realpath -m -s "$t")" @@ -96,7 +109,9 @@ done # Verify no broken symlinks if test "$(find "$destdir" -xtype l | wc -l)" -ne 0 ; then - err "Broken symlinks found:\\n$(find "$destdir" -xtype l)" + if [ -z "${FIRMWARE_LIST}" ]; then + err "Broken symlinks found:\\n$(find "$destdir" -xtype l)" + fi fi exit 0