As my mind wanders, I wonder just how the existing setup is managed. When I plug in the pico (while holding bootsel), my system detects that a new "flash stick" has shown up on the USB bus, and it generates /dev/sdd and /dev/sdd1 for it (with permissions allowing access by root:disk), but nothing more. When I click on the icon that clues me in to this, it mounts the drive as /run/media/tom/RPI-RP2. This mount point is owned by tom and allows me access to the drive. Mount shows:
/dev/sdd1 on /run/media/tom/RPI-RP2 type vfat (rw,nosuid,nodev,relatime,uid=1004,gid=1004,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)Some of this is managed by the Thunar manager, which is part of XFCE. I launch Thunar, go to Edit--Preferences, and select Advanced. I see "Enable volume management" is already checked. I click on "Configure" and select both "Mount when hot-plugged" and "Mount when inserted". This yields an improvement. Now when I Plug in the Pico with bootsel, it mounts it for me on /dev/sdd1 as /run/media/tom/RPI-RP2 -- no need for me to click the icon, though the icon still appears. Also it does not launch Thunar, which is wonderful. I also get the link /dev/rp2040upl, but not /dev/rp2040upl1 -- but I may not care about these links.
What I could do is to write a script (that could run as tom) that just polls looking for /run/media/tom/RPI-RP2 to show up, and when it does it would copy the uf2 file to it and exit. This could be part of my standard drill in my Makefiles under "make install". In fact I would probably put together a script in /usr/tom/bin to handle all of this, so I could put this entry in my makefile:
install: pico-boot xyz.uf2So, I would type "make install", then go hit reset and bootsel on the Pico and would just sit back until my code started running. This script could time out after some interval (let's say 30 seconds) and announce failure.
Tom's electronics pages / [email protected]