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

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

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

#1 Post 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
Attachments
mods.diff.gz
gunzip to produce 'mods.diff' file.
(1.12 KiB) Downloaded 130 times
Last edited by gyro on Sat 28 Mar 2020, 04:14, edited 1 time in total.

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#2 Post by s243a »

Sounds pretty cool :)

Any plans to include this in woof-CE?
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#3 Post 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

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#4 Post 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

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#5 Post 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

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#6 Post 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

Post Reply