Add bootstrapping support

Add tools for launching a root shell on the device, and for sending
serial commands to the device. Extend the make.sh script to push those
and configure a root shell. Commands can now be executed as root via:

adb shell rootshell -c \"touch /tmp/test\"

allowing automatic configuration of the tooling.
This commit is contained in:
Matthew Garrett
2024-01-07 19:39:47 -08:00
parent dea1d17337
commit 4d39248bf9
7 changed files with 205 additions and 0 deletions

15
rootshell/src/main.rs Normal file
View File

@@ -0,0 +1,15 @@
use std::process::Command;
use std::os::unix::process::CommandExt;
use std::env;
fn main() {
let mut args = env::args();
// discard argv[0]
let _ = args.next();
Command::new("/bin/bash")
.args(args)
.uid(0)
.gid(0)
.exec();
}