Skip to content

Commit

Permalink
boot/init: Honor skipping kexec
Browse files Browse the repository at this point in the history
  • Loading branch information
samueldr committed Feb 11, 2021
1 parent aea3b46 commit 2a46962
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions boot/init/tasks/switch_root.rb
Expand Up @@ -120,6 +120,7 @@ def choose_generation()
# Read data from the user
data = JSON.parse(File.read("/run/boot/choice"))
generation = data["generation"]
@use_generation_kernel = data["use_generation_kernel"]

# Why "$default" rather than passing a path?
# Because there may be no generations folder. It's easier to cheat and
Expand Down Expand Up @@ -153,6 +154,9 @@ def will_kexec?()
# Only stage-0 bootloader-flavourd init will kexec.
return false unless STAGE == 0

# The user wants to use the generation's kernel
return false unless @use_generation_kernel

# AND if we find the required files.
[
"initrd",
Expand Down

0 comments on commit 2a46962

Please sign in to comment.