try to fix upgrade mode - run vgscan --mknodes
[bootmanager.git] / source / steps / InstallBootstrapFS.py
index 24ea4bf..7449b2c 100644 (file)
@@ -15,6 +15,7 @@ import time
 
 from Exceptions import *
 import utils
+import systeminfo
 import BootServerRequest
 import BootAPI
 
@@ -78,6 +79,22 @@ def Run(vars, upgrade, log):
 
     bs_request = BootServerRequest.BootServerRequest(vars)
     
+    # in upgrade mode, since we skip InstallPartitionDisks
+    # we need to run this
+    if upgrade:
+        log.write("Upgrade mode init : Scanning for devices\n")
+        systeminfo.get_block_devices_dict(vars, log)
+        utils.sysexec_noerr("vgscan --mknodes", log)
+
+    # debugging info - show in either mode
+    log.write("In InstallBootstrapFS : DEVICES status BEG\n")
+    utils.sysexec_noerr("vgdisplay", log)
+    utils.sysexec_noerr("pvdisplay", log)
+    for name, path in PARTITIONS.items():
+        log.write("PARTITIONS[{}]={}\n".format(name,path))
+        utils.sysexec_noerr("ls -l {}".format(path), log)
+    log.write("In InstallBootstrapFS : DEVICES status END\n")
+
     log.write("turning on swap space\n")
     utils.sysexec("swapon {}".format(PARTITIONS["swap"]), log)
 
@@ -238,10 +255,12 @@ def Run(vars, upgrade, log):
 def CleanupSysimgBeforeUpgrade(sysimg, target_nodefamily, log):
 
     areas_to_cleanup = [
-        '/usr/lib',
+        '/boot',
+        '/usr',
         '/var',
         '/etc',
-        '/boot',
+        '/run',
+        '/vsys',
     ]
 
     target_pldistro, target_fcdistro, target_arch = target_nodefamily.split('-')