[PATCH 02/20] kbuild: scripts/install.sh: properly quote all variables

From: Greg Kroah-Hartman
Date: Wed Apr 07 2021 - 01:35:01 EST


A few variables are quoted to handle spaces in directory names, but not
all of them. Properly quote everything so that the kernel build can
handle working correctly with directory names with spaces.

This change makes the script "shellcheck" clean now.

Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
scripts/install.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/install.sh b/scripts/install.sh
index d13ec1c38640..c183d6ddd00c 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -33,21 +33,21 @@ verify "$3"

# User may have a custom install script

-if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
-if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
+if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi
+if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi

# Default install - same as make zlilo

-if [ -f $4/vmlinuz ]; then
- mv $4/vmlinuz $4/vmlinuz.old
+if [ -f "$4"/vmlinuz ]; then
+ mv "$4"/vmlinuz "$4"/vmlinuz.old
fi

-if [ -f $4/System.map ]; then
- mv $4/System.map $4/System.old
+if [ -f "$4"/System.map ]; then
+ mv "$4"/System.map "$4"/System.old
fi

-cat $2 > $4/vmlinuz
-cp $3 $4/System.map
+cat "$2" > "$4"/vmlinuz
+cp "$3" "$4"/System.map

if [ -x /sbin/lilo ]; then
/sbin/lilo
--
2.31.1