The current kernel needs to provide the reboot mode in the boot parameter. However, we can not know this in advance. The kernel should have a method to set the reboot options when the system is booted.
This patchset add handles in the <sysfs>/kernel/reboot to read reboot configuration and rewrite it. Therefore users can change the reboot mode as they want.
Matteo Croce (1): reboot: allow to specify reboot mode via sysfs
Nathan Chancellor (1): reboot: Fix variable assignments in type_store
Documentation/ABI/testing/sysfs-kernel-reboot | 32 +++ kernel/reboot.c | 206 ++++++++++++++++++ 2 files changed, 238 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-kernel-reboot