diff --git a/package/yast2-bootloader.changes b/package/yast2-bootloader.changes index 0e106b42c..6db2c5e12 100644 --- a/package/yast2-bootloader.changes +++ b/package/yast2-bootloader.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Nov 28 10:22:57 UTC 2017 - jreidinger@suse.com + +- Do not propose boot from partition for md raids (bsc#1063957) +- 4.0.6 + ------------------------------------------------------------------- Tue Nov 21 13:14:50 UTC 2017 - gsouza@suse.com diff --git a/package/yast2-bootloader.spec b/package/yast2-bootloader.spec index 240999767..0b35d9b04 100644 --- a/package/yast2-bootloader.spec +++ b/package/yast2-bootloader.spec @@ -17,7 +17,7 @@ Name: yast2-bootloader -Version: 4.0.5 +Version: 4.0.6 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/src/lib/bootloader/stage1.rb b/src/lib/bootloader/stage1.rb index 03acfb749..9994c5ace 100644 --- a/src/lib/bootloader/stage1.rb +++ b/src/lib/bootloader/stage1.rb @@ -172,6 +172,9 @@ def can_use_boot? # LVM partition does not have reserved space for stage one return false if part.lvm_pv + # MD Raid does not have reserved space for stage one (bsc#1063957) + return false if part.is?(:md) || part.ancestors.any? { |a| a.is?(:md) } + # encrypted partition does not have reserved space and it is bad idea in general (bsc#1056862) return false if part.encrypted? diff --git a/test/data/md_raid.xml b/test/data/md_raid.xml new file mode 100644 index 000000000..a7c98dfed --- /dev/null +++ b/test/data/md_raid.xml @@ -0,0 +1,878 @@ + + + + + + 600 + /dev/vdd + vdd + /devices/pci0000:00/0000:00:09.0/virtio5/block/vdd + + 41943040 + 512 + + pci-0000:00:09.0 + + 256 + true + + + 601 + /dev/vdb + vdb + /devices/pci0000:00/0000:00:07.0/virtio3/block/vdb + + 41943040 + 512 + + pci-0000:00:07.0 + + 256 + true + + + 602 + /dev/vdc + vdc + /devices/pci0000:00/0000:00:08.0/virtio4/block/vdc + + 41943040 + 512 + + pci-0000:00:08.0 + + 256 + true + + + 603 + /dev/vda + vda + /devices/pci0000:00/0000:00:06.0/virtio2/block/vda + + 41943040 + 512 + + pci-0000:00:06.0 + + 256 + true + + + 604 + + + 605 + /dev/vda1 + vda1 + /devices/pci0000:00/0000:00:06.0/virtio2/block/vda/vda1 + + 2048 + 585938 + 512 + + pci-0000:00:06.0-part1 + primary + 253 + + + 606 + /dev/vda2 + vda2 + /devices/pci0000:00/0000:00:06.0/virtio2/block/vda/vda2 + + 589824 + 15625000 + 512 + + pci-0000:00:06.0-part2 + primary + 253 + + + 607 + /dev/vda3 + vda3 + /devices/pci0000:00/0000:00:06.0/virtio2/block/vda/vda3 + + 16216064 + 195313 + 512 + + pci-0000:00:06.0-part3 + primary + 253 + + + 608 + + + 609 + /dev/vdb1 + vdb1 + /devices/pci0000:00/0000:00:07.0/virtio3/block/vdb/vdb1 + + 2048 + 585938 + 512 + + pci-0000:00:07.0-part1 + primary + 253 + + + 610 + /dev/vdb2 + vdb2 + /devices/pci0000:00/0000:00:07.0/virtio3/block/vdb/vdb2 + + 589824 + 15625000 + 512 + + pci-0000:00:07.0-part2 + primary + 253 + + + 611 + /dev/vdb3 + vdb3 + /devices/pci0000:00/0000:00:07.0/virtio3/block/vdb/vdb3 + + 16216064 + 195313 + 512 + + pci-0000:00:07.0-part3 + primary + 253 + + + 612 + + + 613 + /dev/vdc1 + vdc1 + /devices/pci0000:00/0000:00:08.0/virtio4/block/vdc/vdc1 + + 2048 + 585938 + 512 + + pci-0000:00:08.0-part1 + primary + 253 + + + 614 + /dev/vdc2 + vdc2 + /devices/pci0000:00/0000:00:08.0/virtio4/block/vdc/vdc2 + + 589824 + 15625000 + 512 + + pci-0000:00:08.0-part2 + primary + 253 + + + 615 + /dev/vdc3 + vdc3 + /devices/pci0000:00/0000:00:08.0/virtio4/block/vdc/vdc3 + + 16216064 + 195313 + 512 + + pci-0000:00:08.0-part3 + primary + 253 + + + 616 + + + 617 + /dev/vdd1 + vdd1 + /devices/pci0000:00/0000:00:09.0/virtio5/block/vdd/vdd1 + + 2048 + 585938 + 512 + + pci-0000:00:09.0-part1 + primary + 253 + + + 618 + /dev/vdd2 + vdd2 + /devices/pci0000:00/0000:00:09.0/virtio5/block/vdd/vdd2 + + 589824 + 15625000 + 512 + + pci-0000:00:09.0-part2 + primary + 253 + + + 619 + /dev/vdd3 + vdd3 + /devices/pci0000:00/0000:00:09.0/virtio5/block/vdd/vdd3 + + 16216064 + 195313 + 512 + + pci-0000:00:09.0-part3 + primary + 253 + + + 620 + /dev/md0 + md0 + /devices/virtual/block/md0 + + 61523200 + 512 + + + 131072 + + 256 + RAID0 + 32768 + + + 621 + + + 622 + 5 + + + + 623 + -1 + @ + true + + + 624 + / + uuid + true + 0 + 0 + + + 629 + -1 + @/home + + + 630 + /home + uuid + subvol=/@/home + true + 0 + 0 + + + 631 + -1 + @/opt + + + 632 + /opt + uuid + subvol=/@/opt + true + 0 + 0 + + + 633 + -1 + @/srv + + + 634 + /srv + uuid + subvol=/@/srv + true + 0 + 0 + + + 635 + -1 + @/tmp + + + 636 + /tmp + uuid + subvol=/@/tmp + true + 0 + 0 + + + 637 + -1 + @/usr/local + + + 638 + /usr/local + uuid + subvol=/@/usr/local + true + 0 + 0 + + + 639 + -1 + @/var/cache + + + 640 + /var/cache + uuid + subvol=/@/var/cache + true + 0 + 0 + + + 641 + -1 + @/var/crash + + + 642 + /var/crash + uuid + subvol=/@/var/crash + true + 0 + 0 + + + 643 + -1 + @/var/lib/libvirt/images + true + + + 644 + /var/lib/libvirt/images + uuid + subvol=/@/var/lib/libvirt/images + true + 0 + 0 + + + 645 + -1 + @/var/lib/machines + + + 646 + /var/lib/machines + uuid + subvol=/@/var/lib/machines + true + 0 + 0 + + + 647 + -1 + @/var/lib/mailman + + + 648 + /var/lib/mailman + uuid + subvol=/@/var/lib/mailman + true + 0 + 0 + + + 649 + -1 + @/var/lib/mariadb + true + + + 650 + /var/lib/mariadb + uuid + subvol=/@/var/lib/mariadb + true + 0 + 0 + + + 651 + -1 + @/var/lib/mysql + true + + + 652 + /var/lib/mysql + uuid + subvol=/@/var/lib/mysql + true + 0 + 0 + + + 653 + -1 + @/var/lib/named + + + 654 + /var/lib/named + uuid + subvol=/@/var/lib/named + true + 0 + 0 + + + 655 + -1 + @/var/lib/pgsql + true + + + 656 + /var/lib/pgsql + uuid + subvol=/@/var/lib/pgsql + true + 0 + 0 + + + 657 + -1 + @/var/log + + + 658 + /var/log + uuid + subvol=/@/var/log + true + 0 + 0 + + + 659 + -1 + @/var/opt + + + 660 + /var/opt + uuid + subvol=/@/var/opt + true + 0 + 0 + + + 661 + -1 + @/var/spool + + + 662 + /var/spool + uuid + subvol=/@/var/spool + true + 0 + 0 + + + 663 + -1 + @/var/tmp + + + 664 + /var/tmp + uuid + subvol=/@/var/tmp + true + 0 + 0 + + + 665 + /dev/md1 + md1 + /devices/virtual/block/md1 + + 576640 + 512 + + + 256 + RAID1 + 4096 + + + 673 + + + 674 + /boot + device + true + 0 + 0 + + + 675 + /dev/md2 + md2 + /devices/virtual/block/md2 + + 768768 + 512 + + + 131072 + + 256 + RAID0 + 32768 + + + 687 + + + 688 + swap + device + true + 0 + 0 + + + + + 603 + 604 + + + 604 + 605 + + + 604 + 606 + + + 604 + 607 + + + 601 + 608 + + + 608 + 609 + + + 608 + 610 + + + 608 + 611 + + + 602 + 612 + + + 612 + 613 + + + 612 + 614 + + + 612 + 615 + + + 600 + 616 + + + 616 + 617 + + + 616 + 618 + + + 616 + 619 + + + 618 + 620 + + + 610 + 620 + + + 614 + 620 + + + 606 + 620 + + + 621 + 622 + + + 620 + 621 + + + 622 + 623 + + + 621 + 624 + + + 623 + 629 + + + 629 + 630 + + + 623 + 631 + + + 631 + 632 + + + 623 + 633 + + + 633 + 634 + + + 623 + 635 + + + 635 + 636 + + + 623 + 637 + + + 637 + 638 + + + 623 + 639 + + + 639 + 640 + + + 623 + 641 + + + 641 + 642 + + + 623 + 643 + + + 643 + 644 + + + 623 + 645 + + + 645 + 646 + + + 623 + 647 + + + 647 + 648 + + + 623 + 649 + + + 649 + 650 + + + 623 + 651 + + + 651 + 652 + + + 623 + 653 + + + 653 + 654 + + + 623 + 655 + + + 655 + 656 + + + 623 + 657 + + + 657 + 658 + + + 623 + 659 + + + 659 + 660 + + + 623 + 661 + + + 661 + 662 + + + 623 + 663 + + + 663 + 664 + + + 617 + 665 + + + 609 + 665 + + + 613 + 665 + + + 605 + 665 + + + 665 + 673 + + + 673 + 674 + + + 619 + 675 + + + 611 + 675 + + + 615 + 675 + + + 607 + 675 + + + 675 + 687 + + + 687 + 688 + + + diff --git a/test/stage1_test.rb b/test/stage1_test.rb index 9e732b552..8a0d68080 100644 --- a/test/stage1_test.rb +++ b/test/stage1_test.rb @@ -201,6 +201,14 @@ expect(subject.can_use_boot?).to eq false end + it "returns false if boot partition is on md raid" do + devicegraph_stub("md_raid.xml") + boot_partition = find_device("/dev/md0") + allow(Yast::BootStorage).to receive(:boot_partition).and_return(boot_partition) + + expect(subject.can_use_boot?).to eq false + end + it "returns false if boot partition is encrypted" do boot_partition = find_device("/dev/sda4") allow(Yast::BootStorage).to receive(:boot_partition).and_return(boot_partition)