This patch adds check of kernel module existance and
propagate errors to upper callers.
In case of break other callers of instmods(), this patch
adds an option '-c' to it, only when "-c" is specified
we fail, otherwise, errors are ignored.
Reported-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Harald Hoyer <harald@redhat.com>
Sometimes some hook script will need to be before the cleanup hook scripts
For example dhclient killing, nfs cleanup, etc. must not happen before kdump
because it will use their fuctionalities.
So here introduce a new hook pre-pivot-cleanup, all cleanup scripts will go there.
that means pre-pivot hook is splited to two hooks pre-pivot and pre-pivot-cleanup
Signed-off-by: Dave Young <dyoung@redhat.com>
Another solution could be searching in directories found at
/etc/ld.so.conf.d/*.conf or adding a new parameter. Here is a patch
which adds a new --libdirs parameter, and also a new inst_libdir_file
function which will try to expand metacharacters on each lib
directory:
inst_libdir_file "libdevmapper-event-lvm*.so"
If symlink is yet alone in target directory, inst_symlink will fail to
create it. This is how to reproduce the bug:
# mkdir /tmp/test
# ln -s /bin/cp /tmp/test/cp
# ./dracut -l -f -H /tmp/test.img -I /tmp/test/cp
Result:
[...]
I: *** Including modules done ***
ln: failed to create symbolic link
`/var/tmp/initramfs.Z5isVu//tmp/test/cp': No such file or directory
ln: failed to create symbolic link
`/var/tmp/initramfs.Z5isVu//tmp/test/cp': No such file or directory
I: Wrote /tmp/test.img:
[...]
Following patch creates directory for the symlink if it doesn't exist.
The "online" hook runs whenever a network interface comes online (that
is, once it's actually up and configured).
The initqueue --env argument is used to set "$netif" to the name of the
newly-online network interface.
first check for omit, then mark the kernel module as seen
when we temporarily omit_drivers, we don't want to mark them as seen.
example: nfs.ko module in kernel-modules, but the nfs module
should be able to load it later on.
Like -H, we need to poll every module to check if it is needed
to mount a specific device in '--mount'.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Determine devices and filesystems to be included in the host-only
initramfs image.
To get a minimal initramfs, which can mount
/
/etc
/usr
/usr/bin
/usr/sbin
/usr/lib
/usr/lib64
/boot
we look in fstab for the corresponding devices and determine their and
their slaves' filesystem type and put all that in $host_fs_types
and $host_devs.
inst_script checks for a shebang, if it doesn't exist it exits.
If it does it should not be calling inst_binary, it should call
inst_simple like it used to.