diff --git a/libguestfs.changes b/libguestfs.changes index e8f52d5..8fcd7e1 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Aug 29 21:36:08 CEST 2013 - ohering@suse.de + +- Add support for lvm (bnc#837595) + ------------------------------------------------------------------- Thu Aug 22 11:36:24 CEST 2013 - ohering@suse.de diff --git a/libguestfs.mkinitrd.boot.sh b/libguestfs.mkinitrd.boot.sh index db365c9..5944886 100644 --- a/libguestfs.mkinitrd.boot.sh +++ b/libguestfs.mkinitrd.boot.sh @@ -114,6 +114,12 @@ load_modules # from libguestfs-1.19.34/appliance/init: +# Disk optimizations. +# Increase the SCSI timeout so we can read remote images. +for f in /sys/block/sd*/device/timeout; do if test -w $f ; then echo 300 > $f; fi; done +# https://access.redhat.com/site/solutions/5427 +for f in /sys/block/{h,s,ub,v}d*/queue/scheduler; do if test -w $f ; then echo noop > $f; fi; done + # Scan for MDs. mdadm -As --auto=yes --run @@ -123,22 +129,21 @@ echo -n >> /etc/lvm/lvm.conf lvm vgscan --ignorelockingfailure lvm vgchange -ay --ignorelockingfailure -# Improve virtio-blk performance (RHBZ#509383). -for f in /sys/block/vd*/queue/rotational; do if test -f $f ; then echo 1 > $f; fi ; done - # These are useful when debugging. if grep -sq guestfs_verbose=1 /proc/cmdline; then ls -lR /dev head -n 1234 \ - /proc/mounts \ + /proc/mounts \ /proc/modules \ /proc/cpuinfo \ /proc/uptime \ /proc/version \ /proc/partitions - lvm pvs - lvm vgs - lvm lvs + for i in pvs vgs lvs + do + echo "# lvm $i:" + lvm $i + done # ip a # ip r date diff --git a/libguestfs.mkinitrd.setup.sh b/libguestfs.mkinitrd.setup.sh index 8fd4d2b..36779da 100644 --- a/libguestfs.mkinitrd.setup.sh +++ b/libguestfs.mkinitrd.setup.sh @@ -44,6 +44,17 @@ do done done +# copy needed rules +for rule in \ + 95-dm-notify.rules \ + ; do + if [ -f /lib/udev/rules.d/$rule ]; then + cp /lib/udev/rules.d/$rule $tmp_mnt/lib/udev/rules.d + elif [ -f /etc/udev/rules.d/$rule ]; then + cp /etc/udev/rules.d/$rule $tmp_mnt/etc/udev/rules.d + fi +done + # Need to create the modprobe.conf file to force read-write mode if modinfo -k $kernel_version ext4 | grep -E '^parm:[[:blank:]]+rw:' then diff --git a/libguestfs.spec b/libguestfs.spec index 13c80a9..c1a5705 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -667,6 +667,7 @@ bash -x \ -i initramfs.${arch}.img \ -b $PWD/mkinitrd/boot_tmp \ -m "$additional_modules" \ + -f "lvm2 dm md network nfs" \ -B # mkdir -vp $RPM_BUILD_ROOT%{_libdir}/guestfs