Re: mount phone for file transfer?

From: Matthias Apitz <guru_at_unixarea.de>
Date: Sun, 19 Oct 2025 17:40:37 UTC
El día domingo, octubre 19, 2025 a las 11:13:50a. m. -0600, Gary Aitken escribió:

> Hi all,
> 
> How does one mount a phone (android) to transfer files?
> I can do this on a lynix system but can't figure out how on my fbsd 13.5.
> I have urndis loaded:
> 
> $ kldstat | grep urn
> 16    1 0xffffffff82773000     3380 if_urndis.ko
> 
> $ dmesg | tail
> ugen7.2: <SAMSUNG SAMSUNGAndroid> at usbus7
> umodem0 on uhub2
> umodem0: <CDC Abstract Control Model (ACM)> on usbus7
> umodem0: data interface 2, has no CM over data, has no break
> 
> ...

I don't mount, but use SSH and SCP from/to my Linux cellphone Purism L5.
On plugin of the USB cable the following driver is loaded:

Oct 19 19:33:24 c720-1400094 kernel: ugen0.4: <Purism, SPC Librem 5> at usbus0
Oct 19 19:33:24 c720-1400094 kernel: cdce0 on uhub0
Oct 19 19:33:24 c720-1400094 kernel: cdce0: <CDC Network Control Model (NCM)> on usbus0
Oct 19 19:33:24 c720-1400094 kernel: ue0: <USB Ethernet> on cdce0
Oct 19 19:33:24 c720-1400094 kernel: ue0: Ethernet address: a2:7a:8e:7f:ac:93
Oct 19 19:33:24 c720-1400094 kernel: umodem0 on uhub0
Oct 19 19:33:24 c720-1400094 kernel: umodem0: <CDC Abstract Control Model (ACM)> on usbus0
Oct 19 19:33:24 c720-1400094 kernel: umodem0: data interface 1, has no CM over data, has no break
Oct 19 19:33:24 c720-1400094 kernel: ue0: link state changed to UP
Oct 19 19:33:29 c720-1400094 kernel: usb_dev_resume_peer: Clearing device remote wakeup failed: USB_ERR_TIMEOUT


$ ifconfig ue0
ue0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
	options=80000<LINKSTATE>
	ether a2:7a:8e:7f:ac:93
	inet 10.42.0.19 netmask 0xffffff00 broadcast 10.42.0.255
	inet6 fe80::a07a:8eff:fe7f:ac93%ue0 prefixlen 64 scopeid 0x3
	media: Ethernet autoselect
	status: active
	nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

This is done by devd-hooks:

$ cat /usr/local/etc/devd/l5.conf

notify 1 {
	match "system"          "IFNET";
	match "subsystem"       "ue0";
	match "type"            "ATTACH";
	action "/usr/local/etc/devd/l5.sh";
};

$ cat /usr/local/etc/devd/l5.sh
#!/bin/sh
#
dhclient ue0
exit 0

And works for years this way already, I forgot the hooks and have had to
look into :-)

HIH

	matthias


-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub

An die deutsche Bundesregierung: Nein, meine Söhne geb' ich nicht für Ihren Krieg!
Al Gobierno alemán: ¡No, no doy mis hijos para su guerra!
To the German Government: No, I will not give my sons for your war!