Re: [PATCH 3/3] Improve message given to user for fsck failures (#527626).

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

 



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

On Mon, 19 Oct 2009, Chris Lumens wrote:

@@ -486,8 +490,30 @@ class FS(DeviceFormat):
             if w:
                 w.pop()

-        if rc >= 4:
-            raise FSError("filesystem check failed: %s" % rc)
+        if self._fsckFailed(rc):
+            hdr = _("%(type)s filesystem check failure on %(device)s: ") % \
+                   (self.type, self.device,)
+
+            if rc in self._fsckErrors.keys():
+                msg = self._fsckErrors[rc]
+            else:
+                msg = _("Unknown return code: %d.") % (rc,)
+
+            if intf:
+                help = _("Errors like this usually mean there is a problem "
+                         "with the filesystem that will require user "
+                         "interaction to repair.  Before restarting "
+                         "installation, reboot to rescue mode or another "
+                         "system that allows you to repair the filesystem "
+                         "interactively.  Restart installation after you "
+                         "have correct the problems on the filesystem.")
+
+                self.intf.messageWindow(_("Unrecoverable Error"),
+                                        hdr + "\n\n" + msg + "\n\n" + help,
+                                        custom_icon='error')
+                sys.exit(0)
+            else:
+                raise FSError(hdr + msg)

     def loadModule(self):
         """Load whatever kernel module is required to support this filesystem."""

You may need to be a little fancier than this:  at least according to
"man resize2fs", the error codes are OR'ed together, so I guess it's
possible several could happen at the same time.

You mean e2fsck.  I changed things up a bit so there's now a method called
_fsckErrorMessage() which by default returns:

    _("Unknown return code: %d.") % (rc,)

In Ext2FS, I override it with a method that builds a string containing all
possible errors that have been set.

Thanks,

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

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

iEYEARECAAYFAkrdBLMACgkQ5hsjjIy1VkmBtACePz+6t8jW7fh0rSapJM8ZuERh
DlkAn3mKr65EtcTIsy6xjJnY4FgMrIIL
=BLHc
-----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