Hello community, here is the log from the commit of package yast2-bootloader for openSUSE:Factory checked in at 2016-05-13 09:22:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-bootloader (Old) and /work/SRC/openSUSE:Factory/.yast2-bootloader.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-bootloader" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-bootloader/yast2-bootloader.changes 2016-05-04 08:18:02.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-bootloader.new/yast2-bootloader.changes 2016-05-13 09:22:26.000000000 +0200 @@ -1,0 +2,26 @@ +Thu May 12 15:46:49 CEST 2016 - snwint@suse.de + +- fix grub2 settings for lvm encrypted boot partition (bsc #976315) +- 3.1.183 + +------------------------------------------------------------------- +Wed May 11 11:03:09 UTC 2016 - jreidinger@suse.com + +- do not crash when stage1 is set to extended partition (thanks to + mvidner for catch, also fix bnc#978284) +- 3.1.182 + +------------------------------------------------------------------- +Tue May 10 15:10:43 UTC 2016 - jreidinger@suse.com + +- do not crash with uninitialized variable 'extended' (bnc#978284) +- 3.1.181 + +------------------------------------------------------------------- +Mon May 9 09:28:55 UTC 2016 - agraf@suse.com + +- Disable secure boot on AArch64 (bsc#978157) +- Generate grub2 as removable on non-nvram efi systems (bsc#978593) +- 3.1.180 + +------------------------------------------------------------------- Old: ---- yast2-bootloader-3.1.179.tar.bz2 New: ---- yast2-bootloader-3.1.183.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-bootloader.spec ++++++ --- /var/tmp/diff_new_pack.NdIKAH/_old 2016-05-13 09:22:28.000000000 +0200 +++ /var/tmp/diff_new_pack.NdIKAH/_new 2016-05-13 09:22:28.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-bootloader -Version: 3.1.179 +Version: 3.1.183 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -28,7 +28,7 @@ BuildRequires: yast2-devtools >= 3.1.10 BuildRequires: yast2-ruby-bindings >= 1.0.0 BuildRequires: yast2-storage -BuildRequires: rubygem(%rb_default_ruby_abi:cfa_grub2) >= 0.4.0 +BuildRequires: rubygem(%rb_default_ruby_abi:cfa_grub2) >= 0.4.1 BuildRequires: rubygem(%rb_default_ruby_abi:rspec) BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake) PreReq: /bin/sed %fillup_prereq @@ -41,7 +41,7 @@ Requires: yast2-pkg-bindings >= 2.17.25 Requires: yast2-storage >= 2.18.18 # GRUB_DEFAULT attribute -Requires: rubygem(%rb_default_ruby_abi:cfa_grub2) >= 0.4.0 +Requires: rubygem(%rb_default_ruby_abi:cfa_grub2) >= 0.4.1 # lenses are needed as cfa_grub2 depends only on augeas bindings, but also # lenses are needed here Requires: augeas-lenses ++++++ yast2-bootloader-3.1.179.tar.bz2 -> yast2-bootloader-3.1.183.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.179/package/yast2-bootloader.changes new/yast2-bootloader-3.1.183/package/yast2-bootloader.changes --- old/yast2-bootloader-3.1.179/package/yast2-bootloader.changes 2016-05-03 13:26:53.000000000 +0200 +++ new/yast2-bootloader-3.1.183/package/yast2-bootloader.changes 2016-05-12 17:22:00.000000000 +0200 @@ -1,4 +1,30 @@ ------------------------------------------------------------------- +Thu May 12 15:46:49 CEST 2016 - snwint@suse.de + +- fix grub2 settings for lvm encrypted boot partition (bsc #976315) +- 3.1.183 + +------------------------------------------------------------------- +Wed May 11 11:03:09 UTC 2016 - jreidinger@suse.com + +- do not crash when stage1 is set to extended partition (thanks to + mvidner for catch, also fix bnc#978284) +- 3.1.182 + +------------------------------------------------------------------- +Tue May 10 15:10:43 UTC 2016 - jreidinger@suse.com + +- do not crash with uninitialized variable 'extended' (bnc#978284) +- 3.1.181 + +------------------------------------------------------------------- +Mon May 9 09:28:55 UTC 2016 - agraf@suse.com + +- Disable secure boot on AArch64 (bsc#978157) +- Generate grub2 as removable on non-nvram efi systems (bsc#978593) +- 3.1.180 + +------------------------------------------------------------------- Mon May 2 10:24:17 CEST 2016 - schubi@suse.de - Fixed nil in custom_devices. Compact! is returning nil if no diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.179/package/yast2-bootloader.spec new/yast2-bootloader-3.1.183/package/yast2-bootloader.spec --- old/yast2-bootloader-3.1.179/package/yast2-bootloader.spec 2016-05-03 13:26:53.000000000 +0200 +++ new/yast2-bootloader-3.1.183/package/yast2-bootloader.spec 2016-05-12 17:22:00.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-bootloader -Version: 3.1.179 +Version: 3.1.183 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -28,7 +28,7 @@ BuildRequires: yast2-devtools >= 3.1.10 BuildRequires: yast2-ruby-bindings >= 1.0.0 BuildRequires: yast2-storage -BuildRequires: rubygem(%rb_default_ruby_abi:cfa_grub2) >= 0.4.0 +BuildRequires: rubygem(%rb_default_ruby_abi:cfa_grub2) >= 0.4.1 BuildRequires: rubygem(%rb_default_ruby_abi:rspec) BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake) PreReq: /bin/sed %fillup_prereq @@ -41,7 +41,7 @@ Requires: yast2-pkg-bindings >= 2.17.25 Requires: yast2-storage >= 2.18.18 # GRUB_DEFAULT attribute -Requires: rubygem(%rb_default_ruby_abi:cfa_grub2) >= 0.4.0 +Requires: rubygem(%rb_default_ruby_abi:cfa_grub2) >= 0.4.1 # lenses are needed as cfa_grub2 depends only on augeas bindings, but also # lenses are needed here Requires: augeas-lenses diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.179/src/lib/bootloader/grub2efi.rb new/yast2-bootloader-3.1.183/src/lib/bootloader/grub2efi.rb --- old/yast2-bootloader-3.1.179/src/lib/bootloader/grub2efi.rb 2016-05-03 13:26:54.000000000 +0200 +++ new/yast2-bootloader-3.1.183/src/lib/bootloader/grub2efi.rb 2016-05-12 17:22:00.000000000 +0200 @@ -56,7 +56,8 @@ # for UEFI always remove PMBR flag on disk (bnc#872054) self.pmbr_action = :remove - @secure_boot = true + # non-x86_64 systems don't support secure boot yet (bsc#978157) + @secure_boot = Yast::Arch.x86_64 ? true : false grub_default.generic_set("GRUB_USE_LINUXEFI", Yast::Arch.aarch64 ? "false" : "true") end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.179/src/lib/bootloader/grub_install.rb new/yast2-bootloader-3.1.183/src/lib/bootloader/grub_install.rb --- old/yast2-bootloader-3.1.179/src/lib/bootloader/grub_install.rb 2016-05-03 13:26:54.000000000 +0200 +++ new/yast2-bootloader-3.1.183/src/lib/bootloader/grub_install.rb 2016-05-12 17:22:00.000000000 +0200 @@ -23,6 +23,28 @@ cmd << "--force" << "--skip-fs-probe" end + # EFI has 2 boot paths. The default is that there is a target file listed + # in the boot list. The boot list is stored in NVRAM and exposed as + # efivars. + # + # If no entry in the boot list was bootable (or a removable media is in + # the boot list), EFI falls back to removable media booting which loads + # a default file from /efi/boot/boot.efi. + # + # On U-Boot EFI capable systems we do not have NVRAM because we would + # have to store that on the same flash that Linux may be running on, + # creating device ownership conflicts. So on those systems we instead have + # to rely on the removable boot case. + # + # The easiest heuristic is that on "normal" EFI systems with working + # NVRAM, there is at least one efi variable visible. On systems without + # working NVRAM, we either see no efivars at all (booted via non-EFI entry + # point) or there is no efi variable exposed. Install grub in the + # removable location there. + if Dir.glob("/sys/firmware/efi/efivars/*").empty? + cmd << "--no-nvram" << "--removable" + end + if devices devices.each do |dev| Yast::Execute.on_target(cmd + [dev]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.179/src/lib/bootloader/stage1.rb new/yast2-bootloader-3.1.183/src/lib/bootloader/stage1.rb --- old/yast2-bootloader-3.1.179/src/lib/bootloader/stage1.rb 2016-05-03 13:26:54.000000000 +0200 +++ new/yast2-bootloader-3.1.183/src/lib/bootloader/stage1.rb 2016-05-12 17:22:00.000000000 +0200 @@ -169,7 +169,7 @@ else res[:root] = Yast::BootStorage.RootPartitionDevice end - res[:extended] = extended if logical_boot? + res[:extended] = extended_partition if logical_boot? end def propose_x86 @@ -342,7 +342,7 @@ case selected_location when :root then add_udev_device(Yast::BootStorage.RootPartitionDevice) when :boot then add_udev_device(Yast::BootStorage.BootPartitionDevice) - when :extended then add_udev_device(extended) + when :extended then add_udev_device(extended_partition) when :mbr then add_udev_device(Yast::BootStorage.mbr_disk) when :none then log.info "Resetting bootloader device" when Array diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.179/src/modules/BootStorage.rb new/yast2-bootloader-3.1.183/src/modules/BootStorage.rb --- old/yast2-bootloader-3.1.179/src/modules/BootStorage.rb 2016-05-03 13:26:54.000000000 +0200 +++ new/yast2-bootloader-3.1.183/src/modules/BootStorage.rb 2016-05-12 17:22:00.000000000 +0200 @@ -311,17 +311,49 @@ ret end - def encrypted_boot? - dev = BootPartitionDevice() + # Build map with encrypted partitions (even indirectly) + # @return map with encrypted partitions + def crypto_devices + cryptos = {} tm = Yast::Storage.GetTargetMap || {} - tm.each_value do |v| - partitions = v["partitions"] || [] - partition = partitions.find { |p| p["device"] == dev || p["crypt_device"] == dev } + log.info "target map = #{tm}" + + # first, find the directly encrypted things + # that is, target map has a 'crypt_device' key for it + # + # FIXME: can the device itself have a 'crypt_device' key? + tm.each_value do |d| + partitions = d["partitions"] || [] + partitions.each do |p| + if p["crypt_device"] + cryptos[p["device"]] = true + cryptos[p["used_by_device"]] = true if p["used_by_device"] + end + end + end - next unless partition + log.info "crypto devices, step 1 = #{cryptos}" - return partition["crypt_device"] && !partition["crypt_device"].empty? + # second step: check if the encrypted things have itself partitions + tm.each_value do |d| + next if !cryptos[d["device"]] + partitions = d["partitions"] || [] + partitions.each { |p| cryptos[p["device"]] = true } end + + log.info "crypto devices, final = #{cryptos}" + + cryptos + end + + def encrypted_boot? + dev = BootPartitionDevice() + log.info "boot device = #{dev}" + result = !!crypto_devices[dev] + + log.info "encrypted_boot? = #{result}" + + result end publish :variable => :BootPartitionDevice, :type => "string" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.179/test/boot_storage_test.rb new/yast2-bootloader-3.1.183/test/boot_storage_test.rb --- old/yast2-bootloader-3.1.179/test/boot_storage_test.rb 2016-05-03 13:26:54.000000000 +0200 +++ new/yast2-bootloader-3.1.183/test/boot_storage_test.rb 2016-05-12 17:22:00.000000000 +0200 @@ -167,4 +167,13 @@ ) end end + + describe ".encrypted_boot?" do + it "returns true if /boot partition is on boot" do + target_map_stub("storage_encrypted_two_levels.yaml") + subject.BootPartitionDevice = "/dev/system/root" + + expect(subject.encrypted_boot?).to eq true + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.179/test/data/storage_encrypted_two_levels.yaml new/yast2-bootloader-3.1.183/test/data/storage_encrypted_two_levels.yaml --- old/yast2-bootloader-3.1.179/test/data/storage_encrypted_two_levels.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-bootloader-3.1.183/test/data/storage_encrypted_two_levels.yaml 2016-05-12 17:22:00.000000000 +0200 @@ -0,0 +1,224 @@ +"/dev/sda": + unique: 3OOL.W8iGvCekDp8 + bus: IDE + device: "/dev/sda" + vendor: QEMU + model: HARDDISK + driver: ata_piix + driver_module: ata_piix + partitions: + - device: "/dev/sda1" + name: sda1 + used_by_type: :UB_NONE + used_by_device: '' + udev_path: pci-0000:00:01.1-ata-1-part1 + udev_id: + - ata-QEMU_HARDDISK_QM00001-part1 + - scsi-0ATA_QEMU_HARDDISK_QM00001-part1 + - scsi-1ATA_QEMU_HARDDISK_QM00001-part1 + - scsi-SATA_QEMU_HARDDISK_QM00001-part1 + size_k: 408576 + used_fs: :ext4 + detected_fs: :ext4 + uuid: 75fde4d6-63ca-4b0c-9913-fd8e57eb9a92 + nr: 1 + fsid: 131 + fstype: Linux native + region: + - 0 + - 51 + type: :primary + boot: true + - device: "/dev/sda2" + name: sda2 + used_by: + - type: :UB_LVM + device: "/dev/system" + used_by_type: :UB_LVM + used_by_device: "/dev/system" + udev_path: pci-0000:00:01.1-ata-1-part2 + udev_id: + - ata-QEMU_HARDDISK_QM00001-part2 + - scsi-0ATA_QEMU_HARDDISK_QM00001-part2 + - scsi-1ATA_QEMU_HARDDISK_QM00001-part2 + - scsi-SATA_QEMU_HARDDISK_QM00001-part2 + crypt_device: "/dev/mapper/cr_ata-QEMU_HARDDISK_QM00001-part2" + size_k: 20559872 + detected_fs: :unknown + enc_type: :luks + nr: 2 + fsid: 142 + fstype: Linux LVM + region: + - 50 + - 2560 + type: :primary + size_k: 20971520 + cyl_size: 8225280 + cyl_count: 2610 + sector_size: 512 + label: msdos + name: sda + max_logical: 255 + max_primary: 4 + type: :CT_DISK + transport: :ata + used_by_type: :UB_NONE + used_by_device: '' + udev_id: + - ata-QEMU_HARDDISK_QM00001 + - scsi-0ATA_QEMU_HARDDISK_QM00001 + - scsi-1ATA_QEMU_HARDDISK_QM00001 + - scsi-SATA_QEMU_HARDDISK_QM00001 + udev_path: pci-0000:00:01.1-ata-1 + dasd_format: 0 + dasd_type: 0 +"/dev/system": + device: "/dev/system" + name: system + used_by_type: :UB_NONE + used_by_device: '' + type: :CT_LVM + create: false + size_k: 20557824 + cyl_size: 4194304 + pesize: 4194304 + cyl_count: 5019 + pe_free: 2 + lvm2: true + devices: + - "/dev/mapper/cr_ata-QEMU_HARDDISK_QM00001-part2" + partitions: + - device: "/dev/system/root" + name: root + used_by: + - type: :UB_BTRFS + device: 30b268b1-8a74-48d9-b4f5-a40d3aa6a45b + used_by_type: :UB_BTRFS + used_by_device: 30b268b1-8a74-48d9-b4f5-a40d3aa6a45b + size_k: 19030016 + used_fs: :btrfs + detected_fs: :btrfs + fstopt: defaults + stripes: 1 + type: :lvm + fstype: LV + subvol: + - name: "@/.snapshots" + - name: "@/.snapshots/1/snapshot" + - name: "@/home" + - name: "@/opt" + - name: "@/srv" + - name: "@/tmp" + - name: "@/usr/local" + - name: "@/var/crash" + - name: "@/var/lib/libvirt/images" + nocow: true + - name: "@/var/lib/mailman" + - name: "@/var/lib/mariadb" + nocow: true + - name: "@/var/lib/mysql" + nocow: true + - name: "@/var/lib/named" + - name: "@/var/lib/pgsql" + nocow: true + - name: "@/var/log" + - name: "@/var/opt" + - name: "@/var/spool" + - name: "@/var/tmp" + - name: "@/.snapshots/2/snapshot" + - name: "@/.snapshots/1/snapshot/var/lib/machines" + - name: "@/.snapshots/3/snapshot" + - name: "@/.snapshots/4/snapshot" + - name: "@/.snapshots/5/snapshot" + uuid: 30b268b1-8a74-48d9-b4f5-a40d3aa6a45b + mount: "/" + mountby: :uuid + - device: "/dev/system/swap" + name: swap + used_by_type: :UB_NONE + used_by_device: '' + size_k: 1519616 + used_fs: :swap + detected_fs: :swap + mount: swap + mountby: :device + fstopt: defaults + uuid: 4ff45837-2a10-45ab-94dd-a83a309aad0e + stripes: 1 + type: :lvm + fstype: LV +"/dev/btrfs": + device: "/dev/btrfs" + name: btrfs + used_by_type: :UB_NONE + used_by_device: '' + type: :CT_BTRFS + partitions: [] +"/dev/tmpfs": + device: "/dev/tmpfs" + name: tmpfs + used_by_type: :UB_NONE + used_by_device: '' + type: :CT_TMPFS + partitions: + - device: tmpfs + name: none + used_by_type: :UB_NONE + used_by_device: '' + size_k: 507856 + used_fs: :tmpfs + detected_fs: :tmpfs + mount: "/dev/shm" + mountby: :uuid + ignore_fstab: true + type: :tmpfs + fstype: TMPFS + - device: tmpfs + name: none + used_by_type: :UB_NONE + used_by_device: '' + size_k: 507856 + used_fs: :tmpfs + detected_fs: :tmpfs + mount: "/run" + mountby: :uuid + ignore_fstab: true + type: :tmpfs + fstype: TMPFS + - device: tmpfs + name: none + used_by_type: :UB_NONE + used_by_device: '' + size_k: 507856 + used_fs: :tmpfs + detected_fs: :tmpfs + mount: "/sys/fs/cgroup" + mountby: :uuid + ignore_fstab: true + type: :tmpfs + fstype: TMPFS + - device: tmpfs + name: none + used_by_type: :UB_NONE + used_by_device: '' + size_k: 101572 + used_fs: :tmpfs + detected_fs: :tmpfs + mount: "/run/user/486" + mountby: :uuid + ignore_fstab: true + type: :tmpfs + fstype: TMPFS + - device: tmpfs + name: none + used_by_type: :UB_NONE + used_by_device: '' + size_k: 101572 + used_fs: :tmpfs + detected_fs: :tmpfs + mount: "/run/user/0" + mountby: :uuid + ignore_fstab: true + type: :tmpfs + fstype: TMPFS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.179/test/grub2_efi_test.rb new/yast2-bootloader-3.1.183/test/grub2_efi_test.rb --- old/yast2-bootloader-3.1.179/test/grub2_efi_test.rb 2016-05-03 13:26:54.000000000 +0200 +++ new/yast2-bootloader-3.1.183/test/grub2_efi_test.rb 2016-05-12 17:22:00.000000000 +0200 @@ -69,11 +69,19 @@ expect(subject.pmbr_action).to eq :remove end - it "proposes to use secure boot" do + it "proposes to use secure boot for x86_64" do + allow(Yast::Arch).to receive(:architecture).and_return("x86_64") subject.propose expect(subject.secure_boot).to eq true end + + it "proposes to not use secure boot for aarch64" do + allow(Yast::Arch).to receive(:architecture).and_return("aarch64") + subject.propose + + expect(subject.secure_boot).to eq false + end end describe "#packages" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.179/test/grub_install_test.rb new/yast2-bootloader-3.1.183/test/grub_install_test.rb --- old/yast2-bootloader-3.1.179/test/grub_install_test.rb 2016-05-03 13:26:54.000000000 +0200 +++ new/yast2-bootloader-3.1.183/test/grub_install_test.rb 2016-05-12 17:22:00.000000000 +0200 @@ -10,8 +10,21 @@ allow(Yast::Arch).to receive(:architecture).and_return(arch) end - def expect_grub2_install(target, device: nil) + def stub_efivars(removable: false) + if removable + efivardirs = [] + else + efivardirs = ["Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c", + "BootCurrent-8be4df61-93ca-11d2-aa0d-00e098032b8c", + "BootOrder-8be4df61-93ca-11d2-aa0d-00e098032b8c"] + end + + allow(Dir).to receive(:glob).and_return(efivardirs) + end + + def expect_grub2_install(target, device: nil, removable: false) params = [/grub2-install/, "--target=#{target}", "--force", "--skip-fs-probe"] + params << "--no-nvram" << "--removable" if removable params << device if device expect(Yast::Execute).to receive(:on_target) @@ -22,6 +35,7 @@ subject { Bootloader::GrubInstall.new(efi: true) } it "runs shim-install instead of grub2-install if secure_boot: true passed" do + stub_efivars expect(Yast::Execute).to receive(:on_target) .with([/shim-install/, "--config-file=/boot/grub2/grub.cfg"]) @@ -30,6 +44,7 @@ it "runs with target i386-efi on i386" do stub_arch("i386") + stub_efivars expect_grub2_install("i386-efi") subject.execute @@ -37,6 +52,7 @@ it "runs with target x86_64-efi on x86_64" do stub_arch("x86_64") + stub_efivars expect_grub2_install("x86_64-efi") subject.execute @@ -44,18 +60,21 @@ it "raise exception on ppc64" do stub_arch("ppc64") + stub_efivars expect { subject.execute }.to raise_error(RuntimeError) end it "raise exception on s390" do stub_arch("s390_64") + stub_efivars expect { subject.execute }.to raise_error(RuntimeError) end it "runs with target arm64-efi on aarch64" do stub_arch("aarch64") + stub_efivars expect_grub2_install("arm64-efi") subject.execute @@ -66,6 +85,14 @@ expect { subject.execute }.to raise_error(RuntimeError) end + + it "creates a removable grub2 install on non-nvram systems" do + stub_arch("aarch64") + stub_efivars(removable: true) + expect_grub2_install("arm64-efi", removable: true) + + subject.execute + end end context "initialized with efi:false" do @@ -77,6 +104,7 @@ it "runs for each device passed in devices" do stub_arch("x86_64") + stub_efivars expect_grub2_install("i386-pc", device: "/dev/sda") expect_grub2_install("i386-pc", device: "/dev/sdb") expect_grub2_install("i386-pc", device: "/dev/sdc") @@ -86,6 +114,7 @@ it "runs with target i386-pc on i386" do stub_arch("i386") + stub_efivars expect_grub2_install("i386-pc", device: "/dev/sda") subject.execute(devices: ["/dev/sda"]) @@ -93,6 +122,7 @@ it "runs with target i386-pc on x86_64" do stub_arch("x86_64") + stub_efivars expect_grub2_install("i386-pc", device: "/dev/sda") subject.execute(devices: ["/dev/sda"]) @@ -100,6 +130,7 @@ it "runs with target powerpc-ieee1275 on ppc64" do stub_arch("ppc64") + stub_efivars expect_grub2_install("powerpc-ieee1275", device: "/dev/sda") subject.execute(devices: ["/dev/sda"]) @@ -107,6 +138,7 @@ it "runs with target s390x-emu on s390" do stub_arch("s390_64") + stub_efivars expect_grub2_install("s390x-emu", device: "/dev/dasda1") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.179/test/stage1_test.rb new/yast2-bootloader-3.1.183/test/stage1_test.rb --- old/yast2-bootloader-3.1.179/test/stage1_test.rb 2016-05-03 13:26:54.000000000 +0200 +++ new/yast2-bootloader-3.1.183/test/stage1_test.rb 2016-05-12 17:22:00.000000000 +0200 @@ -162,4 +162,18 @@ end end + + describe "#available_locations" do + context "on x86_64" do + before do + allow(Yast::Arch).to receive(:architecture).and_return("x86_64") + end + + it "returns map with :extended set to extended partition" do + pending "need to get target map with /boot on logical partition" + + expect(subject.available_locations[:extended]).to eq "/dev/sda4" + end + end + end end