nixos/modules-closure.sh: don't fail if firmware is missing

Since fdf32154fc, we no longer allow
missing modules in the initrd. Unfortunately since before this commit,
the modules-closure script would also fail on missing firmware, which
is a very common case (e.g. xhci-pci.ko.xz lists renesas_usb_fw.mem as
dependent firmware). Fix this by only issuing a warning instead.
This commit is contained in:
Dominik Xaver Hörl 2021-01-11 17:23:24 +01:00
parent db132fe8db
commit 49130f93b7

View file

@ -81,7 +81,8 @@ for module in $(cat closure); do
for i in $(modinfo -b $kernel --set-version "$version" -F firmware $module | grep -v '^name:'); do
mkdir -p "$out/lib/firmware/$(dirname "$i")"
echo "firmware for $module: $i"
cp "$firmware/lib/firmware/$i" "$out/lib/firmware/$i" 2>/dev/null || if test -z "$allowMissing"; then exit 1; fi
cp "$firmware/lib/firmware/$i" "$out/lib/firmware/$i" 2>/dev/null \
|| echo "WARNING: missing firmware $i for module $module"
done
done