Bug#678973: mdadm: copy customized udev rules as well as system rules

Dmitrijs Ledkovs dmitrijs.ledkovs at canonical.com
Mon Jun 25 13:00:34 UTC 2012


On 25/06/12 13:55, Michael Tokarev wrote:
> 25.06.2012 15:47, Dmitrijs Ledkovs пишет:
>>     # Copy udev rules, which udev no longer does
>> -  mkdir -p $DESTDIR/lib/udev/rules.d/
>> -  cp/lib/udev/rules.d/64-md-raid.rules $DESTDIR/lib/udev/rules.d/
>> +  UDEV_RULE=64-md-raid.rules
>> +  for rules_folder in /lib/udev/rules.d /etc/udev/rules.d; do
>> +      if [ -f $rules_folder/$UDEV_RULE ]; then
>> +      mkdir -p $DESTDIR$rules_folder
>> +      cp $rules_folder/$UDEV_RULE $DESTDIR$rules_folder/$UDEV_RULE
>> +      fi
>> +  done
> 
> It is enough to copy first of /etc/udev, /lib/udev file, to ONE
> place (either to /lib/udev or /etc/udev).  No need to copy both,
> and generally, no need to use two (/etc/udev and /lib/udev) dirs
> in initramfs.
> 

No, it is not.

The file in /etc with the same name takes precedence over /lib.

But if the admin screwed it up and manages to render his system
unbootable due to borked udev rule in the /etc, we should offer the
system file in the initramfs.

Most other packages copy both etc and lib.

In the most common scenario, they will not modify mdadm.rules.

There is no clear policy whether we should copy only one into /etc or
both into both locations.


-- 
Regards,
Dmitrijs.





More information about the pkg-mdadm-devel mailing list