From c34e588695c5b4b4eb716b7fbfdaf3de55778a9a Mon Sep 17 00:00:00 2001 From: iVAN <88724353+ivan-hc@users.noreply.github.com> Date: Wed, 1 Jan 2025 05:55:11 +0100 Subject: [PATCH] Archimage 4.1alpha (#18) * Update obs-full-junest.sh * Update obs-junest.sh --- obs-full-junest.sh | 53 ++++++++++++++++++++++++--------------------- obs-junest.sh | 54 +++++++++++++++++++++++++--------------------- 2 files changed, 58 insertions(+), 49 deletions(-) diff --git a/obs-full-junest.sh b/obs-full-junest.sh index 9e37e0f..dadf9f0 100644 --- a/obs-full-junest.sh +++ b/obs-full-junest.sh @@ -207,29 +207,34 @@ function _create_AppRun() { [ -z "$NVIDIA_ON" ] && NVIDIA_ON=1 if [ "$NVIDIA_ON" = 1 ]; then - DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}" - CONTY_DIR="${DATADIR}/Conty/overlayfs_shared" - CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}" - [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)" - [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty="$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version)" - if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then - if command -v curl >/dev/null 2>&1; then - if ! curl --output /dev/null --silent --head --fail https://github.com 1>/dev/null; then - notify-send "You are offline, cannot use Nvidia drivers" - else - notify-send "Configuring Nvidia drivers for this AppImage..." - mkdir -p "${CACHEDIR}" && cd "${CACHEDIR}" || exit 1 - curl -Ls "https://raw.githubusercontent.com/ivan-hc/ArchImage/main/nvidia-junest.sh" > nvidia-junest.sh - chmod a+x ./nvidia-junest.sh && ./nvidia-junest.sh - fi - else - notify-send "Missing \"curl\" command, cannot use Nvidia drivers" - echo "You need \"curl\" to download this script" - fi - fi - [ -d "${CONTY_DIR}"/up/usr/bin ] && export PATH="${PATH}":"${CONTY_DIR}"/up/usr/bin:"${PATH}" - [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}" - [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}" + DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}" + CONTY_DIR="${DATADIR}/Conty/overlayfs_shared" + [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)" + if [ -n "$nvidia_driver_version" ]; then + [ ! -d "${CONTY_DIR}"/up/usr/share/glvnd ] && ln -s /usr/share/glvnd "${CONTY_DIR}"/up/usr/share/ 2>/dev/null + [ ! -d "${CONTY_DIR}"/up/usr/share/nvidia ] && ln -s /usr/share/nvidia "${CONTY_DIR}"/up/usr/share/ 2>/dev/null + ln -s /usr/share/nvidia "${CONTY_DIR}"/up/usr/share/ 2>/dev/null + mkdir -p "${CONTY_DIR}"/up/usr/lib + if [ ! -f "${CONTY_DIR}"/nvidia/current-nvidia-version ]; then + mkdir -p "${CONTY_DIR}"/nvidia + echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version + fi + [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty=$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version) + if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then + rm -f "${CONTY_DIR}"/up/usr/lib/* + echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version + fi + nvidialibs="libcuda libEGL_nvidia libGLX_nvidia libnvidia libOpenCL libvdpau_nvidia" + for n in $nvidialibs; do + nvidia_libs="$nvidia_libs $(find /usr/lib -name "$n*" -print0 | xargs -0)" + done + for n in $nvidia_libs; do + libname=$(echo "$n" | sed 's:.*/::') + [ ! -f "${CONTY_DIR}"/up/usr/lib/"$libname" ] && cp "$n" "${CONTY_DIR}"/up/usr/lib/ + done + [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}" + [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}" + fi fi BINDS=" --dev-bind /dev /dev \ @@ -575,4 +580,4 @@ fi export ARCH=x86_64 ./appimagetool -n --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ -u "gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|OBS-Studio-appimage|continuous-full|*-$ARCH.AppImage.zsync" \ - ./"$APP".AppDir ./"$(awk -F"=" '/Name=/ {print $2; exit}' ./"$APP".AppDir/*.desktop | sed 's/ /-/g')"-FULL_"$VERSION"-archimage4-"$ARCH".AppImage + ./"$APP".AppDir ./"$(awk -F"=" '/Name=/ {print $2; exit}' ./"$APP".AppDir/*.desktop | sed 's/ /-/g')"-FULL_"$VERSION"-archimage4.1alpha-"$ARCH".AppImage diff --git a/obs-junest.sh b/obs-junest.sh index cee52f2..0688b1a 100644 --- a/obs-junest.sh +++ b/obs-junest.sh @@ -203,32 +203,36 @@ function _create_AppRun() { export UNION_PRELOAD=$HERE export JUNEST_HOME=$HERE/.junest export PATH=$PATH:$HERE/.local/share/junest/bin - [ -z "$NVIDIA_ON" ] && NVIDIA_ON=1 if [ "$NVIDIA_ON" = 1 ]; then - DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}" - CONTY_DIR="${DATADIR}/Conty/overlayfs_shared" - CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}" - [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)" - [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty="$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version)" - if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then - if command -v curl >/dev/null 2>&1; then - if ! curl --output /dev/null --silent --head --fail https://github.com 1>/dev/null; then - notify-send "You are offline, cannot use Nvidia drivers" - else - notify-send "Configuring Nvidia drivers for this AppImage..." - mkdir -p "${CACHEDIR}" && cd "${CACHEDIR}" || exit 1 - curl -Ls "https://raw.githubusercontent.com/ivan-hc/ArchImage/main/nvidia-junest.sh" > nvidia-junest.sh - chmod a+x ./nvidia-junest.sh && ./nvidia-junest.sh - fi - else - notify-send "Missing \"curl\" command, cannot use Nvidia drivers" - echo "You need \"curl\" to download this script" - fi - fi - [ -d "${CONTY_DIR}"/up/usr/bin ] && export PATH="${PATH}":"${CONTY_DIR}"/up/usr/bin:"${PATH}" - [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}" - [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}" + DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}" + CONTY_DIR="${DATADIR}/Conty/overlayfs_shared" + [ -f /sys/module/nvidia/version ] && nvidia_driver_version="$(cat /sys/module/nvidia/version)" + if [ -n "$nvidia_driver_version" ]; then + [ ! -d "${CONTY_DIR}"/up/usr/share/glvnd ] && ln -s /usr/share/glvnd "${CONTY_DIR}"/up/usr/share/ 2>/dev/null + [ ! -d "${CONTY_DIR}"/up/usr/share/nvidia ] && ln -s /usr/share/nvidia "${CONTY_DIR}"/up/usr/share/ 2>/dev/null + ln -s /usr/share/nvidia "${CONTY_DIR}"/up/usr/share/ 2>/dev/null + mkdir -p "${CONTY_DIR}"/up/usr/lib + if [ ! -f "${CONTY_DIR}"/nvidia/current-nvidia-version ]; then + mkdir -p "${CONTY_DIR}"/nvidia + echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version + fi + [ -f "${CONTY_DIR}"/nvidia/current-nvidia-version ] && nvidia_driver_conty=$(cat "${CONTY_DIR}"/nvidia/current-nvidia-version) + if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then + rm -f "${CONTY_DIR}"/up/usr/lib/* + echo "${nvidia_driver_version}" > "${CONTY_DIR}"/nvidia/current-nvidia-version + fi + nvidialibs="libcuda libEGL_nvidia libGLX_nvidia libnvidia libOpenCL libvdpau_nvidia" + for n in $nvidialibs; do + nvidia_libs="$nvidia_libs $(find /usr/lib -name "$n*" -print0 | xargs -0)" + done + for n in $nvidia_libs; do + libname=$(echo "$n" | sed 's:.*/::') + [ ! -f "${CONTY_DIR}"/up/usr/lib/"$libname" ] && cp "$n" "${CONTY_DIR}"/up/usr/lib/ + done + [ -d "${CONTY_DIR}"/up/usr/lib ] && export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${CONTY_DIR}"/up/usr/lib:"${LD_LIBRARY_PATH}" + [ -d "${CONTY_DIR}"/up/usr/share ] && export XDG_DATA_DIRS="${XDG_DATA_DIRS}":"${CONTY_DIR}"/up/usr/share:"${XDG_DATA_DIRS}" + fi fi BINDS=" --dev-bind /dev /dev \ @@ -574,4 +578,4 @@ fi export ARCH=x86_64 ./appimagetool -n --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \ -u "gh-releases-zsync|$GITHUB_REPOSITORY_OWNER|OBS-Studio-appimage|latest|*-$ARCH.AppImage.zsync" \ - ./"$APP".AppDir ./"$(awk -F"=" '/Name=/ {print $2; exit}' ./"$APP".AppDir/*.desktop | sed 's/ /-/g')"_"$VERSION"-archimage4-"$ARCH".AppImage + ./"$APP".AppDir ./"$(awk -F"=" '/Name=/ {print $2; exit}' ./"$APP".AppDir/*.desktop | sed 's/ /-/g')"_"$VERSION"-archimage4.1alpha-"$ARCH".AppImage