From 6774ce0c6dd43233444e24288bde82b5a98721ef Mon Sep 17 00:00:00 2001 From: RadxaPanda Date: Fri, 21 Jun 2024 10:55:07 +0300 Subject: [PATCH 01/23] feat: add steam to rsetup --- debian/control | 2 + src/usr/lib/rsetup/cli/main.sh | 1 + src/usr/lib/rsetup/cli/steam.sh | 189 +++++++++++++++++++++ src/usr/lib/rsetup/tui/task/steam/steam.sh | 32 ++++ src/usr/lib/rsetup/tui/task/task.sh | 2 + 5 files changed, 226 insertions(+) create mode 100644 src/usr/lib/rsetup/cli/steam.sh create mode 100644 src/usr/lib/rsetup/tui/task/steam/steam.sh diff --git a/debian/control b/debian/control index 4d13021d..2b9d3f98 100644 --- a/debian/control +++ b/debian/control @@ -23,6 +23,8 @@ Depends: device-tree-compiler, python3, python3-yaml, u-boot-menu, + xz-utils, + jq, ${misc:Depends}, Suggests: aicrf-test, gpiod, diff --git a/src/usr/lib/rsetup/cli/main.sh b/src/usr/lib/rsetup/cli/main.sh index cd90b7db..99da6a0b 100644 --- a/src/usr/lib/rsetup/cli/main.sh +++ b/src/usr/lib/rsetup/cli/main.sh @@ -15,6 +15,7 @@ source "/usr/lib/rsetup/cli/docker.sh" source "/usr/lib/rsetup/cli/u-boot-menu.sh" source "/usr/lib/rsetup/cli/wi-fi.sh" source "/usr/lib/rsetup/cli/kernel.sh" +source "/usr/lib/rsetup/cli/steam.sh" source "/usr/lib/rsetup/cli/test/main.sh" diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh new file mode 100644 index 00000000..ead19fa8 --- /dev/null +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -0,0 +1,189 @@ +# shellcheck shell=bash + +get_user_home() { + if [ -n "${PKEXEC_UID:-}" ]; then + getent passwd "${PKEXEC_UID}" | cut -d: -f6 + elif [ -n "${SUDO_USER:-}" ]; then + getent passwd "${SUDO_USER}" | cut -d: -f6 + else + echo "/home/$(whoami)" + fi +} + +install_box64() { + wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list + wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg + apt update -y && apt install -y box64-rk3588 +} + +install_box86() { + dpkg --add-architecture armhf + wget https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -O /etc/apt/sources.list.d/box86.list + wget -qO- https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg + apt update -y && apt install -y box86 +} + +# shellcheck disable=SC2120 +# files are script files and reference arguments +install_winex86() { + local -r user_home="$(get_user_home)" + rm -rf "${user_home}/.wine/" "${user_home}/wine/" + # cp wine /usr/local/bin/ + cat < /usr/local/bin/wine +#!/bin/bash +#export GALLIUM_HUD=simple,fps +setarch linux32 -L box86 $HOME/wine/bin/wine "$@" +EOF + cat < /usr/local/bin/wineserver +#!/bin/bash +box86 $HOME/wine/bin/wineserver "$@" +EOF + cat < /usr/local/bin/winetricks +#!/bin/bash +env BOX86_NOBANNER=1 box86 $HOME/wine/winetricks "$@" +EOF + chmod +x /usr/local/bin/winetricks + chmod +x /usr/local/bin/wineserver + chmod +x /usr/local/bin/wine + mkdir -p "${user_home}/.local/share/applications/" + cat < "${user_home}/.local/share/applications/wine-config.desktop" +[Desktop Entry] +Version=1.0 +Type=Application +Name=Wine Configuration +Comment=Configuration utility for Wine +Icon=wine +box86 Exec=/usr/local/bin/wine winecfg +Categories=Game; +Terminal=false +EOF + cat < "${user_home}/.local/share/applications/wine-desktop.desktop" +[Desktop Entry] +Version=1.0 +Type=Application +Name=Wine Desktop +Comment=Graphical desktop for Wine +Icon=wine +box86 Exec=/usr/local/bin/wine explorer /desktop=shell,1280x720 explorer.exe +Categories=Game; +Terminal=false +EOF + + mkdir "${user_home}/wine/" + mkdir "${user_home}/wine/lib/" + # cp libwine.so ${user_home}/wine/lib/ + # cp libwine.so.1 ${user_home}/wine/lib/ + cd "${user_home}/wine/" || exit + latest_version=$(curl -s https://api.github.com/repos/Kron4ek/Wine-Builds/releases/latest | jq -r .tag_name) + curl -L -o "wine-latest-x86.tar.xz" "https://github.com/Kron4ek/Wine-Builds/releases/download/$latest_version/wine-$latest_version-x86.tar.xz" + xz -d wine-latest-x86.tar.xz + tar -xf wine-latest-x86.tar + cd "wine-$latest_version-x86/" || exit + cp -R ./* "${user_home}/wine" + # ln -s "${user_home}/wine/bin/wine" /usr/local/bin/wine + # ln -s "${user_home}/wine/bin/winecfg" /usr/local/bin/winecfg + # ln -s "${user_home}/wine/bin/wineserver" /usr/local/bin/wineserver + # #try to chown using either sudo_user or pkexec_uid + chown -R "${SUDO_USER:-${PKEXEC_UID}}" "${user_home}/wine" + echo "Run wine winecfg to let wine configure itself" +} + +# install_wine64() { +# __parameter_count_check 0 "$@" +# local -r user_home="$(get_user_home)" +# rm -r ~/.wine/ +# rm -r ~/wine/ +# cd ~ +# wget https://github.com/Kron4ek/Wine-Builds/releases/download/8.16/wine-8.16-amd64.tar.xz +# mkdir ~/wine +# cd ~/wine +# xz -d ../wine-8.16-amd64.tar.xz +# tar -xvf ../wine-8.16-amd64.tar +# rm /usr/local/bin/wine /usr/local/bin/wineboot /usr/local/bin/winecfg /usr/local/bin/wineserver /usr/local/bin/wine64 +# cd wine-8.16-amd64/ +# ln -s ~/wine/wine-8.16-amd64/bin/wine /usr/local/bin/wine +# ln -s ~/wine/wine-8.16-amd64/bin/wine64 /usr/local/bin/wine64 +# ln -s ~/wine/wine-8.16-amd64/bin/wineserver /usr/local/bin/wineserver +# ln -s ~/wine/wine-8.16-amd64/bin/winecfg /usr/local/bin/winecfg +# ln -s ~/wine/wine-8.16-amd64/bin/wineboot /usr/local/bin/wineboot +# cd ~ +# rm wine-8.16-amd64.tar.xz +# } + + +install_steam() { + __parameter_count_check 0 "$@" + local -r user_home="$(get_user_home)" + install_box86 + install_box64 + install_winex86 + # install_wine64 + # create necessary directories + mkdir -p "${user_home}/steam" + mkdir -p "${user_home}/steam/tmp" + cd "${user_home}/steam/tmp" || exit + + # download latest deb and unpack + wget https://cdn.cloudflare.steamstatic.com/client/installer/steam.deb + ar x steam.deb + tar xf data.tar.xz + + # remove deb archives, not needed anymore + rm ./*.tar.xz ./steam.deb + + # move deb contents to steam folder + mv ./usr/* ../ + cd ../ && rm -rf ./tmp/ + + # create run script + echo '#!/bin/bash +export STEAMOS=1 +export STEAM_RUNTIME=1 +export DBUS_FATAL_WARNINGS=0 +~/steam/bin/steam $@' > steam + + # make script executable and move + chmod +x steam + mv steam /usr/local/bin/ + apt install -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf libxinerama1:armhf libxdamage1:armhf libibus-1.0-5 libdrm2:armhf libgbm1:armhf + +} + +uninstall_steam() { + local -r user_home="$(get_user_home)" + + # Remove Box64 + rm /etc/apt/sources.list.d/box64.list + rm /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg + apt-get purge -y box64-rk3588 + + # Remove Box86 + rm /etc/apt/sources.list.d/box86.list + rm /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg + apt-get purge -y box86 + + # Remove Wine related files and directories + rm -rf "${user_home}/.wine" "${user_home}/wine" + rm -f /usr/local/bin/wine /usr/local/bin/wineserver /usr/local/bin/winetricks + rm -f "${user_home}/.local/share/applications/wine-config.desktop" + rm -f "${user_home}/.local/share/applications/wine-desktop.desktop" + + # Remove Steam related files and directories + rm -rf "${user_home}/steam" + rm -f /usr/local/bin/steam + + # Remove additional packages installed for Steam + apt-get purge -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf \ + libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf \ + libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf \ + libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf \ + libxinerama1:armhf libxdamage1:armhf libgbm1:armhf libdrm2:armhf + + + # Remove Box86 architecture + dpkg --remove-architecture armhf + + # Update apt repositories and clean up + apt-get update -y + apt-get autoremove -y +} diff --git a/src/usr/lib/rsetup/tui/task/steam/steam.sh b/src/usr/lib/rsetup/tui/task/steam/steam.sh new file mode 100644 index 00000000..af082f3f --- /dev/null +++ b/src/usr/lib/rsetup/tui/task/steam/steam.sh @@ -0,0 +1,32 @@ +# shellcheck shell=bash + +__task_steam_uninstall() { + if yesno "Are you sure to uninstall Steam?" + then + if uninstall_steam + then + msgbox "Steam was successfully uninstalled." + else + msgbox "Failed to uninstall steam." "$RTUI_PALETTE_ERROR" + fi + fi +} + +__task_steam_install() { + if yesno "Are you sure you want to install Steam?" + then + install_steam + fi +} + +__task_steam() { + menu_init + # "$(get_user_home)/steam" exists + if [[ -d "$(get_user_home)/steam" ]] + then + menu_add __task_steam_uninstall "Uninstall Steam" + else + menu_add __task_steam_install "Install Steam" + fi + menu_show "Please select an option below:" +} diff --git a/src/usr/lib/rsetup/tui/task/task.sh b/src/usr/lib/rsetup/tui/task/task.sh index 9a882e3e..2a0ca48f 100644 --- a/src/usr/lib/rsetup/tui/task/task.sh +++ b/src/usr/lib/rsetup/tui/task/task.sh @@ -4,6 +4,7 @@ source "/usr/lib/rsetup/tui/task/docker/docker.sh" source "/usr/lib/rsetup/tui/task/ssh/ssh.sh" source "/usr/lib/rsetup/tui/task/baota/baota.sh" +source "/usr/lib/rsetup/tui/task/steam/steam.sh" __task() { menu_init @@ -13,5 +14,6 @@ __task() { menu_add __task_ssh "SSH" fi menu_add __task_baota "Baota" + menu_add __task_steam "Steam" menu_show "Please select an option below:" } From f5dfb9e7743c8f1e184d344060859732d342307a Mon Sep 17 00:00:00 2001 From: RadxaPanda Date: Fri, 21 Jun 2024 13:39:48 +0300 Subject: [PATCH 02/23] fix: add requirested changes --- debian/control | 5 +++-- src/usr/lib/rsetup/cli/steam.sh | 30 ++++++++++++++++-------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/debian/control b/debian/control index 2b9d3f98..76a485e4 100644 --- a/debian/control +++ b/debian/control @@ -15,8 +15,10 @@ Architecture: all Section: admin Priority: standard Essential: yes -Depends: device-tree-compiler, +Depends: curl, + device-tree-compiler, gdisk, + jq, librtui (>= 0.1.2), parted, pkexec | policykit-1 (<< 122-1), @@ -24,7 +26,6 @@ Depends: device-tree-compiler, python3-yaml, u-boot-menu, xz-utils, - jq, ${misc:Depends}, Suggests: aicrf-test, gpiod, diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index ead19fa8..acd5ae92 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -1,26 +1,26 @@ # shellcheck shell=bash - +set -e get_user_home() { if [ -n "${PKEXEC_UID:-}" ]; then getent passwd "${PKEXEC_UID}" | cut -d: -f6 elif [ -n "${SUDO_USER:-}" ]; then getent passwd "${SUDO_USER}" | cut -d: -f6 else - echo "/home/$(whoami)" + getent passwd "${USER}" | cut -d: -f6 fi } install_box64() { - wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list - wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg - apt update -y && apt install -y box64-rk3588 + curl https://ryanfortner.github.io/box64-debs/box64.list -o /etc/apt/sources.list.d/box64.list + curl -s https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg + apt-get update -y && apt-get install -y box64-rk3588 } install_box86() { dpkg --add-architecture armhf - wget https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -O /etc/apt/sources.list.d/box86.list - wget -qO- https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg - apt update -y && apt install -y box86 + curl https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -o /etc/apt/sources.list.d/box86.list + curl -s https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg + apt-get update -y && apt-get install -y box86 } # shellcheck disable=SC2120 @@ -145,7 +145,7 @@ export DBUS_FATAL_WARNINGS=0 # make script executable and move chmod +x steam mv steam /usr/local/bin/ - apt install -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf libxinerama1:armhf libxdamage1:armhf libibus-1.0-5 libdrm2:armhf libgbm1:armhf + apt-get install -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf libxinerama1:armhf libxdamage1:armhf libibus-1.0-5 libdrm2:armhf libgbm1:armhf } @@ -155,12 +155,12 @@ uninstall_steam() { # Remove Box64 rm /etc/apt/sources.list.d/box64.list rm /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg - apt-get purge -y box64-rk3588 + apt-get autoremove -y box64-rk3588 # Remove Box86 rm /etc/apt/sources.list.d/box86.list rm /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg - apt-get purge -y box86 + apt-get autoremove -y box86 # Remove Wine related files and directories rm -rf "${user_home}/.wine" "${user_home}/wine" @@ -173,15 +173,17 @@ uninstall_steam() { rm -f /usr/local/bin/steam # Remove additional packages installed for Steam - apt-get purge -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf \ + apt-get autoremove -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf \ libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf \ libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf \ libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf \ libxinerama1:armhf libxdamage1:armhf libgbm1:armhf libdrm2:armhf - # Remove Box86 architecture - dpkg --remove-architecture armhf + # Remove armhf architecture + if ! dpkg --remove-architecture armhf; then + echo "Failed to remove the armhf architecture. There might be some packages that are still using it." + fi # Update apt repositories and clean up apt-get update -y From 728f67f265f4574c47faf989d86c309f20783157 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:20:44 +0800 Subject: [PATCH 03/23] fix: curl with -Ls to follow 302 redirection Signed-off-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index acd5ae92..43366318 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -11,15 +11,15 @@ get_user_home() { } install_box64() { - curl https://ryanfortner.github.io/box64-debs/box64.list -o /etc/apt/sources.list.d/box64.list - curl -s https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg + curl -Ls https://ryanfortner.github.io/box64-debs/box64.list -o /etc/apt/sources.list.d/box64.list + curl -Ls https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg apt-get update -y && apt-get install -y box64-rk3588 } install_box86() { dpkg --add-architecture armhf - curl https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -o /etc/apt/sources.list.d/box86.list - curl -s https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg + curl -Ls https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -o /etc/apt/sources.list.d/box86.list + curl -Ls https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg apt-get update -y && apt-get install -y box86 } @@ -74,8 +74,8 @@ EOF # cp libwine.so ${user_home}/wine/lib/ # cp libwine.so.1 ${user_home}/wine/lib/ cd "${user_home}/wine/" || exit - latest_version=$(curl -s https://api.github.com/repos/Kron4ek/Wine-Builds/releases/latest | jq -r .tag_name) - curl -L -o "wine-latest-x86.tar.xz" "https://github.com/Kron4ek/Wine-Builds/releases/download/$latest_version/wine-$latest_version-x86.tar.xz" + latest_version=$(curl -Ls https://api.github.com/repos/Kron4ek/Wine-Builds/releases/latest | jq -r .tag_name) + curl -Lso "wine-latest-x86.tar.xz" "https://github.com/Kron4ek/Wine-Builds/releases/download/$latest_version/wine-$latest_version-x86.tar.xz" xz -d wine-latest-x86.tar.xz tar -xf wine-latest-x86.tar cd "wine-$latest_version-x86/" || exit From 828adcdae01a30d286ce06e48c01896b880c2feb Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:26:46 +0800 Subject: [PATCH 04/23] fix: overwrite existing keyring Signed-off-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index 43366318..4da902db 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -12,14 +12,14 @@ get_user_home() { install_box64() { curl -Ls https://ryanfortner.github.io/box64-debs/box64.list -o /etc/apt/sources.list.d/box64.list - curl -Ls https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg + curl -Ls https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor --batch --yes -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg apt-get update -y && apt-get install -y box64-rk3588 } install_box86() { dpkg --add-architecture armhf curl -Ls https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -o /etc/apt/sources.list.d/box86.list - curl -Ls https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg + curl -Ls https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor --batch --yes -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg apt-get update -y && apt-get install -y box86 } From 521b7e09bfacf7fbc8ea9113433c75e47f71b5f6 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:30:03 +0800 Subject: [PATCH 05/23] fix: use redirection as -o won't overwrite existing file Signed-off-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index 4da902db..c9fa8b74 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -11,14 +11,14 @@ get_user_home() { } install_box64() { - curl -Ls https://ryanfortner.github.io/box64-debs/box64.list -o /etc/apt/sources.list.d/box64.list + curl -Ls https://ryanfortner.github.io/box64-debs/box64.list > /etc/apt/sources.list.d/box64.list curl -Ls https://ryanfortner.github.io/box64-debs/KEY.gpg | gpg --dearmor --batch --yes -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg apt-get update -y && apt-get install -y box64-rk3588 } install_box86() { dpkg --add-architecture armhf - curl -Ls https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -o /etc/apt/sources.list.d/box86.list + curl -Ls https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list > /etc/apt/sources.list.d/box86.list curl -Ls https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor --batch --yes -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg apt-get update -y && apt-get install -y box86 } @@ -75,7 +75,7 @@ EOF # cp libwine.so.1 ${user_home}/wine/lib/ cd "${user_home}/wine/" || exit latest_version=$(curl -Ls https://api.github.com/repos/Kron4ek/Wine-Builds/releases/latest | jq -r .tag_name) - curl -Lso "wine-latest-x86.tar.xz" "https://github.com/Kron4ek/Wine-Builds/releases/download/$latest_version/wine-$latest_version-x86.tar.xz" + curl -Ls "https://github.com/Kron4ek/Wine-Builds/releases/download/$latest_version/wine-$latest_version-x86.tar.xz" > "wine-latest-x86.tar.xz" xz -d wine-latest-x86.tar.xz tar -xf wine-latest-x86.tar cd "wine-$latest_version-x86/" || exit From ba18f2ec3d7f57a85ace0af268a05cb7d7e0cff3 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Wed, 10 Jul 2024 17:27:17 +0800 Subject: [PATCH 06/23] refactor: wrap package list Signed-off-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index c9fa8b74..9195a208 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -145,7 +145,11 @@ export DBUS_FATAL_WARNINGS=0 # make script executable and move chmod +x steam mv steam /usr/local/bin/ - apt-get install -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf libxinerama1:armhf libxdamage1:armhf libibus-1.0-5 libdrm2:armhf libgbm1:armhf + apt-get install -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf \ + libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf \ + libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf \ + libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf \ + libxinerama1:armhf libxdamage1:armhf libdrm2:armhf libgbm1:armhf libibus-1.0-5 } @@ -155,12 +159,12 @@ uninstall_steam() { # Remove Box64 rm /etc/apt/sources.list.d/box64.list rm /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg - apt-get autoremove -y box64-rk3588 + apt-get remove -y box64-rk3588 # Remove Box86 rm /etc/apt/sources.list.d/box86.list rm /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg - apt-get autoremove -y box86 + apt-get remove -y box86 # Remove Wine related files and directories rm -rf "${user_home}/.wine" "${user_home}/wine" @@ -173,7 +177,7 @@ uninstall_steam() { rm -f /usr/local/bin/steam # Remove additional packages installed for Steam - apt-get autoremove -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf \ + apt-get remove -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf \ libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf \ libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf \ libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf \ @@ -187,5 +191,5 @@ uninstall_steam() { # Update apt repositories and clean up apt-get update -y - apt-get autoremove -y + apt-get remove -y } From 617307f98501c35353f078705aea4655cc776287 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Wed, 10 Jul 2024 17:40:44 +0800 Subject: [PATCH 07/23] refactor: move foreign arch setup to parent function Signed-off-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index 9195a208..2ce8e8e2 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -17,7 +17,6 @@ install_box64() { } install_box86() { - dpkg --add-architecture armhf curl -Ls https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list > /etc/apt/sources.list.d/box86.list curl -Ls https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | gpg --dearmor --batch --yes -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg apt-get update -y && apt-get install -y box86 @@ -114,6 +113,7 @@ EOF install_steam() { __parameter_count_check 0 "$@" local -r user_home="$(get_user_home)" + dpkg --add-architecture armhf install_box86 install_box64 install_winex86 From 70c0c5bf4b1ee4747657fa8eacf4ffc77b243342 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Wed, 10 Jul 2024 18:03:02 +0800 Subject: [PATCH 08/23] fix: avoid GitHub API due to quota limit Signed-off-by: ZHANG Yuntian --- debian/control | 1 - src/usr/lib/rsetup/cli/steam.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 76a485e4..a5555099 100644 --- a/debian/control +++ b/debian/control @@ -18,7 +18,6 @@ Essential: yes Depends: curl, device-tree-compiler, gdisk, - jq, librtui (>= 0.1.2), parted, pkexec | policykit-1 (<< 122-1), diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index 2ce8e8e2..a6128b19 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -73,7 +73,7 @@ EOF # cp libwine.so ${user_home}/wine/lib/ # cp libwine.so.1 ${user_home}/wine/lib/ cd "${user_home}/wine/" || exit - latest_version=$(curl -Ls https://api.github.com/repos/Kron4ek/Wine-Builds/releases/latest | jq -r .tag_name) + latest_version="$(basename "$(curl -Ls -o /dev/null -w "%{url_effective}" https://github.com/Kron4ek/Wine-Builds/releases/latest)")" curl -Ls "https://github.com/Kron4ek/Wine-Builds/releases/download/$latest_version/wine-$latest_version-x86.tar.xz" > "wine-latest-x86.tar.xz" xz -d wine-latest-x86.tar.xz tar -xf wine-latest-x86.tar From 64fa98db3911a26a5af9a30e83693afdc8c6d7e1 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Wed, 10 Jul 2024 18:09:32 +0800 Subject: [PATCH 09/23] fix: use HEAD instead GET to avoid data download Signed-off-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index a6128b19..583fef0e 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -73,7 +73,7 @@ EOF # cp libwine.so ${user_home}/wine/lib/ # cp libwine.so.1 ${user_home}/wine/lib/ cd "${user_home}/wine/" || exit - latest_version="$(basename "$(curl -Ls -o /dev/null -w "%{url_effective}" https://github.com/Kron4ek/Wine-Builds/releases/latest)")" + latest_version="$(basename "$(curl -ILs -o /dev/null -w "%{url_effective}" https://github.com/Kron4ek/Wine-Builds/releases/latest)")" curl -Ls "https://github.com/Kron4ek/Wine-Builds/releases/download/$latest_version/wine-$latest_version-x86.tar.xz" > "wine-latest-x86.tar.xz" xz -d wine-latest-x86.tar.xz tar -xf wine-latest-x86.tar From 861365d11d60310581f8533e873056e19ee153d6 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:35:58 +0800 Subject: [PATCH 10/23] refactor: create run script directly in the final destination Signed-off-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index 583fef0e..cd89e261 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -140,11 +140,10 @@ install_steam() { export STEAMOS=1 export STEAM_RUNTIME=1 export DBUS_FATAL_WARNINGS=0 -~/steam/bin/steam $@' > steam +~/steam/bin/steam $@' > /usr/local/bin/steam - # make script executable and move - chmod +x steam - mv steam /usr/local/bin/ + # make script executable + chmod +x /usr/local/bin/steam apt-get install -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf \ libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf \ libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf \ From 0836e1219c1c871f77c9bac4390b841d19db1140 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:38:35 +0800 Subject: [PATCH 11/23] refactor: unpack steam.deb in a temp dir Also remove steam_dir before mv operation. Signed-off-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index cd89e261..dd8f8c2a 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -119,21 +119,22 @@ install_steam() { install_winex86 # install_wine64 # create necessary directories - mkdir -p "${user_home}/steam" - mkdir -p "${user_home}/steam/tmp" - cd "${user_home}/steam/tmp" || exit + local steam_dir="${user_home}/steam" temp_dir + temp_dir="$(mktemp -d)" + + rm -rf "$steam_dir" + mkdir -p "$steam_dir" + pushd "$temp_dir" # download latest deb and unpack wget https://cdn.cloudflare.steamstatic.com/client/installer/steam.deb ar x steam.deb tar xf data.tar.xz - # remove deb archives, not needed anymore - rm ./*.tar.xz ./steam.deb - # move deb contents to steam folder - mv ./usr/* ../ - cd ../ && rm -rf ./tmp/ + mv ./usr/* "$steam_dir" + popd + rm -rf "$temp_dir" # create run script echo '#!/bin/bash From 2377b9ae22d44ca6a5633bd8383861172b858b2f Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:26:46 +0800 Subject: [PATCH 12/23] refactor: use logname to get real user Signed-off-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index dd8f8c2a..8fbecd41 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -1,13 +1,7 @@ # shellcheck shell=bash set -e get_user_home() { - if [ -n "${PKEXEC_UID:-}" ]; then - getent passwd "${PKEXEC_UID}" | cut -d: -f6 - elif [ -n "${SUDO_USER:-}" ]; then - getent passwd "${SUDO_USER}" | cut -d: -f6 - else - getent passwd "${USER}" | cut -d: -f6 - fi + getent passwd "$(logname)" | cut -d: -f6 } install_box64() { From 94d9721f40611d9dc9b8b10bfcc4657a407a5f64 Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:28:24 +0800 Subject: [PATCH 13/23] fix: remove duplicated set -e This is assumed from rsetup init code. Signed-off-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index 8fbecd41..66bc7000 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -1,5 +1,4 @@ # shellcheck shell=bash -set -e get_user_home() { getent passwd "$(logname)" | cut -d: -f6 } @@ -118,7 +117,7 @@ install_steam() { rm -rf "$steam_dir" mkdir -p "$steam_dir" - pushd "$temp_dir" + pushd "$temp_dir" || return 1 # download latest deb and unpack wget https://cdn.cloudflare.steamstatic.com/client/installer/steam.deb @@ -127,7 +126,7 @@ install_steam() { # move deb contents to steam folder mv ./usr/* "$steam_dir" - popd + popd || return 1 rm -rf "$temp_dir" # create run script From e754cf01a9ce6724e085fdd0781170e623bf770c Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:43:22 +0800 Subject: [PATCH 14/23] refactor: replace cd with pushd/popd Signed-off-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index 66bc7000..06d02810 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -65,18 +65,20 @@ EOF mkdir "${user_home}/wine/lib/" # cp libwine.so ${user_home}/wine/lib/ # cp libwine.so.1 ${user_home}/wine/lib/ - cd "${user_home}/wine/" || exit + pushd "${user_home}/wine/" || return 1 latest_version="$(basename "$(curl -ILs -o /dev/null -w "%{url_effective}" https://github.com/Kron4ek/Wine-Builds/releases/latest)")" curl -Ls "https://github.com/Kron4ek/Wine-Builds/releases/download/$latest_version/wine-$latest_version-x86.tar.xz" > "wine-latest-x86.tar.xz" xz -d wine-latest-x86.tar.xz tar -xf wine-latest-x86.tar - cd "wine-$latest_version-x86/" || exit + popd || return 1 + pushd "${user_home}/wine/wine-$latest_version-x86/" || return 1 cp -R ./* "${user_home}/wine" # ln -s "${user_home}/wine/bin/wine" /usr/local/bin/wine # ln -s "${user_home}/wine/bin/winecfg" /usr/local/bin/winecfg # ln -s "${user_home}/wine/bin/wineserver" /usr/local/bin/wineserver # #try to chown using either sudo_user or pkexec_uid chown -R "${SUDO_USER:-${PKEXEC_UID}}" "${user_home}/wine" + popd || return 1 echo "Run wine winecfg to let wine configure itself" } From a264dfea6923fdfc2d4ed66bd5d34ca48851870e Mon Sep 17 00:00:00 2001 From: ZHANG Yuntian <95260730+RadxaYuntian@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:56:51 +0800 Subject: [PATCH 15/23] fix: ensure wine install with correct file owner Signed-off-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index 06d02810..7a457700 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -37,8 +37,8 @@ EOF chmod +x /usr/local/bin/winetricks chmod +x /usr/local/bin/wineserver chmod +x /usr/local/bin/wine - mkdir -p "${user_home}/.local/share/applications/" - cat < "${user_home}/.local/share/applications/wine-config.desktop" + sudo -u "$(logname)" mkdir -p "${user_home}/.local/share/applications/" + cat < "${user_home}/.local/share/applications/wine-desktop.desktop" + cat < "wine-latest-x86.tar.xz" - xz -d wine-latest-x86.tar.xz - tar -xf wine-latest-x86.tar + curl -Lso "wine-$latest_version-x86.tar.xz" "https://github.com/Kron4ek/Wine-Builds/releases/download/$latest_version/wine-$latest_version-x86.tar.xz" + sudo -u "$(logname)" tar xf "wine-$latest_version-x86.tar.xz" popd || return 1 - pushd "${user_home}/wine/wine-$latest_version-x86/" || return 1 - cp -R ./* "${user_home}/wine" + sudo -u "$(logname)" cp -R "$wine_pkg/wine-$latest_version-x86"/* "${user_home}/wine" # ln -s "${user_home}/wine/bin/wine" /usr/local/bin/wine # ln -s "${user_home}/wine/bin/winecfg" /usr/local/bin/winecfg # ln -s "${user_home}/wine/bin/wineserver" /usr/local/bin/wineserver - # #try to chown using either sudo_user or pkexec_uid - chown -R "${SUDO_USER:-${PKEXEC_UID}}" "${user_home}/wine" - popd || return 1 + rm -rf "$wine_pkg" echo "Run wine winecfg to let wine configure itself" } From 2fc4ce14594d43ca6c869ea7cfa1b0bb4c846595 Mon Sep 17 00:00:00 2001 From: RadxaPanda Date: Mon, 15 Jul 2024 05:40:34 +0300 Subject: [PATCH 16/23] fix: wine and steam not being able to launch --- src/usr/lib/rsetup/cli/steam.sh | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index 7a457700..ab592cae 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -24,15 +24,15 @@ install_winex86() { cat < /usr/local/bin/wine #!/bin/bash #export GALLIUM_HUD=simple,fps -setarch linux32 -L box86 $HOME/wine/bin/wine "$@" +setarch linux32 -L box86 ~/wine/bin/wine "$@" EOF cat < /usr/local/bin/wineserver #!/bin/bash -box86 $HOME/wine/bin/wineserver "$@" +box86 ~/wine/bin/wineserver "$@" EOF cat < /usr/local/bin/winetricks #!/bin/bash -env BOX86_NOBANNER=1 box86 $HOME/wine/winetricks "$@" +env BOX86_NOBANNER=1 box86 ~/wine/winetricks "$@" EOF chmod +x /usr/local/bin/winetricks chmod +x /usr/local/bin/wineserver @@ -59,6 +59,12 @@ Icon=wine box86 Exec=/usr/local/bin/wine explorer /desktop=shell,1280x720 explorer.exe Categories=Game; Terminal=false +EOF + + cat < /etc/binfmt.d/wine.conf +package wine +interpreter /usr/bin/wine +magic MZ EOF sudo -u "$(logname)" mkdir -p "${user_home}/wine/lib/" @@ -76,7 +82,6 @@ EOF # ln -s "${user_home}/wine/bin/winecfg" /usr/local/bin/winecfg # ln -s "${user_home}/wine/bin/wineserver" /usr/local/bin/wineserver rm -rf "$wine_pkg" - echo "Run wine winecfg to let wine configure itself" } # install_wine64() { @@ -133,15 +138,22 @@ install_steam() { export STEAMOS=1 export STEAM_RUNTIME=1 export DBUS_FATAL_WARNINGS=0 +export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 ~/steam/bin/steam $@' > /usr/local/bin/steam + # .desktop file + sudo -u "$(logname)" mkdir -p "${user_home}/.local/share/applications/" + sed -i 's|/usr/bin/steam|/usr/local/bin/steam|' "${steam_dir}/lib/steam/steam.desktop" + cp "${steam_dir}/lib/steam/steam.desktop" "${user_home}/.local/share/applications/" + # make script executable chmod +x /usr/local/bin/steam apt-get install -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf \ libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf \ libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf \ libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf \ - libxinerama1:armhf libxdamage1:armhf libdrm2:armhf libgbm1:armhf libibus-1.0-5 + libxinerama1:armhf libxdamage1:armhf libdrm2:armhf libgbm1:armhf libibus-1.0-5 \ + zenity libgl1:armhf libgl1-mesa-dri:armhf binfmt-support } @@ -163,6 +175,8 @@ uninstall_steam() { rm -f /usr/local/bin/wine /usr/local/bin/wineserver /usr/local/bin/winetricks rm -f "${user_home}/.local/share/applications/wine-config.desktop" rm -f "${user_home}/.local/share/applications/wine-desktop.desktop" + rm -f "${user_home}/.local/share/applications/steam.desktop" + rm -f /etc/binfmt.d/wine.conf # Remove Steam related files and directories rm -rf "${user_home}/steam" @@ -173,7 +187,8 @@ uninstall_steam() { libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf \ libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf \ libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf \ - libxinerama1:armhf libxdamage1:armhf libgbm1:armhf libdrm2:armhf + libxinerama1:armhf libxdamage1:armhf libdrm2:armhf libgbm1:armhf libibus-1.0-5 \ + zenity libgl1:armhf libgl1-mesa-dri:armhf binfmt-support # Remove armhf architecture From e9c961000a60bb40b72ea47f9cedf4f474e2766f Mon Sep 17 00:00:00 2001 From: RadxaPanda <152165783+RadxaPanda@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:39:27 +0300 Subject: [PATCH 17/23] fix: escape $HOME and $@ when creating executables for wine and steam --- src/usr/lib/rsetup/cli/steam.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index ab592cae..c67d2389 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -21,18 +21,18 @@ install_winex86() { local -r user_home="$(get_user_home)" rm -rf "${user_home}/.wine/" "${user_home}/wine/" # cp wine /usr/local/bin/ - cat < /usr/local/bin/wine + cat <<\EOF > /usr/local/bin/wine #!/bin/bash #export GALLIUM_HUD=simple,fps -setarch linux32 -L box86 ~/wine/bin/wine "$@" +setarch linux32 -L box86 $HOME/wine/bin/wine "$@" EOF - cat < /usr/local/bin/wineserver + cat <<\EOF > /usr/local/bin/wineserver #!/bin/bash -box86 ~/wine/bin/wineserver "$@" +box86 $HOME/wine/bin/wineserver "$@" EOF - cat < /usr/local/bin/winetricks + cat <<\EOF > /usr/local/bin/winetricks #!/bin/bash -env BOX86_NOBANNER=1 box86 ~/wine/winetricks "$@" +env BOX86_NOBANNER=1 box86 $HOME/wine/winetricks "$@" EOF chmod +x /usr/local/bin/winetricks chmod +x /usr/local/bin/wineserver @@ -139,7 +139,7 @@ export STEAMOS=1 export STEAM_RUNTIME=1 export DBUS_FATAL_WARNINGS=0 export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 -~/steam/bin/steam $@' > /usr/local/bin/steam +$HOME/steam/bin/steam $@' > /usr/local/bin/steam # .desktop file sudo -u "$(logname)" mkdir -p "${user_home}/.local/share/applications/" From b95ed9a72b8048404e10aa0a087a931b7f3ab22a Mon Sep 17 00:00:00 2001 From: RadxaPanda <152165783+RadxaPanda@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:42:59 +0300 Subject: [PATCH 18/23] fix: add an ignore shellcheck option --- src/usr/lib/rsetup/cli/steam.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index c67d2389..d8c93c2e 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -134,6 +134,8 @@ install_steam() { rm -rf "$temp_dir" # create run script + # We don't want the expression to expand so disable the check + # shellcheck disable=SC2016 echo '#!/bin/bash export STEAMOS=1 export STEAM_RUNTIME=1 From 46f30b5d28784844c6f0734ab591dd58baf95bce Mon Sep 17 00:00:00 2001 From: RadxaPanda <152165783+RadxaPanda@users.noreply.github.com> Date: Tue, 16 Jul 2024 06:34:11 +0300 Subject: [PATCH 19/23] chore: use cat instead of echo for the steam executable Co-authored-by: ZHANG Yuntian --- src/usr/lib/rsetup/cli/steam.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index d8c93c2e..f7130be1 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -134,14 +134,14 @@ install_steam() { rm -rf "$temp_dir" # create run script - # We don't want the expression to expand so disable the check - # shellcheck disable=SC2016 - echo '#!/bin/bash + cat </usr/local/bin/steam +'#!/bin/bash export STEAMOS=1 export STEAM_RUNTIME=1 export DBUS_FATAL_WARNINGS=0 export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 -$HOME/steam/bin/steam $@' > /usr/local/bin/steam +"\$HOME/steam/bin/steam" "$@" +EOF # .desktop file sudo -u "$(logname)" mkdir -p "${user_home}/.local/share/applications/" From 5a4a751423a192c25e52f069b0bbfe22b06c3203 Mon Sep 17 00:00:00 2001 From: RadxaPanda <152165783+RadxaPanda@users.noreply.github.com> Date: Wed, 17 Jul 2024 07:36:28 +0000 Subject: [PATCH 20/23] chore: fix typo in the steam executable Co-authored-by: CodeChenL <43897062+CodeChenL@users.noreply.github.com> --- src/usr/lib/rsetup/cli/steam.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index f7130be1..c423a630 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -135,7 +135,7 @@ install_steam() { # create run script cat </usr/local/bin/steam -'#!/bin/bash +#!/bin/bash export STEAMOS=1 export STEAM_RUNTIME=1 export DBUS_FATAL_WARNINGS=0 From c17f0960e136394842d4464190a0180f6f41f05c Mon Sep 17 00:00:00 2001 From: RadxaPanda <152165783+RadxaPanda@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:47:36 +0300 Subject: [PATCH 21/23] chore: fix binfmtd --- src/usr/lib/rsetup/cli/steam.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index c423a630..83f4dfaa 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -62,9 +62,7 @@ Terminal=false EOF cat < /etc/binfmt.d/wine.conf -package wine -interpreter /usr/bin/wine -magic MZ +:wine:M::MZ::/usr/local/bin/wine: EOF sudo -u "$(logname)" mkdir -p "${user_home}/wine/lib/" From e9f9456c4bb3c4dd85f6e78de9341be8f4ef1219 Mon Sep 17 00:00:00 2001 From: RadxaPanda Date: Thu, 18 Jul 2024 02:03:33 +0000 Subject: [PATCH 22/23] feat: improve Steam installation prompt for devices without panthor --- src/usr/lib/rsetup/tui/task/steam/steam.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/usr/lib/rsetup/tui/task/steam/steam.sh b/src/usr/lib/rsetup/tui/task/steam/steam.sh index af082f3f..5f58eae3 100644 --- a/src/usr/lib/rsetup/tui/task/steam/steam.sh +++ b/src/usr/lib/rsetup/tui/task/steam/steam.sh @@ -13,7 +13,12 @@ __task_steam_uninstall() { } __task_steam_install() { - if yesno "Are you sure you want to install Steam?" + if lsmod | grep -q panthor; then + text="Are you sure you want to install Steam?" + else + text="You are using a device that has an incompatible gpu, you may experience stutters or crashes, do you still want to install Steam?" + fi + if yesno "$text" then install_steam fi From 428b93afc563c76070398d1ea51ec4cbb8d1f356 Mon Sep 17 00:00:00 2001 From: RadxaPanda <152165783+RadxaPanda@users.noreply.github.com> Date: Thu, 25 Jul 2024 07:30:56 +0300 Subject: [PATCH 23/23] chore: fix uninstall so it doesnt remove every single package it finds --- src/usr/lib/rsetup/cli/steam.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usr/lib/rsetup/cli/steam.sh b/src/usr/lib/rsetup/cli/steam.sh index 83f4dfaa..77fc861f 100644 --- a/src/usr/lib/rsetup/cli/steam.sh +++ b/src/usr/lib/rsetup/cli/steam.sh @@ -183,11 +183,11 @@ uninstall_steam() { rm -f /usr/local/bin/steam # Remove additional packages installed for Steam - apt-get remove -y libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf \ + apt-get remove -y --allow-remove-essential libc6:armhf libgcc-s1:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf \ libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf \ libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf \ libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf \ - libxinerama1:armhf libxdamage1:armhf libdrm2:armhf libgbm1:armhf libibus-1.0-5 \ + libxinerama1:armhf libxdamage1:armhf libdrm2:armhf libgbm1:armhf \ zenity libgl1:armhf libgl1-mesa-dri:armhf binfmt-support