proxmox_hassio_lxc icon indicating copy to clipboard operation
proxmox_hassio_lxc copied to clipboard

using /dev/serial/by-id

Open mdallau opened this issue 5 years ago • 3 comments

I like to use the /dev/serial/by-id/usb_xxxxxx symbolic links in my Hassio config, but those doesn't seem to be working. After apt-get install usbutils I can see the symbolic links, but they don't work, however the original devices /dev/ttyUSBx where the symbolic links go do work fine. I think something has to be changed in /etc/pve/lxc/100.conf for the line:

lxc.hook.autodev: bash -c 'for dev in $(ls /dev/tty{ACM,S,USB}* 2>/dev/null) $([ -d "/dev/bus" ] && find /dev/bus -type c) $([ -d "/dev/usb" ] && find /dev/usb -type c) /dev/mem /dev/net/tun; do mkdir -p $(dirname ${LXC_ROOTFS_MOUNT}${dev}); for link in $(udevadm info --query=property $dev | sed -n "s/DEVLINKS=//p"); do mkdir -p ${LXC_ROOTFS_MOUNT}$(dirname $link); cp -dR $link ${LXC_ROOTFS_MOUNT}${link}; done; cp -dR $dev ${LXC_ROOTFS_MOUNT}${dev}; done'

I think to replicate them in the lxc container, but I don't know exactly what.

mdallau avatar Feb 05 '20 22:02 mdallau

Does replacing the following with the line you referred to obtain your desired results?

lxc.hook.autodev: bash -c 'for dev in $(ls /dev/tty{ACM,S,USB}* 2>/dev/null) $([ -d "/dev/bus" ] && find /dev/bus -type c) $([ -d "/dev/serial" ] && find /dev/serial -type c) $([ -d "/dev/usb" ] && find /dev/usb -type c) /dev/mem /dev/net/tun; do mkdir -p $(dirname ${LXC_ROOTFS_MOUNT}${dev}); for link in $(udevadm info --query=property $dev | sed -n "s/DEVLINKS=//p"); do mkdir -p ${LXC_ROOTFS_MOUNT}$(dirname $link); cp -dR $link ${LXC_ROOTFS_MOUNT}${link}; done; cp -dR $dev ${LXC_ROOTFS_MOUNT}${dev}; done'

whiskerz007 avatar Feb 07 '20 14:02 whiskerz007

Does replacing the following with the line you referred to obtain your desired results?

lxc.hook.autodev: bash -c 'for dev in $(ls /dev/tty{ACM,S,USB}* 2>/dev/null) $([ -d "/dev/bus" ] && find /dev/bus -type c) $([ -d "/dev/serial" ] && find /dev/serial -type c) $([ -d "/dev/usb" ] && find /dev/usb -type c) /dev/mem /dev/net/tun; do mkdir -p $(dirname ${LXC_ROOTFS_MOUNT}${dev}); for link in $(udevadm info --query=property $dev | sed -n "s/DEVLINKS=//p"); do mkdir -p ${LXC_ROOTFS_MOUNT}$(dirname $link); cp -dR $link ${LXC_ROOTFS_MOUNT}${link}; done; cp -dR $dev ${LXC_ROOTFS_MOUNT}${dev}; done'

i have try this and it works for me maybe you can implement it in the script?

alexswart avatar Sep 30 '20 20:09 alexswart

Significant changes have been made to the installation script. Is this still an issue with new installs?

whiskerz007 avatar Oct 28 '20 13:10 whiskerz007