Update Arch build with latest changes

This commit is contained in:
Josh.5
2023-07-09 20:23:42 +12:00
committed by Josh Sunnex
parent 0b600108f7
commit 42ebc826b8
10 changed files with 213 additions and 241 deletions

View File

@@ -5,8 +5,8 @@
# File Created: Friday, 12th January 2022 8:54:01 am
# Author: Josh.5 (jsunnex@gmail.com)
# -----
# Last Modified: Tuesday, 4th October 2022 11:27:10 am
# Modified By: Josh.5 (jsunnex@gmail.com)
# Last Modified: Sunday, 9th July 2023 7:43:44 pm
# Modified By: Console and webGui login account (jsunnex@gmail.com)
###
PUID=${PUID:-99}
@@ -21,10 +21,6 @@ usermod -o -u "${PUID}" ${USER}
groupmod -o -g "${PGID}" ${USER}
echo "Adding default user to video, audio, input and pulse groups"
usermod -a -G video,audio,input,pulse ${USER}
echo "Adding default user to any additional required device groups"
device_nodes=( /dev/uinput /dev/input/event* /dev/dri/* )
added_groups=""
@@ -52,7 +48,7 @@ for dev in "${device_nodes[@]}"; do
# Add group to user
if [[ "${added_groups}" != *"${dev_group}"* ]]; then
echo "Adding user '${USER}' to group: '${dev_group}' for device: ${dev}"
usermod -a -G ${dev_group} ${USER}
usermod -aG ${dev_group} ${USER}
added_groups=" ${added_groups} ${dev_group} "
fi
done
@@ -99,4 +95,8 @@ echo "${USER}:${USER_PASSWORD}" | chpasswd
mkdir -p /tmp/runtime-root
chown root:root /tmp/runtime-root
# Fix some flatpak quirks (not sure what is happening here)
mount -t proc none /proc
flatpak list
echo "DONE"

View File

@@ -1,21 +0,0 @@
echo "**** Configure SSH server ****"
if [[ "X${PORT_SSH:-}" != "X" ]]; then
# Generate new SSH host keys if they dont exist
if [[ ! -f /etc/ssh/ssh_host_rsa_key ]]; then
echo "**** Generating SSH keys ****";
/usr/bin/ssh-keygen -A
fi
mkdir -p /run/sshd
chmod 744 /run/sshd
echo "Set port to '${PORT_SSH}'"
sed -i "s|^# Port 22.*$|Port ${PORT_SSH}|" /etc/ssh/ssh_config
else
echo "Disable SSH server"
# Disable supervisord script
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/sshd.ini
fi
echo "DONE"

View File

@@ -85,7 +85,6 @@ function install_amd_gpu_driver {
echo "Install AMD vulkan driver"
if command -v pacman &> /dev/null; then
pacman -Syu --noconfirm --needed \
lib32-mesa \
lib32-vulkan-icd-loader \
lib32-vulkan-radeon \
vulkan-icd-loader \
@@ -105,7 +104,6 @@ function install_intel_gpu_driver {
echo "Install Intel vulkan driver"
if command -v pacman &> /dev/null; then
pacman -Syu --noconfirm --needed \
lib32-mesa \
lib32-vulkan-icd-loader \
lib32-vulkan-intel \
vulkan-icd-loader \
@@ -121,13 +119,6 @@ function install_intel_gpu_driver {
fi
}
# NVIDIA GPU
if [[ ! -z ${nvidia_pci_address} ]]; then
echo "**** Found NVIDIA device '${nvidia_gpu_name}' ****";
install_nvidia_driver
else
echo "**** No NVIDIA device found ****";
fi
# Intel Arc GPU or Intel CPU with possible iGPU
if [[ ! -z ${intel_gpu_model} ]]; then
echo "**** Found Intel device '${intel_gpu_model}' ****";
@@ -145,5 +136,12 @@ if [[ ! -z ${amd_gpu_model} ]]; then
else
echo "**** No AMD device found ****";
fi
# NVIDIA GPU
if [[ ! -z ${nvidia_pci_address} ]]; then
echo "**** Found NVIDIA device '${nvidia_gpu_name}' ****";
install_nvidia_driver
else
echo "**** No NVIDIA device found ****";
fi
echo "DONE"

View File

@@ -54,7 +54,11 @@ function configure_nvidia_x_server {
# Allow anybody for running x server
function configure_x_server {
# Configure x to be run by anyone
if grep -Fxq "allowed_users=console" /etc/X11/Xwrapper.config; then
if [[ ! -f /etc/X11/Xwrapper.config ]]; then
echo "Create Xwrapper.config"
echo 'allowed_users=anybody' > /etc/X11/Xwrapper.config
echo 'needs_root_rights=yes' >> /etc/X11/Xwrapper.config
elif grep -Fxq "allowed_users=console" /etc/X11/Xwrapper.config; then
echo "Configure Xwrapper.config"
sed -i "s/allowed_users=console/allowed_users=anybody/" /etc/X11/Xwrapper.config
echo 'needs_root_rights=yes' >> /etc/X11/Xwrapper.config

View File

@@ -6,9 +6,6 @@ if [ "${MODE}" == "s" ] | [ "${MODE}" == "secondary" ]; then
# Disable desktop
echo " - Disable desktop"
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/desktop.ini
# Disable sshd
echo " - Disable sshd"
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/sshd.ini
# Disable vnc
echo " - Disable vnc"
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/vnc.ini
@@ -34,4 +31,10 @@ if [ "${MODE}" == "s" ] | [ "${MODE}" == "secondary" ]; then
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/udev.ini
fi
# TODO: Disabled some stuff for development... re-enable it after Archis working
echo " - DISABLEING dind"
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/dind.ini
#echo " - DISABLEING desktop"
#sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/desktop.ini
echo "DONE"

View File

@@ -1,14 +0,0 @@
[program:sshd]
priority=10
autostart=true
autorestart=true
user=root
command=/usr/sbin/sshd -Ddp "%(ENV_PORT_SSH)s"
stopsignal=INT
stdout_logfile=/var/log/supervisor/sshd.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=7
stderr_logfile=/var/log/supervisor/sshd.err.log
stderr_logfile_maxbytes=10MB
stderr_logfile_backups=7

View File

@@ -18,7 +18,7 @@ priority=40
autostart=false
autorestart=true
user=%(ENV_USER)s
command=/usr/local/bin/websockify %(ENV_PORT_AUDIO_WEBSOCKET)s localhost:%(ENV_PORT_AUDIO_STREAM)s
command=websockify %(ENV_PORT_AUDIO_WEBSOCKET)s localhost:%(ENV_PORT_AUDIO_STREAM)s
stopsignal=INT
stdout_logfile=/home/%(ENV_USER)s/.cache/log/audiowebsock.log
stdout_logfile_maxbytes=10MB

View File

@@ -25,6 +25,7 @@ Terminal=false
Hidden=false
EOF
)"
mkdir -p "${USER_HOME:?}/.config/autostart"
if [[ ! -f "${USER_HOME:?}/.config/autostart/Sunshine.desktop" ]]; then
echo "${sunshine_autostart_desktop:?}" > "${USER_HOME:?}/.config/autostart/Sunshine.desktop"
fi
@@ -61,6 +62,7 @@ sunshine_apps_json="$(cat <<EOF
}
EOF
)"
mkdir -p "${USER_HOME:?}/.config/sunshine"
if [[ ! -f "${USER_HOME:?}/.config/sunshine/apps.json" ]]; then
echo "${sunshine_apps_json:?}" > "${USER_HOME:?}/.config/sunshine/apps.json"
fi