Project Description

I plan on continuing on with my Linux Kernel Library efforts from the last Hackweek. This time I'd like to spice things up a bit by plumbing USB devices into LKL, allowing reuse of native Linux USB host drivers on non-root Android.

Goals for this Hackweek

  • enumerate USB devices on Android
  • use the Android USB getFileDescriptor API to obtain a file descriptor for a connected USB device
  • find out what kind of magic is needed to plumb the USB device fd into LKL
    • XHCI emulation (see crosvm implementation) or...
    • a simple proxy: Android USB fd <-> LKL GadgetFS driver <-> LKL dummy-hcd loopback
  • successfully mount a Btrfs filesystem from LKL
  • stretch goal: help out again with LKL mainlining efforts
  • stretch goal: add DocumentsProvider integration so that LKL mounts are accessible to the Android device
  • stretch goal: map a LUKS/dm-crypt device


Looking for hackers with the skills:

Nothing? Add some keywords!

This project is part of:

Hack Week 20


  • 9 months ago: kokin10 joined this project.
  • 9 months ago: Pharaoh_Atem liked this project.
  • 9 months ago: dmdiss started this project.
  • 9 months ago: dmdiss originated this project.

  • Comments

    • dmdiss
      8 months ago by dmdiss | Reply

      With hackweek now over, below is a summary of what I achieved. I decided to prioritize learning a new language, which saw me use Rust for the implementation. This slowed me down quite a bit, leaving:

      • revisited current upstream lkl state
        • found current UML merge submissions lack Android support, so instead fell-back to thehajime's lkl-next repo
      • rebased ceph-walkley (from hw19) against lkl-v5.10
      • submitted a couple of minor PRs upstream: 1 and 2
      • rebased ceph-walkley's embedded wireguard library against upstream
      • reworked the ceph-walkley build process to better handle kconfig and parallel build jobs
      • learned Rust's bindgen to generate lkl_host and libusb language bindings
      • investigated Linux's functionfs gadget API, mostly via the upstream example
      • wrote basic lkl boot / init program in Rust
      • wrote libusb dev/config/interface/endpoint enumeration utility in Rust

    • dmdiss
      8 months ago by dmdiss | Reply

      I've published my Hackweek 20 source code at This is my first proper Rust project, which probably shows. To build, it requires lkl-next-5.10 liblkl at $LKL_DIR, which will be statically linked.

    Similar Projects

    This project is one of its kind!