[PATCH 2/2] Do not add DASD default options to rd_DASD option (#606783)

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

 



Only include option values in the rd_DASD parameter if the user has
changed the value.  This should reduce the amount of data written to
zipl.conf by a reasonable amount, which should keep most use cases from
exceeding the boot parameter length limit.
---
 storage/devices.py    |    5 ++++-
 storage/devicetree.py |    2 ++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 0f6e892..fac0452 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -3555,6 +3555,7 @@ class DASDDevice(DiskDevice):
     def __init__(self, device, **kwargs):
         self.busid = kwargs.pop('busid')
         self.opts = kwargs.pop('opts')
+        self.origopts = kwargs.pop('origopts')
         self.dasd = kwargs.pop('dasd')
         DiskDevice.__init__(self, device, **kwargs)
 
@@ -3562,7 +3563,9 @@ class DASDDevice(DiskDevice):
             self.dasd.addDASD(self)
 
     def getOpts(self):
-        return map(lambda (k, v): "%s=%s" % (k, v,), self.opts.items())
+        return map(lambda (k, v): "%s=%s" % (k, v,),
+                   filter(lambda (k, v): v != self.origopts[k],
+                          self.opts.items())
 
     def dracutSetupString(self):
         args = ["rd_DASD=%s" % (self.busid,)] + self.getOpts()
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 6a167e9..7228768 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1191,9 +1191,11 @@ class DeviceTree(object):
             kwargs["dasd"] = self.dasd
             kwargs["busid"] = udev_device_get_dasd_bus_id(info)
             kwargs["opts"] = {}
+            kwargs["origopts"] = {}
 
             for attr in ['readonly', 'use_diag', 'erplog', 'failfast']:
                 kwargs["opts"][attr] = udev_device_get_dasd_flag(info, attr)
+                kwargs["origopts"][attr] = udev_device_get_dasd_flag(info, attr)
 
             log.debug("%s is a dasd device" % name)
         elif udev_device_is_zfcp(info):
-- 
1.7.0.1

_______________________________________________
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