Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion rhel10/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ _mount_rootfs() {
mount --rbind / ${RUN_DIR}/driver

echo "Check SELinux status"
if [ -e /sys/fs/selinux ]; then
if grep -qsw "selinuxfs" /proc/mounts && [ -f /sys/fs/selinux/enforce ]; then
echo "SELinux is enabled"
echo "Change device files security context for selinux compatibility"
chcon -R -t container_file_t ${RUN_DIR}/driver/dev
Expand Down
12 changes: 9 additions & 3 deletions rhel10/ocp_dtk_entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,15 @@ nv-ctr-run-with-dtk() {
cp -rv "${MODULES_SHARED}"/* "${MODULES_LOCAL}"

# Tell SELinux to allow loading these files
find . -type f \
\( -name "*.txt" -or -name "*.go" \) \
-exec chcon -t modules_object_t "{}" \;
echo "Check SELinux status"
if grep -qsw "selinuxfs" /proc/mounts && [ -f /sys/fs/selinux/enforce ]; then
echo "SELinux is enabled"
find . -type f \
\( -name "*.txt" -or -name "*.go" \) \
-exec chcon -t modules_object_t "{}" \;
else
echo "SELinux is disabled, skipping..."
fi

echo "#"
echo "# Executing nvidia-driver load script ..."
Expand Down
2 changes: 1 addition & 1 deletion rhel10/precompiled/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ _mount_rootfs() {
mount --rbind / ${RUN_DIR}/driver

echo "Check SELinux status"
if [ -e /sys/fs/selinux ]; then
if grep -qsw "selinuxfs" /proc/mounts && [ -f /sys/fs/selinux/enforce ]; then
echo "SELinux is enabled"
echo "Change device files security context for selinux compatibility"
chcon -R -t container_file_t ${RUN_DIR}/driver/dev
Expand Down
2 changes: 1 addition & 1 deletion rhel8/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ _mount_rootfs() {
mount --rbind / ${RUN_DIR}/driver

echo "Check SELinux status"
if [ -e /sys/fs/selinux ]; then
if grep -qsw "selinuxfs" /proc/mounts && [ -f /sys/fs/selinux/enforce ]; then
echo "SELinux is enabled"
echo "Change device files security context for selinux compatibility"
chcon -R -t container_file_t ${RUN_DIR}/driver/dev
Expand Down
12 changes: 9 additions & 3 deletions rhel8/ocp_dtk_entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,15 @@ nv-ctr-run-with-dtk() {
cp -rv "${MODULES_SHARED}"/* "${MODULES_LOCAL}"

# Tell SELinux to allow loading these files
find . -type f \
\( -name "*.txt" -or -name "*.go" \) \
-exec chcon -t modules_object_t "{}" \;
echo "Check SELinux status"
if grep -qsw "selinuxfs" /proc/mounts && [ -f /sys/fs/selinux/enforce ]; then
echo "SELinux is enabled"
find . -type f \
\( -name "*.txt" -or -name "*.go" \) \
-exec chcon -t modules_object_t "{}" \;
else
echo "SELinux is disabled, skipping..."
fi

echo "#"
echo "# Executing nvidia-driver load script ..."
Expand Down
2 changes: 1 addition & 1 deletion rhel8/precompiled/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ _mount_rootfs() {
mount --rbind / ${RUN_DIR}/driver

echo "Check SELinux status"
if [ -e /sys/fs/selinux ]; then
if grep -qsw "selinuxfs" /proc/mounts && [ -f /sys/fs/selinux/enforce ]; then
echo "SELinux is enabled"
echo "Change device files security context for selinux compatibility"
chcon -R -t container_file_t ${RUN_DIR}/driver/dev
Expand Down
2 changes: 1 addition & 1 deletion rhel9/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ _mount_rootfs() {
mount --rbind / ${RUN_DIR}/driver

echo "Check SELinux status"
if [ -e /sys/fs/selinux ]; then
if grep -qsw "selinuxfs" /proc/mounts && [ -f /sys/fs/selinux/enforce ]; then
echo "SELinux is enabled"
echo "Change device files security context for selinux compatibility"
chcon -R -t container_file_t ${RUN_DIR}/driver/dev
Expand Down
12 changes: 9 additions & 3 deletions rhel9/ocp_dtk_entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,15 @@ nv-ctr-run-with-dtk() {
cp -rv "${MODULES_SHARED}"/* "${MODULES_LOCAL}"

# Tell SELinux to allow loading these files
find . -type f \
\( -name "*.txt" -or -name "*.go" \) \
-exec chcon -t modules_object_t "{}" \;
echo "Check SELinux status"
if grep -qsw "selinuxfs" /proc/mounts && [ -f /sys/fs/selinux/enforce ]; then
echo "SELinux is enabled"
find . -type f \
\( -name "*.txt" -or -name "*.go" \) \
-exec chcon -t modules_object_t "{}" \;
else
echo "SELinux is disabled, skipping..."
fi

echo "#"
echo "# Executing nvidia-driver load script ..."
Expand Down
2 changes: 1 addition & 1 deletion rhel9/precompiled/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ _mount_rootfs() {
mount --rbind / ${RUN_DIR}/driver

echo "Check SELinux status"
if [ -e /sys/fs/selinux ]; then
if grep -qsw "selinuxfs" /proc/mounts && [ -f /sys/fs/selinux/enforce ]; then
echo "SELinux is enabled"
echo "Change device files security context for selinux compatibility"
chcon -R -t container_file_t ${RUN_DIR}/driver/dev
Expand Down
10 changes: 8 additions & 2 deletions vgpu-manager/rhel8/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ _mount_rootfs() {
mkdir -p ${RUN_DIR}/driver
mount --rbind / ${RUN_DIR}/driver

echo "Change device files security context for selinux compatibility"
chcon -R -t container_file_t ${RUN_DIR}/driver/dev
echo "Check SELinux status"
if grep -qsw "selinuxfs" /proc/mounts && [ -f /sys/fs/selinux/enforce ]; then
echo "SELinux is enabled"
echo "Change device files security context for selinux compatibility"
chcon -R -t container_file_t ${RUN_DIR}/driver/dev
else
echo "SELinux is disabled, skipping..."
fi
}

# Unmount the driver rootfs from the run directory.
Expand Down
10 changes: 8 additions & 2 deletions vgpu-manager/rhel9/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ _mount_rootfs() {
mkdir -p ${RUN_DIR}/driver
mount --rbind / ${RUN_DIR}/driver

echo "Change device files security context for selinux compatibility"
chcon -R -t container_file_t ${RUN_DIR}/driver/dev
echo "Check SELinux status"
if grep -qsw "selinuxfs" /proc/mounts && [ -f /sys/fs/selinux/enforce ]; then
echo "SELinux is enabled"
echo "Change device files security context for selinux compatibility"
chcon -R -t container_file_t ${RUN_DIR}/driver/dev
else
echo "SELinux is disabled, skipping..."
fi
}

# Unmount the driver rootfs from the run directory.
Expand Down