Github messages for voidlinux
 help / color / mirror / Atom feed
From: dkwo <dkwo@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] new package: libudev-zero
Date: Tue, 11 Apr 2023 22:34:02 +0200	[thread overview]
Message-ID: <20230411203402.oLrMfAnFvq9pUDct1GmGGJ0pHvj6HZ77fzgaaTKlrPA@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-42488@inbox.vuxu.org>

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

There is an updated pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages udev
https://github.com/void-linux/void-packages/pull/42488

new package: libudev-zero
https://github.com/illiliti/libudev-zero

- find optimal mdev.conf; current taken from kiss-linux, see also alpine and mdev-like-a-boss
- edit runit stage 1 script at void-linux/void-runit#106
- I tested the changes in this PR: no
- I built this PR locally for my native architecture, (x86_64-musl)

cc mantainer @mobinmob added a service and conf file to mdevd

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

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

From 6bbcea04cf7a33a022899a88704f1b0d535869b2 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Fri, 24 Feb 2023 17:01:40 -0500
Subject: [PATCH 1/3] mdevd: add conf and service

---
 srcpkgs/mdevd/files/mdev.conf | 70 +++++++++++++++++++++++++++++++++++
 srcpkgs/mdevd/files/mdevd/run |  4 ++
 srcpkgs/mdevd/template        |  5 ++-
 3 files changed, 78 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/mdevd/files/mdev.conf
 create mode 100644 srcpkgs/mdevd/files/mdevd/run

diff --git a/srcpkgs/mdevd/files/mdev.conf b/srcpkgs/mdevd/files/mdev.conf
new file mode 100644
index 000000000000..0c88a022cdcc
--- /dev/null
+++ b/srcpkgs/mdevd/files/mdev.conf
@@ -0,0 +1,70 @@
+# Configuration based on 'mdev-like-a-boss'.
+# https://github.com/slashbeast/mdev-like-a-boss/blob/master/mdev.conf
+
+null          root:root 666 @chmod 666 $MDEV
+zero          root:root 666
+full          root:root 666
+random        root:root 444
+urandom       root:root 444
+hwrandom      root:root 444
+grsec         root:root 660
+kmem          root:root 640
+mem           root:root 640
+
+port          root:root 640
+console       root:tty  600 @chmod 600 $MDEV
+ptmx          root:tty  666
+pty.*         root:tty  660
+tty           root:tty  666
+tty[0-9]*     root:tty  660
+vcsa*[0-9]*   root:tty  660
+
+# Kernel based virtual machine.
+kvm           root:kvm  660
+vhost-net     root:kvm  660
+
+# Block devices.
+ram([0-9]*)   root:disk 660 >rd/%1
+loop([0-9]+)  root:disk 660 >loop/%1
+sr[0-9]*      root:cdrom 660 @ln -sf $MDEV cdrom
+fd[0-9]*      root:floppy 660
+
+net/tun[0-9]* root:kvm 660
+net/tap[0-9]* root:root 600
+fuse          root:root 666
+agpgart       root:root 660 >misc/
+psaux         root:root 660 >misc/
+rtc           root:root 664 >misc/
+
+# Audio stuff.
+adsp          root:audio 660 >sound/
+audio         root:audio 660 >sound/
+dsp           root:audio 660 >sound/
+mixer         root:audio 660 >sound/
+sequencer.*   root:audio 660 >sound/
+snd/.*        root:audio 660
+
+# Raid controllers.
+cciss!(.*)    root:disk 660 =cciss/%1
+ida!(.*)      root:disk 660 =ida/%1
+rd!(.*)       root:disk 660 =rd/%1
+
+# Input stuff.
+SUBSYSTEM=input;.* root:input 660
+
+# Video stuff.
+card[0-9]     root:video 660 =dri/
+vbi[0-9]      root:video 660 >v4l/
+video[0-9]    root:video 660 >v4l/
+dri/.*        root:video 660
+
+# Don't create old usbdev* devices.
+usbdev[0-9].[0-9]* root:root 660 !
+
+# Stop creating x:x:x:x which looks like /dev/dm-*.
+[0-9]+\:[0-9]+\:[0-9]+\:[0-9]+ root:root 660 !
+
+# /dev/cpu support.
+microcode       root:root 600 =cpu/
+cpu([0-9]+)     root:root 600 =cpu/%1/cpuid
+msr([0-9]+)     root:root 600 =cpu/%1/msr
diff --git a/srcpkgs/mdevd/files/mdevd/run b/srcpkgs/mdevd/files/mdevd/run
new file mode 100644
index 000000000000..3d95ad3a6850
--- /dev/null
+++ b/srcpkgs/mdevd/files/mdevd/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+exec 2>&1
+exec mdevd -f /etc/mdev.conf -D 3 -b 200000 -O4
diff --git a/srcpkgs/mdevd/template b/srcpkgs/mdevd/template
index 15690b0ead37..f720e5caafef 100644
--- a/srcpkgs/mdevd/template
+++ b/srcpkgs/mdevd/template
@@ -15,9 +15,10 @@ homepage="https://skarnet.org/software/mdevd/"
 changelog="https://skarnet.org/software/mdevd/upgrade.html"
 distfiles="https://skarnet.org/software/mdevd/mdevd-${version}.tar.gz"
 checksum=ac2fcf9004f07904592c5894e2c401e15bb027ecf37bcb8ea661e2a7993447be
-
+conf_files="/etc/mdev.conf"
 build_options="static"
 desc_option_static="Build static binaries"
+make_check=no # no tests
 
 case "$XBPS_TARGET_MACHINE" in
 	*-musl)
@@ -30,6 +31,8 @@ post_install() {
 	vlicense COPYING
 	vdoc README
 	vcopy "doc/*" usr/share/doc/${pkgname}
+	vsv mdevd
+	vcopy ${FILESDIR}/mdev.conf etc/mdev.conf
 }
 
 mdevd-doc_package() {

From 5321eff63f91a984c1844646bc05ecebb06efb46 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 1 Mar 2023 17:07:50 -0500
Subject: [PATCH 2/3] runit-void: patch for udev

---
 srcpkgs/runit-void/patches/udev.patch | 79 +++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100644 srcpkgs/runit-void/patches/udev.patch

diff --git a/srcpkgs/runit-void/patches/udev.patch b/srcpkgs/runit-void/patches/udev.patch
new file mode 100644
index 000000000000..b15530bc0f2d
--- /dev/null
+++ b/srcpkgs/runit-void/patches/udev.patch
@@ -0,0 +1,79 @@
+From 109a056987fce4e0706420fba6705522e379bda5 Mon Sep 17 00:00:00 2001
+From: dkwo <nicolopiazzalunga@gmail.com>
+Date: Wed, 1 Mar 2023 15:42:53 -0500
+Subject: [PATCH] core-services/{02,99},rc.conf: allow alternative udevd
+
+---
+ core-services/02-udev.sh    | 27 +++++++++++++--------------
+ core-services/99-cleanup.sh | 11 +++++++++++
+ rc.conf                     |  5 +++++
+ 3 files changed, 29 insertions(+), 14 deletions(-)
+
+diff --git a/core-services/02-udev.sh b/core-services/02-udev.sh
+index b08f8ca..2c46d55 100644
+--- a/core-services/02-udev.sh
++++ b/core-services/02-udev.sh
+@@ -2,18 +2,17 @@
+ 
+ [ -n "$VIRTUALIZATION" ] && return 0
+ 
+-if [ -x /usr/lib/systemd/systemd-udevd ]; then
+-    _udevd=/usr/lib/systemd/systemd-udevd
+-elif [ -x /sbin/udevd -o -x /bin/udevd ]; then
+-    _udevd=udevd
+-else
+-    msg_warn "cannot find udevd!"
+-fi
++msg "Starting device manager and waiting for devices to settle..."
++case $CONFIG_DEV in
++	udevd)
++		udevd --daemon
++		udevadm trigger --action=add --type=subsystems
++		udevadm trigger --action=add --type=devices
++		udevadm settle
++        ;;
+ 
+-if [ -n "${_udevd}" ]; then
+-    msg "Starting udev and waiting for devices to settle..."
+-    ${_udevd} --daemon
+-    udevadm trigger --action=add --type=subsystems
+-    udevadm trigger --action=add --type=devices
+-    udevadm settle
+-fi
++	mdevd)
++		mdevd & pid_mdevd=$!
++		mdevd-coldplug
++        ;;
++esac
+diff --git a/core-services/99-cleanup.sh b/core-services/99-cleanup.sh
+index f27f728..d9f3f98 100644
+--- a/core-services/99-cleanup.sh
++++ b/core-services/99-cleanup.sh
+@@ -8,3 +8,14 @@ if [ ! -e /var/log/btmp ]; then
+ fi
+ install -dm1777 /tmp/.X11-unix /tmp/.ICE-unix
+ rm -f /etc/nologin /forcefsck /forcequotacheck /fastboot
++
++msg "Killing device manager to make way for service..."
++case $CONFIG_DEV in
++	udevd)
++		udevadm control --exit
++	;;
++
++	mdevd)
++		kill "$pid_mdevd"
++	;;
++esac
+diff --git a/rc.conf b/rc.conf
+index aa3da51..8a5e9f4 100644
+--- a/rc.conf
++++ b/rc.conf
+@@ -45,3 +45,8 @@
+ # RNG, for example if you plan to replicate this file system image and do not
+ # have the wherewithal to first delete the contents of /var/lib/seedrng.
+ #SEEDRNG_SKIP_CREDIT=false
++
++# The device manager to run during the init process. This is killed once boot
++# is complete for a supervised version to take its place. Valid values are
++# currently 'mdevd' or 'udevd' (default).
++CONFIG_DEV=udevd

From cb8d01847a04ded43c3ab5448b49dcce6831e46d Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Fri, 24 Feb 2023 18:26:36 -0500
Subject: [PATCH 3/3] new package: libudev-zero

---
 common/shlibs                 |  1 +
 srcpkgs/libudev-zero-devel    |  1 +
 srcpkgs/libudev-zero-helper   |  1 +
 srcpkgs/libudev-zero/template | 44 +++++++++++++++++++++++++++++++++++
 4 files changed, 47 insertions(+)
 create mode 120000 srcpkgs/libudev-zero-devel
 create mode 120000 srcpkgs/libudev-zero-helper
 create mode 100644 srcpkgs/libudev-zero/template

diff --git a/common/shlibs b/common/shlibs
index 847f5daec09d..3b5fa43e6442 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -218,6 +218,7 @@ libgirepository-gimarshallingtests-1.0.so libgirepository-1.30_1
 libgirepository-everything-1.0.so libgirepository-1.30_1
 libgirepository-1.0.so.1 libgirepository-1.30_1
 libudev.so.1 eudev-libudev-1.6_1
+libudev.so.1 libudev-zero-1.0.1_1
 libgudev-1.0.so.0 libgudev-230_1
 libumockdev.so.0 libumockdev-0.17.6_1
 libext2fs.so.2 e2fsprogs-libs-1.41.5_1
diff --git a/srcpkgs/libudev-zero-devel b/srcpkgs/libudev-zero-devel
new file mode 120000
index 000000000000..fa3977904232
--- /dev/null
+++ b/srcpkgs/libudev-zero-devel
@@ -0,0 +1 @@
+libudev-zero/
\ No newline at end of file
diff --git a/srcpkgs/libudev-zero-helper b/srcpkgs/libudev-zero-helper
new file mode 120000
index 000000000000..fa3977904232
--- /dev/null
+++ b/srcpkgs/libudev-zero-helper
@@ -0,0 +1 @@
+libudev-zero/
\ No newline at end of file
diff --git a/srcpkgs/libudev-zero/template b/srcpkgs/libudev-zero/template
new file mode 100644
index 000000000000..a001e8342262
--- /dev/null
+++ b/srcpkgs/libudev-zero/template
@@ -0,0 +1,44 @@
+# Template file for 'libudev-zero'
+pkgname=libudev-zero
+version=1.0.1
+revision=1
+_UDEV_VERSION=243
+build_style=gnu-makefile
+short_desc="Daemonless replacement for libudev"
+maintainer="dkwo <npiazza@disroot.org>"
+license="ISC"
+homepage="https://github.com/illiliti/libudev-zero"
+distfiles="https://github.com/illiliti/libudev-zero/archive/refs/tags/${version}.tar.gz"
+checksum=c4cf149ea96295c1e6e86038d10c725344c751982ed4a790b06c76776923e0ea
+make_check=no # no tests
+provides="libudev-${_UDEV_VERSION}_${revision}"
+conflicts="eudev-libudev>=3.2.11_1"
+
+post_build() {
+	"$CC" $LDFLAGS $CFLAGS $CPPFLAGS -o libudev-zero-helper contrib/helper.c
+}
+
+post_install() {
+	vlicense LICENSE
+}
+
+libudev-zero-devel_package() {
+	provides="libudev-devel-${_UDEV_VERSION}_${revision}"
+	conflicts="eudev-libudev-devel>=3.2.11_1"
+	depends="libudev-zero>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.a"
+		vmove "usr/lib/*.so"
+	}
+}
+
+libudev-zero-helper_package() {
+	depends="libudev-zero>=${version}_${revision}"
+	short_desc+=" - helper"
+	pkg_install() {
+		vinstall libudev-zero-helper 755 usr/libexec
+	}
+}

  parent reply	other threads:[~2023-04-11 20:34 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 16:49 [PR PATCH] [rfc] udev alternatives dkwo
2023-02-27 17:10 ` mobinmob
2023-02-27 17:11 ` mobinmob
2023-02-27 17:31 ` mobinmob
2023-02-27 17:38 ` mobinmob
2023-02-27 17:38 ` mobinmob
2023-02-27 18:05 ` [PR PATCH] [Updated] " dkwo
2023-02-27 18:06 ` dkwo
2023-02-27 18:07 ` [PR PATCH] [Updated] " dkwo
2023-02-27 18:25 ` dkwo
2023-02-27 18:38 ` dkwo
2023-02-27 21:25 ` dkwo
2023-02-27 23:04 ` [PR PATCH] [Updated] " dkwo
2023-02-28 15:20 ` mobinmob
2023-02-28 15:20 ` mobinmob
2023-02-28 17:19 ` mobinmob
2023-02-28 18:40 ` [PR PATCH] [Updated] " dkwo
2023-02-28 18:45 ` dkwo
2023-02-28 21:03 ` dkwo
2023-03-01 19:57 ` dkwo
2023-03-01 20:55 ` new package: libudev-zero dkwo
2023-03-01 22:09 ` [PR PATCH] [Updated] " dkwo
2023-03-01 23:07 ` dkwo
2023-03-06 19:24 ` [PR PATCH] [Updated] " dkwo
2023-04-07 14:32 ` dkwo
2023-04-11 20:34 ` dkwo [this message]
2023-04-11 20:35 ` [PR PATCH] [Updated] " dkwo
2023-04-11 21:49 ` dkwo
2023-04-21 21:34 ` dkwo
2023-04-24 18:24 ` dkwo
2023-04-26 14:11 ` dkwo
2023-04-26 14:19 ` dkwo
2023-04-26 17:41 ` mobinmob
2023-04-26 17:42 ` mobinmob
2023-04-29 15:09 ` [PR PATCH] [Updated] [WIP] " dkwo
2023-04-29 15:17 ` dkwo
2023-05-01  9:06 ` mobinmob
2023-05-01 14:43 ` [PR PATCH] [Updated] " dkwo
2023-07-15 21:56 ` dkwo
2023-10-14  1:44 ` github-actions
2023-10-15 21:44 ` [PR PATCH] [Updated] " dkwo
2024-01-14  1:50 ` github-actions
2024-01-14 10:39 ` [PR PATCH] [Updated] " dkwo
2024-04-14  1:59 ` github-actions
2024-04-15 17:08 ` [PR PATCH] [Updated] " dkwo
2024-04-16 23:33 ` xplshn
2024-04-16 23:34 ` xplshn
2024-04-16 23:35 ` xplshn
2024-04-17 13:46 ` dkwo
2024-04-18  0:47 ` xplshn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230411203402.oLrMfAnFvq9pUDct1GmGGJ0pHvj6HZ77fzgaaTKlrPA@z \
    --to=dkwo@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).