From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harald Hoyer Subject: Re: dracut is too "clever" at identifying modules to exclude. Date: Fri, 13 Nov 2015 13:42:50 +0100 Message-ID: <5645DACA.20403@redhat.com> References: <20150409140840.0bb6d59d@notabene.brown> <87r3l023ha.fsf@notabene.neil.brown.name> <561BD1E9.5010007@redhat.com> <87vbabzv6a.fsf@notabene.neil.brown.name> <5645D9A1.3040304@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5645D9A1.3040304-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Sender: initramfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Neil Brown , trenn-IBi9RG/b67k@public.gmane.org Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 13.11.2015 13:37, Harald Hoyer wrote: > On 12.10.2015 22:30, Neil Brown wrote: >> Harald Hoyer writes: >> >>> On 12.10.2015 05:02, Neil Brown wrote: >>>> >>>> If I have booted a kernel with md/raid built in (no modules) and >>>> I use dracut to build the initramfs for a different kernel which >>>> has the md code compiled as separate modules, then it does not include >>>> the required md modules in the initramfs. >>>> >>>> As a particular instance this happen when the root filesystem is on >>>> RAID0. The 'raid0.ko' module is not included and boot fails. >>>> >>>> https://bugzilla.opensuse.org/show_bug.cgi?id=935993 >>>> >>>> This only happens when 'host-only' is selected (which is the default for >>>> openSUSE). >>>> >>>> the modules.d/90mdraid/module-setup.sh code calls >>>> >>>> instmods =drivers/md >>>> >>>> instmods calls >>>> module_is_host_only "raid0" >>>> and this incorrectly fails. >>>> >>>> If raid0.ko didn't have any alias this would succeed, but it does. >>>> >>>> $ modinfo -F alias raid0 >>>> md-level-0 >>>> md-raid0 >>>> md-personality-2 >>> >>> Huh? Is the module not loaded? >> >> No, because the running kernel has "md/raid built in (no modules)". >> >> Thanks, >> NeilBrown >> >>> >>>> >>>> However these aliases don't appear in any modalias file in /sys/devices, >>>> in /proc/crypto, or in /proc/modules. >>>> >>>> Maybe you could parse /proc/mdstat.. >>>> >>>> if [ -f /proc/mdstat ]; then >>>> while read _d _c _a _m _x; do >>>> if [ "$_c" = ':' -a "$_a" = 'active' ]; then >>>> host_modalias["md-$_m"]=1 >>>> fi >>>> done < /proc/mdstat >>>> fi >>>> >>>> but it all seems rather fragile. There are probably other modules that >>>> might miss out accidentally. dm? >>>> >>>> Do we really need the host_modalias stuff? >>>> >>>> Thanks, >>>> NeilBrown >>>> > > Interesting... so we have to blow up the initramfs with the entire drivers/md > in the case, where you switch from "compiled in" to "not compiled in".. > > I guess that happens not that often, so better be safe than sorry. remove host_modalias