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

Fix shutdown/reboot in stage-1 #68

Merged
merged 3 commits into from Jan 11, 2020
Merged

Conversation

@samueldr
Copy link
Member

@samueldr samueldr commented Jan 10, 2020

Why didn't it work before? That's because busybox expects you will be using their init with their shutdown and reboot. The utilities only signal init about the need to shutdown or reboot.

This hardshutdown is based on the one found in the busybox tree, but enhanced to use the RESTART2 type of syscall, allowing "reasons" to be given for the reboot.

In turn, those "reasons" are used by the platform, here I'm assuming an android-based device, to "do stuff". With most (all?) android devices you can directly reboot to bootloader using this "reason" by using reboot bootloader.

It may be possible to reboot to recovery using reboot recovery, but this has not been tested successfully on two devices.


Note: the reboot command from systemd already supports passing a reason to the syscall, so from stage-2 it already was possible to do this.

@samueldr samueldr merged commit 5abd837 into NixOS:master Jan 11, 2020
@samueldr samueldr deleted the samueldr-wip:feature/hardshutdown branch Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.