From a5cde2dd18c32eacb396789b15a8edf0d711e0a1 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 29 Mar 2012 14:56:46 +0200 Subject: [PATCH] dracut-functions.sh: removed get_fs_uuid() and get_fs_type() get_fs_uuid() and get_fs_type() are not used anymore --- dracut-functions.sh | 50 ++++++++++++++------------------------------------ 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/dracut-functions.sh b/dracut-functions.sh index a77c42d..a915614 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -172,48 +172,26 @@ get_fs_env() { unset ID_FS_UUID eval $(udevadm info --query=env --name=$1 \ | while read line; do - [[ "$line" =~ ID_FS_(TYPE|UUID)= ]] && echo $line; + strstr "$line" "ID_FS_TYPE=" && echo $line; done) [[ $ID_FS_TYPE ]] && return 0 if [[ -x /lib/udev/vol_id ]]; then - eval $(/lib/udev/vol_id --export $1) - elif find_binary blkid >/dev/null; then - eval $(blkid -o udev $1) - else - return 1 + eval $(/lib/udev/vol_id --export $1 | + | while read line; do + strstr "$line" "ID_FS_TYPE=" && echo $line; + done) + [[ $ID_FS_TYPE ]] && return 0 fi -} - -# get_fs_uuid -# Prints the filesystem UUID for a device. -# Example: -# $ get_fs_uuid /dev/sda2 -# 551a39aa-4ae9-4e70-a262-ef665cadb574 -get_fs_uuid() ( - get_fs_env $1 || return - echo $ID_FS_UUID -) - -# get_fs_type -# Prints the filesystem type for a device. -# Example: -# $ get_fs_type /dev/sda1 -# ext4 -get_fs_type() ( - [[ $1 ]] || return - if [[ $1 != ${1#/dev/block/nfs:} ]] \ - || [[ $1 != ${1#/dev/block/nfs3:} ]] \ - || [[ $1 != ${1#/dev/block/nfs4:} ]]; then - echo "nfs" - return 0 - fi - if get_fs_env $1; then - echo $ID_FS_TYPE - return 0 + if find_binary blkid >/dev/null; then + eval $(blkid -o udev $1 | + | while read line; do + strstr "$line" "ID_FS_TYPE=" && echo $line; + done) + [[ $ID_FS_TYPE ]] && return 0 fi - find_dev_fstype $1 -) + return 1 +} # get_maj_min # Prints the major and minor of a device node. -- 2.7.4