Skip to content

Commit

Permalink
skip mbr update on s390 (bnc#937015)
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jul 7, 2015
1 parent e0b0c4f commit dc6a679
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/bootloader/mbr_update.rb
Expand Up @@ -19,6 +19,8 @@ class MBRUpdate
# Update contents of MBR (active partition and booting code)
# @return [Boolean] true on success
def run
return true if Yast::Arch.s390

activate = Yast::BootCommon.globals["activate"] == "true"
generic_mbr = Yast::BootCommon.globals["generic_mbr"] == "true"

Expand Down
13 changes: 13 additions & 0 deletions test/mbr_update_test.rb
Expand Up @@ -20,6 +20,9 @@
dev + num.to_s
end

# by default common architecture"
allow(Yast::Arch).to receive(:architecture).and_return("x86_64")

# fake query for gpt label
allow(Yast::Storage).to receive(:GetTargetMap).and_return(
double(:fetch => { "label" => "msdos" },
Expand All @@ -28,6 +31,16 @@
)
end

context "on s390" do
before do
allow(Yast::Arch).to receive(:architecture).and_return("s390_64")
end

it "does nothing except returning true" do
expect(subject.run).to eq true
end
end

context "BootCommon.backup_mbr config is not set" do
before do
Yast::BootCommon.backup_mbr = false
Expand Down

0 comments on commit dc6a679

Please sign in to comment.