From 82e835e450aa8ee20d57d1c64e8bc3fe5c2aeec3 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Fri, 17 Mar 2023 10:57:19 -0500 Subject: [PATCH] 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. --- build-rootfs.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build-rootfs.sh b/build-rootfs.sh index 6130ee0..6325db3 100755 --- a/build-rootfs.sh +++ b/build-rootfs.sh @@ -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/