--nostrip Do not strip binaries in the initramfs
--mdadmconf Include local /etc/mdadm.conf
--nomdadmconf Do not include local /etc/mdadm.conf
+ --lvmconf Include local /etc/lvm/lvm.conf
+ --nolvmconf Do not include local /etc/lvm/lvm.conf
-h, --help This message
--debug Output debug information of the build process
-v, --verbose Verbose output during the build process
--nostrip) do_strip_l="no";;
--mdadmconf) mdadmconf_l="yes";;
--nomdadmconf) mdadmconf_l="no";;
+ --lvmconf) lvmconf_l="yes";;
+ --nolvmconf) lvmconf_l="no";;
-h|--help) usage; exit 1 ;;
--debug) debug="yes";;
-v|--verbose) beverbose="yes";;
[[ $do_strip_l ]] && do_strip=$do_strip_l
[[ $hostonly_l ]] && hostonly=$hostonly_l
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
+[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
[[ $fw_dir ]] || fw_dir=/lib/firmware
[[ $do_strip ]] || do_strip=yes
export initdir hookdirs dsrc dracutmodules drivers \
fw_dir drivers_dir debug beverbose no_kernel kernel_only \
- add_drivers mdadmconf
+ add_drivers mdadmconf lvmconf
if [[ $kernel_only != yes ]]; then
# Create some directory structure first
# install local /etc/mdadm.conf
mdadmconf="yes"
+
+# install local /etc/lvm/lvm.conf
+lvmconf="yes"
Name: dracut
Version: 002
-Release: 1%{?rdist}
+Release: 2%{?rdist}
Summary: Initramfs generator using udev
Group: System Environment/Base
License: GPLv2+
%dir /var/lib/dracut/overlay
%changelog
+* Fri Sep 18 2009 Harald Hoyer <harald@redhat.com> 002-2
+- do not cleanup dmraids
+- copy over lvm.conf
+
* Thu Sep 17 2009 Harald Hoyer <harald@redhat.com> 002-1
- version 002
- set correct PATH
+++ /dev/null
-# close everything which is not busy
-dmraid -an >/dev/null 2>&1
DM_RAIDS=$(getargs rd_DM_UUID=)
+DM_CLEANUP="no"
+
# run dmraid if udev has settled
info "Scanning for dmraid devices $DM_RAIDS"
SETS=$(dmraid -c -s)
[ -e "/dev/mapper/$s" ] && kpartx -a -p p "/dev/mapper/$s" 2>&1 | vinfo
done
fi
+
fi
inst_rules "$moddir/61-dmraid-imsm.rules"
-inst_hook pre-pivot 30 "$moddir/dmraid-cleanup.sh"
-inst_hook pre-pivot 31 "$moddir/dmraid-cleanup.sh"
+inst "$moddir/dmraid-cleanup.sh" /sbin/dmraid-cleanup
inst_hook pre-trigger 30 "$moddir/parse-dm.sh"
inst_rules "$moddir/64-lvm.rules" 64-lvm.rules
-if [[ $hostonly ]]; then
+if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
[ -f /etc/lvm/lvm.conf ] && inst /etc/lvm/lvm.conf
fi
inst "$moddir/lvm_scan.sh" /sbin/lvm_scan
inst_hook cmdline 30 "$moddir/parse-lvm.sh"
-inst_hook pre-pivot 30 "$moddir/lvm-cleanup.sh"
-inst_hook pre-pivot 31 "$moddir/lvm-cleanup.sh"
\ No newline at end of file
+inst "$moddir/lvm-cleanup.sh" /sbin/lvm-cleanup
info "Scanning devices $lvmdevs for LVM volume groups $VGS"
lvm vgscan 2>&1 | vinfo
lvm vgchange -ay $VGS 2>&1 | vinfo
-[ "$lvmwritten" ] && rm -f /etc/lvm/lvm.conf
+if [ "$lvmwritten" ]; then
+ rm -f /etc/lvm/lvm.conf
+ ln -s /sbin/lvm-cleanup /pre-pivot/30-lvm-cleanup.sh 2>/dev/null
+ ln -s /sbin/lvm-cleanup /pre-pivot/31-lvm-cleanup.sh 2>/dev/null
+fi
unset lvmwritten
inst "$moddir/mdadm_auto.sh" /sbin/mdadm_auto
inst "$moddir/md_finished.sh" /sbin/md_finished.sh
inst_hook pre-trigger 30 "$moddir/parse-md.sh"
-inst_hook pre-pivot 30 "$moddir/mdraid-cleanup.sh"
-inst_hook pre-pivot 31 "$moddir/mdraid-cleanup.sh"
+inst "$moddir/mdraid-cleanup.sh" /sbin/mdraid-cleanup
info "Autoassembling MD Raid"
/sbin/mdadm -As --auto=yes --run 2>&1 | vinfo
+ln -s /sbin/mdraid-cleanup /pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
+ln -s /sbin/mdraid-cleanup /pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
udevadm control --stop-exec-queue
# and activate any containers
mdadm -IR $md 2>&1 | vinfo
+ln -s /sbin/mdraid-cleanup /pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
+ln -s /sbin/mdraid-cleanup /pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
udevadm control --start-exec-queue
info "Assembling MD RAID arrays"
udevadm control --stop-exec-queue
mdadm -IRs 2>&1 | vinfo
+ln -s /sbin/mdraid-cleanup /pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
+ln -s /sbin/mdraid-cleanup /pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
udevadm control --start-exec-queue