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 bootstrapping support #30

Merged
merged 8 commits into from
Feb 1, 2024
Merged

Add bootstrapping support #30

merged 8 commits into from
Feb 1, 2024

Conversation

mjg59
Copy link
Collaborator

@mjg59 mjg59 commented Jan 8, 2024

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.

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.
@mjg59
Copy link
Collaborator Author

mjg59 commented Jan 8, 2024

Enables #27

@mjg59
Copy link
Collaborator Author

mjg59 commented Jan 8, 2024

This requires tools for the host architecture and also the target architecture, and I'm not familiar enough with Rust cross-building to know how to set that up

@wgreenberg
Copy link
Collaborator

thanks @mjg59! i have a few nitpicky idiomatic rust comments if that'd be helpful, though np if not.

re: cross building, i think the .cargo/config.toml file is a pretty convenient place to configure this. maybe we make one per crate, each specifying that crate's desired architecture?

currently we have one such config at the workspace root, which annoyingly will override any sub-crate configs if you run cargo build in the root. so we'd have to descend into each crate and run cargo build if we do this. alternately, we can just run cargo build --bin <crate name> --target=<whatever> for each target

Ensure the mode switch works, and handle broken pipe failures. Also handle
devices that are in diag+rndis mode.
@mjg59
Copy link
Collaborator Author

mjg59 commented Jan 11, 2024

This is my first attempt at writing Rust, please do give me guidance on idioms!

serial/src/main.rs Outdated Show resolved Hide resolved
serial/src/main.rs Outdated Show resolved Hide resolved
serial/src/main.rs Show resolved Hide resolved
serial/src/main.rs Outdated Show resolved Hide resolved
@mjg59
Copy link
Collaborator Author

mjg59 commented Jan 11, 2024

Still need to work out building the serial tool for the host architecture (and probably also not hardcoding the host architecture) - possibly also want to split the rooting stuff out into a separate script?

@cooperq cooperq marked this pull request as ready for review February 1, 2024 06:02
@cooperq
Copy link
Collaborator

cooperq commented Feb 1, 2024

I know @mjg59 still wants to build out to support more host architectures which I think is worthwhile but for now I have cleaned up the script and separated into install and build scripts and I think this is ready for a merge since it's important now that we have more contributors.

@cooperq
Copy link
Collaborator

cooperq commented Feb 1, 2024

@wgreenberg this is ready for your review.

@wgreenberg wgreenberg merged commit fd3931f into main Feb 1, 2024
1 check passed
@wgreenberg wgreenberg deleted the bootstrap branch February 1, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants