Sophie

Sophie

distrib > Mandriva > 2010.0 > x86_64 > media > main-testing-src > by-pkgid > 73d4e64fc0a6e30c14426cc4c79b21e7 > files > 24

mkinitrd-6.0.93-6.3mnb2.src.rpm

From 3696467fb5d6d1fff1dc6e89348feafb12f4ad69 Mon Sep 17 00:00:00 2001
From: Luca Berra <bluca@vodka.it>
Date: Mon, 15 Jun 2009 16:53:02 +0200
Subject: [PATCH] Get correct module when rootfs is auto in fstab

Mandriva bug #30873
---
 mkinitrd |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/mkinitrd b/mkinitrd
index 6ed8c24..8965725 100755
--- a/mkinitrd
+++ b/mkinitrd
@@ -1068,6 +1068,16 @@ if [ "x$PROBE" == "xyes" ]; then
     [ -z "$rootopts" ] && rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' $fstab)
     [ -z "$rootopts" ] && rootopts="defaults"
 
+    if [ "$rootfs" = "auto" ]; then
+	rootfs=`blkid -s TYPE $rootdev`
+	rootfs=${rootfs##*TYPE=\"}
+	rootfs=${rootfs%%\"*}
+    fi
+    if [ -z "$rootfs" ]; then
+	echo "Cannot determine root filesystem type from fstab" 1>&2
+	exit 1
+    fi
+
     # in case the root filesystem is modular
     findmodule -${rootfs}
 
-- 
1.6.4.4