> Subject: [PATCH v2 1/2] kexec: history: track previous kernel version
Nit: please use the prefix "kho: " for KHO patches.
On Fri, Jan 02 2026, Breno Leitao wrote:
> Add CONFIG_KEXEC_HISTORY to store and display the kernel version from
> the previous kexec boot.
>
> When enabled, the current kernel's release string is saved to the
> "previous-release" property in the KHO device tree before kexec. On
> the next boot, if this property exists, the previous kernel version
> is retrieved and printed during early boot.
>
> This helps diagnose bugs that only manifest when kexecing from
> specific kernel versions, making it easier to correlate crashes with
> the kernel that initiated the kexec.
Why can't you use journalctl to figure out which kernel was running
previously?
For example, you can do:
$ journalctl --list-boots
-2 a1d93be939b64ac4b7b26aa003bfdb93 Wed 2025-12-24 21:34:22 CET Thu
2025-12-25 02:04:07 CET
-1 dbbedcf8fff54d5990c6f2a6399cfce1 Fri 2025-12-26 11:46:23 CET Fri
2025-12-26 11:46:54 CET
0 d002d51c28e748d9a7c6c8cdd391aa73 Fri 2025-12-26 17:40:52 CET Fri
2026-01-02 21:12:09 CET
[...]
$ journalctl -k -b -1
This will show you the full logs of the previous boot, or the one
before, and so on. And when you're debugging, you'd likely want to view
previous boot logs anyway.
Everything you add to the KHO FDT is ABI. While we do have some
flexibility in changing the ABI, I'd rather not add something that can
easily be queried by existing userspace tools.
>
> Disabled by default to avoid overhead for users who don't need this
> information.
>
> Signed-off-by: Breno Leitao <[email protected]>
[...]
--
Regards,
Pratyush Yadav