Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -k option to shutdown for kexec functionality #436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

el-remph
Copy link

@el-remph el-remph commented Feb 3, 2025

Adds a -k option to 'shutdown', analogous to that of systemd and OpenRC. Am daily driving this and it gets a nice speedup on reboot. Also tried to make the ifdef-ing out of shutdown code based on RB_* constants more consistent, so the user can clearly see which shutdown modes are supported (since kexec may not be available at compile time on very old environments).

The only real downside that I can see is if the user has neglected to load an image before calling 'reboot -k', then reboot will return -1 with EINVAL, init will exit and the kernel will panic. I can't see an easy way to avoid this, since we only find out that the user has remembered to load an image when we call reboot() and it doesn't return.

@mobin-2008 mobin-2008 added Enhancement/New Feature Improving things or introduce new feature P-Linux Things related to Linux A-Importance: Normal C-shutdown Things about shutdown/reboot/halt utilities labels Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Importance: Normal C-shutdown Things about shutdown/reboot/halt utilities Enhancement/New Feature Improving things or introduce new feature P-Linux Things related to Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants