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

[PATCH] run convertfs on upgrade (#787893)



From: "Brian C. Lane" <bcl redhat com>

When upgradig to F17 the dracut convertfs script needs to be
run on the target filesystem so that it can convert /bin, /sbin,
/lib and /lib64 to symlinks into /usr
---
 pyanaconda/dispatch.py |    3 ++-
 pyanaconda/upgrade.py  |   26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/dispatch.py b/pyanaconda/dispatch.py
index 85e66b0..36ca40a 100644
--- a/pyanaconda/dispatch.py
+++ b/pyanaconda/dispatch.py
@@ -40,7 +40,7 @@ from flags import flags
 from upgrade import upgradeMountFilesystems
 from upgrade import restoreTime
 from upgrade import upgradeMigrateFind
-from upgrade import findRootParts, queryUpgradeContinue
+from upgrade import findRootParts, queryUpgradeContinue, upgradeUsr
 from installmethod import doMethodComplete
 from kickstart import doKickstart, runPostScripts
 from sshd import doSshd
@@ -274,6 +274,7 @@ class Dispatcher(object):
         self.add_step("upgradecontinue", queryUpgradeContinue)
         self.add_step("upgrademigfind", upgradeMigrateFind)
         self.add_step("upgrademigratefs")
+        self.add_step("upgradeusr", upgradeUsr)
         self.add_step("storagedone", storageComplete)
         self.add_step("enablefilesystems", turnOnFilesystems)
         self.add_step("upgbootloader")
diff --git a/pyanaconda/upgrade.py b/pyanaconda/upgrade.py
index 5d9fe4f..95b8cd7 100644
--- a/pyanaconda/upgrade.py
+++ b/pyanaconda/upgrade.py
@@ -256,6 +256,31 @@ def upgradeMountFilesystems(anaconda):
     except Exception as e:
         log.warning("error checking selinux state: %s" %(e,))
 
+def upgradeUsr(anaconda):
+    """
+    Handle the upgrade of /bin, /sbin, /lib, /lib64 to symlinks into /usr/
+    This uses dracut's convertfs module
+    """
+    dirs = ["/bin", "/sbin", "/lib", "/lib64"]
+    dirs = [ROOT_PATH+d for d in dirs]
+    if False not in map(os.path.islink, dirs):
+        log.info("upgradeusr dirs are already symlinks")
+        return
+
+    # run /run/initramfs/usr/bin/convertfs  <path_to_sysroot>
+    if iutil.execWithRedirect("/usr/lib/dracut/modules.d/30convertfs/convertfs.sh",
+                              [ROOT_PATH],
+                              stdout="/dev/tty5", stderr="/dev/tty5"):
+        log.error("convertfs failed")
+
+        rc = anaconda.intf.messageWindow(_("/usr upgrade failed"),
+                           _("convertfs failed to upgrade your system to symlink "
+                             "into /usr. This is required for Fedora 17 to work."
+                             " The upgrade cannot continue."
+                             "\n\n"))
+        sys.exit(0)
+    log.info("convertfs was successful")
+
 def setSteps(anaconda):
     dispatch = anaconda.dispatch
     dispatch.reset_scheduling() # scrap what is scheduled
@@ -278,6 +303,7 @@ def setSteps(anaconda):
                 "upgrademigratefs",
                 "enablefilesystems",
                 "upgradecontinue",
+                "upgradeusr",
                 "reposetup",
                 "upgbootloader",
                 "postselection",
-- 
1.7.6.5


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