Blob Blame History Raw
From 426b68b20ada687327d464c3822c8e84e43e5672 Mon Sep 17 00:00:00 2001
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Tue, 20 Dec 2011 14:09:58 +0800
Subject: [PATCH] Fix get_maj_min() to follow symlink

Otherwise get_maj_min /dev/mapper/vg_cr0-lv_home will return 0:0.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 dracut-functions |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dracut-functions b/dracut-functions
index 2f9e713..a77a002 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -180,7 +180,7 @@ get_fs_uuid() (
 
 get_maj_min() {
     local _dev
-    _dev=$(stat -c '$((0x%T)):$((0x%t))' "$1" 2>/dev/null)
+    _dev=$(stat -L -c '$((0x%T)):$((0x%t))' "$1" 2>/dev/null)
     _dev=$(eval "echo $_dev")
     echo $_dev
 }