eduardas_m | spiiroin: hello, I would like to make buteo-mtp a standalone component that I could use in my Yocto builds without any other mer middleware... could you provide advice on the best way to go about this? | 09:24 |
---|---|---|
eduardas_m | i.e. what are the parts of the code that can be safely removed or need to be changed? | 09:25 |
r0kk3rz | eduardas_m: im not sure that makes sense | 10:02 |
eduardas_m | r0kk3rz: well, I need a USB-MTP solution for a Yocto project based system and something that is not under GPLv3/LGPLv3 is needed (permissive licenses are preferred, of course) | 10:13 |
eduardas_m | and I do not want to pull in all of the mer middleware just to have USB-MTP | 10:14 |
eduardas_m | r0kk3rz: and there aren't that many USB-MTP solutions for Linux: http://www.trivialfeat.com/home/2016/11/17/media-transfer-protocol-in-a-usb-composite-gadget | 10:14 |
r0kk3rz | yeah i can see that, most of them deal with the host side not the gadget side | 10:15 |
eduardas_m | uMTP-Responder is under GPLv3 and Ubuntu Touch MTP server too | 10:15 |
r0kk3rz | it shouldnt be too bad if you pull in syncd | 10:15 |
eduardas_m | r0kk3rz: what is that? where is it located in the source? what does it do? | 10:16 |
r0kk3rz | but the whole thing is written in qt, so you'll need that too | 10:16 |
r0kk3rz | https://git.merproject.org/spiiroin/buteo-syncfw/tree/master | 10:16 |
eduardas_m | r0kk3rz: I already have Qt, so no problem there | 10:16 |
r0kk3rz | sorry, better look at the proper one - https://git.merproject.org/mer-core/buteo-syncfw | 10:16 |
eduardas_m | r0kk3rz: thank you, but what does it do exactly? | 10:19 |
r0kk3rz | ok, so that mtp thing, is a plugin for msyncd | 10:20 |
eduardas_m | r0kk3rz: also my problem now is that I can not find the place where it is specified for buteo-mtp what part of the flash storage to expose | 10:20 |
r0kk3rz | eduardas_m: thats because its complicated :) | 10:24 |
eduardas_m | r0kk3rz: that is a simple fact of life in embedded Linux...everything is complicated... | 10:26 |
r0kk3rz | well iirc, the way that part works is probably not the way you want | 10:27 |
eduardas_m | r0kk3rz: also what is contextkit?... I see it is a dependency of buteo-mtp | 10:27 |
eduardas_m | I just want to set a single partition with user files and be done with it, honestly | 10:28 |
eduardas_m | uMTP-Responder has a config for that and in Ubuntu Touch it is enough to hardcode a single string | 10:29 |
eduardas_m | r0kk3rz: not sure, but perhaps fsstorageplugin is responsible for that: https://github.com/AsteroidOS/meta-asteroid/commit/5bb2bd258c2a7bd9aec8de05ab62f521a408c9a0#diff-641651c474a1992290016ecc5dab7e62 | 10:33 |
r0kk3rz | eduardas_m: if kido has it working in asteroid, then steal his recipes | 10:35 |
eduardas_m | r0kk3rz: well, I have been aware of his work for a while... my problem with his recipes is that one must pull in quite a few packages (not just buteo-mtp), i. e. a lot of mer middleware that I do not understand | 10:38 |
r0kk3rz | yeah that happens | 10:38 |
r0kk3rz | he also probably has a more complicated use case than you | 10:39 |
eduardas_m | r0kk3rz: well, after poking around with bitbake, this is how much one needs to satisfy just the dependencies specified in metadata: https://pastebin.com/GLNVwNEu | 10:52 |
eduardas_m | to even get bitbake to start building buteo-mtp... | 10:53 |
eduardas_m | and most of those... I have no idea what they do :D | 10:53 |
r0kk3rz | you can probably cut a lot of those off | 11:03 |
r0kk3rz | mce, dsme, ngfd | 11:04 |
r0kk3rz | you need more or a graph :) | 11:06 |
r0kk3rz | which i think bitbake can do | 11:06 |
r0kk3rz | yeah -g flag | 11:07 |
eduardas_m | r0kk3rz: thank you for your help...will try to decouple stuff | 11:10 |
spiiroin | eduardas_m: I'd start by working in sailfish sdk (to initially have the build deps), then dropping everything that is not needed for building the standalone daemon from .pro files, then start weeding the sfos specific build requirements, and finally drop unwanted packages / files from packages from the spec file | 12:32 |
spiiroin | the end result should be something that has just qt deps I guess | 12:33 |
r0kk3rz | spiiroin: how dependent on usbmoded is it? | 12:33 |
spiiroin | r0kk3rz: zero | 12:34 |
r0kk3rz | ah ok, so usbmoded delegates to the mtp service | 12:34 |
spiiroin | ... we've just changed how it works, so ... | 12:34 |
spiiroin | it used to be so that: | 12:34 |
spiiroin | usb moded -> programs gadget config & sends "mtp-mode" signal -> caught by msyncd that loads mtp plugin (from buteo-mtp source tree) -> mtp appears limping on the bus | 12:36 |
spiiroin | now it goes: usb moded disables usb, preps gadget config, starts mtp daemon, waits for mtp daemon to configure endpoints -> usb moded enables usb -> mtp should be ready to serve when it is visible on bus | 12:37 |
spiiroin | in neither case the mtp functionality itself (stuff from buteo-mtp) knows anything about usb-moded | 12:38 |
r0kk3rz | but it would still need something to handle the gadget config? | 12:39 |
r0kk3rz | which isnt that hard, you can do it from a shell script | 12:39 |
spiiroin | r0kk3rz: yes, but it does not need to be usb-moded | 12:39 |
r0kk3rz | sounds reasonable | 12:40 |
spiiroin | r0kk3rz: while debugging configfs vs what usb-moded did handle, I did this: https://git.merproject.org/mer-core/usb-moded/blob/master/scripts/set_usb_mode.sh | 12:41 |
spiiroin | kind of "usb-moded as shell script for sony xa2" | 12:42 |
r0kk3rz | aha | 12:42 |
r0kk3rz | that looks really useful actually | 12:43 |
spiiroin | review appreciated: usb mode selector tweaks | 12:59 |
spiiroin | https://git.merproject.org/mer-core/libusb-moded-qt/merge_requests/4 | 12:59 |
spiiroin | https://git.merproject.org/mer-core/lipstick/merge_requests/86 | 12:59 |
eduardas_m | that is really useful information | 13:03 |
eduardas_m | spiiroin: I am now trying out your script on my i.MX6 system... I do a mount -t configfs none /config and then ./set_usb_mode.sh -v mtp_mode | 13:49 |
eduardas_m | configfs mount point does not seem to get populated | 13:49 |
eduardas_m | only output of script in verbose mode is set_usb_mode.sh: D: Validate ConfigFS mountpoint | 13:50 |
eduardas_m | any idea what I am doing wrong? | 13:51 |
r0kk3rz | eduardas_m: you have configfs kernel options set? | 13:52 |
eduardas_m | r0kk3rz: yes | 13:52 |
r0kk3rz | iirc there should be at least one folder in the mount | 13:52 |
eduardas_m | r0kk3rz: here is my mount command output https://pastebin.com/DDKtZAAp | 13:53 |
r0kk3rz | yeah but what is in the /config dir | 13:55 |
eduardas_m | nothing | 13:55 |
r0kk3rz | do a mkdir -p usb_gadget/g1 | 13:56 |
eduardas_m | mkdir: 'usb_gadget': Operation not permitted | 13:57 |
eduardas_m | succeeded after I did a modprobe g_ffs (FunctionFS driver module) | 13:59 |
eduardas_m | no idea what the logic here is | 13:59 |
r0kk3rz | ah yes of course | 14:09 |
r0kk3rz | you'll need to make sure the modules are loaded :P | 14:09 |
eduardas_m | r0kk3rz: now I am stuck with mkdir: '/config/usb_gadget/g1/functions/ffs.mtp': Device or resource busy | 14:26 |
r0kk3rz | eduardas_m: do a lsmod and check whats loaded | 14:41 |
eduardas_m | r0kk3rz: configfs, libcomposite, usb_f_fs and g_ffs modules seem to be loaded this time | 14:51 |
r0kk3rz | mtp module? | 14:52 |
eduardas_m | r0kk3rz: only Android kernels have dedicated MTP modules, I thought buteo-mtp can function without that | 14:53 |
eduardas_m | the USB-MTP kernel module from Android (same thing used by Ubuntu Touch) was never accepted into mainline | 14:54 |
r0kk3rz | typically this stuff is run with android kernels these days | 14:57 |
r0kk3rz | and what you're currently doing is setting up kernel stuff through configfs | 14:57 |
eduardas_m | r0kk3rz: yes, good point... it seems that if I try to create mtp.mtp in functions directory that works (but this uses the out-of-tree module I have used for Ubuntu touch experiments) | 15:02 |
eduardas_m | I am not running an Android kernel, but merely a fork of the NXP 4.9 vendor kernel for i.MX6 | 15:03 |
r0kk3rz | eduardas_m: https://www.kernel.org/doc/Documentation/usb/functionfs.txt | 15:06 |
eduardas_m | spiiroin: does buteo-mtp still require an Android-specific driver? | 15:54 |
eduardas_m | spiiroin: FUNCTION_MTP="ffs.mtp" in the set_usb_mode.sh script got me confused | 15:55 |
eduardas_m | the Android MTP gadget driver uses the mtp.mtp name https://wiki.linaro.org/LMG/Kernel/AndroidConfigFSGadgets | 15:56 |
kimmoli | the abbreviation FFS in MTP context is on point ? | 15:59 |
r0kk3rz | :D | 16:04 |
r0kk3rz | they are often said in context | 16:04 |
spiiroin | eduardas_m: that script is "investigating how configfs goes in general and specifically sony xa2" i.e. details like ffs.mtp are "whatever worked in xa2" | 19:46 |
spiiroin | IIRC all buteo-mtp needs is /dev/mtp/ep0 to write to - in sfos that is handled by dev-mtp.mount systemd unit | 19:49 |
spiiroin | ... but in addition to that the gadget config (whether it happens via android usb, configs, or kernel mods) must be sane & enabled too | 19:51 |
Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!