From 4ede63c069d81aaabbe1960d4ff63689d2c2b67a Mon Sep 17 00:00:00 2001 From: Jens Maus Date: Sat, 23 Sep 2023 12:00:35 +0200 Subject: [PATCH] package/linux-tools: fix SysV init script This commit fixes the S10hyperv SysV init script which expects binaries to be locate in /sbin while they are installed in /usr/sbin. Please note, that the systemd init scripts correctly reference them. Furthermore, the SysV init script did not check for an actual HyperV environment to be present, which is also corrected. In addition, this commit also fixes check-package warnings regarding a missing DAEMON definition. Signed-off-by: Jens Maus [Peter: drop from .checkpackageignore] Signed-off-by: Peter Korsgaard (cherry picked from commit 14c4bd7bf8150283e158c50df87c77d63bb1b73c) Signed-off-by: Peter Korsgaard --- .checkpackageignore | 1 - package/linux-tools/S10hyperv | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.checkpackageignore b/.checkpackageignore index 1ff0f4e0c0..526df2d781 100644 --- a/.checkpackageignore +++ b/.checkpackageignore @@ -825,7 +825,6 @@ package/linux-fusion/0001-fix-for-linux-4-and-above.patch Upstream package/linux-fusion/0002-Fix-mismatched-conversion-spec-and-value-in-printk.patch Upstream package/linux-fusion/0003-Fix-fusion-Unknown-symbol-tasklist_lock-err-0.patch Upstream package/linux-fusion/0004-Port-one-one_udp.c-to-Linux-4.1.patch Upstream -package/linux-tools/S10hyperv Variables package/linux-zigbee/0001-test-serial-Remove-test-serial.patch Upstream package/linux-zigbee/0002-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch Upstream package/linuxptp/S65ptp4l Indent Shellcheck diff --git a/package/linux-tools/S10hyperv b/package/linux-tools/S10hyperv index 32887d1b6c..be9ed2c5df 100644 --- a/package/linux-tools/S10hyperv +++ b/package/linux-tools/S10hyperv @@ -2,14 +2,18 @@ PROGS="@PROGS@" PIDDIR="/var/run" +DAEMON="hyperv" # shellcheck source=/dev/null -[ -r "/etc/default/hyperv" ] && . "/etc/default/hyperv" +[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" + +# only continue if we are in a HyperV platform +[ -e "/sys/bus/vmbus" ] || exit 0 start_one() { printf 'Starting %s: ' "$1" # shellcheck disable=SC2086 # we need the word splitting - start-stop-daemon -b -m -S -q -p "$PIDDIR/$1.pid" -x "/sbin/$1" -- -n + start-stop-daemon -b -m -S -q -p "$PIDDIR/$1.pid" -x "/usr/sbin/$1" -- -n status=$? if [ "$status" -eq 0 ]; then echo "OK"