This introduces filter_kernel_modules, which should be used to install
all kernel modules that match whatever criteria you want.
If running in --hostonly, filter_kernel_modules will only consider
modules that are loaded in the kernel, otherwise it will consider
all the modules installed on the system for the appropriate kernel.
This drastically reduces initramfs generation time when using --hostonly
by eliminating lots of unneeded filesystem activity.
Instead of grovelling through all the modules available for the
kernel looking for block devices, only look at the modules that are
actually loaded. This speeds things up by a rather large amount
when generating the initramfs with --hostonly.
While we are at it, only load the filesystem module that will actually
be used for the root filesystem when running in --hostonly instead
of all the filesystem modules that happen to be loaded at the time.
Since different distros may or may not use vol_id in udev, and blkid
is generally replacing vol_id, abstract them out into a function which
tries to use vol_id first and blkid second, on the assumption that
blkid can take over for vol_id if vol_id is no longer there.
Quotes are generally not needed in when assigning one variable to another,
and are also not needed inside [[ ]] comaprisons, as word splitting and
pathname expansion are not performed in these cases.
Hello,
Now a fact that the path is full is checked by
[[ -x $1 ]]
But if the working directory is /bin or a directory with a file named
"mount",
this condition will be met for "inst mount", and "mount" will not be copied
into initrd at all.
--kernel-only
only install kernel drivers and firmware files
--no-kernel
do not install kernel drivers and firmware files
All kernel module related install commands moved from "install"
to "installkernel".
For "--kernel-only" all installkernel scripts of the specified
modules are used, regardless of any checks, so that all modules
which might be needed by any dracut generic image are in.
The basic idea is to create two images. One image with the kernel
modules and one without. So if the kernel changes, you only have
to replace one image.
Grub and the kernel can handle multiple images, so grub entry can
look like this:
title Fedora (2.6.29.5-191.fc11.i586)
root (hd0,0)
kernel /vmlinuz-2.6.29.5-191.fc11.i586 ro rhgb quiet
initrd /initrd-20090722.img
initrd /initrd-kernel-2.6.29.5-191.fc11.i586.img
initrd /initrd-config.img
initrd-20090722.img
the image provided by the initrd rpm
one old backup version is kept like with the kernel
initrd-kernel-2.6.29.5-191.fc11.i586.img
the image provided by the kernel rpm
initrd-config.img
optional image with local configuration files
This kernel module is dangerous to load here. It is meant only to allow direct
access to SCSI disks, which can destroy data. The i2o_block driver gives you
access to the defined hardware RAID arrays.
We were not loading all the required kernel modules due to a bug in the
dependency checking code. This was causing us to load only the first
dependent module and ignore the rest.
If dracut was run with --hostonly, instmods will only load a module
into the initramfs if it is already loaded on the host machine.
This really trims the fat out of a --hostonly generated initramfs, and
eliminates the need for the kernel-modules-loaded hook.
This patch also allows a module to flag that it should only load as
a dependency by exiting 255 instead of 0. Currently, only the network module
uses this functionality.
This also eliminates --skip-missing. Check scripts should now check
to ensure that any files and settings they will copy from the host
system actually exist when called without arguments.
The check scripts are also updated to not try to source dracut-functions
which(1) is a perfectly good way of checking if a command is on the path.
Move srcmods definition into the function, as $kernel isn't defined yet when
dracut-functions is sourced from dracut.
Signed-off-by: David Dillow <dave@thedillows.org>
remove "-d" as a short-alias for --debug. It collides with the
--driver short-alias.
If --debug is set, inst_script() spews binary "garbage" to the screen
which are interpreted as control characters by the terminal, prompting
the user to call "reset" after dracut has finished. This is related to
set -x printing binary headers from files to stdout.
As inst_script() is only checking if it is a script it should copy by
reading the first 80chars of the file and checking for the shebang line,
it is safe to call tr on the read in data and remove all unprintable
chars if the debug switch is set.