Commit Graph

73 Commits (c09a9932b828a94079c0d96d5902fc2a812d673a)

Author SHA1 Message Date
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
Philippe Seewer 2e6b98c7f6 All module scripts should have a shebang 2009-11-27 14:07:21 +01:00
Harald Hoyer bad6113059 lvm/dmraid: make LIBDIR depend on the binary 2009-11-25 20:08:22 +01:00
Yanko Kaneti 9e7ac6982a Wildcards need dracut_install 2009-11-25 19:55:17 +01:00
Harald Hoyer 47ab3b6c5e lvm: scan without monitor
https://bugzilla.redhat.com/show_bug.cgi?id=540289
2009-11-25 19:55:17 +01:00
Harald Hoyer 15c82415c2 90dmraid,90lvm: device mapper upstream rules got renamed 2009-10-27 16:02:56 +01:00
Philippe Seewer 41f8a4f14f Add dm_mod loader
Some kernel configurations might build base dm support as a module.
Add module dm which ensures that dm_mod is there and loaded.
2009-10-27 16:02:56 +01:00
Harald Hoyer 99fd62e3be dm/lvm: make usage of new udev event rules optionally 2009-09-29 18:29:34 +02:00
Harald Hoyer b9c4654a63 devicemapper: add dmeventd and new rules for device mapper 2009-09-23 16:52:14 -07:00
Harald Hoyer c53acc3015 lvm: add rd_NO_LVMCONF 2009-09-18 12:28:36 +02:00
Harald Hoyer 7a34efa5c4 md/dm/lvm: install pre-pivot cleanup hooks only if actually needed
- removed dmraid cleanup
- only call lvm cleanup, if no lvm.conf provided
- copy over lvm.conf by default
- add --nolvmconf --lvmconf parameters
2009-09-18 12:20:21 +02:00
Harald Hoyer 094097fab3 lvm/dm/md: switch from lockfiles to $sys/$devpath/holders/*
This is a more sane solution, than ignoring subsequent "change" events.

The only danger is that we could loop, if a lvm scan triggers a broken
md partition, which triggers a broken PV and so on.

Better fix the scanning tools, not to emit change events for devices,
if no action was taken.
2009-09-16 15:34:13 +02:00
Harald Hoyer 650da7bada removed initrdargs from parse-*.sh 2009-09-10 17:34:15 +02:00
Harald Hoyer 273b197d75 added initqueue-settled and refactored code 2009-09-07 19:12:01 +02:00
Harald Hoyer e4dec3d6b6 {crypt,dmraid,lvm,mdraid}: cleanup with pre-pivot 30 and 31 2009-09-03 17:11:57 +02:00
Harald Hoyer 52168b7b9d reordered blkid/vol_id rules 2009-09-02 15:55:34 +02:00
Peter Rajnoha d6462323d6 LVM/DM rules in dracut
I've looked at the LVM rules used in dracut just recently
and it needs fixing - we should react to change events only
for DM devices, so we have to skip vol_id/blkid call on ADD:

KERNEL=="dm-[0-9]*", ACTION=="add", GOTO="lvm_end"

Also, MD devices have their own rules, where vol_id/blkid
is called and where the symlinks are created (when looking
into raw initrd, this is in  64-md-raid.rules).

Also, if those rules are meant to be for DM devices only,
maybe we should skip symlink creation for the other devices
there, to keep the rules clean and straightforward. I think
we shouldn't create/recreate symlinks for non-dm devices in
LVM/DM rules (..should be in appropriate rules for that type
of device):

KERNEL!="dm-[0-9]*", GOTO="lvm_end"
2009-09-02 15:55:34 +02:00
Harald Hoyer 194f7d125f 90*/*cleanup.sh: fixed redirection to /dev/null 2009-09-01 15:59:31 +02:00
Harald Hoyer 780afa9876 release any raid/crypt/lvm device assembled, but not in use 2009-09-01 15:51:51 +02:00
Harald Hoyer ec74fa8789 split dracut in network / non-network 2009-09-01 15:42:28 +02:00
Harald Hoyer b6bf29b054 lvm.rules: blkid for cciss devices 2009-09-01 15:42:27 +02:00
Harald Hoyer 5c6a593f2e add udevsettle function and settle after raid/lvm/crypto activities 2009-09-01 15:42:27 +02:00