[PATCH 2/2] Use 'zerombr' kickstart command for DASDs needing dasdfmt (#528386).

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

 



If performing a kickstart install on s390, dasdfmt is only run if:
a) There is a UI available to prompt the user.
b) 'zerombr' is specified in the kickstart file.

The zerombr command will also skip the UI if there is one.  The UI
prompt is a fallback.
---
 storage/__init__.py |    2 +-
 storage/dasd.py     |   25 ++++++++++++++++++-------
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index e1569c8..a3a403c 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -322,7 +322,7 @@ class Storage(object):
         self.iscsi.startup(self.anaconda.intf)
         self.fcoe.startup(self.anaconda.intf)
         self.zfcp.startup()
-        self.dasd.startup(self.anaconda.intf)
+        self.dasd.startup(intf=self.anaconda.intf, zeroMbr=self.zeroMbr)
         if self.anaconda.id.getUpgrade():
             clearPartType = CLEARPART_TYPE_NONE
         else:
diff --git a/storage/dasd.py b/storage/dasd.py
index 7217a36..94e31df 100644
--- a/storage/dasd.py
+++ b/storage/dasd.py
@@ -48,7 +48,7 @@ class DASD:
         self._maxFormatJobs = 0
         self.started = False
 
-    def startup(self, intf=None):
+    def startup(self, *args, **kwargs):
         """ Look for any unformatted DASDs in the system and offer the user
             the option for format them with dasdfmt or exit the installer.
         """
@@ -60,6 +60,9 @@ class DASD:
         if not iutil.isS390():
             return
 
+        intf = kwargs.get("intf")
+        zeroMbr = kwargs.get("zeroMbr")
+
         log.info("Checking for unformatted DASD devices:")
 
         for device in os.listdir("/sys/block"):
@@ -82,12 +85,20 @@ class DASD:
             log.info("    no unformatted DASD devices found")
             return
 
+        askUser = True
+
+        if zeroMbr:
+            askUser = False
+        elif not intf and not zeroMbr:
+            log.info("    non-interactive kickstart install without zerombr "
+                     "command skipping dasdfmt")
+            sys.exit(0)
+
         tmplist = map(lambda s: "/dev/" + s, self._dasdlist)
         self._dasdlist = map(lambda s: deviceNameToDiskByPath(s), tmplist)
+        c = len(self._dasdlist)
 
-        if intf:
-            c = len(self._dasdlist)
-
+        if intf and askUser:
             title = P_("Unformatted DASD Device Found",
                        "Unformatted DASD Devices Found", c)
             msg = P_("Format uninitialized DASD device?\n\n"
@@ -109,9 +120,9 @@ class DASD:
             icon = "/usr/share/icons/gnome/32x32/status/dialog-error.png"
             buttons = [_("_Format"), _("_Exit installer")]
             rc = intf.detailedMessageWindow(title, msg, devs.strip(),
-                                            type="custom",
-                                            custom_icon=icon,
-                                            custom_buttons=buttons)
+                                                 type="custom",
+                                                 custom_icon=icon,
+                                                 custom_buttons=buttons)
             if rc == 1:
                 sys.exit(0)
 
-- 
1.6.2.5

_______________________________________________
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