Skip to content

Commit

Permalink
Merge pull request #18 from vmoravec/keep-runlevel-compatibility
Browse files Browse the repository at this point in the history
Accept legacy runlevel profile entry for setting systemd target
  • Loading branch information
vmoravec committed Dec 3, 2013
2 parents 788df6d + 16b737f commit 6a4ba7f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
3.1.2
3.1.3
6 changes: 6 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Dec 3 14:45:40 UTC 2013 - vmoravec@suse.com

- Support legacy runlevel profile
- 3.1.3

-------------------------------------------------------------------
Thu Nov 28 16:37:19 CET 2013 - fehr@suse.de

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Expand Up @@ -17,7 +17,7 @@


Name: autoyast2
Version: 3.1.1
Version: 3.1.3
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
16 changes: 13 additions & 3 deletions src/clients/inst_autosetup.rb
Expand Up @@ -278,7 +278,7 @@ def main

Progress.NextStage
AutoinstSoftware.Import(Ops.get_map(Profile.current, "software", {}))
keys = Profile.current.keys.select do |k|
keys = Profile.current.keys.select do |k|
Profile.current[k].is_a?(Array)||Profile.current[k].is_a?(Hash)
end
AutoinstSoftware.AddYdepsFromProfile(keys)
Expand Down Expand Up @@ -327,15 +327,25 @@ def main
LanUdevAuto.Import(Ops.get_map(Profile.current, "networking", {}))

Progress.NextStage
@default_target = Profile.current['default_target'].to_s
Builtins.y2milestone("autoyast - configured default target: #{@default_target}")

if Profile.current['runlevel'] && Profile.current['runlevel']['default']
default_runlevel = Profile.current['runlevel']['default'].to_i
@default_target = default_runlevel == 5 ? Target::GRAPHICAL : Target::MULTIUSER
Builtins.y2milestone("Accepting runlevel '#{default_runlevel}' as default target '#{@default_target}'")
else
@default_target = Profile.current['default_target'].to_s
end

Builtins.y2milestone("autoyast - configured default target: '#{@default_target}'")

if !@default_target.empty?
SystemdTarget.default_target = @default_target
else
SystemdTarget.default_target = Installation.x11_setup_needed &&
Arch.x11_setup_needed &&
Pkg.IsSelected("xorg-x11-server") ? Target::GRAPHICAL : Target::MULTIUSER
end

Builtins.y2milestone(
"autoyast - setting default target to: #{SystemdTarget.default_target}"
)
Expand Down

0 comments on commit 6a4ba7f

Please sign in to comment.