From 81b0c7c19fb19896d0d72e6679a2163e06212ff1 Mon Sep 17 00:00:00 2001 From: dkwo Date: Wed, 1 Mar 2023 17:07:50 -0500 Subject: [PATCH 1/2] runit-void: patch for udev --- srcpkgs/runit-void/patches/udev.patch | 95 +++++++++++++++++++++++++++ srcpkgs/runit-void/template | 2 +- 2 files changed, 96 insertions(+), 1 deletion(-) 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..6583d87a38ab --- /dev/null +++ b/srcpkgs/runit-void/patches/udev.patch @@ -0,0 +1,95 @@ +From 30be966515f6d766baa6d3da83c66efa66a9b725 Mon Sep 17 00:00:00 2001 +From: dkwo +Date: Wed, 1 Mar 2023 15:42:53 -0500 +Subject: [PATCH] core-services/{02,99},rc.conf,shutdown.d/60: allow + alternative udevd + +--- + core-services/02-udev.sh | 27 +++++++++++++-------------- + core-services/99-cleanup.sh | 11 +++++++++++ + rc.conf | 5 +++++ + shutdown.d/60-udev.sh | 4 ---- + 4 files changed, 29 insertions(+), 18 deletions(-) + delete mode 100644 shutdown.d/60-udev.sh + +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 +diff --git a/shutdown.d/60-udev.sh b/shutdown.d/60-udev.sh +deleted file mode 100644 +index dd42ff7..0000000 +--- a/shutdown.d/60-udev.sh ++++ /dev/null +@@ -1,4 +0,0 @@ +-if [ -z "$VIRTUALIZATION" ]; then +- msg "Stopping udev..." +- udevadm control --exit +-fi +-- +2.40.0 + diff --git a/srcpkgs/runit-void/template b/srcpkgs/runit-void/template index 9c46593c7d58..207b7c08f0f7 100644 --- a/srcpkgs/runit-void/template +++ b/srcpkgs/runit-void/template @@ -1,7 +1,7 @@ # Template file for 'runit-void' pkgname=runit-void version=20230413 -revision=1 +revision=2 build_style=gnu-makefile short_desc="Void Linux runit scripts" maintainer="Enno Boland " From 89c963376edb39068302bd579cb51ca16d526d38 Mon Sep 17 00:00:00 2001 From: dkwo Date: Fri, 24 Feb 2023 18:26:36 -0500 Subject: [PATCH 2/2] New package: libudev-zero-1.0.3 --- common/shlibs | 1 + srcpkgs/libudev-zero-devel | 1 + srcpkgs/libudev-zero-helper | 1 + srcpkgs/libudev-zero/template | 45 +++++++++++++++++++++++++++++++++++ 4 files changed, 48 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 4b2122d1b199..8245323e125d 100644 --- a/common/shlibs +++ b/common/shlibs @@ -224,6 +224,7 @@ libgirepository-everything-1.0.so libgirepository-1.30_1 libgirepository-1.0.so.1 libgirepository-1.30_1 libudev.so.0 libudev0-shim-1_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..fc37ba222bd1 --- /dev/null +++ b/srcpkgs/libudev-zero/template @@ -0,0 +1,45 @@ +# Template file for 'libudev-zero' +pkgname=libudev-zero +version=1.0.3 +revision=1 +_UDEV_VERSION=251 +_eudev_version=3.2.12_1 +build_style=gnu-makefile +short_desc="Daemonless replacement for libudev" +maintainer="dkwo " +license="ISC" +homepage="https://github.com/illiliti/libudev-zero" +distfiles="https://github.com/illiliti/libudev-zero/archive/refs/tags/${version}.tar.gz" +checksum=0bd89b657d62d019598e6c7ed726ff8fed80e8ba092a83b484d66afb80b77da5 +make_check=no # no tests +provides="libudev-${_UDEV_VERSION}_${revision} eudev-libudev-${_eudev_version}" +replaces="eudev-libudev>=0" + +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} eudev-libudev-devel-${_eudev_version}" + replaces="eudev-libudev-devel>=0" + 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 + } +}