]> git.ipfire.org Git - thirdparty/dracut.git/commit
Record loaded kernel modules when hostonly mode is enabled
authorKairui Song <kasong@redhat.com>
Tue, 17 Jul 2018 09:16:07 +0000 (17:16 +0800)
committerHarald Hoyer <harald@hoyer.xyz>
Wed, 18 Jul 2018 09:50:18 +0000 (11:50 +0200)
commit7047294617bbdd3ffb2466c73db56fda4e6156db
tree78a6a32c5c560a7f0426b580d9d2e1f2dce69353
parent1caaeaae1ecbaadf69e3ac90d77a5da5a9d250b1
Record loaded kernel modules when hostonly mode is enabled

A hostonly image will not include every possibly required kernel module,
so if any hardware or configuration changed, the image may fail to boot.

One way to know if there are any hardware change or configuration change
that will require an image rebuild or not is to check the loaded kernel
module list. If the loaded kernel module list differs from last build
time, then the image may require to be rebuilt.

This commit will let dracut record the loaded kernel module list when
the image is being built, so other tools or services can compare this
list with currently loaded kernel modules to decide if dracut should be
called to rebuild the image.

To retrieve the loaded kernel modules list when an image is built, use
lsinitrd command:

lsinitrd $image -f */lib/dracut/loaded-kernel-modules.txt
dracut-functions.sh
dracut.sh