mirror of
https://github.com/tteck/Proxmox.git
synced 2025-02-15 06:09:15 +01:00
added group render mapping
This commit is contained in:
parent
7279ac22c1
commit
43091dcaed
2 changed files with 5 additions and 3 deletions
|
@ -240,6 +240,7 @@ pct start $CTID
|
||||||
msg_ok "Pre-started LXC Container"
|
msg_ok "Pre-started LXC Container"
|
||||||
|
|
||||||
VIDEO_GID=$(pct exec ${CTID} getent group video | cut -d: -f3)
|
VIDEO_GID=$(pct exec ${CTID} getent group video | cut -d: -f3)
|
||||||
|
RENDER_GID=$(pct exec ${CTID} getent group render | cut -d: -f3)
|
||||||
TTY_GID=$(pct exec ${CTID} getent group tty | cut -d: -f3)
|
TTY_GID=$(pct exec ${CTID} getent group tty | cut -d: -f3)
|
||||||
INPUT_GID=$(pct exec ${CTID} getent group input | cut -d: -f3)
|
INPUT_GID=$(pct exec ${CTID} getent group input | cut -d: -f3)
|
||||||
AUDIO_GID=$(pct exec ${CTID} getent group audio | cut -d: -f3)
|
AUDIO_GID=$(pct exec ${CTID} getent group audio | cut -d: -f3)
|
||||||
|
@ -272,7 +273,7 @@ lxc.idmap: u 0 100000 65536
|
||||||
EOF
|
EOF
|
||||||
#TODO internalize code to generate mapping instad of using external python script
|
#TODO internalize code to generate mapping instad of using external python script
|
||||||
LXC_SUB_CONF=$(python3 -c "$(wget -qLO - https://raw.githubusercontent.com/ddimick/proxmox-lxc-idmapper/master/run.py)" \
|
LXC_SUB_CONF=$(python3 -c "$(wget -qLO - https://raw.githubusercontent.com/ddimick/proxmox-lxc-idmapper/master/run.py)" \
|
||||||
${VIDEO_GID}=$(getent group video | cut -d: -f3) ${TTY_GID}=$(getent group tty | cut -d: -f3) ${INPUT_GID}=$(getent group input | cut -d: -f3) ${AUDIO_GID}=$(getent group audio | cut -d: -f3))
|
${VIDEO_GID}=$(getent group video | cut -d: -f3) ${RENDER_GID}=$(getent group render | cut -d: -f3) ${TTY_GID}=$(getent group tty | cut -d: -f3) ${INPUT_GID}=$(getent group input | cut -d: -f3) ${AUDIO_GID}=$(getent group audio | cut -d: -f3))
|
||||||
echo "$LXC_SUB_CONF" | grep 'lxc.idmap: g ' >> $LXC_CONFIG
|
echo "$LXC_SUB_CONF" | grep 'lxc.idmap: g ' >> $LXC_CONFIG
|
||||||
# on host add rights to map gids but only if they are not already in the file
|
# on host add rights to map gids but only if they are not already in the file
|
||||||
echo "$LXC_SUB_CONF" | sed -n '/subgid/,// { /subgid/! p }' | while read line; do cat /etc/subgid | sed 's/[[:blank:]]*//g' | grep -qxF "$line" || echo $line >> /etc/subgid; done
|
echo "$LXC_SUB_CONF" | sed -n '/subgid/,// { /subgid/! p }' | while read line; do cat /etc/subgid | sed 's/[[:blank:]]*//g' | grep -qxF "$line" || echo $line >> /etc/subgid; done
|
||||||
|
@ -290,7 +291,7 @@ EOF
|
||||||
/bin/chmod 755 /dev/dri
|
/bin/chmod 755 /dev/dri
|
||||||
/bin/chown :${VIDEO_GID} /dev/dri/*
|
/bin/chown :${VIDEO_GID} /dev/dri/*
|
||||||
/bin/chmod 660 /dev/dri/*
|
/bin/chmod 660 /dev/dri/*
|
||||||
/bin/chown :${VIDEO_GID} /dev/renderD128
|
/bin/chown :${RENDER_GID} /dev/renderD128
|
||||||
/bin/chmod 660 /dev/renderD128
|
/bin/chmod 660 /dev/renderD128
|
||||||
/bin/chown :${TTY_GID} /dev/tty7
|
/bin/chown :${TTY_GID} /dev/tty7
|
||||||
/bin/chown :${INPUT_GID} /dev/input/*
|
/bin/chown :${INPUT_GID} /dev/input/*
|
||||||
|
|
|
@ -91,6 +91,7 @@ msg_info "Setting Up kodi user"
|
||||||
useradd -d /home/kodi -m kodi &>/dev/null
|
useradd -d /home/kodi -m kodi &>/dev/null
|
||||||
gpasswd -a kodi audio &>/dev/null
|
gpasswd -a kodi audio &>/dev/null
|
||||||
gpasswd -a kodi video &>/dev/null
|
gpasswd -a kodi video &>/dev/null
|
||||||
|
gpasswd -a kodi render &>/dev/null
|
||||||
groupadd -r autologin &>/dev/null
|
groupadd -r autologin &>/dev/null
|
||||||
gpasswd -a kodi autologin &>/dev/null
|
gpasswd -a kodi autologin &>/dev/null
|
||||||
gpasswd -a kodi input &>/dev/null #to enable direct access to devices
|
gpasswd -a kodi input &>/dev/null #to enable direct access to devices
|
||||||
|
@ -165,7 +166,7 @@ __EOF__
|
||||||
cat > /etc/systemd/system/lightdm.service.d/override.conf << __EOF__
|
cat > /etc/systemd/system/lightdm.service.d/override.conf << __EOF__
|
||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=/bin/sh -c '/usr/local/bin/preX-populate-input.sh'
|
ExecStartPre=/bin/sh -c '/usr/local/bin/preX-populate-input.sh'
|
||||||
SupplementaryGroups=video input audio tty
|
SupplementaryGroups=video render input audio tty
|
||||||
__EOF__
|
__EOF__
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
msg_ok "Set up device detection for xorg"
|
msg_ok "Set up device detection for xorg"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue