Skip to content

Commit

Permalink
[celestica]: Fix E1031 udev rules not work for sonic os first boot af…
Browse files Browse the repository at this point in the history
…ter 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.
  • Loading branch information
sandycelestica authored and qiluo-msft committed Jul 14, 2021
1 parent da7f596 commit 169af8d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
depmod -a
sudo chmod +x /usr/local/bin/udev_prefix.sh
sudo chmod +x /usr/local/bin/popmsg.sh
sudo chmod +x /usr/local/bin/reload_udev.sh
systemctl enable platform-modules-haliburton.service
systemctl enable fancontrol.service

systemctl start platform-modules-haliburton.service
systemctl start fancontrol.service

/usr/local/bin/platform_api_mgnt.sh install
sudo chmod +x /usr/local/bin/udev_prefix.sh
sudo chmod +x /usr/local/bin/popmsg.sh
/usr/local/bin/reload_udev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/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

0 comments on commit 169af8d

Please sign in to comment.