Skip to contentSkip to conversation

dracut-functions: get_persistent_dev() fall back to the original name

PATCH In review WANG Chao 2 participants 2 messages Jul 28, 2014 – Aug 15, 2014 1 message not in the archive

lore
Share & tools
lore

WANG Chao

author
#0 lore raw

PATCH 1/1 dracut-functions: get_persistent_dev() fall back to the original name

In case of raw disk/partition, ex. /dev/vda1, which doesn't contain any filesystem on it. get_persistent_dev() would return empty. Now fix it to return its original name, /dev/vda1 in above case. So that we don't have to check its return string every time.

---
 dracut-functions.sh | 1 +
 1 file changed, 1 insertion(+)
dracut-functions.sh +1 -0
index 6cdfea0..b07063f 100755
@@ -388,6 +388,7 @@ get_persistent_dev() {
             return
         fi
     done
+    echo $1
 }
 
 expand_persistent_dev() {
Signature · 1 line
1.9.3

A message that is not in the archive (sent off-list or not yet received): 1406557588-22484-1-git-send-email-chaowang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

#2 lore raw
Quoted 16 lines · WANG Chao

In case of raw disk/partition, ex. /dev/vda1, which doesn't contain any filesystem on it. get_persistent_dev() would return empty. Now fix it to return its original name, /dev/vda1 in above case. So that we don't have to check its return string every time.

---
 dracut-functions.sh | 1 +
 1 file changed, 1 insertion(+)
dracut-functions.sh +0 -0
index 6cdfea0..b07063f 100755

dracut-functions.sh get_persistent_dev() { · line 394

Quoted 7 lines
dracut-functions.sh +1 -0
@@ -388,6 +388,7 @@ get_persistent_dev() {
             return
         fi
     done
+    echo $1
 }
 
 expand_persistent_dev() {

pushed, but added a patch to use printf instead of echo