From e7d6ca0fea441b76df2bbe99a6f4b53c5e7ce3f7 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Sat, 30 Jan 2021 22:51:52 -0500 Subject: [PATCH] asus-dumo: Basic configuration for USB gadget mode --- devices/asus-dumo/default.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/devices/asus-dumo/default.nix b/devices/asus-dumo/default.nix index 2b2c8b22..3667cc83 100644 --- a/devices/asus-dumo/default.nix +++ b/devices/asus-dumo/default.nix @@ -37,6 +37,27 @@ config.mobile.device.firmware ]; + # The controller is hidden from the OS unless started using the "android" + # launch option in the weird UEFI GUI chooser. + mobile.usb.mode = "gadgetfs"; + + # Commonly re-used values, Nexus 4 (debug) + # (These identifiers have well-known default udev rules.) + mobile.usb.idVendor = "18d1"; + mobile.usb.idProduct = "d002"; + + # Mainline gadgetfs functions + mobile.usb.gadgetfs.functions = { + rndis = "rndis.usb0"; + mass_storage = "mass_storage.0"; + adb = "ffs.adb"; + }; + + mobile.boot.stage-1.bootConfig = { + # Used by target-disk-mode to share the internal drive + storage.internal = "/dev/disk/by-path/platform-fe330000.sdhci"; + }; + mobile.boot.stage-1.tasks = [ # This hack unbinds and rebinds the currently problematic storage driver. # TODO: move into a generic "gru family" thing.