169af8ddab
Use udevadm to trigger the udev rules on the first boot How to verify: - Connect C0 with E1031; - Install or upgrade the sonic os to 202012 branch; - When access to sonic check if /dev/C0-1 to /dev/C0-48 are existed.
15 lines
316 B
Bash
15 lines
316 B
Bash
#!/bin/bash
|
|
|
|
UDEV_DIR=/etc/udev/rules.d/50-ttyUSB-C0.rules
|
|
TTYUSB_DIR=/dev/ttyUSB
|
|
|
|
if [ -f "$UDEV_DIR" ]; then
|
|
for i in {0..95}
|
|
do
|
|
ttydev=$TTYUSB_DIR$i
|
|
if [ -c "$ttydev" ]; then
|
|
udevadm trigger -c add $ttydev
|
|
fi
|
|
done
|
|
fi
|