Commit Graph

34 Commits (5d623b1775ebc7dc17bc23f2839906f418b17383)

Author SHA1 Message Date
Harald Hoyer 5d623b1775 lvm: always install thin utils for lvm 2013-10-21 09:09:26 +02:00
Harald Hoyer aabea6f7b9 lvm: fix thin recognition
The global var setting was happening in a pipe and did not have an
effect.

Use <<<$() instead.

< <() cannot be used, because dracut is called in chroot's environments,
where /dev/fd does not point to /proc/self/fd, but bash wants
/dev/fd/<num> for this construct.
2013-10-16 11:30:08 +02:00
Harald Hoyer 8bcfd683bd */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
Harald Hoyer a3c0cef9a7 lvm: install thin utils for non-hostonly 2013-10-08 10:30:00 +02:00
Peter Rajnoha b874d4b5be lvm/mdraid: Fix LVM on MD activation
The 69-dm-lvm-metad.rules set some udev env. variables that makes it
possible to detect the right time to activate LVM on MD. The MD is very
similar to DM during activation - it's usable only after proper device
activation - the CHANGE event. We need to make a difference between a
CHANGE event that comes from this activation and CHANGE event that is
the outcome of the WATCH udev rule (otherwise we'd end up with LVM
activation done on each CHANGE event - which is wrong).

So we need the udev databse to be persistent during pivot to root fs
even for MD devices.
2013-10-04 10:41:24 +02:00
Harald Hoyer 575733aa25 add newline to cmdline config files 2013-08-20 13:08:52 +02:00
Harald Hoyer 1743473b2b add parameter --print-cmdline
This prints the kernel command line parameters for the current disk
layout.

$ dracut --print-cmdline
rd.luks.uuid=luks-e68c8906-6542-4a26-83c4-91b4dd9f0471
rd.lvm.lv=debian/root rd.lvm.lv=debian/usr root=/dev/mapper/debian-root
rootflags=rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered
rootfstype=ext4
2013-08-15 16:06:37 +02:00
Harald Hoyer 69f7ed9610 Create initramfs without using udevadm
This enables building a hostonly image, without the udev database
populated.
2013-08-15 10:44:20 +02:00
Harald Hoyer af11946054 dracut-functions.sh: inst_multiple == dracut_install 2013-08-07 10:33:15 +02:00
Harald Hoyer 5decf6d813 add debian udev rule files 2013-07-24 13:42:17 +02:00
Harald Hoyer b093aa2dc7 beautified shell code
checked with shellcheck http://www.shellcheck.net/about.html
2013-07-04 12:31:15 +02:00
Baoquan He 8a9a5838f3 90lvm/module-setup.sh: redirect error message of lvs to /dev/null
Signed-off-by: Baoquan He <bhe@redhat.com>
2013-06-13 15:49:20 +02:00
Harald Hoyer ad45024416 lvm: fixed "thin" recognition 2013-06-06 09:40:26 +02:00
Harald Hoyer 57937cf480 lvm: add tools for thin provisioning
https://bugzilla.redhat.com/show_bug.cgi?id=921235
2013-05-30 12:02:59 +02: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 7d4d3f8da6 lvm/module-setup.sh: use for_each_host_dev_and_slaves_all
Use for_each_host_dev_and_slaves_all to get all lvm setups for the
host-only case.

Thanks to Olivier Thauvin
2013-02-21 12:13:56 +01: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
Harald Hoyer 53fe81e752 modules.d/*/module-setup.sh: combine and specify type for installs
To speedup image creation, combine dracut_install calls and specify the exact type.
E.g. inst_script instead of the generic inst.
2012-06-29 12:41:27 +02:00
Harald Hoyer 4d0f1d7b28 modules.d/*/module-setup.sh: no more sourcing of dracutfunctions 2012-06-29 12:41:26 +02:00
Peter Rajnoha b8a81fb885 lvm: disable lvmetad
Currently dracut uses lvm.conf as found in the system and modifies only
global/locking_type setting. As there's a new feature introduced - the lvmetad
daemon, dracut should disable its use as well by setting "global/use_lvmetad=0"
(patch attached).

Otherwise, there's a warning message issued:

dracut: WARNING: Failed to connect to lvmetad: No such file or directory.
Falling back to internal scanning.

@@ -, +, @@
 modules.d/90lvm/lvm_scan.sh     |    2 ++
 modules.d/90lvm/module-setup.sh |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)
2012-04-16 14:46:53 +02:00
Jon Ander Hernandez c9143a63fe Debian multiarch support
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"
2012-04-16 14:46:53 +02:00
Harald Hoyer 030b8a160f 90lvm/module-setup.sh: ignore DM_UDEV_DISABLE_DISK_RULES_FLAG=1
Ignore logical volumes, which have DM_UDEV_DISABLE_DISK_RULES_FLAG=1
set for the generation of hostonly cmdline parameter.
2012-03-30 10:48:37 +02:00
Harald Hoyer 004fd0557d host-only checks corrected and kernel_only mode
In kernel_only mode, we don't want to write /etc/cmdline.d

Correctly return the check functions, so we have a valid return of
for_each_host_dev_fs().

mdraid and dmraid functions had wrong checkings for the filesystem
type.
2012-02-22 19:29:57 +01:00
Colin Guthrie 0330b91987 lvm: Only activate a given vg+lv once.
Due to the way the main loop runs to detect partions, the same one
might be included twice (albeit via different symlinks.

This code simply prevents the same combo being activated twice.

A better fix might simply be to not include duplicate (after
resolving symlinks) entries in the host_fs_types variable.
2012-02-22 18:30:58 +01:00
Harald Hoyer 96b8d60a9b dracut: precreate "${initdir}/etc/cmdline.d" 2012-02-07 18:48:04 +01:00
Cong Wang a72cae66dc lvm: pass the correct rd.lvm.lv parameter
rd.lvm.lv accepts ${DM_VG_NAME}/${DM_LV_NAME}, not ${DM_LV_NAME}.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-13 11:35:49 +01:00
Cong Wang 1b7fd0fa3e Check module dependencies of mount points
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>
2012-01-13 11:35:49 +01:00
Harald Hoyer 480d772f22 */module-setup.sh: use host_fs_types host_devs
For the $hostonly case, use $host_fs_types and $host_devs to determine,
if a module has to be included in the initramfs.
2011-12-15 14:49:03 +01:00
Harald Hoyer 760dcc6a65 lvm, dm, dmraid: cleanup, which module installs what
The dm module, which lvm and dmraid depend on, installed dmraid
shared libs. The lvm module installed udev rules, which were
already installed by the dm module.
Cleaned up those issues.
2011-11-15 09:47:28 +01:00
Harald Hoyer e59f58f854 use inst_simple to install non-binary files 2011-08-12 13:11:30 +02:00
Harald Hoyer 29b10e65b1 dracut-functions: make local vars local and prefix with "_" 2011-05-12 11:06:47 +02:00
Harald Hoyer 3b403b32fc removed trailing whitespaces 2011-05-10 11:56:09 +02:00
Amadeusz Żołnowski 5d72984a01 Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install rules:
10-dm.rules
  11-dm-lvm.rules
  13-dm-disk.rules
  95-dm-notify.rules

but provides only 64-device-mapper.rules combining more or less the
above rules files.
2011-03-04 13:07:28 +01:00
Harald Hoyer 71df3c4329 renamed module-info.sh to module-setup.sh 2011-02-02 16:35:18 +01:00