Skip to content

Commit

Permalink
Make changes for Raspberry Pi OS Bookworm (#2084)
Browse files Browse the repository at this point in the history
* fixed markdown warnings

* fix flake warnings

* * use bookworm
* use venv as Bookworm implemented PEP668
* explicitly install netcat-traditional package

* dont sudo activate

* allow breaking system packages

* fix break-system-packages, as this switch doesnt exist pre bookworm

* improve command for break system packages

* set break system packages globally

* fix permissions for mpd.conf

* revert last commit

* explictily start mpd

* explicitly stop mod when using Spotify

* use parallel for coveralls
  • Loading branch information
s-martin authored Nov 8, 2023
1 parent 38a02f6 commit 093cc61
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,20 @@ jobs:
run: |
pip install -r requirements.txt
pytest --cov --cov-report xml
- name: Report to Coveralls
- name: Report to Coveralls (parallel)
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ./components/gpio_control/coverage.xml
format: cobertura
parallel: true



finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Close parallel build
uses: coverallsapp/github-action@v1
with:
parallel-finished: true
#carryforward: "run-1,run-2"
2 changes: 1 addition & 1 deletion .github/workflows/test_docker_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
debian_version_name: ['bullseye', 'buster']
debian_version_name: ['bullseye', 'buster', 'bookworm']
uses: ./.github/workflows/test_docker_debian_versionname_sub.yml
with:
runs_on: ubuntu-latest
Expand Down
19 changes: 14 additions & 5 deletions scripts/installscripts/buster-install-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,8 @@ install_main() {
local jukebox_dir="$1"
local apt_get="sudo apt-get -qq --yes"
local allow_downgrades="--allow-downgrades --allow-remove-essential --allow-change-held-packages"

local pip_install="sudo python3 -m pip install --upgrade --force-reinstall -q"

clear

echo "#####################################################
Expand Down Expand Up @@ -918,7 +919,7 @@ install_main() {
${apt_get} ${allow_downgrades} install raspberrypi-kernel-headers
fi

${apt_get} ${allow_downgrades} install samba samba-common-bin gcc lighttpd php-common php-cgi php at mpd mpc mpg123 git ffmpeg resolvconf spi-tools netcat alsa-utils lsof procps
${apt_get} ${allow_downgrades} install samba samba-common-bin gcc lighttpd php-common php-cgi php at mpd mpc mpg123 git ffmpeg resolvconf spi-tools netcat-traditional alsa-utils lsof procps

# in the docker test env fiddling with resolv.conf causes issues, see https://stackoverflow.com/a/60576223
if [ "$DOCKER_RUNNING" != "true" ]; then
Expand All @@ -931,6 +932,8 @@ install_main() {

# use python3 as default
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
# make compatible for Bookworm, which implements PEP 668
sudo python3 -m pip config set global.break-system-packages true

# Get github code
cd "${HOME_DIR}" || exit
Expand Down Expand Up @@ -966,12 +969,12 @@ install_main() {
${apt_get} ${allow_downgrades} install libspotify12 python3-cffi python3-ply python3-pycparser python3-spotify

# Install necessary Python packages
sudo python3 -m pip install --upgrade --force-reinstall -q -r "${jukebox_dir}"/requirements-spotify.txt
${pip_install} -r "${jukebox_dir}"/requirements-spotify.txt
fi

# Install more required packages
echo "Installing additional Python packages..."
sudo python3 -m pip install --upgrade --force-reinstall -q -r "${jukebox_dir}"/requirements.txt
${pip_install} -r "${jukebox_dir}"/requirements.txt

samba_config

Expand Down Expand Up @@ -1075,6 +1078,7 @@ install_main() {
local mopidy_conf="${HOME_DIR}/.config/mopidy/mopidy.conf"
echo "Configuring Spotify support..."
sudo systemctl disable mpd
sudo service mpd stop
sudo systemctl enable mopidy
# Install Config Files
sudo cp "${jukebox_dir}"/misc/sampleconfigs/locale.gen.sample /etc/locale.gen
Expand Down Expand Up @@ -1105,7 +1109,7 @@ install_main() {

# GPIO-Control
if [[ "${GPIOconfig}" == "YES" ]]; then
sudo python3 -m pip install --upgrade --force-reinstall -q -r "${jukebox_dir}"/requirements-GPIO.txt
${pip_install} -r "${jukebox_dir}"/requirements-GPIO.txt
sudo systemctl enable phoniebox-gpio-control.service
if [[ ! -f "${jukebox_dir}"/settings/gpio_settings.ini ]]; then
cp "${jukebox_dir}"/misc/sampleconfigs/gpio_settings.ini.sample "${jukebox_dir}"/settings/gpio_settings.ini
Expand All @@ -1127,6 +1131,11 @@ install_main() {
sudo sed -i "s%/home/pi%${HOME_DIR}%g" "${mpd_conf}"
sudo chown mpd:audio "${mpd_conf}"
sudo chmod 640 "${mpd_conf}"

# start mpd
echo "Starting mpd service..."
sudo service mpd restart
sudo systemctl enable mpd
fi

# set which version has been installed
Expand Down
2 changes: 1 addition & 1 deletion scripts/installscripts/tests/test_installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ verify_apt_packages(){
local packages="samba
samba-common-bin gcc lighttpd php${phpver}-common php${phpver}-cgi php${phpver} at mpd mpc mpg123 git ffmpeg
resolvconf spi-tools python3 python3-dev python3-pip python3-setuptools python3-wheel python3-mutagen python3-gpiozero
python3-spidev netcat alsa-utils"
python3-spidev netcat-traditional alsa-utils"
local packages_raspberrypi="raspberrypi-kernel-headers"
local packages_spotify="libspotify-dev mopidy mopidy-mpd mopidy-local mopidy-spotify libspotify12
python3-cffi python3-ply python3-pycparser python3-spotify"
Expand Down

0 comments on commit 093cc61

Please sign in to comment.