From f0ecbc053f42525d2047aea4790e7f126d179685 Mon Sep 17 00:00:00 2001 From: Jiri Srain Date: Fri, 27 Oct 2017 13:35:08 +0200 Subject: [PATCH 1/3] Limit maximal proposed size of EFI partition (bsc#1062775) --- package/yast2-storage-ng.changes | 6 ++++++ package/yast2-storage-ng.spec | 2 +- src/lib/y2storage/boot_requirements_strategies/uefi.rb | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package/yast2-storage-ng.changes b/package/yast2-storage-ng.changes index 6e0fd7d1c5..238e013867 100644 --- a/package/yast2-storage-ng.changes +++ b/package/yast2-storage-ng.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Oct 27 11:33:55 UTC 2017 - jsrain@suse.cz + +- Limit maximal proposed size of EFI partition (bsc#1062775) +- 4.0.12 + ------------------------------------------------------------------- Wed Oct 25 13:12:37 UTC 2017 - igonzalezsosa@suse.com diff --git a/package/yast2-storage-ng.spec b/package/yast2-storage-ng.spec index 7d319c7b96..ef8f69c770 100644 --- a/package/yast2-storage-ng.spec +++ b/package/yast2-storage-ng.spec @@ -16,7 +16,7 @@ # Name: yast2-storage-ng -Version: 4.0.11 +Version: 4.0.12 Release: 0 BuildArch: noarch diff --git a/src/lib/y2storage/boot_requirements_strategies/uefi.rb b/src/lib/y2storage/boot_requirements_strategies/uefi.rb index 146caf7f07..f3af3743be 100644 --- a/src/lib/y2storage/boot_requirements_strategies/uefi.rb +++ b/src/lib/y2storage/boot_requirements_strategies/uefi.rb @@ -39,6 +39,7 @@ def needed_partitions(target) MIN_SIZE = DiskSize.MiB(33).freeze DESIRED_SIZE = DiskSize.MiB(500).freeze + MAX_SIZE = DiskSize.MiB(500).freeze def efi_missing? free_mountpoint?("/boot/efi") @@ -51,7 +52,7 @@ def efi_partition(target) else vol.partition_id = PartitionId::ESP vol.min_size = target == :min ? MIN_SIZE : DESIRED_SIZE - vol.max_size = DiskSize.unlimited + vol.max_size = MAX_SIZE vol.max_start_offset = DiskSize.TiB(2) end vol From e689ededde9dc54a2f8950472d1697d35f2b30b5 Mon Sep 17 00:00:00 2001 From: Jiri Srain Date: Fri, 27 Oct 2017 14:26:01 +0200 Subject: [PATCH 2/3] Updated test --- test/support/proposed_partitions_examples.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/support/proposed_partitions_examples.rb b/test/support/proposed_partitions_examples.rb index a89361ffcc..2de34ef7bc 100644 --- a/test/support/proposed_partitions_examples.rb +++ b/test/support/proposed_partitions_examples.rb @@ -104,6 +104,7 @@ it "requires /boot/efi to be at least 500 MiB large" do expect(efi_part.min_size).to eq 500.MiB + expect(efi_part.max_size).to eq 500.MiB end end @@ -112,6 +113,7 @@ it "requires /boot/efi to be at least 33 MiB large" do expect(efi_part.min_size).to eq 33.MiB + expect(efi_part.max_size).to eq 500.MiB end end end From bbf0a781a7488e025790add308d6578fb074f2a5 Mon Sep 17 00:00:00 2001 From: Jiri Srain Date: Fri, 27 Oct 2017 15:21:47 +0200 Subject: [PATCH 3/3] Fixed tests description --- test/support/proposed_partitions_examples.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/support/proposed_partitions_examples.rb b/test/support/proposed_partitions_examples.rb index 2de34ef7bc..e380bbf337 100644 --- a/test/support/proposed_partitions_examples.rb +++ b/test/support/proposed_partitions_examples.rb @@ -102,7 +102,7 @@ context "when aiming for the recommended size" do let(:target) { :desired } - it "requires /boot/efi to be at least 500 MiB large" do + it "requires /boot/efi to be exactly 500 MiB large" do expect(efi_part.min_size).to eq 500.MiB expect(efi_part.max_size).to eq 500.MiB end @@ -111,7 +111,7 @@ context "when aiming for the minimal size" do let(:target) { :min } - it "requires /boot/efi to be at least 33 MiB large" do + it "requires /boot/efi to be between 33 MiB and 500 MiB large" do expect(efi_part.min_size).to eq 33.MiB expect(efi_part.max_size).to eq 500.MiB end