Skip to content

Instantly share code, notes, and snippets.

@rgov
Last active November 30, 2022 02:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgov/aac0450ee3b9fb528f93b8ca37d56896 to your computer and use it in GitHub Desktop.
Save rgov/aac0450ee3b9fb528f93b8ca37d56896 to your computer and use it in GitHub Desktop.
Tool to reboot an NVIDIA Jetson device into recovery mode
/*
Tool to reboot an NVIDIA Jetson device into recovery mode. Run as root.
Based on https://forums.developer.nvidia.com/t/remote-reboot-into-recovery-mode/36032/4
*/
#include <linux/reboot.h>
#include <sys/syscall.h>
#include <unistd.h>
int main() {
return (int)syscall(
SYS_reboot,
LINUX_REBOOT_MAGIC1,
LINUX_REBOOT_MAGIC2,
LINUX_REBOOT_CMD_RESTART2,
"forced-recovery"
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment