Skip to content

Commit

Permalink
Better Chromium: use Pi-Apps-Coders chromium/widevine mirror
Browse files Browse the repository at this point in the history
safer than adding the entire archive.raspberrypi.com repo. If the user removed the pin priority they could break their system.

only show libwidevinecdm0 on 22.10+

suggestion from #2528

closes #2528

use force removal of pi-apps-coders-chromium repo

since Better Chromium requires that chromium be installed before running, chromium will never get purged as part of purge_packages since it must have either been marked manually installed or automatically installed by another package
  • Loading branch information
theofficialgman committed Jan 20, 2024
1 parent ac5c904 commit 9cfd465
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
40 changes: 40 additions & 0 deletions apps/Better Chromium/install
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,46 @@ else
error "User error: Chromium is not installed! Failed to find either a 'chromium' command or 'chromium-browser' command. If you are sure Chromium is installed, please reach out to Botspot for this to be fixed."
fi

# obtain model
get_model &>/dev/null
if [[ "$model" == *"Raspberry Pi"* ]] && [[ "$__os_id" == Ubuntu ]] && printf '%s\n' "22.04" "$__os_release" | sort -CV; then
# rpi ubuntu (22.04+) use Pi OS packaged chromium for better hardware support
add_external_repo "pi-apps-coders-chromium" "https://github.com/Pi-Apps-Coders/chromium-debs/raw/main/KEY.gpg" "https://github.com/Pi-Apps-Coders/chromium-debs/releases/download/apt-release" "./" || exit 1
# also disable chromium snap apt package from Ubuntu

# Ubuntu must be 22.10+ (GLIBC 2.36+) to be compatible with widevine
if printf '%s\n' "22.10" "$__os_release" | sort -CV; then
echo 'Package: chromium-*
Pin: release o=Pi-Apps-Coders chromium-debs
Pin-Priority: 1000
Package: libwidevinecdm0
Pin: release o=Pi-Apps-Coders chromium-debs
Pin-Priority: 500
Package: chromium-*
Pin: release o=Ubuntu*
Pin-Priority: -1' | sudo tee /etc/apt/preferences.d/pi-apps-coders-chromium >/dev/null
else
echo 'Package: chromium-*
Pin: release o=Pi-Apps-Coders chromium-debs
Pin-Priority: 1000
Package: libwidevinecdm0
Pin: release o=Pi-Apps-Coders chromium-debs
Pin-Priority: -1
Package: chromium-*
Pin: release o=Ubuntu*
Pin-Priority: -1' | sudo tee /etc/apt/preferences.d/pi-apps-coders-chromium >/dev/null
fi
install_packages chromium-browser || exit 1
# install_packages will not switch an already installed 1:1snap* package to a XXX chromium-browser package since this would constitute a downgrade
# the pin priorities added above will prevent Ubuntu repository chromium-browser packages from even showing or installing in the future but we still need to do the initial downgrade from 1:1snap* to the Pi OS version of chromium-browser
apt_lock_wait
sudo apt --only-upgrade --allow-downgrades install chromium-browser -y | less_apt
fi

#determine where the Chromium customizations folder is.
if [ -d /etc/chromium.d ];then
folder=/etc/chromium.d
Expand Down
5 changes: 5 additions & 0 deletions apps/Better Chromium/uninstall
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# rpi ubuntu (22.04+) use Pi OS packaged chromium for better hardware support
purge_packages
rm_external_repo "pi-apps-coders-chromium" force
sudo rm -f /etc/apt/preferences.d/pi-apps-coders-chromium

#determine where the Chromium customizations folder is.
if [ -d /etc/chromium.d ];then
folder=/etc/chromium.d
Expand Down

0 comments on commit 9cfd465

Please sign in to comment.