On Tue, Mar 7, 2023 at 7:00 PM Geoff Back <geoff@xxxxxxxxxxxxxxx> wrote: > > Hello, > > MD Autodetect allows for the assembly of raid-1 mirror filesystems > in-kernel before userspace starts, without requiring the complexity and > fragility of using an initrd and switch-root. > It is still in widespread use and given that it has a wide use case in > any system that wants fully resilient boot/root devices (which can be > done even on EFI) is likely to remain essential. While the various > high-profile general purpose Linux distributions such as Red Hat and > Ubuntu may use initrd by default, there are innumerable scenarios, > particularly in embedded space, where initrd is never used but RAID may > be and hence auto-detect is used to assemble the actual root file system. Hi Geoff Thanks for the explanation. > > Removing it would be a major regression in 'md' functionality. > > Yes, it requires CONFIG_MD and the appropriate RAID personality > (typically CONFIG_MD_RAID1) to be set to 'y' in Kconfig. It doesn't raid1 can be loaded automatically. So it doesn't need to set CONFIG_MD_RAID1 to y. > (IIRC) get built if CONFIG_MD is set to M. Changing the default for > CONFIG_MD should not have any impact on this so long as the ability to > set CONFIG_MD=y does not get disabled (which would also be a regression). I'm a little confused here. If I understand right, for the os that doesn't use initrd and we still have the ability to set CONFIG_MD=y, so we can set it to y and rebuild the kernel. So the raid1 can be assembled by md auto-detect, right? > > If auto-detect were to be considered for removal then IMO it needs to go > through the full kernel feature deprecation/removal life cycle - i.e. > first it gets marked as deprecated in KConfig, then after a decent time > interval (years?) the default for the option is changed, and only after > that has all happened without causing problems, the code gets considered > for removal. Thanks for this information Regards Xiao > > Regards, > > Geoff. > > Geoff Back > What if we're all just characters in someone's nightmares? > > On 07/03/2023 03:04, Xiao Ni wrote: > > From the code of md-autodetect.c, it looks like it's used to create > > the raid device > > during boot. Now we use udev rules to assemble the raid. Do we still need it? > > What's the usage of md-autodetect? > > > > And in Kconfig, it depends on md-raid as Y when building a kernel. If we change > > the default to M, md-autodetect will not work anymore, right? > > > > Best Regards > > Xiao > > >