From b32a3b53f8ba026e698e35130878eb2294c84513 Mon Sep 17 00:00:00 2001 From: menli Date: Tue, 2 Dec 2025 14:48:01 +0800 Subject: [PATCH] Add --no-reboot-after-bugcheck option for crash debugging This option allows keeping systems in crashed state after bugcheck instead of automatically rebooting, enabling better debugging of system crashes during HCK installation and testing. Signed-off-by: menli --- lib/cli.rb | 7 ++++++- lib/engines/hckinstall/hckinstall.rb | 3 ++- lib/engines/hckinstall/setup_scripts_helper.rb | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/cli.rb b/lib/cli.rb index 96a993fe..85f090e9 100644 --- a/lib/cli.rb +++ b/lib/cli.rb @@ -201,7 +201,7 @@ def define_options(parser) # class InstallOptions class InstallOptions - attr_accessor :platform, :force, :skip_client, :drivers, :driver_path, :debug + attr_accessor :platform, :force, :skip_client, :drivers, :driver_path, :debug, :no_reboot_after_bugcheck def create_parser OptionParser.new do |parser| @@ -221,6 +221,7 @@ def define_options(parser) @skip_client = false @drivers = [] @debug = false + @no_reboot_after_bugcheck = false parser.on('--debug', TrueClass, 'Enable debug mode', &method(:debug=)) @@ -244,6 +245,10 @@ def define_options(parser) parser.on('--driver-path ', String, 'Path to the location of the driver wanted to be installed', &method(:driver_path=)) + + parser.on('--no-reboot-after-bugcheck', TrueClass, + 'Keep system in crashed state after crash for debugging (disables automatic reboot)', + &method(:no_reboot_after_bugcheck=)) end # rubocop:enable Metrics/MethodLength end diff --git a/lib/engines/hckinstall/hckinstall.rb b/lib/engines/hckinstall/hckinstall.rb index ba79e6a5..be800d47 100644 --- a/lib/engines/hckinstall/hckinstall.rb +++ b/lib/engines/hckinstall/hckinstall.rb @@ -247,7 +247,8 @@ def prepare_setup_scripts_config config = { kit_type:, hlk_kit_ver: kit_version, - debug: @project.options.install.debug + debug: @project.options.install.debug, + no_reboot_after_bugcheck: @project.options.install.no_reboot_after_bugcheck } @kit_path = find_kit(kit_type, kit_version) diff --git a/lib/engines/hckinstall/setup_scripts_helper.rb b/lib/engines/hckinstall/setup_scripts_helper.rb index a3bf8ca1..6a7fd400 100644 --- a/lib/engines/hckinstall/setup_scripts_helper.rb +++ b/lib/engines/hckinstall/setup_scripts_helper.rb @@ -8,7 +8,8 @@ module Helper kit_type: '', hlk_kit_ver: '', remove_gui: '', - debug: '' + debug: '', + no_reboot_after_bugcheck: '' }.freeze def validate_setup_scripts_config(config)