Skip to content

Commit 6368e07

Browse files
committed
Switch container exec from bash to sh in fix_gpu_gids
Replaces bash with sh for container execution in fix_gpu_gids and updates device matching logic to use a POSIX-compliant case statement. This improves compatibility with containers that may not have bash installed.
1 parent 7ce32cc commit 6368e07

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

misc/build.func

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,15 +2954,14 @@ fix_gpu_gids() {
29542954

29552955
# For privileged containers: also fix permissions inside container
29562956
if [[ "$CT_TYPE" == "0" ]]; then
2957-
pct exec "$CTID" -- bash -c "
2957+
pct exec "$CTID" -- sh -c "
29582958
if [ -d /dev/dri ]; then
29592959
for dev in /dev/dri/*; do
29602960
if [ -e \"\$dev\" ]; then
2961-
if [[ \"\$dev\" =~ renderD ]]; then
2962-
chgrp ${render_gid} \"\$dev\" 2>/dev/null || true
2963-
else
2964-
chgrp ${video_gid} \"\$dev\" 2>/dev/null || true
2965-
fi
2961+
case \"\$dev\" in
2962+
*renderD*) chgrp ${render_gid} \"\$dev\" 2>/dev/null || true ;;
2963+
*) chgrp ${video_gid} \"\$dev\" 2>/dev/null || true ;;
2964+
esac
29662965
chmod 660 \"\$dev\" 2>/dev/null || true
29672966
fi
29682967
done

0 commit comments

Comments
 (0)