diff mbox series

[2/2] kbuild: Create INSTALL_PATH directory if it does not exist

Message ID 20240714085751.176357-3-xtex@envs.net (mailing list archive)
State New
Headers show
Series kbuild: Fix install errors when INSTALL_PATH does not exist | expand

Commit Message

Bingwu Zhang July 14, 2024, 8:57 a.m. UTC
From: Zhang Bingwu <xtexchooser@duck.com>

If INSTALL_PATH is not a valid directory, create it, like what
modules_install and dtbs_install will do in the same situation.

Signed-off-by: Zhang Bingwu <xtexchooser@duck.com>
---
 scripts/install.sh | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Bingwu Zhang July 14, 2024, 12:12 p.m. UTC | #1
Reviewed-by: Nicolas Schier <nicolas@jasle.eu>
Link: https://lore.kernel.org/linux-riscv/Zcfp8fn7o74K08g0@fjasle.eu/
Masahiro Yamada July 14, 2024, 7:24 p.m. UTC | #2
On Sun, Jul 14, 2024 at 5:58 PM Zhang Bingwu <xtex@envs.net> wrote:
>
> From: Zhang Bingwu <xtexchooser@duck.com>
>
> If INSTALL_PATH is not a valid directory, create it, like what
> modules_install and dtbs_install will do in the same situation.
>
> Signed-off-by: Zhang Bingwu <xtexchooser@duck.com>
> ---
>  scripts/install.sh | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/scripts/install.sh b/scripts/install.sh
> index 9bb0fb44f04a..02b845e7ab33 100755
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -20,6 +20,10 @@ do
>         fi
>  done
>
> +if [ "${INSTALL_PATH}" != "" ] && ! [ -e "${INSTALL_PATH}" ]; then

I changed the first check to [ -n "${INSTALL_PATH}" ]
Applied to linux-kbuild. Thanks!


> +       mkdir -p "${INSTALL_PATH}"
> +fi
> +
>  # User/arch may have a custom install script
>  for file in "${HOME}/bin/${INSTALLKERNEL}"             \
>             "/sbin/${INSTALLKERNEL}"                    \
> --
> 2.43.0
>
diff mbox series

Patch

diff --git a/scripts/install.sh b/scripts/install.sh
index 9bb0fb44f04a..02b845e7ab33 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -20,6 +20,10 @@  do
 	fi
 done
 
+if [ "${INSTALL_PATH}" != "" ] && ! [ -e "${INSTALL_PATH}" ]; then
+	mkdir -p "${INSTALL_PATH}"
+fi
+
 # User/arch may have a custom install script
 for file in "${HOME}/bin/${INSTALLKERNEL}"		\
 	    "/sbin/${INSTALLKERNEL}"			\