[arch-general] Incorporate udev rules in initrd

Rodrigo Rivas rodrigorivascosta at gmail.com
Sun Jan 13 09:21:01 EST 2013


On Sat, Jan 12, 2013 at 10:55 PM, Christoph Vigano <mail at cvigano.de> wrote:

> On 31.12.2012 11:00, Rodrigo Rivas wrote:
> > On Mon, Dec 31, 2012 at 8:37 AM, Christoph Vigano <mail at cvigano.de>
> wrote:
> >
> >>
> >> How can I tell mkinitcpio to include a custom udev rule? Do I need to
> >> write a hook for that? How can a hook for this look like?
> >
> >
> > AFAIK, using FILES="path-to-udev-rule-file" should be enough. The udev
> > binaries and basic rules are already there, so adding the custom rule to
> > the image should make it work automagically.
> >
> > HTH
> > --
> > Rodrigo
> >
>
> Sadly, that did not work although the file containing the rule is inside
> the initrd (verified with lsinitcpio).
>
> Any other idea how to debug this?
>

Well... an ugly hack I did to debug the initrd is, if you use grub:
1. In the grub menu press 'e' to edit the boot commands.
2. Remove the 'root=whatever' or change it so something non-existant.
3. Run the boot commands with F10.

This way the initramfs will not mount the root filesystem and will drop to
a emergency shell. It will run with the initramfs mounted at '/', so you
can use it to debug your problem. Note that you still can mount the real
root into, for example, '/mnt' and copy or use any tool or file you need
that is not available in initramfs (eg 'udevadm').

Yes, it is a hack, but I don't know a proper way to do it. Other distros,
such as Ubuntu, have a 'debug=<breakpoint>' option to do this kind of
things. But, hey, it works, I even used it once to convert the root
filesystem from ext4 to btrfs without an additional boot device 8-).

-- 
Rodrigo


More information about the arch-general mailing list