gadget is not an essential functionality, it will not go to the base.
Okay - g_ether and g_mass_storage are not. But you currently support a serial connection via ACM0 or S0. Having gadget mode in PiZero one can have a serial connection without any additional hardware or cable (despite a power usb cable connected to the usb port, which is needed anyway for power). To me this seems more essential than connecting GPIO pins and sharing ACM0
But I understand your point - ACM0 is available anyway
@Paul_123 My point is that gadget is built into PiZero, therefore no need to buy any additional hardware nor to make software configurations. All PiZero users get this for free.
However it can be useful to have when no ethernet is available. What we can do to make kernel modules and support programs if any as tcz, test and add to the repo. If it works fine, we can decide to preinstall same way as openssh.
@johannkraus
Can you provide list of kernel modules and user space programs, files needed?
That would be fine. I'll have a look at the the minimal set of kernel modules needed for serial/ether/storage configurations and come back to you.
For now I can only tell what lsmod tells me
usb_f_acm 6023 1
u_serial 11369 1 usb_f_acm
usb_f_rndis 17023 1
g_multi 5631 0
usb_f_mass_storage 39135 2 g_multi
libcomposite 49319 4 usb_f_acm,usb_f_rndis,g_multi,usb_f_mass_storage
u_ether 14023 2 usb_f_rndis,g_multi
dwc2 109939 0
udc_core 12750 2 libcomposite,dwc2
Being lazy for serialtty I have:
Having cmdline0.txt (like cmdline3.txt) as
console=ttyGS0,115200 ...
my change to /usr/sbin/startserialtty is at line7
elif [ "${model:0:17}" = "Raspberry Pi Zero" ]; then
port=ttyGS0
However, this does not work if dwc2, libcomposite, usb_f_acm and u_serial are not available and modprobed before. And it should only be made iff the dwc2 overlay is used. I don't find infos about used overlays in /proc/device-tree otherwise I would just add this to the elif condition above.
And being even more lazy - for ether and mass storage I have in /opt/bootlocal.sh
# ------ Put other system startup commands below this line
/sbin/modprobe dwc2 # <- but this is too late for /usr/sbin/startserialtty and had to be moved to line 2
/bin/sleep 5 # <- and this is killing performance if moved to line 2
Currently searching a way to avoid it.
/sbin/modprobe g_multi file=/home/tc/piusb.bin stall=0
/sbin/ifconfig usb0 192.168.100.2 up