diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2024-02-29 17:20:45 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2024-02-29 17:20:45 -0500 |
| commit | 9023719fa7c37f0f07d8a359bca51ef802df0fe2 (patch) | |
| tree | 402811ad366cfa8ee0230a3cec3eb49914f9cbf1 /distro/_ubuntu_arm64_box86.sh | |
| parent | d23b0a0e9a8cefce6826bbff73f29d3808932041 (diff) | |
| download | dotfiles-9023719fa7c37f0f07d8a359bca51ef802df0fe2.tar.gz dotfiles-9023719fa7c37f0f07d8a359bca51ef802df0fe2.tar.xz | |
Ubuntu setup script tweaks. New arm64 box86/box64 setup script.
Diffstat (limited to 'distro/_ubuntu_arm64_box86.sh')
| -rwxr-xr-x | distro/_ubuntu_arm64_box86.sh | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/distro/_ubuntu_arm64_box86.sh b/distro/_ubuntu_arm64_box86.sh new file mode 100755 index 0000000..85f9bfa --- /dev/null +++ b/distro/_ubuntu_arm64_box86.sh @@ -0,0 +1,71 @@ +#!/bin/sh +set -ex +# Automatically install box86/box64 on ARM64 SBCs +# Largely based on: +# https://github.com/ptitSeb/box86/blob/master/docs/COMPILE.md +codedir="$HOME/scm/pub" +box86dir="$codedir/box86" +box64dir="$codedir/box64" +winedir="$HOME/wine" + +if false ; then + +if [ "$(uname -m)" = "aarch64" ] ; then +sudo dpkg --add-architecture armhf +sudo apt update +sudo apt install -y libc6:armhf +sudo apt install -y gcc-arm-linux-gnueabihf +# sudo apt install libc6-dev-armhf-cross # Might need if you get crt1.o errors +fi + +fi # end if false + +cmakeflags="" +makeopts="" +_system="$(cat /sys/firmware/devicetree/base/model)" +echo "Found '$_system'..." +case $_system in + Orange\ Pi\ 5\ Plus) cmakeflags="-DRK3588=1"; makeopts="-j4"; ;; + *) echo "Unknown system, please add it"; exit 1; ;; +esac + +if ! [ -d "$box86dir" ] ; then + git clone https://github.com/ptitSeb/box86 "$box86dir" +fi +cd "$box86dir"; mkdir -p build; cd -; cd "$box86dir"/build +cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo $cmakeflags +make $makeopts +sudo make install +sudo systemctl restart systemd-binfmt + + +# Now for box64 +# https://github.com/ptitSeb/box64/blob/main/docs/COMPILE.md + +if ! [ -d "$box64dir" ] ; then + git clone https://github.com/ptitSeb/box64 "$box64dir" +fi +cd "$box64dir"; mkdir -p build; cd -; cd "$box64dir"/build +cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo $cmakeflags +make $makeopts +sudo make install +sudo systemctl restart systemd-binfmt + + +# Now for wine32 and wine64... +# https://github.com/ptitSeb/box86/blob/master/docs/X86WINE.md +# https://github.com/ptitSeb/box64/blob/main/docs/X64WINE.md +# TODO, finish this part... + +mkdir -p "$winedir" +x86winever="PlayOnLinux-wine-9.0-upstream-linux-x86" +x86winedest="$winedir/${x86winever}.tar.gz" +if ! [ -e "$x86winedest" ] ; then + wget -O "$x86winedest" \ + "https://www.playonlinux.com/wine/binaries/phoenicis/upstream-linux-x86/$x86winever.tar.gz" +fi + +if sha256sum "$x86winedest" | grep -q 2c99f45688eeb75a9c28303223edcede700ed2b1 ; then + echo "Failed to verify x86 wine package, exiting" + exit 1 +fi |
