initramfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb-IBi9RG/b67k@public.gmane.org>
To: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	trenn-IBi9RG/b67k@public.gmane.org
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: dracut is too "clever" at identifying modules to exclude.
Date: Wed, 16 Dec 2015 15:15:33 +1100	[thread overview]
Message-ID: <87mvtb9ggq.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <5645DACA.20403-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2450 bytes --]

On Fri, Nov 13 2015, Harald Hoyer wrote:

> On 13.11.2015 13:37, Harald Hoyer wrote:
>> On 12.10.2015 22:30, Neil Brown wrote:
>>> Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 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
>
> <https://github.com/haraldh/dracut/commit/07a081f352497258862ae164d11d9e6dc2c5b959>

Thanks a lot for resolving this!

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

      parent reply	other threads:[~2015-12-16  4:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09  4:08 [PATCH] dracut-systemd: ensure grep is installed as needed by rootfs-generator NeilBrown
     [not found] ` <20150409140840.0bb6d59d-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2015-04-21 14:38   ` Harald Hoyer
     [not found]     ` <553660CE.7090509-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-04-21 23:47       ` NeilBrown
2015-10-12  3:02 ` dracut is too "clever" at identifying modules to exclude Neil Brown
     [not found]   ` <87r3l023ha.fsf-wvvUuzkyo1HefUI2i7LXDhCRmIWqnp/j@public.gmane.org>
2015-10-12 15:29     ` Harald Hoyer
     [not found]       ` <561BD1E9.5010007-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-10-12 20:30         ` Neil Brown
     [not found]           ` <87vbabzv6a.fsf-wvvUuzkyo1HefUI2i7LXDhCRmIWqnp/j@public.gmane.org>
2015-11-13 12:37             ` Harald Hoyer
     [not found]               ` <5645D9A1.3040304-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-13 12:42                 ` Harald Hoyer
     [not found]                   ` <5645DACA.20403-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-12-16  4:15                     ` NeilBrown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvtb9ggq.fsf@notabene.neil.brown.name \
    --to=neilb-ibi9rg/b67k@public.gmane.org \
    --cc=harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=trenn-IBi9RG/b67k@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).