All of lore.kernel.org
 help / color / mirror / Atom feed
From: zkabelac@sourceware.org <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW scripts/fsadm.sh
Date: 9 Jun 2009 15:31:37 -0000	[thread overview]
Message-ID: <20090609153137.19485.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac at sourceware.org	2009-06-09 15:31:36

Modified files:
	.              : WHATS_NEW 
	scripts        : fsadm.sh 

Log message:
	Use 'lvm lvresize' instead of 'lvresize' in fsadm.
	Do not use '-n' realine option in fsadm for busybox compatiblity.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1144&r2=1.1145
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/fsadm.sh.diff?cvsroot=lvm2&r1=1.10&r2=1.11

--- LVM2/WHATS_NEW	2009/06/09 14:43:59	1.1144
+++ LVM2/WHATS_NEW	2009/06/09 15:31:36	1.1145
@@ -1,5 +1,7 @@
 Version 2.02.48 - 
 ===============================
+  Use 'lvm lvresize' instead of 'lvresize' in fsadm.
+  Do not use '-n' realine option in fsadm for busybox compatiblity.
   Update vgrename, vgsplit, and vgcreate to use vg_lock_newname.
   Add vg_lock_newname() library function.
   Round up requested readahead to at least one page and print warning.
--- LVM2/scripts/fsadm.sh	2009/02/24 15:48:01	1.10
+++ LVM2/scripts/fsadm.sh	2009/06/09 15:31:36	1.11
@@ -48,7 +48,8 @@
 FSCK=fsck
 XFS_CHECK=xfs_check
 
-LVRESIZE=lvresize
+# user may override lvm location by setting LVM_BINARY
+LVM=${LVM_BINARY-lvm}
 
 YES=
 DRY=0
@@ -66,6 +67,9 @@
 REMOUNT=
 
 IFS_OLD=$IFS
+# without bash $'\n'
+NL='
+'
 
 tool_usage() {
 	echo "${TOOL}: Utility to resize or check the filesystem on a device"
@@ -124,7 +128,7 @@
 	# start LVRESIZE with the filesystem modification flag
 	# and allow recursive call of fsadm
 	unset FSADM_RUNNING
-	test "$DO_LVRESIZE" -eq 2 && exec $LVRESIZE $VERB -r -L$(( $NEWSIZE / 1048576 )) $VOLUME
+	test "$DO_LVRESIZE" -eq 2 && exec $LVM lvresize $VERB -r -L$(( $NEWSIZE / 1048576 )) $VOLUME
 	exit ${1:-0}
 }
 
@@ -155,7 +159,9 @@
 # dereference device name if it is symbolic link
 detect_fs() {
         VOLUME=${1#/dev/}
-	VOLUME=$($READLINK $READLINK_E -n "/dev/$VOLUME") || error "Cannot get readlink $1"
+	VOLUME=$($READLINK $READLINK_E "/dev/$VOLUME") || error "Cannot get readlink $1"
+	# strip newline from volume name
+	VOLUME=${VOLUME%%$NL}
 	# use /dev/null as cache file to be sure about the result
 	# not using option '-o value' to be compatible with older version of blkid
 	FSTYPE=$($BLKID -c /dev/null -s TYPE "$VOLUME") || error "Cannot get FSTYPE of \"$VOLUME\""
@@ -324,8 +330,7 @@
 	#if [ -n "$NEWSIZE" -a $NEWSIZE <
 	test -z "$NEWSIZE" && NEWSIZE=${DEVSIZE}b
 	trap cleanup 2
-	#IFS=$'\n'  # don't use bash-ism ??
-	IFS="$(printf \"\\n\")"  # needed for parsing output
+	IFS=$NL
 	case "$FSTYPE" in
 	  "ext3"|"ext2"|"ext4") resize_ext $NEWSIZE ;;
 	  "reiserfs") resize_reiser $NEWSIZE ;;
@@ -359,10 +364,11 @@
 test -n "$TUNE_EXT" -a -n "$RESIZE_EXT" -a -n "$TUNE_REISER" -a -n "$RESIZE_REISER" \
   -a -n "$TUNE_XFS" -a -n "$RESIZE_XFS" -a -n "$MOUNT" -a -n "$UMOUNT" -a -n "$MKDIR" \
   -a -n "$RMDIR" -a -n "$BLOCKDEV" -a -n "$BLKID" -a -n "$GREP" -a -n "$READLINK" \
-  -a -n "$FSCK" -a -n "$XFS_CHECK" -a -n "LVRESIZE" \
+  -a -n "$FSCK" -a -n "$XFS_CHECK" -a -n "LVM" \
   || error "Required command definitions in the script are missing!"
 
-$($READLINK -e -n / >/dev/null 2>&1) || READLINK_E="-f"
+$LVM version >/dev/null 2>&1 || error "Could not run lvm binary '$LVM'"
+$($READLINK -e / >/dev/null 2>&1) || READLINK_E="-f"
 TEST64BIT=$(( 1000 * 1000000000000 ))
 test $TEST64BIT -eq 1000000000000000 || error "Shell does not handle 64bit arithmetic"
 $(echo Y | $GREP Y >/dev/null) || error "Grep does not work properly"



             reply	other threads:[~2009-06-09 15:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-09 15:31 zkabelac [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-10-08 12:36 LVM2 ./WHATS_NEW scripts/fsadm.sh zkabelac
2010-10-08 13:47 zkabelac
2010-10-08 13:49 zkabelac
2010-10-08 14:49 zkabelac
2010-10-08 14:55 zkabelac
2010-10-08 15:00 zkabelac
2010-10-08 15:02 zkabelac
2010-11-01 14:08 zkabelac
2010-11-10 16:14 zkabelac
2011-09-19 13:43 zkabelac
2011-09-19 13:47 zkabelac
2011-09-19 13:51 zkabelac
2011-09-19 14:52 zkabelac
2012-03-16 12:53 zkabelac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090609153137.19485.qmail@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.