Re: Initramfs Scripts

"Rahul Chandra" ([email protected] via blfs-dev Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.beyond.devel
Message-ID <CAPO7B=ZUv4-R7+5exct6QLhkQnftenVxNQ1pu343j8_gHdjWtw@mail.gmail.com>
On Thu, Jun 5, 2025 at 4:03 PM Joe Locash
<[email protected]> wrote:
>
> On 6/5/25 1:39 PM, Rahul Chandra ([email protected] via blfs-dev
> Mailing List) wrote:
> > Currently the initramfs scripts in BLFS are entirely broken, meaning
> > even the limited subset of features we say to use an initramfs for
> > (drive encryption, network boot, and LVM) don't function. Here is a
> > list of the issues
> >
> > 1. /etc/group missing -- The default 50-default-udev rule requires the
> > base groups from LFS in order to load properly
> > 2. Missing libkmod.so files, udev (at least on systemd) can't load
> > modules without a library link to kmod
> > 3. Missing cgroup mount -- Control groups are almost required nowadays
> > to load modules properly, we need to add a control group mount in
> > /sys/fs/cgroup to fix this
> > 4. udevadm trigger command. I don't know when this changed but udevadm
> > trigger doesn't load modules anymore, you need to add the --action=add
> > flag for it to actually load the modules
> >
> > Other fixes I did a long time ago
> > 5. This is an issue I had fixed a few years ago in my homebrewed
> > version of the initramfs scripts -- The initramfs scripts currently
> > pick a subset of modules on the system. In this version, it
> > dynamically finds the modules currently loaded and adds them to the
> > initramfs
> > 6. Firmware -- Loading firmware in the initramfs (required for some
> > RAID cards and network cards) was not supported with the old scripts.
> > These one's copy the firmware based on the modules that are currently
> > loaded.
> >
> > Other nice to haves  in this version
> > 7. Forceful early module load -- I added a /etc/early-modules-load.conf file
> > cat > /etc/early-modules-load.conf << EOF
> > # This file is for loading modules in the early boot stages in the initramfs
> > EARLY_LOAD_MODULES=""
> > EOF
> > To allow for loading modules that aren't required for the system (e.g
> > vfio or kvmgt for gvt-g/iommu)
> > 8. Modprobe.d support -- to support the last point, config files in
> > /etc/modprobe.d are obeyed.
> >
> > If someone could test this on sysv and let me know how it goes I can
> > push this to the book and file an errata.
> >
> > See attached, you can diff the current one from
> > https://www.linuxfromscratch.org/blfs/view/stable-systemd/postlfs/initramfs.html
> > and this one to see the changes.
> I did a quick test and see no issues. I do see this when running
> mkinitramfs:
>
> root [ /tmp ]# mkinitramfs 6.15.1
> Creating initrd.img-6.15.1... /usr/sbin/mkinitramfs: line 178:
> /etc/early_load_modules.conf: No such file or directory
> Including selected modules for standard mode
> done.
>
> I'd put that in an if [ -f /etc/early_load_modules.conf ].


Thanks Joe. I think we're just going to put instructions to create
that file before running mkinitramfs, so users can easily identify
what file to put modules in when they read guides for hardware.


-- 
Rahul

-- 
http://lists.linuxfromscratch.org/sympa/info/blfs-dev
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.