Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit maximal proposed size of EFI partition (bsc#1062775) #399

Merged
merged 5 commits into from
Oct 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions package/yast2-storage-ng.changes
Original file line number Diff line number Diff line change
@@ -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.13

-------------------------------------------------------------------
Thu Oct 26 15:30:53 UTC 2017 - ancor@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-storage-ng.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-storage-ng
Version: 4.0.12
Version: 4.0.13
Release: 0
BuildArch: noarch

Expand Down
3 changes: 2 additions & 1 deletion src/lib/y2storage/boot_requirements_strategies/uefi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions test/support/proposed_partitions_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,18 @@
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
end

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
end
end
Expand Down