Improvements to the init process
Move some files to locations that make more sense... Downloads go to Downloads Init scripts go to an "init" directory Add a script for clearing up some memory - May or may not use it.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
###
|
###
|
||||||
# File: entrypoint.sh
|
# File: entrypoint.sh
|
||||||
# Project: docker-steamos
|
# Project: docker-steam-headless
|
||||||
# File Created: Saturday, 8th January 2022 7:08:46 pm
|
# File Created: Saturday, 8th January 2022 7:08:46 pm
|
||||||
# Author: Josh.5 (jsunnex@gmail.com)
|
# Author: Josh.5 (jsunnex@gmail.com)
|
||||||
# -----
|
# -----
|
||||||
@@ -17,8 +17,8 @@ if [ ! -z "$@" ]; then
|
|||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Execute all init scripts
|
# Execute all container init scripts
|
||||||
for init_script in /scripts/*.sh ; do
|
for init_script in /etc/cont-init.d/*.sh ; do
|
||||||
echo
|
echo
|
||||||
echo "[ ${init_script}: executing... ]"
|
echo "[ ${init_script}: executing... ]"
|
||||||
sed -i 's/\r$//' "${init_script}"
|
sed -i 's/\r$//' "${init_script}"
|
||||||
|
|||||||
@@ -16,16 +16,17 @@ export nvidia_gpu_name=$(nvidia-smi --format=csv --query-gpu=name --id="${gpu_se
|
|||||||
export nvidia_host_driver_version="$(nvidia-smi 2> /dev/null | grep NVIDIA-SMI | cut -d ' ' -f3)"
|
export nvidia_host_driver_version="$(nvidia-smi 2> /dev/null | grep NVIDIA-SMI | cut -d ' ' -f3)"
|
||||||
|
|
||||||
function download_driver {
|
function download_driver {
|
||||||
mkdir -p ${USER_HOME}/.cache/nvidia
|
mkdir -p ${USER_HOME}/Downloads
|
||||||
|
chown -R ${USER} ${USER_HOME}/Downloads
|
||||||
|
|
||||||
if [[ ! -f "${USER_HOME}/.cache/nvidia/NVIDIA_${nvidia_host_driver_version}.run" ]]; then
|
if [[ ! -f "${USER_HOME}/Downloads/NVIDIA_${nvidia_host_driver_version}.run" ]]; then
|
||||||
echo "Downloading driver v${nvidia_host_driver_version}"
|
echo "Downloading driver v${nvidia_host_driver_version}"
|
||||||
wget -q --show-progress --progress=bar:force:noscroll \
|
wget -q --show-progress --progress=bar:force:noscroll \
|
||||||
-O /tmp/NVIDIA.run \
|
-O /tmp/NVIDIA.run \
|
||||||
http://download.nvidia.com/XFree86/Linux-x86_64/${nvidia_host_driver_version}/NVIDIA-Linux-x86_64-${nvidia_host_driver_version}.run
|
http://download.nvidia.com/XFree86/Linux-x86_64/${nvidia_host_driver_version}/NVIDIA-Linux-x86_64-${nvidia_host_driver_version}.run
|
||||||
[[ $? -gt 0 ]] && echo "Error downloading driver. Exit!" && return 1
|
[[ $? -gt 0 ]] && echo "Error downloading driver. Exit!" && return 1
|
||||||
|
|
||||||
mv /tmp/NVIDIA.run ${USER_HOME}/.cache/nvidia/NVIDIA_${nvidia_host_driver_version}.run
|
mv /tmp/NVIDIA.run ${USER_HOME}/Downloads/NVIDIA_${nvidia_host_driver_version}.run
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,8 +39,8 @@ function install_driver {
|
|||||||
download_driver
|
download_driver
|
||||||
|
|
||||||
echo "Installing driver v${nvidia_host_driver_version} to match what is running on the host"
|
echo "Installing driver v${nvidia_host_driver_version} to match what is running on the host"
|
||||||
chmod +x ${USER_HOME}/.cache/nvidia/NVIDIA_${nvidia_host_driver_version}.run
|
chmod +x ${USER_HOME}/Downloads/NVIDIA_${nvidia_host_driver_version}.run
|
||||||
${USER_HOME}/.cache/nvidia/NVIDIA_${nvidia_host_driver_version}.run \
|
${USER_HOME}/Downloads/NVIDIA_${nvidia_host_driver_version}.run \
|
||||||
--silent \
|
--silent \
|
||||||
--accept-license \
|
--accept-license \
|
||||||
--no-kernel-module \
|
--no-kernel-module \
|
||||||
@@ -51,7 +52,7 @@ function install_driver {
|
|||||||
--no-check-for-alternate-installs \
|
--no-check-for-alternate-installs \
|
||||||
--no-libglx-indirect \
|
--no-libglx-indirect \
|
||||||
--no-install-libglvnd \
|
--no-install-libglvnd \
|
||||||
> ${USER_HOME}/.cache/nvidia/last_install.log 2>&1
|
> ${USER_HOME}/Downloads/nvidia_gpu_install.log 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ -z ${nvidia_pci_address} ]]; then
|
if [[ -z ${nvidia_pci_address} ]]; then
|
||||||
16
overlay/opt/scripts/drop_caches.sh
Executable file
16
overlay/opt/scripts/drop_caches.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
###
|
||||||
|
# File: drop_caches.sh
|
||||||
|
# Project: docker-steam-headless
|
||||||
|
# File Created: Wednesday, 12th January 2022 5:08:46 pm
|
||||||
|
# Author: Josh.5 (jsunnex@gmail.com)
|
||||||
|
# -----
|
||||||
|
# Last Modified: Wednesday, 12th January 2022 5:44:17 pm
|
||||||
|
# Modified By: Josh.5 (jsunnex@gmail.com)
|
||||||
|
###
|
||||||
|
|
||||||
|
# Clear out the memory page cache
|
||||||
|
echo 1 > /proc/sys/vm/drop_caches
|
||||||
|
|
||||||
|
# Flush any FS buffers
|
||||||
|
sync
|
||||||
Reference in New Issue
Block a user