[RESEND PATCH 0/2] kbuild: Fix install errors when INSTALL_PATH does not exist

From: Zhang Bingwu
Date: Sun Jul 14 2024 - 05:06:25 EST


From: Zhang Bingwu <xtexchooser@xxxxxxxx>

When running 'make zinstall INSTALL_PATH=somepath'
where 'somepath' does not exist, the install
scripts (install.sh) print error messages
but also return a success status code.
This will make 'make' regard 'install' (and 'zinstall', etc)
succeeded.
When there are also other targets at the same time,
for example, 'make zinstall dtbs_install modules_install',
make will keep going on and other outputs will fill stdout,
and make the error message hard to find.

dtbs_install and modules_install creates the target directory
if it does not exist. install, zinstall and others should
have the same behaviour.

If INSTALL_PATH is not a valid directory, we should create it.
If the installation process still fails with errors, for example,
insufficient space on disk or permission denied, make should regard
the install target failed, stop as soon as possible,
and exit with error.

Zhang Bingwu (2):
kbuild: Abort make on install failures
kbuild: Create INSTALL_PATH directory if it does not exist

arch/arm/boot/install.sh | 2 ++
arch/arm64/boot/install.sh | 2 ++
arch/m68k/install.sh | 2 ++
arch/nios2/boot/install.sh | 2 ++
arch/parisc/install.sh | 2 ++
arch/riscv/boot/install.sh | 2 ++
arch/s390/boot/install.sh | 2 ++
arch/sparc/boot/install.sh | 2 ++
arch/x86/boot/install.sh | 2 ++
scripts/install.sh | 4 ++++
10 files changed, 22 insertions(+)


base-commit: d0f86d080e3d7d5e1e75a56d88daf8e5f56a4146
--
2.43.0