add back a bit of v1 compatibility
This commit is contained in:
parent
dd25528712
commit
c313274566
|
@ -181,6 +181,8 @@ def get_boot_device_plan_bios(device) -> Optional[MakeBootDevicePlan]:
|
|||
else:
|
||||
return None
|
||||
elif pg.preserve:
|
||||
if device._m.storage_version == 1:
|
||||
return None
|
||||
break
|
||||
else:
|
||||
movable.append(pg)
|
||||
|
|
|
@ -383,7 +383,16 @@ class TestFilesystemManipulator(unittest.TestCase):
|
|||
manipulator.add_boot_disk(disk)
|
||||
self.assertIsBootDisk(manipulator, disk)
|
||||
|
||||
def test_add_boot_BIOS_preserved(self):
|
||||
def test_no_add_boot_BIOS_preserved_v1(self):
|
||||
manipulator = make_manipulator(Bootloader.BIOS, 1)
|
||||
disk = make_disk(manipulator.model, preserve=True)
|
||||
half_size = gaps.largest_gap_size(disk)//2
|
||||
make_partition(
|
||||
manipulator.model, disk, size=half_size, offset=half_size,
|
||||
preserve=True)
|
||||
self.assertFalse(boot.can_be_boot_device(disk))
|
||||
|
||||
def test_add_boot_BIOS_preserved_v2(self):
|
||||
manipulator = make_manipulator(Bootloader.BIOS, 2)
|
||||
disk = make_disk(manipulator.model, preserve=True)
|
||||
half_size = gaps.largest_gap_size(disk)//2
|
||||
|
@ -400,7 +409,19 @@ class TestFilesystemManipulator(unittest.TestCase):
|
|||
manipulator.add_boot_disk(disk)
|
||||
self.assertIsBootDisk(manipulator, disk)
|
||||
|
||||
def test_add_boot_BIOS_new_and_preserved(self):
|
||||
def test_no_add_boot_BIOS_new_and_preserved_v1(self):
|
||||
manipulator = make_manipulator(Bootloader.BIOS, 1)
|
||||
# 2002MiB so that the space available for partitioning (2000MiB)
|
||||
# divided by 4 is an whole number of megabytes.
|
||||
disk = make_disk(manipulator.model, preserve=True, size=2002*MiB)
|
||||
avail = gaps.largest_gap_size(disk)
|
||||
make_partition(
|
||||
manipulator.model, disk, size=avail//4)
|
||||
make_partition(
|
||||
manipulator.model, disk, size=3*avail//4, preserve=True)
|
||||
self.assertFalse(boot.can_be_boot_device(disk))
|
||||
|
||||
def test_add_boot_BIOS_new_and_preserved_v2(self):
|
||||
manipulator = make_manipulator(Bootloader.BIOS, 2)
|
||||
# 2002MiB so that the space available for partitioning (2000MiB)
|
||||
# divided by 4 is an whole number of megabytes.
|
||||
|
|
Loading…
Reference in New Issue