summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-08-09 10:27:12 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-08-09 10:27:12 +0200
commit441fdef79335650e772d9e74cf3d662106d6fb7e (patch)
treed8719ee7b9d2871b44ad290d424a31cf9b0a43b7
parentd5e4a18cb686a387ddb683102b89697eaaad809b (diff)
downloadalpine-conf-441fdef79335650e772d9e74cf3d662106d6fb7e.zip
setup-devd: disable/stop hwdrivers together with mdev
we should stop and disable hwdrivers when we stop and disable mdev ref https://gitlab.alpinelinux.org/alpine/aports/-/issues/14046
-rw-r--r--setup-devd.in4
-rwxr-xr-xtests/setup_devd_test9
2 files changed, 13 insertions, 0 deletions
diff --git a/setup-devd.in b/setup-devd.in
index 7225463..da42a49 100644
--- a/setup-devd.in
+++ b/setup-devd.in
@@ -29,7 +29,9 @@ EOF
disable_mdev () {
if rc-service --exists mdev ; then
+ rc-service --ifstarted --quiet hwdrivers stop
rc-service --ifstarted --quiet mdev stop
+ rc-update delete --quiet hwdriver sysinit || :
rc-update delete --quiet mdev sysinit || :
fi
}
@@ -38,7 +40,9 @@ enable_mdev () {
# mdev openrc script is provided by busybox-initscripts which is assumed
# to be there
rc-update add --quiet mdev sysinit
+ rc-update add --quiet hwdrivers sysinit
rc-service mdev --ifstopped start
+ rc-service hwdrivers --ifstopped start
}
disable_mdevd () {
diff --git a/tests/setup_devd_test b/tests/setup_devd_test
index 3e006ee..923c295 100755
--- a/tests/setup_devd_test
+++ b/tests/setup_devd_test
@@ -16,6 +16,7 @@ init_mdev() {
mkdir -p etc/init.d
touch etc/init.d/mdev
rc-service mdev start
+ rc-service hwdrivers start
}
setup_devd_mdev_body() {
@@ -44,6 +45,10 @@ setup_devd_mdevd_body() {
atf_check -s exit:3 \
-o match:"stopped" \
rc-service mdev status
+
+ atf_check -s exit:3 \
+ -o match:"stopped" \
+ rc-service hwdrivers status
}
setup_devd_udev_body() {
@@ -65,4 +70,8 @@ setup_devd_udev_body() {
atf_check -s exit:3 \
-o match:"stopped" \
rc-service mdev status
+
+ atf_check -s exit:3 \
+ -o match:"stopped" \
+ rc-service hwdrivers status
}