Skip to content

Implement kexec reboot support for SSH mode#20

Open
aleksandrov-denis wants to merge 3 commits intorhkdump:mainfrom
aleksandrov-denis:kexec-reboot-feature
Open

Implement kexec reboot support for SSH mode#20
aleksandrov-denis wants to merge 3 commits intorhkdump:mainfrom
aleksandrov-denis:kexec-reboot-feature

Conversation

@aleksandrov-denis
Copy link
Copy Markdown

Summary

REBOOT_STRATEGY=kexec was documented and configurable but not implemented — do_kexec_reboot() was a
stub that always fell back to a full system reboot. This PR implements it for SSH mode, reducing
per-iteration reboot time from ~60s to ~18s.

Changes

Implement kexec support for SSH mode

Adds two helpers to lib.sh:

  • kexec_load_kernel(kernel_release) — validates that the vmlinuz and initramfs files exist on the test
    host, reads the current kernel command line from /proc/cmdline, and loads the new kernel into memory
    with kexec -l
  • kab_kexec() — executes the loaded kernel via the existing reboot_and_wait mechanism

Updates do_kexec_reboot() in reboot_handler.sh:

  • In SSH mode: loads the kernel with kexec_load_kernel, falls back to a full reboot if loading fails,
    otherwise executes with kab_kexec
  • In local/CRIU mode: preserves the existing fallback to full reboot, since kexec bypasses the normal
    boot sequence that the CRIU daemon relies on to restore the bisect process

install_from_rpm: redirect dnf output on the test host

Fixes a bug where dnf install output in install_from_rpm was redirected to /var/log/install.log via a
local shell redirect, which fails when the controller runs as a non-root user. The redirect is now
passed as an argument to run_cmd so it executes on the test host — consistent with how install_from_git
handles its build log.

Testing

Tested end-to-end on RHEL 9.8 in SSH mode (INSTALL_STRATEGY=rpm, TEST_STRATEGY=simple,
REBOOT_STRATEGY=kexec) bisecting across three CentOS Stream 9 kernel versions (5.14.0-687/688/689):

  • kexec loaded the target kernel and rebooted in ~18s (vs ~60s for full reboot)
  • Test ran correctly on the rebooted kernel
  • Bisect correctly identified the first bad commit

coiby and others added 3 commits April 7, 2026 22:02
Github Action will run basic tests including format-check, static-analysis
and unit-tests. And testing farm will run integration tests.

Pull request workflows from forked repositories don't have access to
repository secrets by default. To address this issue, 1) create a dedicated
environment and 2) use pull_request_target so only approved PR can run
the workflow.
do_kexec_reboot() was a stub that always fell back to a full reboot.
Implement it properly for SSH mode, where CRIU is not involved and
kexec is safe to use.

Add kexec_load_kernel() to lib.sh which validates that the kernel and
initramfs files exist, reads the current command line from
/proc/cmdline, and loads the new kernel into memory with kexec -l.
Add kab_kexec() which executes the loaded kernel via reboot_and_wait.

In local/CRIU mode, kexec bypasses the normal boot sequence that CRIU
relies on to restart the daemon, so the existing fallback to full
reboot is preserved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The dnf install output was being redirected to /var/log/install.log on
the controller machine (local shell redirect), which fails when the
controller runs as a non-root user. Pass the redirect as an argument to
run_cmd so it is evaluated on the test host, consistent with how
install_from_git handles its build log.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coiby coiby force-pushed the main branch 3 times, most recently from d36b580 to 4ed3d67 Compare April 11, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants