From 195dbcef3b12fdd753d97f77ff9568565aeaefc6 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 4 Feb 2025 20:53:50 +0200 Subject: [PATCH] ensure /sys devices are writeable before calling udevadm --- src/main/deploy/package/linux/postinst | 2 +- src/main/deploy/package/linux/sparrow.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/deploy/package/linux/postinst b/src/main/deploy/package/linux/postinst index 991cbfa1..3dd9e0a4 100755 --- a/src/main/deploy/package/linux/postinst +++ b/src/main/deploy/package/linux/postinst @@ -31,7 +31,7 @@ case "$1" in if ! groups "${SUDO_USER:-$(whoami)}" | grep -q plugdev; then usermod -aG plugdev "${SUDO_USER:-$(whoami)}" fi - if [ -x /bin/udevadm ]; then + if [ -w /sys/devices ] && [ -w /sys/kernel/uevent_seqnum ] && [ -x /bin/udevadm ]; then /bin/udevadm control --reload /bin/udevadm trigger fi diff --git a/src/main/deploy/package/linux/sparrow.spec b/src/main/deploy/package/linux/sparrow.spec index bfbc1274..77aeaa38 100755 --- a/src/main/deploy/package/linux/sparrow.spec +++ b/src/main/deploy/package/linux/sparrow.spec @@ -86,7 +86,7 @@ fi if ! groups "${SUDO_USER:-$(whoami)}" | grep -q plugdev; then usermod -aG plugdev "${SUDO_USER:-$(whoami)}" fi -if [ -x /bin/udevadm ]; then +if [ -w /sys/devices ] && [ -w /sys/kernel/uevent_seqnum ] && [ -x /bin/udevadm ]; then /bin/udevadm control --reload /bin/udevadm trigger fi