Commits

Moises Henriquez committed 0931d39

Verify initrd path reported by os-prober and make sure it is not a dir before we try to use it

Comments (0)

Files changed (1)

vinstall/backend/bootloader.py

                         operating_system.kernel = "/boot/vmlinuz"
                     else:
                         operating_system.kernel = bootinfo["kernel"]
+                # Check the initrd
+                if bootinfo["initrd"]:
+                    rdpath = mpoint + bootinfo["initrd"]
+                    if os.path.exists(rdpath) and not os.path.isdir(rdpath):
+                        operating_system.initrd = bootinfo["initrd"]
+                    else:
+                        operating_system.initrd = None
+                        rds = ("boot/initrd","boot/initrd.gz")
+                        for rd in rds:
+                            if os.path.exists(os.path.join(mpoint, rd)) and \
+                               not os.path.isdir(os.path.join(mpoint, rd)):
+                                operating_system.initrd = os.path.join("/",rd)
+                                break
 
                 if needs_umount:
                     host_part.umount()