Commit Graph

104 Commits

Author SHA1 Message Date
Harald Hoyer
15c5c072f4 dracut-functions.sh:get_persistent_dev() fix case for multipath
/dev/mapper/mpath* is not a persistent device path

https://bugzilla.redhat.com/show_bug.cgi?id=969068
2013-05-31 07:47:01 +02:00
Harald Hoyer
19b5c10963 dracut-functions.sh: clarify instmods() error message 2013-05-28 14:25:49 +02:00
Harald Hoyer
9d36d4fb1d dracut-functions.sh: make use of findmnt 2013-04-09 10:47:39 +02:00
Harald Hoyer
fd191a7b41 kernel-modules/module-setup.sh: install all host filesystem drivers
https://bugzilla.redhat.com/show_bug.cgi?id=922565
2013-03-18 08:43:23 +01:00
Harald Hoyer
d351541ee6 make host_fs_types a hashmap
This requires bash >= 4, but hash maps are so much more comfortable
2013-03-11 18:58:32 +01:00
Harald Hoyer
c46cda8260 split 95udev-rules/59-persistent-storage.rules to md and dm modules 2013-03-07 15:01:47 +01:00
Harald Hoyer
34bd2be23f dracut-functions.sh: fix inst_rule_programs()
Logic for the $env{.*} check was reversed and env was missing.

Thanks Colin Guthrie!
2013-03-07 15:01:47 +01:00
Harald Hoyer
8d85429a44 dracut-functions.sh: add dracut_need_initqueue() dracut_module_included()
for all rules files, which reference initqueue also call
dracut_need_initqueue()
2013-03-06 16:04:03 +01:00
Harald Hoyer
5db6ca5a4b dracut: enable initramfs building without kernel modules 2013-02-18 12:03:02 +01:00
Joe Lawrence
fa9f15e3be Support out-of-tree and updated drivers in initramfs creation
The find_kernel_modules_by_path function shouldn't filter out modules not
located underneath the /lib/modules/ver/kernel directory as out-of-tree
drivers may reside in /lib/modules/ver/extra and updated drivers in
/lib/modules/ver/updates.

Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
2013-01-25 13:07:59 +01:00
Harald Hoyer
c8d685c9d3 dracut-functions.sh: cope with optional field #7 in mountinfo
also handle fstab entries with LABEL=, UUID= and PARTUUID=
2013-01-23 15:24:27 +01:00
Harald Hoyer
2b6dd6a1fc dracut-functions.sh: add pre-shutdown hook 2013-01-22 15:31:16 +01:00
Harald Hoyer
256cba18c3 dracut-functions.sh: fixed inst_rules search path 2013-01-03 09:29:05 +01:00
Harald Hoyer
c62b94614d dracut-functions.sh: don't ask question on gzip uncompress 2012-10-16 09:37:49 +02:00
Harald Hoyer
600c876968 consistently lowercase "dracut" 2012-10-10 14:15:11 +02:00
Harald Hoyer
76d5c79e9c dracut-functions.sh: inst_rules_program() skip udev vars ${} 2012-10-08 15:39:23 +02:00
Dave Young
06e9f8870a return proper value in function dracut_install
dracut_install should return the real return value, so module install function
can detect the install failure.

Such as below in 99base:
dracut_install switch_root || dfatal "Failed to install switch_root"

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-10-08 06:17:28 -04:00
Amadeusz Żołnowski
7e0d508002 dracut-functions.sh: find_binary: path starting with variable
Credits go to Alexander Tsoy <bugs+gentoo@puleglot.ru> who provided the
patch with following explanation:

  I get messages "Skipping program $env{DM_SBIN_PATH}/..." when
  generating initramfs. This happens because some udev rules contains
  variables in path to command:

  $ egrep -r 'IMPORT\{program\}=\"\$' /lib64/udev/rules.d/
  /lib64/udev/rules.d/10-dm.rules:ENV{DM_COOKIE}=="?*", IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup udevflags $env{DM_COOKIE}"

  [...]

  $ sudo dracut -f "" 3.5.4-hardened-r1
  I: *** Including module: dm ***
  I: Skipping program $env{DM_SBIN_PATH}/dmsetup using in udev rule 10-dm.rules as it cannot be found
2012-10-08 03:46:19 -04:00
Harald Hoyer
e0a393361d dracut-functions: add inst_rule_group_owner()
add inst_rule_group_owner() to install GROUP and OWNER of udev rules
2012-10-04 13:04:36 -04:00
Harald Hoyer
da9c518116 dracut-functions.sh:inst_rules_program() also recognize RUN+= 2012-10-04 12:15:36 -04:00
Harald Hoyer
4d51eff05f dracut-functions.sh: move the i2o_scsi to the omit_drivers variable 2012-10-03 16:40:36 -04:00
Harald Hoyer
ecfa02bdc8 dracut-functions.sh: do not check all modules for filesystems 2012-10-03 16:33:50 -04:00
Harald Hoyer
080d1b718d dracut-functions.sh: make hostonly case more failsafe for new modules
If new modules are introduced, or modules get renamed, or modules change
from builtin to real modules, we want to include them in the host-only
image, just to be safe.
2012-10-03 16:32:07 -04:00
Harald Hoyer
9037b63eb2 dracut-functions.sh:get_persistent_dev() exception for multipath devices
An exception is multipath devices, child and top layer device may have
same uuid. As dm devices maintain /dev/mapper/* as persistent names,
just do not doing converting for them.
2012-09-28 15:29:47 +02:00
Dave Young
f3f9777497 use by-uuid firstly in get_persistent_dev
For devices with filesystem, udev /dev/disk/by-uuid/* links are always
reliable. So improve the get_persistent_dev() by using by-uuid/* firstly,
and fallback to use by-id/*

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-09-24 13:12:26 +02:00
Dave Young
ff0636635a move get_persistent_dev to dracut-functions.sh
kdump module also need to convert dev name to udev symlinks.
So better to move function get_persistent_dev() to dracut-functions.sh

Also in this patch improvement and fix the original function:
a) use udevadm info --query=name to get the kernel name.
   This will fix the issue caused by passing symbolic link of a device.
b) fix a bug to compare $_tmp instead of $i with $_dev. Really sorry,
   should have tested more carefully.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-09-10 15:50:36 +02:00
Dave Young
a999414eaf use check_block_and_slaves in for_each_host_dev_and_slaves
for_each_host_dev_and_slaves currently is used in some module check()
functions and it's not necessary iterate all slaves. So use
check_block_and_slaves instead of check_block_and_slaves_all is fine.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-09-06 10:39:59 +02:00
Milan Broz
00083a0909 FIPS workaround for fipscheck dir
Also patch old install path... (used in Fedora 17)

Signed-off-by: Milan Broz <mbroz@redhat.com>
2012-09-06 10:39:59 +02:00
Harald Hoyer
73088e46f7 moved the /etc/host_devs write out to 99base
also removed some left-over debugging code
2012-08-23 12:13:02 +02:00
dyoung@redhat.com
83e0dc7a3d Add for_each_host_dev_and_slaves for device only checking
For lvm, multipath, iscsi modules they do not care about the filesystem,
Also there could be devcie in host_devs but it does not get formated.

For these kind of modules, use for_each_host_dev_and_slaves will be better than use
for_each_host_dev_fs, here add a new function to iterate the host_devs and
their slave devices.

In original for_each_host_dev_fs, it will call check_block_and_slaves which
will return once helper function return 0, but this is not enough for kdump
iscsi setup. For kdump iscsi case, it need setup each slave devices so that
the iscsi target can be properly setuped in initramfs.

Thus, this patch also add new functions check_block_and_slaves_all and
for_each_host_dev_and_slaves_all.

Signed-off-by: Dave Young <dyoung@redhat.com>
Tested-by: WANG Chao <chaowang@redhat.com>
2012-08-23 10:15:09 +02:00
Chao Wang
d82e0d7dd8 Revert "dracut-functions: $_x should exist, no need to test."
This reverts commit b2d225a669.

When there's no /sys/dev/block/$2/slaves/*/dev/ exists, $_x will
be assigned with '/sys/dev/block/$2/slaves/*/dev/', this is invalid.
That commit will lead to some warn msg like:
cat: /sys/dev/block/8:16/slaves/*/dev: No such file or directory
cat: /sys/dev/block/8:32/slaves/*/dev: No such file or directory
2012-08-01 09:24:12 +02:00
Harald Hoyer
5a84ac3fe3 dracut-functions.sh: inst_hook() with [0-9]-<name> 2012-07-30 17:08:51 +02:00
Chao Wang
b2d225a669 dracut-functions: $_x should exist, no need to test.
Signed-off-by: Chao Wang <chaowang@redhat.com>
2012-07-30 12:23:32 +02:00
Harald Hoyer
cc21808764 dracut-functions.sh:inst_rule_programs() fix error messages 2012-07-26 19:35:12 +02:00
Harald Hoyer
65d1a8a4ae dracut-functions.sh:inst_rule_programs() fixed IMPORT{program} 2012-07-26 19:12:40 +02:00
Harald Hoyer
8aa9926839 mv rootfs-block/module-setup.sh:search_option() in dracut-functions.sh
new function fs_get_option()
2012-07-26 17:24:01 +02:00
Harald Hoyer
ec5e5ae27a dracut-functions.sh: corrected usage comment of find_mp_fstype() 2012-07-26 17:05:24 +02:00
Harald Hoyer
81672479af dracut-functions.sh: add find_mp_fstype() 2012-07-26 17:00:07 +02:00
Harald Hoyer
c072e13162 get rid of "basename" 2012-07-24 14:12:36 +02:00
Harald Hoyer
f2271428d4 dracut-functions.sh: small error print correction 2012-07-24 14:08:32 +02:00
Harald Hoyer
52f74c8010 dracut-functions.sh: fixed host-only kernel module bug 2012-07-20 13:10:58 +02:00
Harald Hoyer
258de82819 dracut-functions.sh: set LC_MESSAGES=C not LC_ALL 2012-07-19 13:35:50 +02:00
Harald Hoyer
0f283709c9 dracut-functions.sh: output more info, if dependency modules are omitted 2012-07-16 12:21:56 +02:00
Harald Hoyer
593b315c70 dracut-functions.sh: bail out, if $initdir is not set 2012-07-09 10:02:04 +02:00
Harald Hoyer
338b43cd6a fips: add instmods silent check mode "-c -s" 2012-07-05 11:15:42 +02:00
Harald Hoyer
194b80f974 dracut-functions.sh:find_kernel_modules_by_path() fixed hostonly part
filter /sys/module/* modules by path
2012-07-02 22:51:24 +02:00
Harald Hoyer
ec61f0a3af dracut-functions.sh: forgot --set-version $kernel for modprobe 2012-07-02 22:14:49 +02:00
Harald Hoyer
eaa924b69e dracut-functions.sh: create $initdir, if it does not exist 2012-07-02 18:52:49 +02:00
Harald Hoyer
73575f11a9 dracut-functions.sh,dracut.sh: use xargs with "-r" 2012-07-02 18:52:49 +02:00
Harald Hoyer
0e95d84892 dracut-functions.sh: set LC_ALL=C to get correct parsing information 2012-07-02 18:52:49 +02:00