Skip to content

Commit

Permalink
v8.23
Browse files Browse the repository at this point in the history
- Raspberry Pi | Resolved an issue where the /dev/serial* symlinks were missing if binutils was not installed, which broke Bluetooth support among other things. Many thanks to @Rhiz3K for reporting this issue: #6666
  • Loading branch information
MichaIng committed Oct 8, 2023
1 parent e6f10a7 commit 0812ad7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 91 deletions.
87 changes: 6 additions & 81 deletions .build/software/raspberrypi-sys-mods/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,7 @@ fi

G_EXEC mkdir -p raspberrypi-sys-mods/{DEBIAN,lib/udev/rules.d,usr/{lib,share/doc}/raspberrypi-sys-mods}

cat << '_EOF_' > raspberrypi-sys-mods/usr/share/doc/raspberrypi-sys-mods/copyright
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: raspberrypi-sys-mods
Source: https://github.com/RPi-Distro/raspberrypi-sys-mods
Files: *
Copyright: 2015 Raspberry Pi Foundation
License: BSD-3-Clause
License: BSD-3-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HOLDERS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
_EOF_
G_EXEC curl -sSfo raspberrypi-sys-mods/usr/share/doc/raspberrypi-sys-mods/copyright 'https://raw.githubusercontent.com/RPi-Distro/raspberrypi-sys-mods/master/debian/copyright'

cat << '_EOF_' > raspberrypi-sys-mods/usr/lib/raspberrypi-sys-mods/i2cprobe
#!/bin/dash
Expand All @@ -66,53 +33,11 @@ modprobe "$MODALIAS" || modprobe "of:N${OF_NAME}T<NULL>C$OF_COMPATIBLE_0"
_EOF_
G_EXEC chmod +x raspberrypi-sys-mods/usr/lib/raspberrypi-sys-mods/i2cprobe

cat << '_EOF_' > raspberrypi-sys-mods/lib/udev/rules.d/15-i2c-modprobe.rules
SUBSYSTEM=="i2c|spi", ENV{MODALIAS}=="?*", ENV{OF_NAME}=="?*", ENV{OF_COMPATIBLE_0}=="?*", RUN+="/usr/lib/raspberrypi-sys-mods/i2cprobe"
_EOF_

cat << '_EOF_' > raspberrypi-sys-mods/lib/udev/rules.d/99-com.rules
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="*gpiomem*", GROUP="gpio", MODE="0660"
SUBSYSTEM=="rpivid-*", GROUP="video", MODE="0660"
G_EXEC curl -sSfo raspberrypi-sys-mods/lib/udev/rules.d/15-i2c-modprobe.rules 'https://raw.githubusercontent.com/RPi-Distro/raspberrypi-sys-mods/master/lib/udev/rules.d/15-i2c-modprobe.rules'

KERNEL=="vcsm-cma", GROUP="video", MODE="0660"
SUBSYSTEM=="dma_heap", GROUP="video", MODE="0660"
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="/bin/sh -c 'chgrp -R gpio /sys/class/gpio && chmod -R g=u /sys/class/gpio'"
SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/bin/sh -c 'chgrp -R gpio /sys%p && chmod -R g=u /sys%p'"
# PWM export results in a "change" action on the pwmchip device (not "add" of a new device), so match actions other than "remove".
SUBSYSTEM=="pwm", ACTION!="remove", PROGRAM="/bin/sh -c 'chgrp -R gpio /sys%p && chmod -R g=u /sys%p'"
KERNEL=="ttyAMA[0-9]*|ttyS[0-9]*", PROGRAM="/bin/sh -c '\
ALIASES=/proc/device-tree/aliases; \
TTYNODE=$$(readlink /sys/class/tty/%k/device/of_node | sed 's/base/:/' | cut -d: -f2); \
if [ -e $$ALIASES/bluetooth ] && [ $$TTYNODE/bluetooth = $$(strings $$ALIASES/bluetooth) ]; then \
echo 1; \
elif [ -e $$ALIASES/console ]; then \
if [ $$TTYNODE = $$(strings $$ALIASES/console) ]; then \
echo 0;\
else \
exit 1; \
fi \
elif [ $$TTYNODE = $$(strings $$ALIASES/serial0) ]; then \
echo 0; \
elif [ $$TTYNODE = $$(strings $$ALIASES/serial1) ]; then \
echo 1; \
else \
exit 1; \
fi \
'", SYMLINK+="serial%c"
ACTION=="add", SUBSYSTEM=="vtconsole", KERNEL=="vtcon1", RUN+="/bin/sh -c '\
if echo RPi-Sense FB | cmp -s /sys/class/graphics/fb0/name; then \
echo 0 > /sys$devpath/bind; \
fi; \
'"
_EOF_
G_EXEC curl -sSfo raspberrypi-sys-mods/lib/udev/rules.d/99-com.rules 'https://raw.githubusercontent.com/RPi-Distro/raspberrypi-sys-mods/master/etc.armhf/udev/rules.d/99-com.rules'
# The original rule uses the "strings" command from binutils, which we do not want to have pre-installed (it is huge!). So we use cat, which is safe for the node values read here.
G_EXEC sed -i 's/(strings/(cat/g' /usr/lib/udev/rules.d/99-com.rules

cat << '_EOF_' > raspberrypi-sys-mods/DEBIAN/preinst
#!/bin/dash
Expand All @@ -126,7 +51,7 @@ find raspberrypi-sys-mods ! \( -path raspberrypi-sys-mods/DEBIAN -prune \) -type

cat << _EOF_ > raspberrypi-sys-mods/DEBIAN/control
Package: raspberrypi-sys-mods
Version: 2:20230510-dietpi1
Version: 2:20230510-dietpi2
Architecture: all
Maintainer: MichaIng <[email protected]>
Date: $(date -u '+%a, %d %b %Y %T %z')
Expand Down
20 changes: 10 additions & 10 deletions .update/patches
Original file line number Diff line number Diff line change
Expand Up @@ -1412,18 +1412,10 @@ Patch_8_22()
[[ $(apt-key --keyring /etc/apt/trusted.gpg list 2> /dev/null) ]] || G_EXEC rm /etc/apt/trusted.gpg
fi

# RPi: Update raspberrypi-sys-mods
if (( $G_HW_MODEL < 10 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' raspberrypi-sys-mods 2> /dev/null)" lt-nl 2:20230510-dietpi1
then
G_DIETPI-NOTIFY 2 'Updating raspberrypi-sys-mods package ...'
G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/raspberrypi-sys-mods.deb'
G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb
G_EXEC rm package.deb

# Odroid C1: Set kernel packages on hold. We pin them in pre-patches and enforce an automated downgrade, in case, but since v23.02.2 might not be available forever, we should also set them on hold, until we know there is a compatble newer version available:
# - https://dietpi.com/forum/t/odroid-c1-not-booting-after-kernel-upgrade/17818
# - https://github.com/MichaIng/DietPi/issues/6616#issuecomment-1730900296
elif (( $G_HW_MODEL == 10 ))
if (( $G_HW_MODEL == 10 ))
then
G_DIETPI-NOTIFY 2 'Setting Odroid C1 "current" and "edge" kernel packages on hold'
G_EXEC apt-mark hold linux-image-current-meson linux-dtb-current-meson linux-headers-current-meson linux-image-edge-meson linux-dtb-edge-meson linux-headers-edge-meson
Expand Down Expand Up @@ -1472,8 +1464,16 @@ _EOF_

Patch_8_23()
{
# RPi: Update raspberrypi-sys-mods: https://github.com/MichaIng/DietPi/issues/6666
if (( $G_HW_MODEL < 10 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' raspberrypi-sys-mods 2> /dev/null)" lt-nl 2:20230510-dietpi2
then
G_DIETPI-NOTIFY 2 'Updating raspberrypi-sys-mods package ...'
G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/raspberrypi-sys-mods.deb'
G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb
G_EXEC rm package.deb

# VisionFive 2
if (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.55-dietpi1
elif (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.55-dietpi1
then
G_DIETPI-NOTIFY 2 'Updating RISC-V StarFive VisionFive 2 kernel ...'
G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-image-visionfive2.deb'
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Enhancements:
- DietPi-Software | Firefox: Enabled the software option for RISC-V, since Debian provides packages now. But do not expect good performance, as GPU-acceleration is missing.

Bug fixes:
- Raspberry Pi | Resolved an issue where the /dev/serial* symlinks were missing if binutils was not installed, which broke Bluetooth support among other things. Many thanks to @Rhiz3K for reporting this issue: https://github.com/MichaIng/DietPi/issues/6666
- DietPi daily cron | Resolved an issue where daily APT update checks failed if daily DietPi update checks were disabled. Many thanks to @lz1aam for reporting this issue: https://github.com/MichaIng/DietPi/issues/6651
- DietPi-Config | Resolved an issue where the WiFi channel selection was not possible with 5 GHz mode enabled. Many thanks to @lukaszsobala for reporting this issue: https://github.com/MichaIng/DietPi/issues/6636#issuecomment-1734427451
- DietPi-Software | Resolved an issue where motionEye failed to build on Bullseye systems since piwheels currently have no wheel for the latest Pillow version.
Expand Down

0 comments on commit 0812ad7

Please sign in to comment.