From 4d51f9dd2a0a178a449243c78bdd8f65880f4f4a11ff13d73ee8002ea13f536b Mon Sep 17 00:00:00 2001 From: LiuhuaMelody Wang Date: Thu, 9 Apr 2015 07:36:09 +0000 Subject: [PATCH 1/2] Accepting request 286112 from home:MargueriteSu This procedure was ignored, added it back. or you can't install Virtualbox official RPM on Tumbleweed. - provides libdevmapper.so.1.02 libdevmapper-event.so.1.02 for VirtualBox. OBS-URL: https://build.opensuse.org/request/show/286112 OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=127 --- lvm2.changes | 6 ++++++ lvm2.spec | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lvm2.changes b/lvm2.changes index acb8a0b..f502ef5 100644 --- a/lvm2.changes +++ b/lvm2.changes @@ -5,6 +5,12 @@ Mon Mar 23 07:50:05 UTC 2015 - lwang@suse.com to clmv package to avoid dracut build needing cluster stack to be built. (bsc#923127) +------------------------------------------------------------------- +Sat Feb 14 14:06:36 UTC 2015 - i@marguerite.su + +- provides libdevmapper.so.1.02 libdevmapper-event.so.1.02 + for VirtualBox. + ------------------------------------------------------------------- Thu Feb 5 03:13:52 UTC 2015 - lwang@suse.com diff --git a/lvm2.spec b/lvm2.spec index 0a64b6b..48daac6 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -1,7 +1,7 @@ # # spec file for package lvm2 # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -223,6 +223,13 @@ mkdir -p "%buildroot/%_sbindir" install -m755 -D %{S:8} "%buildroot/%_prefix/lib/ocf/resource.d/lvm2/clvmd" install -m755 -D %{S:10} "%buildroot/%_prefix/lib/ocf/resource.d/lvm2/cmirrord" +# Make sure libdevmapper.so.1.02 libdevmapper-event.so.1.02 still available +# on Tumbleweed, as virtualbox.org didn't update their RPMs yet. +rm -f libdm/ioctl/libdevmapper.so daemons/dmeventd/libdevmapper-event.so +sed -i "s/1.03.01/%{device_mapper_version}/" VERSION_DM +make device-mapper +make install_device-mapper DESTDIR=%{buildroot} + pushd "%buildroot/%_lib" ln -sf liblvm2cmd.so.2.02 liblvm2cmd.so ln -sf liblvm2app.so.2.2 liblvm2app.so @@ -461,6 +468,8 @@ mapper. %doc udev/12-dm-permissions.rules /%_lib/libdevmapper.so.1.03 /%_lib/libdevmapper-event.so.1.03 +/%_lib/libdevmapper.so.1.02 +/%_lib/libdevmapper-event.so.1.02 /sbin/dmsetup /sbin/dmeventd %_sbindir/thin_* From c1e92003344db10f30859ccef8daf351569da1de040602acd3b68b11cf797794 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 9 Apr 2015 08:27:21 +0000 Subject: [PATCH 2/2] Accepting request 294273 from home:zhonglidong:branches:Base:System fate#318413 OBS-URL: https://build.opensuse.org/request/show/294273 OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=128 --- fsadm-add-support-for-btrfs.patch | 204 ++++++++++++++++++++++++++++++ lvm2.changes | 6 + lvm2.spec | 2 + 3 files changed, 212 insertions(+) create mode 100644 fsadm-add-support-for-btrfs.patch diff --git a/fsadm-add-support-for-btrfs.patch b/fsadm-add-support-for-btrfs.patch new file mode 100644 index 0000000..9d71933 --- /dev/null +++ b/fsadm-add-support-for-btrfs.patch @@ -0,0 +1,204 @@ +From 67a7538475e9e292103a80fed8cff8ab380314a2 Mon Sep 17 00:00:00 2001 +From: Lidong Zhong +Date: Fri, 6 Mar 2015 18:35:04 +0800 +Subject: [Patch v2] fsadm: add support for btrfs + +Check: mount the device first and then run`btrfs filesystem scrub start +-B` command +Reisze: find the mount point first and resize the filesystem after get +the device id since there are maybe several devices underneath btrfs +filesystem + +--- +Hi David, + +This is the patch I sent to upstream. It works fine based on our test. +Please shed your light and thank you for taking time to review. + +Regards, +Lidong + + scripts/fsadm.sh | 104 ++++++++++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 88 insertions(+), 16 deletions(-) + +diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh +index f4ea796..765f9dc 100755 +--- a/scripts/fsadm.sh ++++ b/scripts/fsadm.sh +@@ -22,6 +22,7 @@ + # ext2/ext3/ext4: resize2fs, tune2fs + # reiserfs: resize_reiserfs, reiserfstune + # xfs: xfs_growfs, xfs_info ++# btrfs: btrfs + # + # Return values: + # 0 success +@@ -56,6 +57,7 @@ FSCK=fsck + XFS_CHECK=xfs_check + # XFS_REPAIR -n is used when XFS_CHECK is not found + XFS_REPAIR=xfs_repair ++BTRFS=btrfs + + # user may override lvm location by setting LVM_BINARY + LVM=${LVM_BINARY:-lvm} +@@ -75,6 +77,9 @@ BLOCKCOUNT= + MOUNTPOINT= + MOUNTED= + REMOUNT= ++FINDMNT= ++UUID= ++BTRFS_DEVID= + PROCMOUNTS="/proc/mounts" + NULL="$DM_DEV_DIR/null" + +@@ -147,7 +152,7 @@ cleanup() { + export _FSADM_YES _FSADM_EXTOFF + unset FSADM_RUNNING + test -n "$LVM_BINARY" && PATH=$_SAVEPATH +- dry exec "$LVM" lvresize $VERB $FORCE -r -L${NEWSIZE}b "$VOLUME_ORIG" ++ dry exec "$LVM" lvresize $VERB $FORCE -r -L${NEWSIZE}b "$VOLUME" + fi + + # error exit status for break +@@ -198,27 +203,62 @@ detect_fs() { + verbose "\"$FSTYPE\" filesystem found on \"$VOLUME\"" + } + ++check_findmnt() { ++ FINDMNT=$(which findmnt 2>$NULL) ++ test -n "$FINDMNT" ++} ++ ++detect_fs_uuid() { ++ UUID=$($BLKID -o value -c $NULL -s UUID "$VOLUME" 2>$NULL) ++ test -n "$UUID" ++} ++ ++#find the mountpoint of this device ++detect_mounted_findmnt() { ++ local TMP ++ local STR_IFS=$IFS ++ IFS=" $(echo -n -e '\t')" ++ ++ read -r TMP<$NULL | $GREP "$UUID") ++EOF ++ ++ TMP=${TMP##*TARGET=\"} ++ TMP=${TMP%%\"*} ++ MOUNTED=$TMP ++ test -n "$MOUNTED" ++ ++ IFS=$STR_IFS ++} ++ + # check if the given device is already mounted and where + # FIXME: resolve swap usage and device stacking + detect_mounted() { +- test -e "$PROCMOUNTS" || error "Cannot detect mounted device \"$VOLUME\"" ++ if test "$FSTYPE" = "btrfs" ; then ++ check_findmnt || error "Need 'findmnt' utility to work with btrfs filesystem" ++ detect_fs_uuid || verbose "Can't get fs UUID from \"$VOLUME\" volume" ++ detect_mounted_findmnt ++ ++ else ++ test -e "$PROCMOUNTS" || error "Cannot detect mounted device \"$VOLUME\"" + +- MOUNTED=$("$GREP" "^$VOLUME[ \t]" "$PROCMOUNTS") ++ MOUNTED=$("$GREP" "^$VOLUME[ \t]" "$PROCMOUNTS") + +- # for empty string try again with real volume name +- test -z "$MOUNTED" && MOUNTED=$("$GREP" "^$RVOLUME[ \t]" "$PROCMOUNTS") ++ # for empty string try again with real volume name ++ test -z "$MOUNTED" && MOUNTED=$("$GREP" "^$RVOLUME[ \t]" "$PROCMOUNTS") + +- # cut device name prefix and trim everything past mountpoint +- # echo translates \040 to spaces +- MOUNTED=${MOUNTED#* } +- MOUNTED=$(echo -n -e ${MOUNTED%% *}) ++ # cut device name prefix and trim everything past mountpoint ++ # echo translates \040 to spaces ++ MOUNTED=${MOUNTED#* } ++ MOUNTED=$(echo -n -e ${MOUNTED%% *}) + +- # for systems with different device names - check also mount output +- if test -z "$MOUNTED" ; then +- MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$VOLUME[ \t]") +- test -z "$MOUNTED" && MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$RVOLUME[ \t]") +- MOUNTED=${MOUNTED##* on } +- MOUNTED=${MOUNTED% type *} # allow type in the mount name ++ # for systems with different device names - check also mount output ++ if test -z "$MOUNTED" ; then ++ MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$VOLUME[ \t]") ++ test -z "$MOUNTED" && MOUNTED=$(LC_ALL=C "$MOUNT" | "$GREP" "^$RVOLUME[ \t]") ++ MOUNTED=${MOUNTED##* on } ++ MOUNTED=${MOUNTED% type *} # allow type in the mount name ++ fi + fi + + test -n "$MOUNTED" +@@ -368,6 +408,31 @@ resize_xfs() { + fi + } + ++######################## ++# Resize btrfs filesystem ++# - mounted for upsize/downsize ++# - cannot resize when unmounted ++######################## ++resize_btrfs() { ++ detect_mounted ++ MOUNTPOINT=$MOUNTED ++ if [ -z "$MOUNTED" ]; then ++ MOUNTPOINT=$TEMPDIR ++ temp_mount || error "Cannot mount Btrfs filesystem" ++ fi ++ ++ verbose "Parsing $BTRFS filesystem show \"$MOUNTPOINT\"" ++ for i in $(LC_ALL=C "$BTRFS" filesystem show "$MOUNTPOINT"); do ++ case "$i" in ++ *"$VOLUME"*) BTRFS_DEVID=${i##*devid};; ++ esac ++ done ++ BTRFS_DEVID=${BTRFS_DEVID%%size*} ++ BTRFS_DEVID=$(echo $BTRFS_DEVID|sed 's/^[ \t]*//g'|sed 's/[ \t]*$'//g) ++ decode_size $1 1 ++ verbose "Resizing filesystem on device \"$VOLUME\" to $NEWSIZE bytes(btrfs devid: $BTRFS_DEVID) " ++ dry "$BTRFS" filesystem resize "$BTRFS_DEVID":"$NEWSIZE" "$MOUNTPOINT" ++} + #################### + # Resize filesystem + #################### +@@ -384,6 +449,7 @@ resize() { + "ext3"|"ext2"|"ext4") resize_ext $NEWSIZE ;; + "reiserfs") resize_reiser $NEWSIZE ;; + "xfs") resize_xfs $NEWSIZE ;; ++ "btrfs") resize_btrfs $NEWSIZE ;; + *) error "Filesystem \"$FSTYPE\" on device \"$VOLUME\" is not supported by this tool" ;; + esac || error "Resize $FSTYPE failed" + cleanup 0 +@@ -441,6 +507,12 @@ check() { + # Think about better way.... + dry "$XFS_REPAIR" -n -o force_geometry "$VOLUME" + fi ;; ++ "btrfs") #mount the device first and then run scrub ++ MOUNTPOINT=$TEMPDIR ++ temp_mount || error "Cannot mount btrfs filesystem" ++ dry "$BTRFS" scrub start -B "$VOLUME" ++ test "$MOUNTPOINT" = "$TEMPDIR" && MOUNTPOINT="" temp_umount ++ ;; + *) # check if executed from interactive shell environment + case "$-" in + *i*) dry "$FSCK" $YES $FORCE "$VOLUME" ;; +@@ -462,7 +534,7 @@ test -n "$FSADM_RUNNING" && exit 0 + for i in "$TUNE_EXT" "$RESIZE_EXT" "$TUNE_REISER" "$RESIZE_REISER" \ + "$TUNE_XFS" "$RESIZE_XFS" "$MOUNT" "$UMOUNT" "$MKDIR" \ + "$RMDIR" "$BLOCKDEV" "$BLKID" "$GREP" "$READLINK" \ +- "$DATE" "$FSCK" "$XFS_CHECK" "$XFS_REPAIR" "$LVM" ; do ++ "$DATE" "$FSCK" "$XFS_CHECK" "$XFS_REPAIR" "$LVM" "$BTRFS" ; do + test -n "$i" || error "Required command definitions in the script are missing!" + done + +-- +1.8.1.4 + diff --git a/lvm2.changes b/lvm2.changes index f502ef5..8f054dd 100644 --- a/lvm2.changes +++ b/lvm2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 3 02:45:02 UTC 2015 - lzhong@suse.com + +- fsadm: add support for btrfs(fate#318413) + fsadm-add-support-for-btrfs.patch + ------------------------------------------------------------------- Mon Mar 23 07:50:05 UTC 2015 - lwang@suse.com diff --git a/lvm2.spec b/lvm2.spec index 48daac6..d46c34d 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -88,6 +88,7 @@ Patch2004: udev_rules-update.diff Patch2005: udev-Check-for-DM_NR_VALID_PATHS.patch # suse, boo#910327 Patch2006: lvm2-do-not-strip-pdata_tools.patch +Patch2007: fsadm-add-support-for-btrfs.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf @@ -149,6 +150,7 @@ Volume Manager. %patch2004 -p1 %patch2005 -p1 %patch2006 -p1 +%patch2007 -p1 %build #set path so that thin_check can be found