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

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 29 Oct 2009, Hans de Goede wrote:

Hi,

1st patch looks good, about this one:

On 10/29/2009 04:12 AM, David Cantrell wrote:
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)
+

Shouldn't this be a simple "return", you are now terminating the installer, if this is really fatal, so exiting is the right thing to do, then the log message
needs to be changed.

You're right, the messages should indicate we're exiting the installer.  I'll
change that.


          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)


While at it you also have me wondering about this, is having unformatted DASD's fatal? If not shouldn't we simply ignore them when the user does not want to format
them ?


No, and I see Steffen already brought it up.  The devices visible to anaconda
are configurable by the user in stage 1, so we really shouldn't have to skip
devices once we're running anaconda on s390.  If something should be skipped,
it should have been masked out in stage 1.  It's just another way to do what
we already offer from stage 1.

- -- David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkrp9XMACgkQ5hsjjIy1VknJvACcC/ydcKv5tpB0eXd8soVAFzwz
BroAoLQZoDHcwC3Wtgp/Q3SnsB0/3bKW
=qYu6
-----END PGP SIGNATURE-----

_______________________________________________
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