Monday, 2026-08-10

*** n2klb_ is now known as n2klb01:48
sharks_I'm learning things about usb-moded / usb gadgets09:44
sharks_if I run `ln -s /config/usb_gadget/g1/functions/rndis.usb0 /config/usb_gadget/g1/configs/b.1/rndis.usb0`, then `echo "" > /sys/kernel/config/usb_gadget/g1/UDC`, and `echo 4e00000.dwc3 > /sys/kernel/config/usb_gadget/g1/UDC`, I get a network interface to come up at usb0, and the computer sees it.09:44
sharks_No dhcp though, and it seems like some firewall rule is blocking the computer from ssh-ing or ping-ing the phone09:44
sharks_So, this all comes back to usb-moded not initialising properly? My bodgey script that I wrote to fix mtp is all well and good, but whatever was broken that meant I had to do that is also the thing that is broken and causing developer mode to not make the links and directories it is supposed to make on its own09:45
sharks_and I can't just add the commands I ran to make developer mode work to my fixup script, because it brings up this ghost "developer mode" regardless of what mode is actually selected in SFOS settings. And as soon as you select some other mode, the `/config/usb_gadget/g1/configs/b.1/` directory is modified and `rndis.usb0 disappears, though the usb0 interface hangs around.09:48
sharks_So I need to understand what is _supposed_ to make the `g1` directory and all its subdirectories and simlinks, and work out why it is failing? Has anyone got any ideas?09:49
T42<elros34> usb-moded detect correctly usb connection? On regular build init-debug script create configfs dirs but on lvm not sure maybe you need init*usb*rc or usb-moded itself. Either way you should enable more verboslogging in usb-moded and maybe take a look how usb is handled in init*usb*rc10:00
sharks_Hey Elros - see journal logs, I am fairly certain usb-moded knows when something is plugged in: https://paste.opensuse.org/pastes/7fc3b61ac65c, similarly from `journalctl -u usb-moded -b -f`, I see `/config/usb_gadget/g1/UDC: write failure: Invalid argument` and `mode setting failed, try charging_only` when in developer mode, but nothing in charging or mtp modes.10:16
sharks_I am not sure how to follow what you mean about init*usb*rc, and I am also not sure how to enable more verbose logging!10:17
sharks_contents of anything on device matching init*usb*rc --> https://paste.opensuse.org/pastes/60524bcf45c010:20
T42<elros34> I dont remember how to increase verbosity but it shouldn't be hard find either usb_modded -h or in channel logs10:26
T42<elros34> how do you know from that journal thhat usb-moded detects usb cable connectin correctly?10:28
sharks_I know from `journalctl -u usb-moded -b`10:28
T42<elros34> ok. Based on kernel log I think you should better start with testing developer mode instead mtp which might not work for other reasons10:30
sharks_`usb-moded` is not in my $PATH, but I have `usb_moded_util`? Don't know what it's capable of, will investigate10:30
T42<elros34> usb_moded10:31
sharks_apologies, didn't realise I made that type10:31
sharks_typo*10:31
sharks_Haven't read it myself yet, but10:36
sharks_USB_MODED_ARGS=-r /usr/sbin/usb_moded -D --systemd $USB_MODED_ARGS $USB_MODED_HW_ADAPTATION_ARGS --> https://paste.opensuse.org/pastes/8a305f51374510:36
sharks_So we're back to square one kind of, usb-moded is not making the rndis simlink10:40
sharks_That's what I'm getting from that output anyway10:41
sharks_Yep, I can replicate the issue! If I run `echo "" > /config/usb_gadget/g1/UDC`, `rm /config/usb_gadget/g1/configs/b.1/mass_storage.usb0/`, then `echo 4e00000.dwc3 > /config/usb_gadget/g1/UDC`, I get the same "bash: write error: Invalid argument"10:43
sharks_So usb-moded does not run `ln -s /config/usb_gadget/g1/functions/rndis.usb0 /config/usb_gadget/g1/configs/b.1/rndis.usb0` before resetting the gadget10:44

Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!