diff --git a/src/lib/bootloader/stage1_proposal.rb b/src/lib/bootloader/stage1_proposal.rb index 0afa02357..eb99b663d 100644 --- a/src/lib/bootloader/stage1_proposal.rb +++ b/src/lib/bootloader/stage1_proposal.rb @@ -5,6 +5,7 @@ Yast.import "Storage" require "bootloader/stage1_device" +require "bootloader/udev_mapping" module Bootloader # Represents object that can set passed stage1 to proposed values. @@ -198,7 +199,9 @@ class PPC < Stage1Proposal def propose partition = proposed_prep_partition if partition - assign_bootloader_device([:custom, partition]) + # ensure that stage1 device is in udev (bsc#1041692) + udev_partition = UdevMapping.to_mountby_device(partition) + assign_bootloader_device([:custom, udev_partition]) stage1.activate = !on_gpt?(partition) # do not activate on gpt disks see (bnc#983194) stage1.generic_mbr = false diff --git a/test/stage1_test.rb b/test/stage1_test.rb index a0befc93c..4537679fb 100644 --- a/test/stage1_test.rb +++ b/test/stage1_test.rb @@ -100,6 +100,18 @@ expect(subject.devices).to eq(["/dev/sda1"]) end + it "sets udev link for device" do + expect(Yast::Storage).to receive(:GetPartition).with(anything, "/dev/sdc1") + .and_return("create" => true) + + expect(Bootloader::UdevMapping).to receive(:to_mountby_device).with("/dev/sdc1") + .and_return("/dev/disk/by-id/partition1") + + subject.propose + + expect(subject.devices).to eq(["/dev/disk/by-id/partition1"]) + end + it "activate partition if it is on DOS partition table" do expect(Yast::Storage).to receive(:GetDisk).with(anything, "/dev/sdb1") .and_return("label" => "dos")