Merge pull request #1326 from dbungert/boot-plan-no-pgs
boot: handle small disk case
This commit is contained in:
commit
1bf5ddcf0a
|
@ -154,6 +154,7 @@ def get_boot_device_plan_bios(device) -> Optional[MakeBootDevicePlan]:
|
|||
if device.ptable == 'msdos':
|
||||
return attr_plan
|
||||
pgs = gaps.parts_and_gaps(device)
|
||||
if len(pgs) > 0:
|
||||
if isinstance(pgs[0], Partition) and pgs[0].flag == "bios_grub":
|
||||
return attr_plan
|
||||
|
||||
|
|
|
@ -457,6 +457,14 @@ class TestFilesystemManipulator(unittest.TestCase):
|
|||
preserve=True)
|
||||
self.assertFalse(boot.can_be_boot_device(disk))
|
||||
|
||||
@parameterized.expand([(1,), (2,)])
|
||||
def test_no_add_boot_BIOS_gpt_teeny_disk(self, version):
|
||||
# Showed up in VM testing - the ISO created cloud-localds shows up as a
|
||||
# potential install target, and weird things happen.
|
||||
manipulator = make_manipulator(Bootloader.BIOS, version)
|
||||
disk = make_disk(manipulator.model, ptable='gpt', size=1 << 20)
|
||||
self.assertFalse(boot.can_be_boot_device(disk))
|
||||
|
||||
@parameterized.expand([(1,), (2,)])
|
||||
def test_add_boot_BIOS_msdos(self, version):
|
||||
manipulator = make_manipulator(Bootloader.BIOS, version)
|
||||
|
|
Loading…
Reference in New Issue