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.
We also need to decide whenter we are going to support modules.* files.
Not only are they Fedora-specific, but doing so makes =* arguments to instmods
have two different and incompatible meanings depending on whether that file
exists.
They are not needed to boot with dracut, so away they go.
Also rewrite inst_rules to automatically search likely rule locations when
installing udev rules.
This patch series aims to make dracut more distro-independent. It includes
some of the functionality that Seewer Philippe posted to the list to make
dracut work on Ubuntu.
depmod does not create these files on all distros (Debian, specifically),
so modify instmods to use pathname components and find to do what we want.
As a bonus, this removes the special-case for =ata.
When handling links sometimes one readlink isn't enough. Dracut doesn't
need to clone a whole link series, so just use readlink -f
--
dracut-functions | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
On some systems with newer or unpatched bash versions the whole right
portion of =~ is considered part of the regex. Means we need to get rid
of enclosing ''.
This patch fixes this.
--
dracut-functions | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
find_binary inside dracut-functions always succeeds. Independent of
whether the file actually exists or not.
This patch fixes this.
And since we're using the function not only to find binaries at little
enhancement there shouldn't be that bad either.
--
dracut-functions | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
Modules are now responsible for loading their hooks into the initrd.
This should be all the structure we need to make it easy for things
to integrate with dracut -- now to document and test it all.
This replaces the eu-readelf and ld-linux.so.2 hackery.
As a bonus it will keep working if we (for some bizzare reason) need
to load a non-elf executable or shared library on the initrd.