From 478cbe27325c04228e0992df3b6eadc564dbd5a8 Mon Sep 17 00:00:00 2001 From: ravenclaw900 <50060110+ravenclaw900@users.noreply.github.com> Date: Tue, 2 Feb 2021 17:52:23 +0000 Subject: [PATCH] v6.35 (#3989) + DietPi-Software | Box86: An i386 wrapper for ARMv7 systems is now available for install. Thanks to binfmt, i386 binaries are executed automatically through Box86, which is able to either wrap native ARMv7 system libraries to work with the i386 binary or find and emulate i386 libraries, installed on the system. Note that it is not able to run x86_64 binaries, nor load such system libaries. + DietPi-Software | Steam: It can now be installed on ARMv7 systems, which will pull in Box86 as dependency then. Note that features and stability are limited and not all games will run. You'll be able to read more about it in our documentation (TBD): https://dietpi.com/docs/ --- dietpi/dietpi-software | 170 +++++++++++++++++++++++++++++++---------- 1 file changed, 129 insertions(+), 41 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 68383d3404..e6c23a1133 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1136,19 +1136,16 @@ _EOF_ software_id=156 aSOFTWARE_NAME[$software_id]='Steam' - aSOFTWARE_DESC[$software_id]='client' + aSOFTWARE_DESC[$software_id]='Valve gaming platform client' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 aSOFTWARE_ONLINEDOC_URL[$software_id]='p=8016#p8016' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - # Native PC only - for ((i=0; i<=$MAX_G_HW_MODEL; i++)) - do - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0 - done - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,21]=1 + # x86_64 and ARMv7 only + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 #------------------ software_id=164 @@ -1170,6 +1167,20 @@ _EOF_ aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 + #------------------ + software_id=62 + + aSOFTWARE_NAME[$software_id]='Box86' + aSOFTWARE_DESC[$software_id]='x86 userspace emulation' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=0#p0' + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + # Only works on ARMv7 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,10]=0 + # Social & Search #-------------------------------------------------------------------------------- software_id=54 @@ -2453,6 +2464,17 @@ _EOF_ fi + # Software that requires Box86 on ARM: Do not reinstall Box86 if present already! + # - Steam (156) + software_id=62 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} < 2 && $G_HW_ARCH == 2 && + ${aSOFTWARE_INSTALL_STATE[156]} == 1 )); then + + aSOFTWARE_INSTALL_STATE[$software_id]=1 + G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed" + + fi + #------------------------------------------------------------------------- # WEBSERVER - Manual stack install # - Define extra DietPi install flags for WEBSERVER_STACKS @@ -6081,21 +6103,25 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u Banner_Installing - # Enable foreign i386 architecture, since Steam is i386-only: https://packages.debian.org/steam - if [[ $(dpkg --print-foreign-architectures) != *'i386'* ]]; then - - dpkg --add-architecture i386 - G_AGUP + # Allow non-interactive install + G_EXEC eval "debconf-set-selections <<< 'steam steam/question select I AGREE'" + # x86_64: Install Debian i386 package + if [[ $G_HW_ARCH == 10 ]] + then + # Add i386 arch: https://packages.debian.org/bullseye/steam + [[ $(dpkg --print-foreign-architectures) == *'i386'* ]] || { G_EXEC dpkg --add-architecture i386; G_AGUP; } + # Add Nvidia i386 driver libs, if Nvidia driver is detected + local nvidia + [[ -e '/sys/module/nvidia/version' ]] && nvidia='nvidia-driver-libs:i386' + G_AGI steam $nvidia + + # ARM: Install repacked Debian i386 package for armhf + elif [[ $G_HW_ARCH == 2 ]] + then + Download_Install "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/steam_$G_HW_ARCH_NAME.deb" fi - # Add Nvidia i386 driver libs, if Nvidia driver is installed - local nvidia= - dpkg-query -s nvidia-driver &> /dev/null && nvidia='nvidia-driver-libs-i386' - - debconf-set-selections <<< 'steam steam/question select I AGREE' - G_AGI steam $nvidia - fi software_id=158 # MinIO @@ -6403,6 +6429,50 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u fi + software_id=62 # Box86 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) + then + Banner_Installing + + # APT deps + DEPS_LIST='cmake python3-minimal' + + # Download + local version=$(curl -sSfL https://api.github.com/repos/ptitSeb/box86/tags | mawk '/"name": /{print $4;exit}') + [[ $version ]] || version='v0.2.0' # Fallback + Download_Install "https://github.com/ptitSeb/box86/archive/$version.tar.gz" + + # Build + G_EXEC mkdir box86-${version#v}/build + G_EXEC cd box86-${version#v}/build + # - RPi 2 + if [[ $G_HW_MODEL == 2 ]] + then + G_EXEC cmake .. -DRPI2=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - RPi 3 + elif [[ $G_HW_MODEL == 3 ]] + then + G_EXEC cmake .. -DRPI3=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - RPi 4 + elif [[ $G_HW_MODEL == 4 ]] + then + G_EXEC cmake .. -DRPI4=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - Odroids + elif (( $G_HW_MODEL < 20 )) + then + G_EXEC cmake .. -DODROID=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - Others + else + G_EXEC cmake .. -DARM_DYNAREC=ON -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + fi + G_EXEC_OUTPUT=1 G_EXEC make CFLAGS='-g0 -O3' "-j$(nproc)" + G_EXEC strip --remove-section=.comment --remove-section=.note box86 + G_EXEC make install + + # Reload binfmt to have i386 binaries executed via box86 automatically from now on + (( $G_HW_ARCH < 10 )) && G_EXEC systemctl restart systemd-binfmt + fi + software_id=27 # TasmoAdmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -12407,20 +12477,21 @@ _EOF_ Banner_Configuration # Move data dir to dietpi_userdata - if [[ -d '/mnt/dietpi_userdata/steam' ]]; then - - rm -Rf /root/.steam - - elif [[ -d '/root/.steam' ]]; then + if [[ -d '/mnt/dietpi_userdata/steam' ]] + then + G_EXEC rm -Rf /root/.steam - mv /root/.steam /mnt/dietpi_userdata/steam + elif [[ -d '/root/.steam' ]] + then + G_EXEC mv /root/.steam /mnt/dietpi_userdata/steam else - - mkdir -p /mnt/dietpi_userdata/steam - + G_EXEC mkdir -p /mnt/dietpi_userdata/steam fi - ln -s /mnt/dietpi_userdata/steam /root/.steam + G_EXEC ln -s /mnt/dietpi_userdata/steam /root/.steam + + # Add Steam desktop shortcut + [[ -f '/root/Desktop/steam.desktop' ]] || G_EXEC ln -sf /usr/share/applications/steam.desktop /root/Desktop/steam.desktop fi @@ -13326,6 +13397,18 @@ _EOF_ fi + software_id=62 # Box86 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then + Banner_Uninstalling + [[ -f '/usr/local/bin/box86' ]] && rm -v /usr/local/bin/box86 + [[ -f '/etc/binfmt.d/box86.conf' ]] && rm -v /etc/binfmt.d/box86.conf + [[ -f '/usr/lib/i386-linux-gnu/libstdc++.so.6' ]] && rm -v /usr/lib/i386-linux-gnu/libstdc++.so.6 + [[ -f '/usr/lib/i386-linux-gnu/libstdc++.so.5' ]] && rm -v /usr/lib/i386-linux-gnu/libstdc++.so.5 + [[ -f '/usr/lib/i386-linux-gnu/libgcc_s.so.1' ]] && rm -v /usr/lib/i386-linux-gnu/libgcc_s.so.1 + [[ -d '/usr/lib/i386-linux-gnu' ]] && rmdir --ignore-fail-on-non-empty /usr/lib/i386-linux-gnu + fi + software_id=27 # TasmoAdmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then @@ -13341,7 +13424,7 @@ _EOF_ fi - software_id=83 + software_id=83 # Apache2 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -13349,7 +13432,7 @@ _EOF_ fi - software_id=85 + software_id=85 # Nginx if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -13357,7 +13440,7 @@ _EOF_ fi - software_id=84 + software_id=84 # Lighttpd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -13610,6 +13693,7 @@ _EOF_ rm -R /etc/systemd/system/blynkserver.service* fi + [[ -d '/etc/systemd/system/blynkserver.service.d' ]] && rm -R /etc/systemd/system/blynkserver.service.d getent passwd blynk > /dev/null && userdel blynk getent group blynk > /dev/null && groupdel blynk # Pre-v6.33 [[ -d '/mnt/dietpi_userdata/blynk' ]] && rm -R /mnt/dietpi_userdata/blynk @@ -13629,6 +13713,7 @@ _EOF_ rm -R /etc/systemd/system/aria2.service* fi + [[ -d '/etc/systemd/system/aria2.service.d' ]] && rm -R /etc/systemd/system/aria2.service.d G_AGP aria2 getent passwd aria2 > /dev/null && userdel aria2 getent group aria2 > /dev/null && groupdel aria2 @@ -14087,22 +14172,19 @@ _EOF_ fi software_id=156 # Steam - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then Banner_Uninstalling G_AGP steam - rm -Rf /{root,home/*}/.steam /mnt/dietpi_userdata/steam - + rm -Rf /{root,home/*}/{.steam{,path,pid},Desktop/steam.desktop} /mnt/dietpi_userdata/steam fi software_id=119 # CAVA - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then Banner_Uninstalling G_AGP cava - rm -Rf /{root,home/*}/.config/cava - rm -f /{root,home/*}/cava.psf - + rm -Rf /{root,home/*}/{.config/cava,cava.psf} fi software_id=118 # Mopidy @@ -16571,6 +16653,12 @@ We allow it to take up to 30 minutes, it's process can be followed, please be pa fi + # Box86 warning + if (( ${aSOFTWARE_INSTALL_STATE[156]} == 1 && $G_HW_ARCH == 2 )) + then + G_WHIP_MSG 'WARNING: The piece of software you are about to install is meant for the x86 platform.\n\nBox86 will be used to run it on ARM, however there may be performance and compatibility issues.' + fi + # dietpi-config can be used to install/configure the following software. Ask user. # - No-IP if (( ${aSOFTWARE_INSTALL_STATE[67]} == 1 )); then