Skip to content

Commit dac598d

Browse files
committed
runit-void: patch for udev
1 parent 5a81243 commit dac598d

2 files changed

Lines changed: 96 additions & 1 deletion

File tree

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
From 30be966515f6d766baa6d3da83c66efa66a9b725 Mon Sep 17 00:00:00 2001
2+
From: dkwo <nicolopiazzalunga@gmail.com>
3+
Date: Wed, 1 Mar 2023 15:42:53 -0500
4+
Subject: [PATCH] core-services/{02,99},rc.conf,shutdown.d/60: allow
5+
alternative udevd
6+
7+
---
8+
core-services/02-udev.sh | 27 +++++++++++++--------------
9+
core-services/99-cleanup.sh | 11 +++++++++++
10+
rc.conf | 5 +++++
11+
shutdown.d/60-udev.sh | 4 ----
12+
4 files changed, 29 insertions(+), 18 deletions(-)
13+
delete mode 100644 shutdown.d/60-udev.sh
14+
15+
diff --git a/core-services/02-udev.sh b/core-services/02-udev.sh
16+
index b08f8ca..2c46d55 100644
17+
--- a/core-services/02-udev.sh
18+
+++ b/core-services/02-udev.sh
19+
@@ -2,18 +2,17 @@
20+
21+
[ -n "$VIRTUALIZATION" ] && return 0
22+
23+
-if [ -x /usr/lib/systemd/systemd-udevd ]; then
24+
- _udevd=/usr/lib/systemd/systemd-udevd
25+
-elif [ -x /sbin/udevd -o -x /bin/udevd ]; then
26+
- _udevd=udevd
27+
-else
28+
- msg_warn "cannot find udevd!"
29+
-fi
30+
+msg "Starting device manager and waiting for devices to settle..."
31+
+case $CONFIG_DEV in
32+
+ udevd)
33+
+ udevd --daemon
34+
+ udevadm trigger --action=add --type=subsystems
35+
+ udevadm trigger --action=add --type=devices
36+
+ udevadm settle
37+
+ ;;
38+
39+
-if [ -n "${_udevd}" ]; then
40+
- msg "Starting udev and waiting for devices to settle..."
41+
- ${_udevd} --daemon
42+
- udevadm trigger --action=add --type=subsystems
43+
- udevadm trigger --action=add --type=devices
44+
- udevadm settle
45+
-fi
46+
+ mdevd)
47+
+ mdevd & pid_mdevd=$!
48+
+ mdevd-coldplug
49+
+ ;;
50+
+esac
51+
diff --git a/core-services/99-cleanup.sh b/core-services/99-cleanup.sh
52+
index f27f728..d9f3f98 100644
53+
--- a/core-services/99-cleanup.sh
54+
+++ b/core-services/99-cleanup.sh
55+
@@ -8,3 +8,14 @@ if [ ! -e /var/log/btmp ]; then
56+
fi
57+
install -dm1777 /tmp/.X11-unix /tmp/.ICE-unix
58+
rm -f /etc/nologin /forcefsck /forcequotacheck /fastboot
59+
+
60+
+msg "Killing device manager to make way for service..."
61+
+case $CONFIG_DEV in
62+
+ udevd)
63+
+ udevadm control --exit
64+
+ ;;
65+
+
66+
+ mdevd)
67+
+ kill "$pid_mdevd"
68+
+ ;;
69+
+esac
70+
diff --git a/rc.conf b/rc.conf
71+
index aa3da51..8a5e9f4 100644
72+
--- a/rc.conf
73+
+++ b/rc.conf
74+
@@ -45,3 +45,8 @@
75+
# RNG, for example if you plan to replicate this file system image and do not
76+
# have the wherewithal to first delete the contents of /var/lib/seedrng.
77+
#SEEDRNG_SKIP_CREDIT=false
78+
+
79+
+# The device manager to run during the init process. This is killed once boot
80+
+# is complete for a supervised version to take its place. Valid values are
81+
+# currently 'mdevd' or 'udevd' (default).
82+
+CONFIG_DEV=udevd
83+
diff --git a/shutdown.d/60-udev.sh b/shutdown.d/60-udev.sh
84+
deleted file mode 100644
85+
index dd42ff7..0000000
86+
--- a/shutdown.d/60-udev.sh
87+
+++ /dev/null
88+
@@ -1,4 +0,0 @@
89+
-if [ -z "$VIRTUALIZATION" ]; then
90+
- msg "Stopping udev..."
91+
- udevadm control --exit
92+
-fi
93+
--
94+
2.40.0
95+

srcpkgs/runit-void/template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Template file for 'runit-void'
22
pkgname=runit-void
33
version=20230413
4-
revision=1
4+
revision=2
55
build_style=gnu-makefile
66
short_desc="Void Linux runit scripts"
77
maintainer="Enno Boland <gottox@voidlinux.org>"

0 commit comments

Comments
 (0)