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