Handle absent udev rules dir

It seems the bug that caused udev rules to be installed in the wrong
location has been fixed.  As such, we need to make this corrective
action step conditional, only moving rules files if any are found in the
wrong place.
master
Dustin 2023-03-17 10:57:19 -05:00
parent 6abf1de348
commit 82e835e450
1 changed files with 5 additions and 3 deletions

View File

@ -65,9 +65,11 @@ fi
cp -uv /usr/${target}/usr/bin/grub-editenv /mnt/gentoo/usr/bin/
find /mnt/gentoo/usr/${target}/usr/lib/udev/rules.d \
-name '*.rules' \
-exec mv -t /mnt/gentoo/usr/lib/udev/rules.d/ {} +
if [ -d /mnt/gentoo/usr/${target}/usr/lib/udev/rules.d ]; then
find /mnt/gentoo/usr/${target}/usr/lib/udev/rules.d \
-name '*.rules' \
-exec mv -t /mnt/gentoo/usr/lib/udev/rules.d/ {} +
fi
if [ -f /mnt/gentoo/etc/udev/hwdb.bin ]; then
mv /mnt/gentoo/etc/udev/hwdb.bin /mnt/gentoo/usr/lib/udev/