1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Remove external dependency on the 'cut' command in fsadm

This commit is contained in:
Zdeněk Kabeláč 2009-02-06 14:28:06 +00:00
parent 81de913b77
commit 7917c3fc15
2 changed files with 7 additions and 5 deletions

View File

@ -1,7 +1,8 @@
Version 2.02.45 -
===================================
Remove external dependency on the 'cut' command in fsadm.
Fix pvs segfault when pv mda attributes requested for not available PV.
Add support for ext4 resize in fsadm
Add support for ext4 resize in fsadm.
Move locking_type reading inside init_locking().
Rename get_vgs() to get_vgnames() and clarify related error messages.
Allow clvmd to be built with all cluster managers & select one on cmdline.

View File

@ -43,7 +43,6 @@ RMDIR=rmdir
BLOCKDEV=blockdev
BLKID=blkid
GREP=grep
CUT=cut
READLINK=readlink
READLINK_E="-e"
FSCK=fsck
@ -158,8 +157,10 @@ detect_fs() {
VOLUME=${1#/dev/}
VOLUME=$($READLINK $READLINK_E -n "/dev/$VOLUME") || error "Cannot get readlink $1"
# use /dev/null as cache file to be sure about the result
# use 'cut' to be compatible with older version of blkid that does not provide option '-o value'
FSTYPE=$($BLKID -c /dev/null -s TYPE "$VOLUME" | $CUT -d \" -f 2) || error "Cannot get FSTYPE of \"$VOLUME\""
# 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\""
FSTYPE=${FSTYPE##*TYPE=\"} # cut quotation marks
FSTYPE=${FSTYPE%%\"*}
verbose "\"$FSTYPE\" filesystem found on \"$VOLUME\""
}
@ -360,7 +361,7 @@ test -n "$FSADM_RUNNING" && exit 0
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 "$CUT" \
-a -n "$FSCK" -a -n "$XFS_CHECK" -a -n "LVRESIZE" \
|| error "Required command definitions in the script are missing!"
$($READLINK -e -n / >/dev/null 2>&1) || READLINK_E="-f"