Skip to content

Commit

Permalink
Merge pull request #262 from ancorgs/workaround_945479_sle12
Browse files Browse the repository at this point in the history
Workaround for bnc#945479 in SLE12
  • Loading branch information
ancorgs committed Sep 11, 2015
2 parents 5a2ad84 + 7245914 commit 1c885a6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions package/yast2-bootloader.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Sep 11 16:46:11 UTC 2015 - ancor@suse.com

- Empty kernel command lines are now properly written (bnc#945479)

-------------------------------------------------------------------
Thu Jun 4 08:19:26 UTC 2015 - jreidinger@suse.com

Expand Down
5 changes: 4 additions & 1 deletion src/include/bootloader/routines/misc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,8 @@ def kernel_param_key(value)
# @return [String] new kernel command line
def setKernelParamToLine(line, key, value)
line ||= ""
# bnc#945479, see last line of this method
line = "" if line == '""'
# FIXME this doesn't work with quotes and spaces
params = line.split(" ").reject(&:empty?)
# count occurences of every parameter, initial value is 0
Expand Down Expand Up @@ -513,7 +515,8 @@ def setKernelParamToLine(line, key, value)
params << Builtins.sformat("%1=%2", key, value)
end
end
params.join(" ")
# bnc#945479 perl-bootloader does not cope well with empty strings
params.empty? ? '""' : params.join(" ")
end


Expand Down
4 changes: 2 additions & 2 deletions test/boot_common_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ def expect_set(key: nil, val: nil, old: nil, new: nil)
new: "verbose")
end

it "return empty string when value is \"false\" and line is nil" do
it "return quoted empty string when value is \"false\" and line is nil" do
expect_set(key: "verbose",
val: "false",
old: nil,
new: "")
new: '""')
end
end
end
2 changes: 1 addition & 1 deletion test/grub2pwd_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def mock_file_presence(exists)
describe "#used?" do
it "return true if exists file #{GRUB2Pwd::PWD_ENCRYPTION_FILE}" do
mock_file_presence(true)
expect(subject.used?).to be_true
expect(subject.used?).to eq true
end
end

Expand Down

0 comments on commit 1c885a6

Please sign in to comment.