[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why are modules and modules.conf not versioned?



Wichert Akkerman wrote:

Previously Eric Richardson wrote:
If every other piece of the kernel is used in a versioned fashioned and called from lilo as such(or via symlinks from a generic name) then it makes sense that the /etc/modules and modules.conf should be versioned as well.


Nothing is versioned though as far as I know.


I guess I'm not perfectly clear with my explanation. Maybe versioned is the wrong term but they come with a version number in the file or directory name to distinguish betwenn components for each version of the kernel. If I have kernel 2.4.18 I have the following:

/boot/System.map-2.4.18-k6
/boot/initrd.img-2.4.18-k6
/boot/vmlinuz-2.4.18-k6
/lib/modules/2.4.18/

/etc/modules *
/etc/modules.conf *

* required and necessary as part of the operating kernel but no versions to separate differences between versions of kernels since modules are an essential part of the kernel.

There may be symlinks such as follows to point to the default version but this is convention only. It's not needed by lilo or other boot loader AFAIK.

/initrd.img -> /boot/initrd.img-version
/vmlinuz -> /boot/vmlinuz-version

Proposal to support different module files loaded for different kernel versions.

I modified /etc/init.d/modutils to use the version (uname -r) so it would look at for example the following files:

/etc/modules-2.4.18-k6 or /etc/modules-2.2.20

This way the correct modules get loaded based on the version of the kernel I am booting. I did nothing with /etc/modules.conf as I had no options passed to the modules. A more complete solution is as follows:

1. Edit /etc/init.d/modutils so it reads the modules from /etc/modules-2.4.18-k6 for this kernel version as follows:

# Loop over every line in /etc/modules-version.
version=$(uname -r)

echo -n "Loading modules for $version: "
(cat /etc/modules-$version; echo) | # make sure there is a LF at the end

Then the script calls modprobe in a do loop.

modprobe $module $args

Change to the following so a versioned modules.conf can be used.

modprobe -C /etc/modules-$version.conf $module $args

2. modprobe insmod and depmod already handle looking at the /lib/modules/2.4.18/ directory which is versioned to load the correct modules or create the module.dep file.

3. The script /usr/sbin/modconf would need to be modified to handle writing or editing the /etc/modules-$version and /etc/modules-$version.conf for options added by update-modules?.

4. No clue where /etc/modutils fits in - mentioned in update-modules.

5. It would be nice if the kernel installer would ask to copy the running OS /etc/modules-$version(.conf) files to the new version files so if the kernel uses the same modules then everything would work as they do now if no different modules are needed. Removing the kernel would remove the files.

That's about it. Hopefully this gives a clearer picture of what I'm talking about.

Eric







Reply to: