Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC] rpi-base: don't install snd_bcm2835.conf module file, move udev rules to separate file, add gpio udev rules
@ 2020-09-12  4:38 amak79
  2020-09-13  0:46 ` [PR PATCH] [Updated] " amak79
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: amak79 @ 2020-09-12  4:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

There is a new pull request by amak79 against master on the void-packages repository

https://github.com/amak79/void-packages rpibase
https://github.com/void-linux/void-packages/pull/24844

[RFC] rpi-base: don't install snd_bcm2835.conf module file, move udev rules to separate file, add gpio udev rules
- Don't install the `snd_bcm2835.conf` module file. The current template only installs this file for `armv6l` (rpi 1, zero). RPi audio should instead be enabled via the device tree parameter `dtparam=audio=on` in `/boot/config.txt`. RPi audio is disabled by default.
- Move udev rules from template to `files/71-raspberrypi.rules` file.
- Add udev rules for GPIO access.
- Add system group `gpio`.
- Fix xlint warnings.

Build for armv6l, armv7l, aarch64.
Tested on armv6l, armv7l.

A patch file from https://github.com/void-linux/void-packages/pull/24844.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rpibase-24844.patch --]
[-- Type: text/x-diff, Size: 3063 bytes --]

From a1c6a2c2c7313103fd8f727a693200f251550a37 Mon Sep 17 00:00:00 2001
From: amak <amak.git@outlook.com>
Date: Sat, 12 Sep 2020 13:47:43 +1000
Subject: [PATCH] rpi-base: don't install snd_bcm2835.conf module file, move
 udev rules to separate file, add gpio udev rules

---
 srcpkgs/rpi-base/files/71-raspberrypi.rules | 16 ++++++++++++
 srcpkgs/rpi-base/template                   | 29 ++++++---------------
 2 files changed, 24 insertions(+), 21 deletions(-)
 create mode 100644 srcpkgs/rpi-base/files/71-raspberrypi.rules

diff --git a/srcpkgs/rpi-base/files/71-raspberrypi.rules b/srcpkgs/rpi-base/files/71-raspberrypi.rules
new file mode 100644
index 00000000000..07975bf9415
--- /dev/null
+++ b/srcpkgs/rpi-base/files/71-raspberrypi.rules
@@ -0,0 +1,16 @@
+# Fix permissions for the vchiq, vcio, vcsm devices.
+SUBSYSTEM=="vchiq", GROUP="video", MODE="0660"
+SUBSYSTEM=="bcm2708_vcio", GROUP="video", MODE="0660"
+SUBSYSTEM=="vc-sm", GROUP="video", MODE="0660"
+
+# Fix permissions for the gpiomem, gpiochip* devices.
+SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
+SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
+
+# Fix permissions for the sysfs nodes needed by GPIO libraries (e.g. RPi.GPIO).
+# See https://github.com/RPi-Distro/raspberrypi-sys-mods/blob/master/etc.armhf/udev/rules.d/99-com.rules
+SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
+	chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
+	chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\
+	chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
+'"
diff --git a/srcpkgs/rpi-base/template b/srcpkgs/rpi-base/template
index a1e15b06280..1d09335cca3 100644
--- a/srcpkgs/rpi-base/template
+++ b/srcpkgs/rpi-base/template
@@ -1,29 +1,16 @@
 # Template file for 'rpi-base'
 pkgname=rpi-base
-version=2.5
-revision=4
-homepage="http://www.voidlinux.org"
-short_desc="Void Linux RaspberryPi base files"
+version=2.6
+revision=1
+archs="armv6l* armv7l* aarch64*"
+depends="virtual?ntp-daemon rpi-firmware rpi-kernel"
+short_desc="Void Linux Raspberry Pi base files"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="Public Domain"
+homepage="https://www.voidlinux.org"
 
-archs="armv6l* armv7l* aarch64*"
-depends="virtual?ntp-daemon rpi-firmware rpi-kernel"
+system_groups="gpio"
 
 do_install() {
-	case "$XBPS_TARGET_MACHINE" in
-	armv6l*)
-		# Load the audio module by default on RPi.
-		vmkdir usr/lib/modules-load.d
-		echo snd-bcm2835 > ${DESTDIR}/usr/lib/modules-load.d/snd_bcm2835.conf
-		;;
-	esac
-	# Fix permissions for the vchiq, vcio, vcsm devices.
-	vmkdir usr/lib/udev/rules.d
-	echo 'SUBSYSTEM=="vchiq", GROUP="video", MODE="0660"' > \
-		${DESTDIR}/usr/lib/udev/rules.d/71-raspberrypi.rules
-	echo 'SUBSYSTEM=="bcm2708_vcio", GROUP="video", MODE="0660"' >> \
-		${DESTDIR}/usr/lib/udev/rules.d/71-raspberrypi.rules
-	echo 'SUBSYSTEM=="vc-sm", GROUP="video", MODE="0660"' >> \
-		${DESTDIR}/usr/lib/udev/rules.d/71-raspberrypi.rules
+	vinstall "${FILESDIR}/71-raspberrypi.rules" 644 usr/lib/udev/rules.d
 }

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2020-12-30  8:24 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-12  4:38 [PR PATCH] [RFC] rpi-base: don't install snd_bcm2835.conf module file, move udev rules to separate file, add gpio udev rules amak79
2020-09-13  0:46 ` [PR PATCH] [Updated] " amak79
2020-09-13  2:25 ` amak79
2020-09-29  2:30 ` rpi-base: don't install snd_bcm2835.conf module file, move udev rules to separate file ericonr
2020-09-30  0:05 ` fosslinux
2020-09-30  0:05 ` fosslinux
2020-09-30  0:47 ` pbui
2020-09-30  1:23 ` amak79
2020-09-30  1:56 ` [PR PATCH] [Updated] " amak79
2020-09-30  2:05 ` amak79
2020-09-30  2:35 ` amak79
2020-09-30  2:36 ` amak79
2020-09-30 10:33 ` fosslinux
2020-09-30 20:17 ` Johnnynator
2020-09-30 22:42 ` [PR PATCH] [Updated] " amak79
2020-09-30 23:03 ` amak79
2020-10-01  0:06 ` amak79
2020-10-21 23:33 ` [PR PATCH] [Updated] " amak79
2020-11-10  3:50 ` amak79
2020-11-10  6:43 ` amak79
2020-11-10  6:47 ` amak79
2020-11-12  0:39 ` amak79
2020-12-30  7:12 ` the-maldridge
2020-12-30  7:41 ` [PR PATCH] [Updated] " amak79
2020-12-30  8:16 ` amak79
2020-12-30  8:24 ` [PR PATCH] [Merged]: " the-maldridge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).