Skip to content

Commit 169af8d

Browse files
sandycelesticaqiluo-msft
authored andcommitted
[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.
1 parent da7f596 commit 169af8d

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
depmod -a
2+
sudo chmod +x /usr/local/bin/udev_prefix.sh
3+
sudo chmod +x /usr/local/bin/popmsg.sh
4+
sudo chmod +x /usr/local/bin/reload_udev.sh
25
systemctl enable platform-modules-haliburton.service
36
systemctl enable fancontrol.service
47

58
systemctl start platform-modules-haliburton.service
69
systemctl start fancontrol.service
710

811
/usr/local/bin/platform_api_mgnt.sh install
9-
sudo chmod +x /usr/local/bin/udev_prefix.sh
10-
sudo chmod +x /usr/local/bin/popmsg.sh
12+
/usr/local/bin/reload_udev.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
UDEV_DIR=/etc/udev/rules.d/50-ttyUSB-C0.rules
4+
TTYUSB_DIR=/dev/ttyUSB
5+
6+
if [ -f "$UDEV_DIR" ]; then
7+
for i in {0..95}
8+
do
9+
ttydev=$TTYUSB_DIR$i
10+
if [ -c "$ttydev" ]; then
11+
udevadm trigger -c add $ttydev
12+
fi
13+
done
14+
fi

0 commit comments

Comments
 (0)