When system option kdump is configured without an explicit memory value, the first boot after add system image triggers an unnecessary kexec reboot. Every boot after that is normal.
Steps to reproduce
- On an installed system, configure kdump and keep the default memory reservation:
set system option kdump commit save
- Reboot so that crashkernel= is active.
- Upgrade with add system image <new-image> and reboot into the new image.
Expected behavior
The new image boots once. Its kernel cmdline already contains crashkernel=1G-8G:512M,8G-64G:768M,64G-:1G.
Actual behavior
The GRUB entry written during the upgrade has no crashkernel=. During the boot commit, system option sees that the running cmdline differs from the configured options and kexecs into a corrected kernel. Because GRUB is rewritten during that commit, later boots are fine.
Root cause
The kernel cmdline is built in two places that must stay in sync:
- Image upgrade (image_installer.py:get_cli_kernel_options()) reads the raw config.boot through ConfigTree. No XML defaults are applied, so kdump memory is missing and no crashkernel= option is emitted.
- Boot commit (system_option.py:generate()) uses get_config_dict(..., with_recursive_defaults=True). That applies <defaultValue>auto</defaultValue> and emits crashkernel=_.
This was introduced with kdump support (T8868, kdump: T8868: Implement kernel crash dump support). Setting system option kdump memory explicitly avoids the problem.
Proposed fix
When the kdump node is present, the installer should fall back to the XML default for memory through vyos.xml_ref.default_value(), so that it produces the same crashkernel= value as conf-mode. The fix only applies to upgrades that start from an image that already contains it, because the upgrade runs the installer from the running image.