sonic-buildimage/platform/broadcom/sonic-platform-modules-cel/haliburton/script/reload_udev.sh
sandycelestica 169af8ddab [celestica]: Fix E1031 udev rules not work for sonic os first boot after be installed (#7043)
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.
2021-07-14 06:34:24 +00:00

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