1. VectorLinux Core
  2. vinstall

Commits

Moises Henriquez  committed b87ff40

Fix #26 at VLCore/vinstall. Fix #25 at VLCore/Vinstall by checking for /boot/vmlinuz on foreign linux installs before assuming what linux-boot-prober reports

  • Participants
  • Parent commits be4da56
  • Branches master

Comments (0)

Files changed (2)

File vinstall/backend/bootloader.py

View file
 
     @property 
     def tamu_kernel_path(self):
-	return os.path.join("/boot/tamu/", "%s-%s"% (self.kernel_name, self._short_root))
+	return os.path.join("/boot/tamu/", "vmlinuz-%s"%  self._short_root)
 
     @property
     def tamu_initrd_path(self):
                 bootinfo = get_linux_boot_info(root, bp_data)
                 if bootinfo is None:
                     continue
+                host_part = media.Partition(bootinfo["root"])
                 operating_system.root = bootinfo["root"] #XX or root ??
-                operating_system.kernel = bootinfo["kernel"]
+#                operating_system.kernel = bootinfo["kernel"]
+                mpoint = None
+                needs_umount = False
+
+                if not bootinfo["kernel"].strip().endswith("vmlinuz"):
+                    if host_part.is_mounted():
+                        mpoint= host_part.mountpoint
+                    else:
+                        mpoint = host_part.mount()
+                        needs_umount = True
+                    if os.path.exists(os.path.join(mpoint, "boot","vmlinuz")):
+                        operating_system.kernel = "/boot/vmlinuz"
+                    else:
+                        operating_system.kernel = bootinfo["kernel"]
+
+                if needs_umount:
+                    host_part.umount()                        
+                    
                 operating_system.initrd = bootinfo["initrd"]
                 #XX: The bootinfo["append"] reports invalid stuff that may cause LiLO to fail
                 #XX: Setting appendline to None until further notice.

File vinstall/backend/installmedia.py

View file
     def find(self):
         for partition in self.partitions:
             needs_umount = False
-            if not partition.is_mounted():
-                partition.mount(partition.mountpoint)
-                needs_umount = True
-            if is_install_media(partition.mountpoint):
-                config = parse_config(partition.mountpoint)
-                yield InstallMedia(partition, partition.mountpoint, config)
-            else:
-                isofinder = ISOInstallMediaFinder(partition)
-                for im in isofinder.find():
-                    yield im
-            if needs_umount:
-                partition.umount()
+            try:
+                if not partition.is_mounted():
+                    partition.mount(partition.mountpoint)
+                    needs_umount = True
+                if is_install_media(partition.mountpoint):
+                    config = parse_config(partition.mountpoint)
+                    yield InstallMedia(partition, partition.mountpoint, config)
+                else:
+                    isofinder = ISOInstallMediaFinder(partition)
+                    for im in isofinder.find():
+                        yield im
+                if needs_umount:
+                    partition.umount()
+            except:
+                LOG.debug("Could not check %s for install media"% partition.path())
+                return
 
 
 class ISOInstallMediaFinder(InstallMediaFinder):