Skip to content

Commit

Permalink
Merge pull request #467 from yast/review_171103_no_boot_custom_export
Browse files Browse the repository at this point in the history
AY: do not export boot_custom
  • Loading branch information
schubi2 committed Nov 3, 2017
2 parents ea3716e + e49b2cd commit c7c6c33
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 34 deletions.
7 changes: 7 additions & 0 deletions package/yast2-bootloader.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Nov 3 10:09:39 CET 2017 - schubi@suse.de

- AutoYaST: Do not export stage1 settings anymore (boot_boot,
boot_custom,...) (bnc#1063975)
- 4.0.3

-------------------------------------------------------------------
Fri Sep 15 11:54:25 UTC 2017 - jreidinger@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-bootloader.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-bootloader
Version: 4.0.2
Version: 4.0.3
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
21 changes: 0 additions & 21 deletions src/lib/bootloader/autoyast_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def export(config)
res["global"] = {}
global = res["global"]
export_grub2(global, config) if config.name == "grub2"
export_stage1(global, config.stage1) if config.respond_to?(:stage1)
export_default(global, config.grub_default)
# Do not export device map as device name are very unpredictable and is used only as
# work-around when automatic ones do not work for what-ever reasons ( it can really safe
Expand Down Expand Up @@ -195,26 +194,6 @@ def bootloader_from_data(data)
end
end

STAGE1_MAPPING = {
"activate" => :activate?,
"generic_mbr" => :generic_mbr?,
"boot_root" => :root_partition?,
"boot_boot" => :boot_partition?,
"boot_mbr" => :mbr?,
"boot_extended" => :extended_partition?
}.freeze
def export_stage1(res, stage1)
STAGE1_MAPPING.each do |key, method|
res[key] = stage1.public_send(method) ? "true" : "false"
end

# if there is no separated boot, then root and boot partition is same, so in such case
# have only one true there
res["boot_boot"] = "false" if res["boot_root"] == "true" && res["boot_boot"] == "true"

res["boot_custom"] = stage1.custom_devices.join(",") unless stage1.custom_devices.empty?
end

# only for grub2, not for others
GRUB2_BOOLEAN_MAPPING = {
"trusted_grub" => :trusted_boot
Expand Down
18 changes: 6 additions & 12 deletions test/autoyast_converter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,12 @@
bootloader.trusted_boot = true

expected_export = {
"append" => "verbose nomodeset",
"terminal" => "gfxterm",
"os_prober" => "true",
"hiddenmenu" => "true",
"timeout" => 10,
"boot_mbr" => "false",
"boot_boot" => "false",
"boot_extended" => "false",
"boot_root" => "false",
"activate" => "true",
"generic_mbr" => "false",
"trusted_grub" => "true"
"append" => "verbose nomodeset",
"terminal" => "gfxterm",
"os_prober" => "true",
"hiddenmenu" => "true",
"timeout" => 10,
"trusted_grub" => "true"
}

expect(subject.export(bootloader)["global"]).to eq expected_export
Expand Down

0 comments on commit c7c6c33

Please sign in to comment.