setup

  • gadget source: https://github.com/oandrew/ipod-gadget.git commmit: 731a4714248f1fc13bd1f1fd9b24c5ddaeb5a501
  • kernel source: https://github.com/LineageOS/android_kernel_samsung_exynos9810a commit: 6a9461f9460ca51d1217e5069a5d5556fcc79e63
  • on a debian 12 system with packages to build kernel + gcc-arm-linux-gnueabi installed
  • aosp source tree to build kernel
    • nix build github:c2vi/nixos/fe411df12d5d4e2017e7fa99dea2a4c05b149b5e#robotnixConfigurations.s9.config.build.debugEnterEnv —option max-call-depth 100000000
    • needs change to open file limit
    • run ./result in an empty folder
    • source build/envsetup && breakfast starlte && make bootimage # to build kernel

place i got a toolchain from

https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/+archive/b0c6a654327ca8796bed1e61dffcf523d04dceaa.tar.gz

  • didn’t work

how i got it to work

  • i didn’t get building it out of tree to work
  • copying the ipod-gadget into the kernel source inside aosp however worked
    • mkdir $aosp-root/kernel/samsung/exynos9810/drivers/ipod-gadget/
    • ipod-gadget/gadget/* $aosp-root/kernel/samsung/exynos9810/drivers/ipod-gadget/
    • then add to $kernel/drivers/Kconfig
    source "drivers/ipod-gadget/Kconfig"
    
    • add to $kernel/drivers/Makefile at the bottom
    obj-$(CONFIG_IPOD_MOD) += ipod-gadget/
    
    • add $kernel/drivers/ipod-gadget/Kconfig
    config IPOD_MOD
        tristate "Ipod protocol gadget module"
        default m
        depends on MODULES
        help
          see: https://github.com/oandrew/ipod-gadget
    
    • and change the Makefile $kernel/drivers/ipod-gadget/Makefile to
    # call from kernel build system
    ifneq ($(KERNELRELEASE),)
    
    g_ipod-y := ipod.o
    g_ipod_hid-y := ipod_hid.o
    g_ipod_audio-y := ipod_audio.o
    g_ipod_gadget-y := ipod_gadget.o
    
    obj-m += g_ipod_hid.o g_ipod_audio.o g_ipod_gadget.o
    
    endif
    
    • then: source build/envsetup.sh && breakfast starlte && m bootimage
    • you have a flashable boot.img in $aosp-root/out/target/product/starlte/boot.img