GNU bug report logs -
#30629
[PATCH 0/5] Detect missing modules in the initrd
Previous Next
Reported by: Ludovic Courtès <ludo <at> gnu.org>
Date: Tue, 27 Feb 2018 14:18:01 UTC
Severity: normal
Tags: patch
Done: ludo <at> gnu.org (Ludovic Courtès)
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hi Ludo,
On Thu, 01 Mar 2018 11:11:11 +0100
ludo <at> gnu.org (Ludovic Courtès) wrote:
> > assert(tablestatus.header.target_count == 1);
> > printf("target_type %s\n", tablestatus.items[0].target_type); // prints "crypto", hence we should modprobe "dm-crypto".
>
> Is this target_type/module name mapping always correct?
Yes - since that's how Linux itself loads the dm modules:
./drivers/md/dm-target.c: request_module("dm-%s", name);
(and see dm-table.c where once can see that name = target_type of the table structure)
On the other hand, not all dm-*.ko are targets!
> If so, we could always implement this DM_TABLE_STATUS ioctl and use it,
> although if it loads modules as a side effect that’s not great.
> > Alternatively, there's even a dm-uevent.c for sysfs AND we have enabled it AND it's supposed
> > to report DM_TARGET - but I can't see it. Maybe it only does that for events and not for state.
I checked it now - it's only reported for events: it reports which target caused
the event.
It would be easy to extend Linux to also report the targets in the state, but
that won't help us with past kernels - and since our use case is mostly
to get the module list starting from an already-running system, it won't
help us.
So I think the ioctl is the best way.
> > $ udevadm info -q all /dev/dm-0
> >
> > ... which has quite a lot of the info, but not the module name.
>
> Hmm! So how do other distros do? There must be a way to get the module
> name no?
Good question... no idea.
[Message part 2 (application/pgp-signature, inline)]
This bug report was last modified 7 years and 127 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.