Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Software | Box86 and Steam for armhf #3989

Merged
merged 59 commits into from
Feb 2, 2021
Merged
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d6e5d0f
Begin to add Box86
ravenclaw900 Dec 21, 2020
668fb15
CodeFactor Fixes
ravenclaw900 Dec 21, 2020
4ed8ddd
Fix ==
ravenclaw900 Dec 22, 2020
4bcb9ba
Again fix syntax
ravenclaw900 Dec 22, 2020
486b361
Wrap everything in G_EXEC
ravenclaw900 Dec 22, 2020
8756a52
Remove extra ]
ravenclaw900 Dec 22, 2020
ca4b684
Change software ID
ravenclaw900 Dec 22, 2020
f6c5f18
Remove gl4es install
ravenclaw900 Dec 22, 2020
509c868
Fix Raspberry Pi detection
ravenclaw900 Dec 22, 2020
eb83d91
Finish fixing Rpi detection
ravenclaw900 Dec 22, 2020
afe0333
Show output on makes
ravenclaw900 Dec 22, 2020
7a3dafb
Add uninstall
ravenclaw900 Dec 22, 2020
6b80226
Add more to uninstall
ravenclaw900 Dec 22, 2020
c318283
Specify Rpi Models
ravenclaw900 Dec 22, 2020
b877335
Add gl4es
ravenclaw900 Dec 22, 2020
6a31cc2
Remove gl4es
ravenclaw900 Dec 23, 2020
7629112
Fix Rpi 4 detection
ravenclaw900 Dec 23, 2020
e754175
Merge branch 'dev' into 'box86'
ravenclaw900 Dec 26, 2020
c62020f
Add make install to all options
ravenclaw900 Dec 27, 2020
61b4c36
Merge branch 'box86' of https://github.com/ravenclaw900/DietPi into b…
ravenclaw900 Dec 27, 2020
1ac0bca
Add support for Steam on ARM
ravenclaw900 Dec 27, 2020
a8c0255
Add dependencies for Steam games
ravenclaw900 Dec 27, 2020
13c986f
CodeFactor Fixes
ravenclaw900 Dec 27, 2020
cb70c8f
More syntax fixes
ravenclaw900 Dec 27, 2020
546ac67
Fix uninstall
ravenclaw900 Dec 27, 2020
b50d9e8
6.35
ravenclaw900 Dec 27, 2020
fbef0cf
Fix syntax
ravenclaw900 Dec 27, 2020
5e562f0
6.35
ravenclaw900 Dec 27, 2020
0976e56
6.35
ravenclaw900 Dec 27, 2020
9f99852
Stop Steam from installing i386 packages on ARM
ravenclaw900 Dec 28, 2020
837ba5c
6.35
ravenclaw900 Dec 28, 2020
4c35b72
6.35
ravenclaw900 Dec 28, 2020
60c758d
6.35
ravenclaw900 Dec 29, 2020
c2f69e7
Merge branch 'dev' into box86
ravenclaw900 Jan 11, 2021
42002a6
6.35
ravenclaw900 Jan 16, 2021
d55eb29
6.35
ravenclaw900 Jan 16, 2021
766b0c1
6.35
ravenclaw900 Jan 16, 2021
9b44ec9
6.35
ravenclaw900 Jan 16, 2021
88b62a8
6.35
ravenclaw900 Jan 16, 2021
76fe093
6.35
ravenclaw900 Jan 23, 2021
00468f3
CodeFactor Fixes
ravenclaw900 Jan 23, 2021
c170c72
6.35
ravenclaw900 Jan 23, 2021
205c6f8
6.35
ravenclaw900 Jan 23, 2021
c0d9f0a
6.35
ravenclaw900 Jan 23, 2021
8a6965f
6.35
ravenclaw900 Jan 23, 2021
5c8a2e6
6.35
ravenclaw900 Jan 23, 2021
76ec0f0
6.35
ravenclaw900 Jan 23, 2021
d359ed2
6.35
ravenclaw900 Jan 23, 2021
2a1bbdc
6.35
ravenclaw900 Jan 23, 2021
c8a7312
v6.35
MichaIng Jan 24, 2021
c912275
v6.35
MichaIng Jan 24, 2021
781a77e
v6.35
MichaIng Jan 24, 2021
5260718
v6.35
MichaIng Jan 26, 2021
817de9d
v6.35
MichaIng Jan 27, 2021
7614c76
v6.35
MichaIng Jan 27, 2021
1fee7e4
v6.35
ravenclaw900 Jan 27, 2021
12d85d0
v6.35
MichaIng Jan 31, 2021
c07c2e1
v6.35
MichaIng Feb 1, 2021
d4dbadd
v6.35
MichaIng Feb 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 129 additions & 41 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -1136,19 +1136,16 @@ DietPi-Software will decrypt and use it for software installs. You can change it
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

Expand All @@ -1170,6 +1167,20 @@ DietPi-Software will decrypt and use it for software installs. You can change it
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
Expand Down Expand Up @@ -2438,6 +2449,17 @@ DietPi-Software will decrypt and use it for software installs. You can change it

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
Expand Down Expand Up @@ -6056,21 +6078,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
Expand Down Expand Up @@ -6368,6 +6394,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

Expand Down Expand Up @@ -12356,20 +12426,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

Expand Down Expand Up @@ -13262,6 +13333,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

Expand All @@ -13277,23 +13360,23 @@ _EOF_

fi

software_id=83
software_id=83 # Apache2
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then

Banner_Uninstalling
G_AGP apache2

fi

software_id=85
software_id=85 # Nginx
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then

Banner_Uninstalling
G_AGP nginx nginx-*

fi

software_id=84
software_id=84 # Lighttpd
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then

Banner_Uninstalling
Expand Down Expand Up @@ -13546,6 +13629,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
Expand All @@ -13565,6 +13649,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
Expand Down Expand Up @@ -14023,22 +14108,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
Expand Down Expand Up @@ -16485,6 +16567,12 @@ _EOF_

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
Expand Down