whiskerz007/proxmox_hassio_lxc

using /dev/serial/by-id

mdallau opened this issue · 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.

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'

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?

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