Skip to content

Commit

Permalink
Extend mesa-vpu extension to load unpatched Chromium by default (armb…
Browse files Browse the repository at this point in the history
…ian#6657)

* Extend mesa-vpu extension to load unpatches Chromium by default
* Pin only Chromium browser

For future - make separate browser extension
  • Loading branch information
igorpecovnik authored Jul 29, 2024
1 parent 0c86f76 commit 10b92e2
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions extensions/mesa-vpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ function extension_prepare_config__3d() {
# only used when generating desktop
[[ "${BUILD_DESKTOP}" != "yes" ]] && return 0

# some desktops doesn't support wayland
[[ "${DESKTOP_ENVIRONMENT}" == "xfce" || "${DESKTOP_ENVIRONMENT}" == "i3-wm" ]] && return 0

# Define image suffix
if [[ "${LINUXFAMILY}" =~ ^(rockchip-rk3588|rk35xx)$ && "$BRANCH" =~ ^(legacy)$ && "${RELEASE}" =~ ^(jammy|noble)$ ]]; then

Expand Down Expand Up @@ -43,6 +46,9 @@ function post_install_kernel_debs__3d() {
# Do not install those packages on CLI and minimal images
[[ "${BUILD_DESKTOP}" != "yes" ]] && return 0

# some desktops doesn't support wayland
[[ "${DESKTOP_ENVIRONMENT}" == "xfce" || "${DESKTOP_ENVIRONMENT}" == "i3-wm" ]] && return 0

# Packages that are going to be installed
declare -a pkgs=("mesa-utils" "mesa-utils-extra" "libglx-mesa0" "libgl1-mesa-dri" "glmark2" "glmark2-wayland" "glmark2-es2-wayland" "glmark2-es2")

Expand Down Expand Up @@ -76,6 +82,36 @@ function post_install_kernel_debs__3d() {
Pin-Priority: 1001
EOF

if [[ "${ARCH}" == "arm64" ]]; then

display_alert "Adding Amazingfate Chromium PPAs" "${EXTENSION}" "info"
do_with_retries 3 chroot_sdcard add-apt-repository ppa:liujianfeng1994/chromium --yes --no-update
sed -i "s/oracular/noble/g" "${SDCARD}"/etc/apt/sources.list.d/liujianfeng1994-ubuntu-chromium-"${RELEASE}".*

display_alert "Pinning amazingfated's Chromium PPAs" "${EXTENSION}" "info"
cat <<- EOF > "${SDCARD}"/etc/apt/preferences.d/liujianfeng1994-chromium-pin
Package: chromium
Pin: release o=LP-PPA-liujianfeng1994-chromium
Pin-Priority: 1001
EOF

else

display_alert "Adding Xtradebs Apps PPAs" "${EXTENSION}" "info"
do_with_retries 3 chroot_sdcard add-apt-repository ppa:xtradeb/apps --yes --no-update
sed -i "s/oracular/noble/g" "${SDCARD}"/etc/apt/sources.list.d/xtradeb-ubuntu-apps-"${RELEASE}".*

display_alert "Pinning Xtradebs PPAs" "${EXTENSION}" "info"
cat <<- EOF > "${SDCARD}"/etc/apt/preferences.d/xtradebs-apps-pin
Package: chromium
Pin: release o=LP-PPA-xtradebs-apps
Pin-Priority: 1001
EOF

fi

pkgs+=("chromium")

elif [[ "${DISTRIBUTION}" == "Debian" && "${RELEASE}" == "bookworm" ]]; then

display_alert "Adding mesa backport repo for ${RELEASE} from OBS" "${EXTENSION}" "info"
Expand Down Expand Up @@ -113,4 +149,9 @@ function post_install_kernel_debs__3d() {
display_alert "Upgrading Mesa packages" "${EXTENSION}" "info"
do_with_retries 3 chroot_sdcard_apt_get dist-upgrade

# Disable wayland flag for XFCE
#if [[ "${DESKTOP_ENVIRONMENT}" == "xfce" ]]; then
# sed -e '/wayland/ s/^#*/#/' -i "${SDCARD}"/etc/chromium.d/default-flags
#fi

}

0 comments on commit 10b92e2

Please sign in to comment.