Skip to content

Commit e0354a3

Browse files
authored
Merge pull request openshift#879 from almaslennikov/pci-ids-in-systemd-mode
fix: copy pci.ids file to host in systemd mode
2 parents 578098b + 136891d commit e0354a3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bindata/manifests/daemon/daemonset.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,15 @@ spec:
116116
command:
117117
- /bin/bash
118118
- -c
119-
- mkdir -p /host/var/lib/sriov/ && cp /usr/bin/sriov-network-config-daemon /host/var/lib/sriov/sriov-network-config-daemon && chcon -t bin_t /host/var/lib/sriov/sriov-network-config-daemon | true # Allow systemd to run the file, use pipe true to not failed if the system doesn't have selinux or apparmor enabled
119+
- |
120+
set -e
121+
if [ ! -f /host/usr/share/hwdata/pci.ids ]; then # If pci.ids file is missing on the host, config daemon won't be able to discover PCI devices
122+
mkdir -p /host/usr/share/hwdata/
123+
cp /usr/share/hwdata/pci.ids /host/usr/share/hwdata/pci.ids
124+
fi
125+
mkdir -p /host/var/lib/sriov/
126+
cp /usr/bin/sriov-network-config-daemon /host/var/lib/sriov/sriov-network-config-daemon
127+
chcon -t bin_t /host/var/lib/sriov/sriov-network-config-daemon || true # Allow systemd to run the file, use pipe true to not failed if the system doesn't have selinux or apparmor enabled
120128
securityContext:
121129
privileged: true
122130
resources:

0 commit comments

Comments
 (0)