summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Meadows <alan.meadows@gmail.com>2018-10-18 09:28:11 -0700
committerAlan Meadows <alan.meadows@gmail.com>2018-10-18 09:46:33 -0700
commitcdfb1737da21bbb097113a6aaeaae37117038781 (patch)
treecb756567d5ec59bdd5c29f8dce3b22e443c1c864
parent52ddfdcf4d1df54fdbc621d3ec411d8f85358406 (diff)
Bugfix Bios Grub Partition Behavior
MaaS 2.3.5 added bios grub partition changes that no longer cared for the size of the storage device nor whether it was a boot device. This patch effectively restores the original behavior which was also reintroduced in MaaS 2.4.0. Change-Id: I8b7b38fe42b005a656e6c5cab615c144b6a90b22
Notes
Notes (review): Code-Review+2: Kaspars Skels <kaspars.skels@gmail.com> Code-Review+2: Scott Hussey <sthussey@att.com> Workflow+1: Scott Hussey <sthussey@att.com> Code-Review+2: Craig Anderson <craig.anderson@att.com> Workflow+1: Craig Anderson <craig.anderson@att.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 18 Oct 2018 21:16:34 +0000 Reviewed-on: https://review.openstack.org/611675 Project: openstack/airship-maas Branch: refs/heads/master
-rw-r--r--images/maas-region-controller/2.3_bios_grub_partition.patch23
-rw-r--r--images/maas-region-controller/2.3_bios_grub_preseed.patch22
-rw-r--r--images/maas-region-controller/Dockerfile4
3 files changed, 49 insertions, 0 deletions
diff --git a/images/maas-region-controller/2.3_bios_grub_partition.patch b/images/maas-region-controller/2.3_bios_grub_partition.patch
new file mode 100644
index 0000000..854b0fa
--- /dev/null
+++ b/images/maas-region-controller/2.3_bios_grub_partition.patch
@@ -0,0 +1,23 @@
1--- partition.py 2018-10-18 09:04:40.300721829 -0700
2+++ partition2.py 2018-10-18 09:08:27.952565248 -0700
3@@ -179,6 +179,8 @@
4
5 def get_partition_number(self):
6 """Return the partition number in the table."""
7+ # Circular imports.
8+ from maasserver.models.partitiontable import GPT_REQUIRED_SIZE
9 # Sort manually instead of with `order_by`, this will prevent django
10 # from making a query if the partitions are already cached.
11 partitions_in_table = self.partition_table.partitions.all()
12@@ -196,7 +198,10 @@
13 block_device = self.partition_table.block_device
14 if (arch == "ppc64el" and block_device.id == boot_disk.id):
15 return idx + 2
16- elif arch == "amd64" and bios_boot_method != "uefi":
17+ elif (arch == "amd64" and
18+ self.partition_table.block_device.id == boot_disk.id and
19+ bios_boot_method != "uefi" and
20+ boot_disk.size >= GPT_REQUIRED_SIZE):
21 return idx + 2
22 else:
23 return idx + 1
diff --git a/images/maas-region-controller/2.3_bios_grub_preseed.patch b/images/maas-region-controller/2.3_bios_grub_preseed.patch
new file mode 100644
index 0000000..bbc9db9
--- /dev/null
+++ b/images/maas-region-controller/2.3_bios_grub_preseed.patch
@@ -0,0 +1,22 @@
1--- preseed_storage.py 2018-10-18 09:09:24.372519602 -0700
2+++ preseed_storage2.py 2018-10-18 09:10:30.112463704 -0700
3@@ -22,6 +22,7 @@
4 from maasserver.models.partition import Partition
5 from maasserver.models.partitiontable import (
6 BIOS_GRUB_PARTITION_SIZE,
7+ GPT_REQUIRED_SIZE,
8 INITIAL_PARTITION_OFFSET,
9 PARTITION_TABLE_EXTRA_SPACE,
10 PREP_PARTITION_SIZE,
11@@ -127,7 +128,10 @@
12 """Return True if block device requires the bios_grub partition."""
13 arch, _ = self.node.split_arch()
14 bios_boot_method = self.node.get_bios_boot_method()
15- return arch == "amd64" and bios_boot_method != "uefi"
16+ return (
17+ arch == "amd64" and
18+ bios_boot_method != "uefi" and
19+ block_device.size >= GPT_REQUIRED_SIZE)
20
21 def _add_partition_operations(self):
22 """Add all the partition operations.
diff --git a/images/maas-region-controller/Dockerfile b/images/maas-region-controller/Dockerfile
index e3174b2..e57b76f 100644
--- a/images/maas-region-controller/Dockerfile
+++ b/images/maas-region-controller/Dockerfile
@@ -57,9 +57,13 @@ RUN apt-get download maas-region-controller=$MAAS_VERSION && \
57COPY 2.3_proxy_port.patch /tmp/2.3_proxy_port.patch 57COPY 2.3_proxy_port.patch /tmp/2.3_proxy_port.patch
58COPY 2.3_route.patch /tmp/2.3_route.patch 58COPY 2.3_route.patch /tmp/2.3_route.patch
59COPY 2.3_kernel_package.patch /tmp/2.3_kernel_package.patch 59COPY 2.3_kernel_package.patch /tmp/2.3_kernel_package.patch
60COPY 2.3_bios_grub_partition.patch /tmp/2.3_bios_grub_partition.patch
61COPY 2.3_bios_grub_preseed.patch /tmp/2.3_bios_grub_preseed.patch
60RUN cd /usr/lib/python3/dist-packages/maasserver && patch compose_preseed.py < /tmp/2.3_proxy_port.patch 62RUN cd /usr/lib/python3/dist-packages/maasserver && patch compose_preseed.py < /tmp/2.3_proxy_port.patch
61RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch 63RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch
62RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed.py < /tmp/2.3_kernel_package.patch 64RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed.py < /tmp/2.3_kernel_package.patch
65RUN cd /usr/lib/python3/dist-packages/maasserver/models && patch partition.py < /tmp/2.3_bios_grub_partition.patch
66RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_storage.py < /tmp/2.3_bios_grub_preseed.patch
63 67
64COPY journalctl-to-tty.service /etc/systemd/system/journalctl-to-tty.service 68COPY journalctl-to-tty.service /etc/systemd/system/journalctl-to-tty.service
65RUN mkdir -p /etc/systemd/system/basic.target.wants ;\ 69RUN mkdir -p /etc/systemd/system/basic.target.wants ;\