From 0aeb7a0a38c26d2da09c364148b037de7deeb7e5 Mon Sep 17 00:00:00 2001 From: Nicholas Cull Date: Sat, 10 May 2014 19:01:27 +1000 Subject: Take user-modified rules from /etc Copy udev rules from /etc/udev/rules.d/ if they have been user-modified, otherwise copy from /lib/udev/rules.d/ instead. Follows usual udev conventions for modifying rules files. --- initramfs/hook | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/initramfs/hook b/initramfs/hook index e618e1a..a6baa24 100755 --- a/initramfs/hook +++ b/initramfs/hook @@ -16,7 +16,12 @@ esac . /usr/share/initramfs-tools/hook-functions -cp -pt "${DESTDIR}/lib/udev/rules.d" /lib/udev/rules.d/69-bcache.rules +if [ -e /etc/udev/rules.d/69-bcache.rules ]; then + cp -pt "${DESTDIR}/lib/udev/rules.d" /etc/udev/rules.d/69-bcache.rules +elif [ -e /lib/udev/rules.d/69-bcache.rules ]; then + cp -pt "${DESTDIR}/lib/udev/rules.d" /lib/udev/rules.d/69-bcache.rules +fi + copy_exec /lib/udev/bcache-register copy_exec /lib/udev/probe-bcache manual_add_modules bcache -- cgit v1.2.3