From c5a0a71d7c05feda417b146e8679d7e3a77d7e59 Mon Sep 17 00:00:00 2001 From: Fiona Klute Date: Tue, 28 Apr 2026 11:50:56 +0200 Subject: [PATCH] package/initscripts: fix check-package warnings & indent No functional change. Add package-level .editorconfig so indentation matches what other init scripts use. Signed-off-by: Fiona Klute Signed-off-by: Julien Olivain (cherry picked from commit 3a488674b52f2515b3cc54526253682749553d11) Signed-off-by: Thomas Perale --- .checkpackageignore | 2 -- package/initscripts/.editorconfig | 3 +++ package/initscripts/init.d/rcK | 41 ++++++++++++++++--------------- package/initscripts/init.d/rcS | 39 ++++++++++++++--------------- 4 files changed, 43 insertions(+), 42 deletions(-) create mode 100644 package/initscripts/.editorconfig diff --git a/.checkpackageignore b/.checkpackageignore index 0e2e975eff..29474d9366 100644 --- a/.checkpackageignore +++ b/.checkpackageignore @@ -448,8 +448,6 @@ package/ifupdown/0001-dont-use-dpkg-architecture.patch lib_patch.Upstream package/igd2-for-linux/S99upnpd Shellcheck lib_sysv.Indent lib_sysv.Variables package/imx-mkimage/0001-Add-unused-fake-version.patch lib_patch.Upstream package/inadyn/S70inadyn NotExecutable lib_sysv.Indent -package/initscripts/init.d/rcK Shellcheck lib_shellscript.ConsecutiveEmptyLines lib_shellscript.EmptyLastLine -package/initscripts/init.d/rcS Shellcheck lib_shellscript.ConsecutiveEmptyLines lib_shellscript.EmptyLastLine package/input-event-daemon/S99input-event-daemon lib_sysv.ConsecutiveEmptyLines lib_sysv.Indent lib_sysv.Variables package/intel-gmmlib/0001-Drop-hardening-related-flags.patch lib_patch.Upstream package/intel-mediasdk/0001-Don-t-force-fstack-protector.patch lib_patch.Upstream diff --git a/package/initscripts/.editorconfig b/package/initscripts/.editorconfig new file mode 100644 index 0000000000..e616e5ae3f --- /dev/null +++ b/package/initscripts/.editorconfig @@ -0,0 +1,3 @@ +[rc?] +indent_style = tab +indent_size = tab diff --git a/package/initscripts/init.d/rcK b/package/initscripts/init.d/rcK index 59e9c54ff9..521e9eb645 100755 --- a/package/initscripts/init.d/rcK +++ b/package/initscripts/init.d/rcK @@ -1,27 +1,28 @@ #!/bin/sh - - +# # Stop all init scripts in /etc/init.d # executing them in reversed numerical order. # -for i in $(ls -r /etc/init.d/S??*) ;do +# we need to reverse the order here, sort -r would be no less fragile +# shellcheck disable=SC2045 +for i in $(ls -r /etc/init.d/S??*); do - # Ignore dangling symlinks (if any). - [ ! -f "$i" ] && continue + # Ignore dangling symlinks (if any). + [ ! -f "$i" ] && continue - case "$i" in - *.sh) - # Source shell script for speed. - ( - trap - INT QUIT TSTP - set stop - . $i - ) - ;; - *) - # No sh extension, so fork subprocess. - $i stop - ;; - esac + case "$i" in + *.sh) + # Source shell script for speed. + ( + trap - INT QUIT TSTP + set stop + # shellcheck source=/dev/null + . "$i" + ) + ;; + *) + # No sh extension, so fork subprocess. + "$i" stop + ;; + esac done - diff --git a/package/initscripts/init.d/rcS b/package/initscripts/init.d/rcS index de411534da..67efe3cf7f 100755 --- a/package/initscripts/init.d/rcS +++ b/package/initscripts/init.d/rcS @@ -1,27 +1,26 @@ #!/bin/sh - - +# # Start all init scripts in /etc/init.d # executing them in numerical order. # -for i in /etc/init.d/S??* ;do +for i in /etc/init.d/S??*; do - # Ignore dangling symlinks (if any). - [ ! -f "$i" ] && continue + # Ignore dangling symlinks (if any). + [ ! -f "$i" ] && continue - case "$i" in - *.sh) - # Source shell script for speed. - ( - trap - INT QUIT TSTP - set start - . $i - ) - ;; - *) - # No sh extension, so fork subprocess. - $i start - ;; - esac + case "$i" in + *.sh) + # Source shell script for speed. + ( + trap - INT QUIT TSTP + set start + # shellcheck source=/dev/null + . "$i" + ) + ;; + *) + # No sh extension, so fork subprocess. + "$i" start + ;; + esac done -