genfstab: avoid re-printing kernel name

Without a specified tag, the devnode should not be printed.
This commit is contained in:
Dave Reisner 2012-11-11 23:43:51 -05:00
parent e62b6bb560
commit 73016da72f

View File

@ -10,10 +10,16 @@ write_source() {
label=$(blkid -s LABEL -o value "$1" 2>/dev/null)
uuid=$(blkid -s UUID -o value "$1" 2>/dev/null)
# bind mounds do not have a UUID!
case $bytag in
'')
[[ $uuid ]] && comment=("UUID=$uuid")
[[ $label ]] && comment+=("LABEL=$label")
;;
LABEL)
spec=$label
comment=("$src" "UUID=$uuid")
[[ $uuid ]] && comment=("$src" "UUID=$uuid")
;;
UUID)
spec=$uuid
@ -21,7 +27,7 @@ write_source() {
[[ $label ]] && comment+=("LABEL=$label")
;;
*)
comment=("$1" "UUID=$uuid")
[[ $uuid ]] && comment=("$1" "UUID=$uuid")
[[ $label ]] && comment+=("LABEL=$label")
[[ $bytag ]] && spec=$(blkid -s "$bytag" -o value "$1")
;;