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 "target-disk-mode" example system #110

Merged
merged 17 commits into from Jan 5, 2021

Conversation

samueldr
Copy link
Member

@samueldr samueldr commented Mar 28, 2020

This builds on top of #96.


This adds an example system taking inspiration from JumpDrive.

The given system, once booted, should present the internal storage of the device to the host computer. Just like a usb flash drive (or jump drive).

There are notes in the added README.

The name, though, comes from the Apple feature.


I say should because I am unable to test it. My Pinephone unit seemingly has a fault making usb gadget mode fail. (Verified not to work with the actual JumpDrive project.)

I tried testing with another mainline device I hoped would do gadget mode, but it seems that asus-dumo can't do gadget mode. It does try to, but something seems to fail between the host and the device. I haven't been able to confirm whether the gru family of devices, gru scarlet and dumo mainly, should work with gadget mode or not (once adapted).


Describe all storage

Right now we hardcode storage.internal.

We probably want to, instead, present a choice in the GUI for which storage to export.

Storage should be described in two ways:

  • block device
  • partitions

Either of those should only be exported by the device description if it is safe to dd garbage onto them. This means that most android-based devices fail this requirement.

The UI should collect all of those and present them as a selection, either radio buttons or drop down selection. Most likely radio buttons?

This does mean we need to extract the gadget mode stuff from the init, and produce a proper HAL utility class. It should be possible to edit, start and stop gadget features as desired.


TODO

  • verify working sshd via rndis
  • decouple the storage location from the gadget implementation somehow

@samueldr samueldr added the 4. type: enhancement New feature or request label Mar 28, 2020
@samueldr samueldr added the 9. status: WIP The PR is not ready for merge, work in progress label Apr 23, 2020
@samueldr
Copy link
Member Author

samueldr commented Oct 3, 2020

I have just now tested it by doing an extremely dangerous configuration and sharing the internal storage of google-walleye.

What does this mean? The "jumpdrive" example system is verified to work.

@samueldr samueldr removed the 9. status: WIP The PR is not ready for merge, work in progress label Oct 3, 2020
@samueldr samueldr added the 9. status: WIP The PR is not ready for merge, work in progress label Oct 3, 2020
@samueldr samueldr force-pushed the examples/jumpdrive branch 2 times, most recently from 5187b15 to b8977bb Compare December 30, 2020 20:49
Same as File.symlink, but logged.

(Also fixes logging of System.write)
This will be used for quirks that needs to know where to write more
configuration.
This only serves to show instructions and reboot/poweroff.

In the future, it should be the owner of gadget mode stuff.
This is not ideal. Ideally devices would provide that information, but
since for now it's only used by jumpdrive, we're skipping the
generalization.

Furthermore, I don't really know how to provide that information in a
way that is coherent with the rest, for now.
@samueldr
Copy link
Member Author

samueldr commented Jan 4, 2021

(Tested recent updates with out-of-tree chuwi-hi10prohq64)

@samueldr samueldr removed the 9. status: WIP The PR is not ready for merge, work in progress label Jan 4, 2021
@samueldr samueldr marked this pull request as ready for review January 4, 2021 10:47
@samueldr samueldr changed the title [WIP] Add "jumpdrive" example system Add "target-disk-mode" example system Jan 4, 2021
There was no need to keep it there. Came from the `examples/hello` GUI
task, which in turn I *think* that in the past used a variable
interpolation.

We don't need any of that.
For "whole disk image" systems, like the Pinephone, this produces much
smaller images.
@samueldr samueldr merged commit 8720497 into NixOS:master Jan 5, 2021
@samueldr samueldr deleted the examples/jumpdrive branch January 5, 2021 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant