Re: [PATCH 06/20] kbuild: scripts/install.sh: handle compressed/uncompressed kernel images

From: Masahiro Yamada
Date: Wed Apr 07 2021 - 07:05:42 EST


On Wed, Apr 7, 2021 at 2:34 PM Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> For x86, the default kernel image is compressed, but other architectures
> allowed both compressed and uncompressed kernel images to be built. Add
> a test to detect which one this is, and either name the output file
> "vmlinuz" for a compressed image, or "vmlinux" for an uncompressed
> image.
>
> For x86 this change is a no-op, but other architectures depend on this.
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> ---
> scripts/install.sh | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/install.sh b/scripts/install.sh
> index 2adcb993efa2..72dc4c81013e 100644
> --- a/scripts/install.sh
> +++ b/scripts/install.sh
> @@ -49,8 +49,18 @@ verify "$3"
> if [ -x ~/bin/"${INSTALLKERNEL}" ]; then exec ~/bin/"${INSTALLKERNEL}" "$@"; fi
> if [ -x /sbin/"${INSTALLKERNEL}" ]; then exec /sbin/"${INSTALLKERNEL}" "$@"; fi
>
> -# Default install - same as make zlilo
> -install "$2" "$4"/vmlinuz
> +base=$(basename "$2")
> +if [ "$base" = "bzImage" ]; then
> + # Compressed install
> + echo "Installing compressed kernel"



After applying this series, I think the excessive
"Installing ..." messages are a bit annoying.


masahiro@grover:~/workspace/linux-kbuild$ make INSTALL_PATH=~/foo install
sh ./scripts/install.sh 5.12.0-rc3+ arch/x86/boot/bzImage \
System.map "/home/masahiro/foo"
Installing compressed kernel
installing 'arch/x86/boot/bzImage' to '/home/masahiro/foo/vmlinuz'
installing 'System.map' to '/home/masahiro/foo/System.map'
Cannot find LILO, ensure your bootloader knows of the new kernel image.



Since 03/20 added a new log in the 'install' function,
can we drop this "Installing compressed kernel" message?




> + base=vmlinuz
> +else
> + # Normal install
> + echo "Installing normal kernel"


Same here.

This message tends to be wrong.
For example, arch/arm/boot/uImage is gzip-compressed,
but it says "Installing normal kernel".







> + base=vmlinux
> +fi
> +
> +install "$2" "$4"/"$base"
> install "$3" "$4"/System.map
> sync
>
> --
> 2.31.1
>


--
Best Regards

Masahiro Yamada