diff --git a/package/yast2-storage-ng.changes b/package/yast2-storage-ng.changes index 18a4f44ab6..82fd15947c 100644 --- a/package/yast2-storage-ng.changes +++ b/package/yast2-storage-ng.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri May 10 14:59:50 UTC 2019 - ancor@suse.com + +- AutoYaST: do not ask for a reusable filesystem when it's not + really needed (bsc#1134330). +- 4.1.84 + ------------------------------------------------------------------- Mon Apr 15 15:46:04 UTC 2019 - ancor@suse.com diff --git a/package/yast2-storage-ng.spec b/package/yast2-storage-ng.spec index 201c4fdd0e..a36d014e19 100644 --- a/package/yast2-storage-ng.spec +++ b/package/yast2-storage-ng.spec @@ -16,7 +16,7 @@ # Name: yast2-storage-ng -Version: 4.1.83 +Version: 4.1.84 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/src/lib/y2storage/proposal/autoinst_drive_planner.rb b/src/lib/y2storage/proposal/autoinst_drive_planner.rb index e582b4fbd9..fa963a1b90 100644 --- a/src/lib/y2storage/proposal/autoinst_drive_planner.rb +++ b/src/lib/y2storage/proposal/autoinst_drive_planner.rb @@ -181,6 +181,10 @@ def add_device_reuse(planned_device, device, section) # @param section [AutoinstProfile::PartitionSection] AutoYaST specification def check_reusable_filesystem(planned_device, device, section) return if planned_device.reformat || device.filesystem || planned_device.component? + # The device to be reused doesn't have filesystem... but maybe it's not + # really needed, e.g. reusing a bios_boot partition (bsc#1134330) + return if planned_device.mount_point.nil? && planned_device.filesystem_type.nil? + issues_list.add(:missing_reusable_filesystem, section) end @@ -216,9 +220,6 @@ def add_partition_reuse(partition, section) return unless partition_to_reuse partition.filesystem_type ||= partition_to_reuse.filesystem_type add_device_reuse(partition, partition_to_reuse, section) - if !partition.reformat && !partition_to_reuse.filesystem && !partition.component? - issues_list.add(:missing_reusable_filesystem, section) - end end # @param partition [Planned::Partition] Planned partition diff --git a/test/y2storage/proposal/autoinst_disk_device_planner_test.rb b/test/y2storage/proposal/autoinst_disk_device_planner_test.rb index e024ecbf72..fcdff03b13 100644 --- a/test/y2storage/proposal/autoinst_disk_device_planner_test.rb +++ b/test/y2storage/proposal/autoinst_disk_device_planner_test.rb @@ -384,6 +384,33 @@ end end + # Regression test for bsc#1134330: when a bios_boot partition (which + # contains no filesystem by definition) is specified to be reused, a bogus + # MissingReusableFilesystem issue is registered + context "when the partition is not formatted and should be reused as-is" do + let(:scenario) { "autoyast_drive_examples" } + + let(:disk_spec) do + { "device" => "/dev/sdh", "partitions" => [grub_spec] } + end + + let(:grub_spec) do + { "create" => false, "format" => false, "partition_nr" => 2 } + end + + it "reuses the partition" do + disk = planner.planned_devices(drive).first + grub = disk.partitions.first + expect(grub.reuse_name).to eq("/dev/sdh2") + end + + it "does not register any issue" do + expect(issues_list).to be_empty + planner.planned_devices(drive) + expect(issues_list).to be_empty + end + end + context "when no partition number or label is specified" do let(:root_spec) do { "create" => false, "mount" => "/", "filesystem" => :btrfs }