[PATCH 1/2] Make root= line in grub.conf and path spec in fstab consistent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



booty was using its own code to find out wether to pass in
UUID=.... or /dev/.... as root= option, leading to inconsistencies
between fstab (/dev/mapper/Volgroup-lv_root) and grub.conf (UUID=...)

Harmless, but confusing. This patch fixes this by removing the no longer
needed getRootDevName method from booty and instead using device.fstabSpec
---
 booty/alpha.py          |    2 +-
 booty/bootloaderInfo.py |   16 +---------------
 booty/ppc.py            |    2 +-
 booty/s390.py           |    2 +-
 booty/sparc.py          |    2 +-
 booty/x86.py            |    3 +--
 6 files changed, 6 insertions(+), 21 deletions(-)

diff --git a/booty/alpha.py b/booty/alpha.py
index ca71556..461086c 100644
--- a/booty/alpha.py
+++ b/booty/alpha.py
@@ -86,7 +86,7 @@ class alphaBootloaderInfo(bootloaderInfo):
             if os.path.isfile(instRoot + initrd):
                 f.write(" initrd=%sinitrd%s.img" %(kernelPath, kernelTag))
 
-            realroot = getRootDevName(instRoot+initrd, rootDevice)
+            realroot = rootDevice.fstabSpec
             f.write(" root=%s" %(realroot,))
 
             args = self.args.get()
diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py
index 8419645..ff9592e 100644
--- a/booty/bootloaderInfo.py
+++ b/booty/bootloaderInfo.py
@@ -82,20 +82,6 @@ def rootIsDevice(dev):
         return False
     return True
 
-# hackery to determine if we should do root=LABEL=/ or whatnot
-# as usual, knows too much about anaconda
-def getRootDevName(initrd, rootDevice):
-    if not os.access(initrd, os.R_OK):
-        return rootDevice.path
-
-    try:
-        if rootDevice.format.uuid:
-            return "UUID=%s" % rootDevice.format.uuid
-    except:
-        pass
-
-    return rootDevice.path
-
 class KernelArguments:
 
     def get(self):
@@ -359,7 +345,7 @@ class bootloaderInfo:
             sl.addEntry("read-only")
 
             append = "%s" %(self.args.get(),)
-            realroot = getRootDevName(instRoot+initrd, rootDev)
+            realroot = rootDev.fstabSpec
             if rootIsDevice(realroot):
                 sl.addEntry("root", rootDev.path)
             else:
diff --git a/booty/ppc.py b/booty/ppc.py
index 7ac9299..706f198 100644
--- a/booty/ppc.py
+++ b/booty/ppc.py
@@ -121,7 +121,7 @@ class ppcBootloaderInfo(bootloaderInfo):
 
             append = "%s" %(self.args.get(),)
 
-            realroot = getRootDevName(instRoot+initrd, rootDev)
+            realroot = rootDev.fstabSpec
             if rootIsDevice(realroot):
                 f.write("\troot=%s\n" %(realroot,))
             else:
diff --git a/booty/s390.py b/booty/s390.py
index 8cddb05..575ab28 100644
--- a/booty/s390.py
+++ b/booty/s390.py
@@ -144,7 +144,7 @@ class s390BootloaderInfo(bootloaderInfo):
             if os.access (instRoot + initrd, os.R_OK):
                 f.write('\tramdisk=%sinitrd%s.img\n' %(self.kernelLocation,
                                                      kernelTag))
-            realroot = getRootDevName(instRoot+initrd, rootDev)
+            realroot = rootDev.fstabSpec
             f.write('\tparameters="root=%s' %(realroot,))
             if bl.args.get():
                 f.write(' %s' % (bl.args.get()))
diff --git a/booty/sparc.py b/booty/sparc.py
index 4ea2cea..b094a45 100644
--- a/booty/sparc.py
+++ b/booty/sparc.py
@@ -62,7 +62,7 @@ class sparcBootloaderInfo(bootloaderInfo):
 
             append = "%s" % (self.args.get(),)
 
-            realroot = getRootDevName(instRoot+initrd, rootDev)
+            realroot = rootDev.fstabSpec
             if rootIsDevice(realroot):
                 f.write("\troot=%s\n" % (realroot,))
             else:
diff --git a/booty/x86.py b/booty/x86.py
index 221186a..d710fbb 100644
--- a/booty/x86.py
+++ b/booty/x86.py
@@ -237,8 +237,7 @@ class x86BootloaderInfo(efiBootloaderInfo):
             f.write('title %s (%s)\n' % (longlabel, version))
             f.write('\troot %s\n' % self.grubbyPartitionName(bootDevs[0]))
 
-            realroot = getRootDevName(instRoot+initrd, rootDev)
-            realroot = " root=%s" %(realroot,)
+            realroot = " root=%s" % rootDev.fstabSpec
 
             if version.endswith("xen0") or (version.endswith("xen") and not os.path.exists("/proc/xen")):
                 # hypervisor case
-- 
1.6.1.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux