Rename usb serial device in jail

Status
Not open for further replies.

Artix

Cadet
Joined
May 25, 2016
Messages
8
Hello,

I use a jail on FreeNAS 11.1-STABLE for home automation (home-assistant)

I have 2 serial usb device used on this jail and I'm having problem with naming.

This two device are named /dev/cuaU[0-1] but I'm not able to persist the name between restart or disconnect of the device.

I tried to investigate devd rules and it works nicely in the FreeNAS system.

In file /dev/devd/zstick.conf

Code:
attach 1000 {
		match "vendor" "0x0658";
		match "product" "0x0200";
		action "ln -sf /dev/cua$ttyname /dev/zstick";
};

notify 1000 {
  match "subsystem" "DEVICE";
  match "type" "DETACH";
  match "vendor" "0x0658";
  match "product" "0x0200";
  action "rm /dev/zstick";
};

In the jail I tried the following solution :

  • In jail /dev/devd/zstick.conf --> Cannot do this in the jail because devd is not running.
  • In FreeNAS /dev/devfs.rules unhide zstick --> not working, /dev/zstick is only a symbolic link so devfs won't mount it in the jail
Only dirty solution i see is create a symbolic link from FreeNAS devd
Code:
/mnt/tank/jails/home_assistant/dev/zstick -> /mnt/tank/jails/home_assistant/dev/cuaU*


Is there a way to make devfs know about /dev/zstick and make the unhide thing work?

Another less dirty solution?

Thanks for your help!
 
Last edited by a moderator:

Artix

Cadet
Joined
May 25, 2016
Messages
8
Hello,

No i don't.

I will probably try the dirty solution with a symbolic link from FreeNAS devd to the jail.

I have asked in freebsd forum too...

Any answer will be posted here :)
 

Jakob Tewes

Cadet
Joined
Oct 8, 2016
Messages
5
Hey Atrix,

switched to iocage today. came out of the blue (warden stopped working - could no more provision working jails).
How did you exponate your dev-nodes to the jail? With warden i went with allow.mount.devfs and ignored the security concerns.
With
Code:
iocage set allow_mount_devfs=1 jailname
there are still no
Code:
/dev/cuaU0
devices
 
Status
Not open for further replies.
Top