Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions files/build_templates/pcie-chk.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=Start the pcie-chk.service in 10 seconds after boot

[Timer]
OnBootSec=10sec
Unit=pcie-chk.service

[Install]
WantedBy=timers.target
9 changes: 0 additions & 9 deletions files/build_templates/pcie-mon.timer

This file was deleted.

12 changes: 6 additions & 6 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,13 @@ echo "procdockerstatsd.service" | sudo tee -a $GENERATED_SERVICE_FILE
sudo cp $IMAGE_CONFIGS/procdockerstatsd/procdockerstatsd $FILESYSTEM_ROOT/usr/bin/

# Copy systemd timer configuration
sudo cp $BUILD_TEMPLATES/pcie-mon.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable pcie-mon.timer
sudo cp $BUILD_TEMPLATES/pcie-chk.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable pcie-chk.timer

# Copy pcie-mon service files
sudo cp $IMAGE_CONFIGS/pcie-mon/pcie-mon.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
echo "pcie-mon.service" | sudo tee -a $GENERATED_SERVICE_FILE
sudo cp $IMAGE_CONFIGS/pcie-mon.sh $FILESYSTEM_ROOT/usr/bin/
# Copy pcie-chk service files
sudo cp $IMAGE_CONFIGS/pcie-chk/pcie-chk.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM
echo "pcie-chk.service" | sudo tee -a $GENERATED_SERVICE_FILE
sudo cp $IMAGE_CONFIGS/pcie-chk.sh $FILESYSTEM_ROOT/usr/bin/

# Copy systemd timer configuration
# It implements delayed start of services
Expand Down
8 changes: 8 additions & 0 deletions files/image_config/pcie-chk/pcie-chk.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=Check the PCIe device presence and status
After=rc.local.service

[Service]
Type=simple
ExecStart=/usr/bin/pcie-chk.sh

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function check_and_rescan_pcie_devices()
debug "PCIe check passed"
exit
else
debug "PCIe RESCAN"
debug "PCIe check failed, try pci bus rescan"
echo 1 > /sys/bus/pci/rescan
fi
sleep 1
Expand Down
8 changes: 0 additions & 8 deletions files/image_config/pcie-mon/pcie-mon.service

This file was deleted.