Skip to content

Commit

Permalink
Allow in autoyast only supported bootloaders(bnc#882210)
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jun 16, 2014
1 parent 8726756 commit 6568245
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/clients/bootloader_auto.rb
Expand Up @@ -52,11 +52,12 @@ def main
Builtins.y2debug("param=%1", @param)

if @func == "Import"
@ret = Bootloader.Import(
AI2Export(
Convert.convert(@param, :from => "map", :to => "map <string, any>")
)
)
data = AI2Export(@param)
if data
@ret = Bootloader.Import(data)
else
@ret = false
end
# Create a summary
# return string
elsif @func == "Summary"
Expand Down
9 changes: 9 additions & 0 deletions src/include/bootloader/routines/autoinstall.rb
Expand Up @@ -109,6 +109,7 @@ def initialize_bootloader_routines_autoinstall(include_target)
Yast.import "Initrd"
Yast.import "Kernel"
Yast.import "Mode"
Yast.import "Popup"
end

# Add missing data (eg. root filesystem) to sections imported from profile
Expand Down Expand Up @@ -413,6 +414,14 @@ def AI2Export(ai)
def Export2AI(exp)
exp = deep_copy(exp)
# bootloader type and location stuff
unsupported_bootloaders = ["grub", "zipl", "plilo", "lilo", "elilo"]
if unsupported_bootloaders.include?(exp["loader_location"])
# FIXME this should be better handled by exception and show it properly, but it require too big change now
Popup.Error(_("Unsupported bootloader '%s'. Please adapt your autoyast profile according."),
exp["loader_location"])
return nil
end

ai = { "loader_type" => Ops.get_string(exp, "loader_type", "default") }
glob = Builtins.filter(Ops.get_map(exp, ["specific", "global"], {})) do |k, v|
Builtins.substring(k, 0, 2) != "__"
Expand Down

0 comments on commit 6568245

Please sign in to comment.