Page 1 of 1

InitrdModules 6 - copy "vital" modules to 'initrd.gz'.

Posted: Fri 27 Mar 2020, 05:33
by gyro
Like 'initmodules' this utility is a workaround to overcome the kernel <-> modules gap that exists during the execution of the Puppy 'init' script.
But whereas 'initmodules' provides a list of modules to 'init' that get loaded as soon as the 'zdrv...sfs' is available,
'initrdmodules' actually copies the modules into the current 'initrd.gz'.
So 'init' can 'insmod' these modules before it attempts fo acesss any disks and before it writes any messages.
Because 'insomd' is used to load the modules, dependencies as defined in 'modules.dep' are also copied.

This means that 'init' can run a Puppy installed on an "mmc" drive that needs a 'kernel/drivers/mmc/host/' module for access,
and it can immediately display it's first message on a screen that needs a 'kernel/drivers/hid/' module.
It also means that keyboards that require a 'kernel/drivers/hid/' module or a 'kernel/drivers/usb/host/' module, will work after 'init' fatal errors.

This project was prompted by this "http://www.murga-linux.com/puppy/viewto ... 99#1049199".

To try:

Download extra sfs 'initrdmodules_6.sfs' from http://www.mediafire.com/folder/0f33m6a ... trdmodules (1,3 MiB).

This is a test sfs, so it contains an 'initrd.gz' with a patched 'init',
and a test script, 'mods-initrd-this', to install this 'initrd.gz' as the current 'initrd.gz' with the current DISTRO_SPECS.

1. Load 'initrdmodules_6.sfs' as an extra sfs.
2. In a console run:

Code: Select all

initrdmodules -h
to ensure that the utility will run.
3. Run

Code: Select all

initrdmodules -l
to see if there are any appropriate modules for your hardware and kernel.
If there are no modules listed, then installing the included 'initrd.gz' should not make any difference.
4. If there are some modules listed, then run

Code: Select all

mods-initrd-this
to install the 'initrd.gz' with the patched 'init'.
Your current 'initrd.gz' will be moved to something like 'initrd_9999.gz'.
5. Run

Code: Select all

initrdmodules -c
to copy modules to 'initrd.gz'.
6. Reboot.

Note1: If the patched 'init' actually loads any modules, it will not run the 'initmodules' code.
This is because any modules that would have been loaded via 'initmodules' should have already been loaded.

Note2: The included 'initrd.gz' has been extracted from 'ScPup-20.01+2-T.iso', but it should boot most woof-ce Puppies.
It worked Ok for me with xenialpup, xenialpup64, bionicpup32, bionicpup64 and ScPup64.
The only thing that changes is the DISTRO_SPECS file.

I have attached the patch file for the 'init' script as 'mods.diff'.

gyro

Posted: Fri 27 Mar 2020, 05:39
by s243a
Sounds pretty cool :)

Any plans to include this in woof-CE?

Posted: Fri 27 Mar 2020, 07:19
by mistfire
Pros: Smaller kernel file size. Additional hardware support on boot

Cons: When upgrading kernel. It requires updating the initrd like other major distros does. Instead of just copy-paste the vmlinuz and zdrv sfs modules

Posted: Sat 28 Mar 2020, 04:12
by gyro
s243a wrote:Any plans to include this in woof-CE?
This is currently a "test" sfs.
If this progressed to "production", it's a fairly simple patch to 'init', that could easily be applied to woof-ce.
A production sfs would contain only the 'initrdmodules' and 'initrdfiles' utilities.
'initrdmodules_20.sfs' could remain as an "extra-sfs" .

gyro

Posted: Sat 28 Mar 2020, 04:29
by gyro
mistfire wrote:Cons: When upgrading kernel. It requires updating the initrd like other major distros does. Instead of just copy-paste the vmlinuz and zdrv sfs modules
Well not quite.

1.The modules in "initrd.gz" are stored in a directory whose name is the name of the kernel, (uname -r).
So if you boot with a different kernel, 'init' will not 'insmod' the old ones.

2. 'initrdmodules' has a service in '/etc/init.d' called 'initrdmods' that works only during boot.
It checks the date/time stamp on the 'vmlinuz' in the install directory,
if the date/time stamp changes, it removes the old modules from 'initrd.gz' and copies any detected new modules to 'initrd.gz'.

gyro

Posted: Sat 28 Mar 2020, 09:18
by gyro
I have uploaded 'initrdmodules_20.sfs' to http://www.mediafire.com/folder/0f33m6a ... trdmodules (8.0 KiB).

This is a "production" type sfs that contains the 2 utilities 'initrdmodules' and 'initrdfile'.
This corresponds to the 'initrdmodules' that is contained in "mio v20" (http://www.murga-linux.com/puppy/viewto ... 41#1053941).

If you use the 'initrdmodules' contained in this sfs to copy modules to 'initrd.gz',
these will be ignored unless your 'init' script has also been patched with the file 'mods.diff', attached above.

gyro