Skip to content

Commit

Permalink
Delete or copy install.inf as applicable (bnc#897066)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwh42 committed Feb 17, 2015
1 parent d8a1151 commit 12dae43
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 38 deletions.
6 changes: 5 additions & 1 deletion src/clients/copy_files_finish.rb
Expand Up @@ -127,7 +127,11 @@ def main
# --------------------------------------------------------------
# Copy /etc/install.inf into built system so that the
# second phase of the installation can find it.
Linuxrc.SaveInstallInf(Installation.destdir)
if second_stage_required?
Linuxrc.SaveInstallInf(Installation.destdir)
else
SCR.Execute(path(".target.remove"), "/etc/install.inf")
end

# Copy control.xml so it can be read once again during continue mode
Builtins.y2milestone("Copying YaST control file")
Expand Down
47 changes: 10 additions & 37 deletions src/include/installation/inst_inc_first.rb
Expand Up @@ -172,45 +172,18 @@ def SetSystemUpdate
end

def HandleSecondStageRequired
if Stage.initial
# the current one is 'initial'
run_second_stage = true
if (Mode.autoinst || Mode.autoupgrade) && !AutoinstConfig.second_stage
run_second_stage = false
Builtins.y2milestone("Autoyast: second stage is disabled")
else
# after reboot/kexec it would be 'continue'
stage_to_check = "continue"

# for matching the control file
mode_to_check = Mode.mode

# file name
run_yast_at_boot = Builtins.sformat(
"%1/%2",
Installation.destdir,
Installation.run_yast_at_boot
)

Builtins.y2milestone(
"Checking RunRequired (%1, %2)",
stage_to_check,
mode_to_check
)
run_second_stage = ProductControl.RunRequired(stage_to_check, mode_to_check)
end
# file name
run_yast_at_boot = "#{Installation.destdir}/#{Installation.run_yast_at_boot}"

if run_second_stage
Builtins.y2milestone("Running the second stage is required")
WFM.Write(path(".local.string"), run_yast_at_boot, "")
WriteSecondStageRequired(true)
else
Builtins.y2milestone("It is not required to run the second stage")
WFM.Execute(path(".local.remove"), run_yast_at_boot)
WriteSecondStageRequired(false)
end
if second_stage_required?
Builtins.y2milestone("Running the second stage is required")
WFM.Write(path(".local.string"), run_yast_at_boot, "")
WriteSecondStageRequired(true)
else
Builtins.y2milestone("It is not required to run the second stage")
WFM.Execute(path(".local.remove"), run_yast_at_boot)
WriteSecondStageRequired(false)
end

nil
end
end
Expand Down
25 changes: 25 additions & 0 deletions src/include/installation/misc.rb
Expand Up @@ -365,5 +365,30 @@ def WriteSecondStageRequired(scst_required)

nil
end

def second_stage_required?
return false unless Stage.initial

# the current one is 'initial'
if (Mode.autoinst || Mode.autoupgrade) && !AutoinstConfig.second_stage
run_second_stage = false
Builtins.y2milestone("Autoyast: second stage is disabled")
else
# after reboot/kexec it would be 'continue'
stage_to_check = "continue"

# for matching the control file
mode_to_check = Mode.mode

Builtins.y2milestone(
"Checking RunRequired (%1, %2)",
stage_to_check,
mode_to_check
)
run_second_stage = ProductControl.RunRequired(stage_to_check, mode_to_check)
end

run_second_stage
end
end
end

0 comments on commit 12dae43

Please sign in to comment.