Commit Graph

94 Commits (c5758f20902b37e3232cd6a1b79f914155457ffd)

Author SHA1 Message Date
Harald Hoyer 5297d4f5b2 lvm/lvm_scan.sh: udevadm settle after lvm scan 2012-07-23 15:36:58 +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 fb67e4aa36 shutdown on demand
Do not save and restore the initramfs, but instead, just unpack the
default initramfs for shutdown on shutdown.
2012-02-13 07:08:08 +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 b0692d0311 add wait_for_dev() and wait_for_mount() 2011-11-15 09:47:16 +01:00
Harald Hoyer 77a57d5eaf order mdadm and lvm timeout operations 2011-10-04 13:03:45 +02:00
Harald Hoyer e59f58f854 use inst_simple to install non-binary files 2011-08-12 13:11:30 +02:00
Harald Hoyer e23f46e86f 90lvm/lvm_scan.sh: use "--partial" to force assembly incomplete VGs
If our internal loop counter is bigger than half of the maximum
count, try to assemble lvm device partially with the "--partial"
option.

https://bugzilla.redhat.com/show_bug.cgi?id=723548
2011-08-11 14:27:26 +02:00
Michal Soltys 6c706227f5 parse-lvm.sh: fix for generated initqueue/finished script
The script that was generated always returned the status of the last test
condition, potentially missing any earlier non-existing devices.

The change assures, that the script returns 0 only if all expected
devices are found.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-07-28 15:01:35 +02:00
Harald Hoyer 23b28c0ab5 lvm/lvm_scan.sh: remove references to lvm-cleanup
lvm-cleanup was removed long time ago
2011-05-17 12:29:47 +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
Harald Hoyer fb59f4c967 get rid of absolute PATHs 2011-04-08 13:49:06 +02:00
Harald Hoyer d125a47061 mkdir always with -m 0755 2011-04-08 10:39:46 +02:00
Harald Hoyer 0b53ca70b6 Move all hooks to "$hookdir"
hookdir=/lib/dracut/hooks for now, to keep the root directory clean
2011-03-25 16:10:46 +01:00
Harald Hoyer c9f1e3d1f4 check for getarg() function before sourcing dracut-lib.sh
make use of "type getarg" to check, if we really need to source
dracut-lib.sh
2011-03-25 16:10:46 +01:00
Harald Hoyer 6767fdaaed lvm: move emergency script from 00 to 90
[forward port of cfb4747e]
2011-03-07 13:37:21 +01: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 8ce58f1f42 add missing shebang 2011-02-23 09:38:25 +01:00
Harald Hoyer 2826a877af 90lvm/lvm_scan.sh: removed garbage line 2011-02-22 18:40:40 +01:00
Harald Hoyer 53570e16c3 90lvm/lvm_scan.sh: fixed lvm version parsing 2011-02-22 17:45:11 +01:00
Harald Hoyer b282107fa9 lvm: use --sysinit, if lvm version >= v2.02.65 2011-02-18 10:58:39 +01:00
Harald Hoyer 71df3c4329 renamed module-info.sh to module-setup.sh 2011-02-02 16:35:18 +01:00
Harald Hoyer 95d2dabc25 replaced check,install,installkernel with module-info.sh 2011-02-02 13:56:03 +01:00
Harald Hoyer fa7ada31d0 new parameter option names with "rd.*" namespace
Renamed Options
       Here is a list of options, which were used in dracut prior to
       version 008, and their new replacement.

       rdbreak
           rd.break

       rd_CCW
           rd.ccw

       rdcopystate
           rd.copystate

       rd_DASD_MOD
           rd.dasd_mod.dasd

       rd_DASD
           rd.dasd

       rdinitdebug rdnetdebug
           rd.debug

       rd_NO_DM
           rd.dm=0

       rd_DM_UUID
           rd.dm.uuid

       rdblacklist
           rd.driver.blacklist

       rdinsmodpost
           rd.driver.post

       rdloaddriver
           rd.driver.pre

       rd_NO_FSTAB
           rd.fstab=0

       rdinfo
           rd.info

       check
           rd.live.check

       rdlivedebug
           rd.live.debug

       live_dir
           rd.live.dir

       liveimg
           rd.live.image

       overlay
           rd.live.overlay

       readonly_overlay
           rd.live.overlay.readonly

       reset_overlay
           rd.live.overlay.reset

       live_ram
           rd.live.ram

       rd_NO_CRYPTTAB
           rd.luks.crypttab=0

       rd_LUKS_KEYDEV_UUID
           rd.luks.keydev.uuid

       rd_LUKS_KEYPATH
           rd.luks.keypath

       rd_NO_LUKS
           rd.luks=0

       rd_LUKS_UUID
           rd.luks.uuid

       rd_LUKS_UUID
           rd.luks.uuid

       rd_NO_LVMCONF
           rd.lvm.conf

       rd_LVM_LV
           rd.lvm.lv

       rd_NO_LVM
           rd.lvm=0

       rd_LVM_SNAPSHOT
           rd.lvm.snapshot

       rd_LVM_SNAPSIZE
           rd.lvm.snapsize

       rd_LVM_VG
           rd.lvm.vg

       rd_NO_MDADMCONF
           rd.md.conf=0

       rd_NO_MDIMSM
           rd.md.imsm=0

       rd_NO_MD
           rd.md=0

       rd_MD_UUID
           rd.md.uuid

       rd_NFS_DOMAIN
           rd.nfs.domain

       rd_NO_PLYMOUTH
           rd.plymouth=0

       rd_retry
           rd.retry

       rdshell
           rd.shell

       rd_NO_SPLASH
           rd.splash

       rdudevdebug
           rd.udev.debug

       rdudevinfo
           rd.udev.info

       rd_NO_ZFCPCONF
           rd.zfcp.conf=0

       rd_ZFCP
           rd.zfcp
2010-10-28 17:11:27 +02:00
James Laska b2dff45423 lvm: support for dynamic LVM SNAPSHOT root volume
I'm looking for a way to have a system with disposable storage that can be
rebooted and all filesystem changes are thrown away.  After reboot, the system
starts with a fresh root volume again.  The use case is for automated testing.
We run test scripts that could potentially not clean up after themselves.

This is almost like stateless, but the storage is local to the system (not
iSCSI, NFS or NBB).

1. Install Fedora 13 using default partition layout
  NOTE: modify the layout to leave extra room in the LVM volume group
2. Apply attached patch
3. Update grub.conf to enable dracut LVM snapshot support.  Add the following
boot arguments

 rd_LVM_SNAPSHOT=vg_test1055/lv_snap (note the VG name will depend on your
system).
 rd_LVM_SNAPSIZE= (optional, defaults to size of volume specified with by
rd_LVM_SNAPSHOT)

4. Adjust grub.conf and fstab to use LVM snapshot
 $ sed -i -e 's|lv_root|lv_snap|' /boot/grub/grub.conf
 $ sed -i -e 's|lv_root|lv_snap|' /etc/fstab
5. Reboot system

Expected results (no value provided for rd_LVM_SNAPSIZE):

  dracut: Starting plymouth daemon
  dracut: rd_NO_DM: removing DM RAID activation
  dracut: rd_NO_MD: removing MD RAID activation
  dracut: Removing existing LVM snapshot vg_test1055/lv_snap
  dracut: Logical volume "lv_snap" successfully removed
  dracut: No LVM snapshot size provided, using size of vg_test1055/lv_root (
9024.00m)
  dracut: Creating LVM snapshot vg_test1055/lv_snap  (  9024.00m)
  dracut: Logical volume "lv_snap" created
  dracut: Scanning devices sda2  for LVM logical volumes vg_test1055/lv_root
vg_test1055/lv_swap
  dracut: inactive Original '/dev/vg_test1055/lv_root' [8.81 GiB] inherit
  dracut: inactive '/dev/vg_test1055/lv_swap' [1.00 GiB] inherit
  dracut: inactive Snapshot '/dev/vg_test1055/lv_snap' [8.81 GiB] inherit
  dracut: Mounted root filesystem /dev/mapper/vg_test1055-lv_snap
  dracut: Loading SELinux policy
  dracut: Switching root

Expected results (rd_LVM_SNAPSIZE=100m):

  dracut: Starting plymouth daemon
  dracut: rd_NO_DM: removing DM RAID activation
  dracut: rd_NO_MD: removing MD RAID activation
  dracut: Removing existing LVM snapshot vg_test1055/lv_snap
  dracut: Logical volume "lv_snap" successfully removed
  dracut: Creating LVM snapshot vg_test1055/lv_snap  (100m )
  dracut: Rounding up size to full physical extent 128.00 MiB
  dracut: Logical volume "lv_snap" created
  dracut: Scanning devices sda2  for LVM logical volumes vg_test1055/lv_root
vg_test1055/lv_swap
  dracut: inactive Original '/dev/vg_test1055/lv_root' [8.81 GiB] inherit
  dracut: inactive '/dev/vg_test1055/lv_swap' [1.00 GiB] inherit
  dracut: inactive Snapshot '/dev/vg_test1055/lv_snap' [128.00 MiB] inherit
  dracut: Mounted root filesystem /dev/mapper/vg_test1055-lv_snap
  dracut: Loading SELinux policy
  dracut: Switching root
2010-09-22 16:39:51 +02:00
Harald Hoyer 0437ced41d lvm: also handle LVM1 volumes 2010-09-22 16:13:20 +02:00
Harald Hoyer cc02093d69 reformat source code
removed tabs and set indention to 4 spaces
added emacs and vi format headers
2010-09-10 15:34:36 +02:00
Harald Hoyer 5acc508cae fixed "use $libdir and $usrlibdir instead of ..." 2010-08-23 12:40:15 +02:00
Amadeusz Żołnowski 55309e7800 use $libdir and $usrlibdir instead of individual detect with ldd 2010-08-23 11:55:11 +02:00
Amadeusz Żołnowski f3af7bd66b use 'type' built-in instead of external cmd 'which' in every Bash script 2010-08-23 11:54:09 +02:00
Harald Hoyer 08852c50b9 removed redundant 64-lvm.rules install
Thanks to Amadeusz Żołnowski, who found it.
2010-07-28 14:09:28 +02:00
Harald Hoyer 3ad4f77cef lvm: wait for all rd_LVM_LV and rd_LVM_VG specified to appear 2010-07-23 12:16:11 +02:00
Harald Hoyer edcd2c5eb7 lvm: install lvm mirror and snaphot libs 2010-06-10 13:51:40 +02:00
Harald Hoyer b6a7c09070 chmod 0755 *.sh 2010-05-19 09:40:48 +02:00
Harald Hoyer b3561ee15f lvm/lvm_scan.sh: silence lvm version check 2010-03-19 16:51:05 +01:00
Mike Snitzer f6458b80ef lvm_scan: use '--ignoremonitoring' rather than '--monitor n'
lvchange and vgchange '--monitor n' will not prevent lvm from
attempting to dlopen the libdevmapper-event library.

dracut git commit 47ab3b6c5e introduced the use of '--monitor n' but
'--ignoremonitoring' is needed now that the libdevmapper-event library
isn't copied into the initramfs (ever since 0fae59d6eb)

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-03-17 11:59:38 +01:00
Harald Hoyer 80deff7c4b lvm: remove lvm-cleanup 2010-01-14 17:04:06 +01:00
Harald Hoyer dc0a0f6c93 lvm: add rd_LVM_LV and "--poll n" 2010-01-13 17:59:14 +01:00
Mike Snitzer 0fae59d6eb lvm: lvm.conf (locking_type = 4)
- the use of sed is placeholder "hack" until lvm2 provides a proper
  tool for changing lvm.conf
- lvm_scan.sh should run lvm commands with --ignorelockingfailure to
  re-use lvm's existing initrd-specific logic; future lvm2 changes
  will split this flag out into various new command-line switches
- no monitoring should be started from within initramfs
- NOTE: the same should apply to 90dmraid/install
- the correct types would be: '[ "blkext", 1 , "cciss0", 16 ]'
  but lvm2 (>= 2.02.52) already properly supports both 'blkext' and
  'cciss' (including cciss0 -> cciss7)
2010-01-13 16:29:12 +01:00