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

[PATCH 3/4] Write dracut rd_NO_foo options to grub.conf



When we don't specify any MD / LVM / DM / LUKS to activate dracut will
activate all found by default, so when we don't specify any write
RD_NO_foo to the kernel cmdline in grub.
---
 booty/bootloaderInfo.py |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py
index 6e6d403..3d77254 100644
--- a/booty/bootloaderInfo.py
+++ b/booty/bootloaderInfo.py
@@ -88,16 +88,27 @@ class KernelArguments:
 
     def getDracutStorageArgs(self):
         args = []
+        types = {}
         root = self.id.storage.rootDevice
         for d in self.id.storage.devices:
             if not root.dependsOn(d):
                 continue
 
-            args.append(d.dracutSetupString())
+            s = d.dracutSetupString()
+            types[s.split("=")[0]] = True
+            args.append(s)
+
             import storage
             if isinstance(d, storage.devices.NetworkStorageDevice):
                 args.append(self.id.network.dracutSetupString(d))
 
+        for i in [ [ "rd_LUKS_UUID", "rd_NO_LUKS" ],
+                   [ "rd_LVM_VG", "rd_NO_LVM" ],
+                   [ "rd_MD_UUID", "rd_NO_MD" ],
+                   [ "rd_DM_UUID", "rd_NO_DM" ] ]:
+            if not types.has_key(i[0]):
+                args.append(i[1])
+
         return args
 
     def get(self):
-- 
1.6.5.2


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