-
Notifications
You must be signed in to change notification settings - Fork 5.2k
how to reboot into partition with new firmware but no systemd? #2095
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
Comments
The RPi firmware still uses the same mechanism as before, but the board support code now uses the standard reboot handling mechanism - passing a command string containing the partition number to the kernel_restart function. It sounds like Batocera is using a command (shell script?) that writes the supplied partition number into a module parameter exposed by the old BCM2708/9 board support code. This code no longer exists, hence the failure you are seeing. Instead it needs a small utility - conventionally called reboot under Linux - that invokes the reboot system call (http://man7.org/linux/man-pages/man2/reboot.2.html) passing in the required magic numbers, LINUX_REBOOT_CMD_RESTART2 and the string with the partition number. You'll have to raise this with the Batocera devs. |
Hi @pelwell , yes, it already has the reboot utility (which symlinks to halt). I was asking is there some source code for the reboot / halt utility (with the extra parameter) that I can compile? Or even that I can modify with the extra parameter myself. I'm just unsure where the source code for reboot / halt is kept? |
Ended up with this
Seems to do what I need.
|
Raspbian uses systemd, and reboot, poweroff etc. are symlinked to systemctl, the source for which can be found here: https://github.com/systemd/systemd/blob/master/src/systemctl/systemctl.c I found the source to a simpler shutdown command here: http://util-linux.sourcearchive.com/documentation/2.14/shutdown_8c-source.html |
Uh oh!
There was an error while loading. Please reload this page.
I am trying to get Batocera OS rebooting into another partition.
They have just updated to 4.9.
The /sys/module/bcm2709/parameters/reboot_part path is no longer present.
If I try the reboot [part], it gives the error.
So, it looks like it's using an "old" reboot that doesn't know about the extra partition parameter?
Is there any other way to set the reboot part?
Or, is their a newer "reboot" I can compile?
Or, is there any simple C code I could compile to achieve it?
I can't fully change the system, but I could copy in a executable and run it if need be to get the result.
I see most systems have switched to systemd and it appears systemd takes care of the reboot now.
This OS is using systemvinit.
And I assume the reboot program is from busybox or something..
Looks like this is the code needs to be run:
syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, reboot_arg);
Is there any compiled "reboot" or "halt" that uses this update line?
Maybe mainline busybox or something like that?
I fear if I just compile a C file with that in it, it's not doing a proper "reboot".
The text was updated successfully, but these errors were encountered: