-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·91 lines (87 loc) · 4.83 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·91 lines (87 loc) · 4.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env bash
# a733-powervr-fex installer — applies the automatable parts on a Radxa A733
# (Cubie A7A/A7S, Debian 11 BSP). Safe: confirms each section, dry-runs the patch,
# never enables services without asking. Vendor blobs + the Mesa build are manual
# (see README / gpu/README.md) — this can't ship those.
#
# ./install.sh # guided (all sections, with prompts)
# ./install.sh kernel # just the pvrsrvkm PRIME patch
# ./install.sh sway # just the GPU sway desktop
set -u
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
say(){ printf '\n\033[1;36m==> %s\033[0m\n' "$*"; }
warn(){ printf '\033[1;33m!! %s\033[0m\n' "$*"; }
ask(){ read -r -p "$1 [y/N] " a; [[ "$a" =~ ^[Yy]$ ]]; }
install_kernel(){
say "Kernel: pvrsrvkm DRM PRIME-import patch"
local src; src="$(ls -d /usr/src/img-bxm-dkms-*/img-bxm/linux/rogue_km/services/server/env/linux 2>/dev/null | head -1)"
if [ -z "$src" ]; then
warn "img-bxm-dkms source not found. Install it first: sudo apt-get install img-bxm-dkms"
return 1
fi
echo "Target: $src"
echo "Dry-run:"; ( cd "$src" && patch -p1 --dry-run < "$HERE/kernel/pvrsrvkm-drm-prime-import.patch" )
if ask "Apply the patch and rebuild the module?"; then
( cd "$src" && sudo patch -p1 < "$HERE/kernel/pvrsrvkm-drm-prime-import.patch" )
local bd; bd="$(ls -d /usr/src/img-bxm-dkms-*/img-bxm/build/linux/sunxi_linux 2>/dev/null | head -1)"
if [ -n "$bd" ]; then
( cd "$bd" && sudo make BUILD=release KERNEL_CC=gcc KERNELDIR=/usr/src/linux-headers-"$(uname -r)" )
warn "Built. Load when pvrsrvkm refcnt is 0: sudo rmmod pvrsrvkm && sudo insmod <path>/pvrsrvkm.ko"
warn "Persist: xz -c <.ko> > /lib/modules/\$(uname -r)/updates/dkms/pvrsrvkm.ko.xz && sudo depmod -a"
else
warn "Build dir not found — rebuild via your DKMS flow."
fi
fi
}
install_sway(){
say "GPU sway + wayvnc desktop"
command -v sway >/dev/null || warn "sway not installed (sudo apt-get install sway)"
command -v wayvnc >/dev/null || warn "wayvnc not installed (build it or apt)"
command -v waybar >/dev/null || warn "waybar not installed (sudo apt-get install waybar wofi)"
if ask "Install sway/waybar configs + user services to ~/.config?"; then
mkdir -p ~/.config/sway ~/.config/waybar ~/.config/systemd/user
cp "$HERE/gpu/sway/sway.config" ~/.config/sway/config
cp "$HERE/gpu/sway/waybar.config" ~/.config/waybar/config
cp "$HERE/gpu/sway/waybar-style.css" ~/.config/waybar/style.css
cp "$HERE/gpu/sway/sway-headless.service" "$HERE/gpu/sway/wayvnc.service" ~/.config/systemd/user/
systemctl --user daemon-reload
echo "Installed. Start with: systemctl --user enable --now sway-headless wayvnc"
echo "(needs seatd running + 'loginctl enable-linger \$USER'). Then point a websockify/noVNC at 127.0.0.1:5901."
fi
}
install_vendor(){
say "Vendor PowerVR stack (fetched from the vendor — NOT bundled here)"
echo "The proprietary GPU userspace + firmware all live in ONE package:"
echo " xserver-xorg-img-bxm (libGLESv2_PVR_MESA, libVK_IMG, libsrv_um, libEGL, rgx.fw.*)"
echo "plus the kernel module: img-bxm-dkms"
# kernel module — usually in the Radxa apt repo
if apt-cache policy img-bxm-dkms 2>/dev/null | grep -q 'Candidate: [0-9]'; then
ask "apt-get install img-bxm-dkms (kernel module)?" && sudo apt-get install -y img-bxm-dkms
else
warn "img-bxm-dkms not in your apt sources — add the Radxa a733-bullseye repo first:"
warn " https://radxa-repo.github.io/a733-bullseye (see Radxa docs), then re-run."
fi
# GPU userspace + firmware — apt if present, else the vendor .deb
if apt-cache policy xserver-xorg-img-bxm 2>/dev/null | grep -q 'Candidate: [0-9]'; then
ask "apt-get install xserver-xorg-img-bxm (GPU userspace + firmware)?" && sudo apt-get install -y xserver-xorg-img-bxm
else
warn "xserver-xorg-img-bxm not in apt. Get the vendor .deb from one of:"
warn " - the Radxa Cubie A7A Debian image, or"
warn " - radxa/allwinner-target (branch target-a733-v1.4.x), or the Radxa apt repo,"
warn "then install it: sudo dpkg -i xserver-xorg-img-bxm*.deb"
read -r -p " Path to the .deb (blank to skip): " deb
[ -n "$deb" ] && [ -f "$deb" ] && sudo dpkg -i "$deb"
fi
echo "After this, libVK_IMG / libGLESv2_PVR_MESA / rgx.fw.* are in place; then run 'kernel'."
}
say "a733-powervr-fex installer"
echo "Sections: vendor (fetch proprietary stack) -> kernel (PRIME patch) -> sway (GPU desktop)."
echo "Zink-GL build + FEX Vulkan thunk stay manual — see gpu/README.md and fex/README.md."
case "${1:-all}" in
vendor) install_vendor ;;
kernel) install_kernel ;;
sway) install_sway ;;
all) install_vendor; install_kernel; install_sway
say "Done. For Zink-GL and the FEX Vulkan thunk, follow gpu/README.md and fex/README.md." ;;
*) echo "usage: $0 [vendor|kernel|sway|all]"; exit 1 ;;
esac