Skip to content

Commit

Permalink
Extend mesa-vpu extension to load unpatches Chromium by default
Browse files Browse the repository at this point in the history
For future - make separate browser extension
  • Loading branch information
igorpecovnik committed May 24, 2024
1 parent 3d1d918 commit 87ba788
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 All @@ -39,6 +42,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 @@ -72,6 +78,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: *
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: *
Pin: release o=LP-PPA-xtradebs-apps
Pin-Priority: 1001
EOF

fi

pkgs+=("chromium")

fi

if [[ "${LINUXFAMILY}" =~ ^(rockchip-rk3588|rk35xx)$ && "${RELEASE}" =~ ^(jammy|noble)$ && "${BRANCH}" =~ ^(legacy|vendor)$ ]]; then
Expand Down Expand Up @@ -103,4 +139,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 87ba788

Please sign in to comment.