From 4f1d3b786deb4e234bd4a7e20bd9c975ee544017 Mon Sep 17 00:00:00 2001 From: Benjamin DeCamp Date: Thu, 20 Aug 2026 16:11:52 +0000 Subject: [PATCH] package/linux-tools/S10hyperv: fix invalid return value In both start() and stop(), ret is only assigned on failure. When hypervkvpd starts or stops successfully, return "$ret" expands to an empty string and causes: /etc/init.d/S10hyperv: return: line 31: Illegal number: Those double quotes were added in Buildroot commit [1], to fix a new ShellCheck warning at that time. This was not a complete fix. Only removing the double quote would reintroduce the ShellCheck warning. This would also reintroduce a check-package error. Since a bare return is equivalent to a "return 0", this commit also initializes with ret=0. Doing so will tell ShellCheck "ret" is an integer. Therefore, the ShellCheck warning will no longer be reported. This commit fixes the invalid return value by removing the double quotes and initialzing "ret=0". [1] https://gitlab.com/buildroot.org/buildroot/-/commit/c4173d8b08525f260fea8a2a1e805b806bcba9fc Signed-off-by: Benjamin DeCamp [Julien: - add "ret=0" initialization in script to fix check-package error - add extra info in the commit log ] Signed-off-by: Julien Olivain (cherry picked from commit 667335cd187150c5afebac2a278f92d5b6ef744d) Signed-off-by: Titouan Christophe --- package/linux-tools/S10hyperv | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/linux-tools/S10hyperv b/package/linux-tools/S10hyperv index be9ed2c5df..63424f5ae2 100644 --- a/package/linux-tools/S10hyperv +++ b/package/linux-tools/S10hyperv @@ -24,11 +24,12 @@ start_one() { } start() { + ret=0 # shellcheck disable=SC2086 # we need the word splitting for prog in ${PROGS}; do start_one "${prog}" || ret=$? done - return "$ret" + return $ret } stop_one() { @@ -45,11 +46,12 @@ stop_one() { } stop() { + ret=0 # shellcheck disable=SC2086 # we need the word splitting for prog in ${PROGS}; do stop_one "${prog}" || ret=$? done - return "$ret" + return $ret } restart() {