summaryrefslogtreecommitdiffstats
path: root/arch/riscv/boot
diff options
context:
space:
mode:
authorEmil Renner Berthing <emil.renner.berthing@canonical.com>2024-05-04 21:34:38 +0200
committerPalmer Dabbelt <palmer@rivosinc.com>2024-05-23 01:12:44 +0200
commite79dfcbfb902a99268cc8022031461da7a8e2bc8 (patch)
tree3f251d982ad4fccebe2747932afac34ce1149a2d /arch/riscv/boot
parentMerge tag 'riscv-for-linus-6.10-mw1' of git://git.kernel.org/pub/scm/linux/ke... (diff)
downloadlinux-e79dfcbfb902a99268cc8022031461da7a8e2bc8.tar.xz
linux-e79dfcbfb902a99268cc8022031461da7a8e2bc8.zip
riscv: make image compression configurable
Previously the build process would always set KBUILD_IMAGE to the uncompressed Image file (unless XIP_KERNEL or EFI_ZBOOT was enabled) and unconditionally compress it into Image.gz. However there are already build targets for Image.bz2, Image.lz4, Image.lzma, Image.lzo and Image.zstd, so let's make use of those, make the compression method configurable and set KBUILD_IMAGE accordingly so that targets like 'make install' and 'make bindeb-pkg' will use the chosen image. Tested-by: Björn Töpel <bjorn@rivosinc.com> Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com> Reviewed-by: Nicolas Schier <n.schier@avm.de> Reviewed-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.kernel.org/r/20240504193446.196886-2-emil.renner.berthing@canonical.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/boot')
-rwxr-xr-xarch/riscv/boot/install.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/riscv/boot/install.sh b/arch/riscv/boot/install.sh
index 4c63f3f0643d..a8df7591513a 100755
--- a/arch/riscv/boot/install.sh
+++ b/arch/riscv/boot/install.sh
@@ -17,15 +17,18 @@
# $3 - kernel map file
# $4 - default install path (blank if root directory)
-if [ "$(basename $2)" = "Image.gz" ]; then
+case "${2##*/}" in
# Compressed install
+Image.*|vmlinuz.efi)
echo "Installing compressed kernel"
base=vmlinuz
-else
+ ;;
# Normal install
+*)
echo "Installing normal kernel"
base=vmlinux
-fi
+ ;;
+esac
if [ -f $4/$base-$1 ]; then
mv $4/$base-$1 $4/$base-$1.old