diff --git a/mkmodpack b/mkmodpack index d4aa782..cb5290e 100644 --- a/mkmodpack +++ b/mkmodpack @@ -136,13 +136,12 @@ AddModuleFirmware() Warning "Firmware file \"$fw_name\" for module \"$mod_name\" not found" continue } - [ "$fw_name" = "${fw_name##*/}" ] || { - [ -n "$fw_privdir" ] || { - fw_privdir="${fw_name%/*}" - FILES="$FILES + fw_privdir=$fw_name + while [ ! "$fw_privdir" = "${fw_name%%/*}" ]; do + fw_privdir="${fw_privdir%/*}" + FILES="$FILES dir /lib/firmware/$fw_privdir 0755 0 0" - } - } + done FILES="$FILES file /lib/firmware/$fw_name $fw_file 0644 0 0" done @@ -223,7 +222,7 @@ depmod -a -F "/boot/System.map-$KERNEL" -b "$WORKDIR" "$KERNEL" || Fatal "Failed cd "$WORKDIR" find "lib/modules/$KERNEL" -type d |sed -e 's,^.\+$,dir\t/&\t0755\t0 0,g' find "lib/modules/$KERNEL" -type f |sed -e "s,^.\+$,file\t/&\t$WORKDIR/&\t0644\t0 0,g" -echo "$FILES" +echo "$FILES"|sort -k2|uniq ) > "$TEMPLATE" if [ -n "$OUTPUT" ]; then