diff mbox series

scripts/package: buildtar: Output as vmlinuz for riscv

Message ID 4edd1c5e-aacb-4513-97ae-e6b2130476fc@imgtec.com (mailing list archive)
State New, archived
Headers show
Series scripts/package: buildtar: Output as vmlinuz for riscv | expand

Commit Message

Matt Coster March 21, 2024, 11:58 a.m. UTC
From: Karolis Mituzas <karolis.mituzas@imgtec.com>

This matches the behavior for arm64 [1] and prevents clobbering of
vmlinux-${KERNELRELEASE}.

[1]: commit 0df57d90bfd6 ("kbuild: buildtar: add arm64 support")

Fixes: 7d0bc44bd0ea ("kbuild: buildtar: add riscv support")
Signed-off-by: Karolis Mituzas <karolis.mituzas@imgtec.com>
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
---
 scripts/package/buildtar | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nathan Chancellor March 21, 2024, 3:43 p.m. UTC | #1
On Thu, Mar 21, 2024 at 11:58:51AM +0000, Matt Coster wrote:
> From: Karolis Mituzas <karolis.mituzas@imgtec.com>
> 
> This matches the behavior for arm64 [1] and prevents clobbering of
> vmlinux-${KERNELRELEASE}.
> 
> [1]: commit 0df57d90bfd6 ("kbuild: buildtar: add arm64 support")
> 
> Fixes: 7d0bc44bd0ea ("kbuild: buildtar: add riscv support")
> Signed-off-by: Karolis Mituzas <karolis.mituzas@imgtec.com>
> Signed-off-by: Matt Coster <matt.coster@imgtec.com>
> ---
>  scripts/package/buildtar | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/package/buildtar b/scripts/package/buildtar
> index 72c91a1b832f..a36aca2a27cc 100755
> --- a/scripts/package/buildtar
> +++ b/scripts/package/buildtar
> @@ -96,7 +96,7 @@ case "${ARCH}" in
>  	riscv)
>  		for i in Image.bz2 Image.gz Image; do

This patch seems fine but it does introduce a slight inconsistency with
the rest of this script, as vmlinuz implies a compressed boot image but
Image is not compressed. Probably does not really matter but I feel like
it is worth mentioning.

>  			if [ -f "${objtree}/arch/riscv/boot/${i}" ] ; then
> -				cp -v -- "${objtree}/arch/riscv/boot/${i}" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}"
> +				cp -v -- "${objtree}/arch/riscv/boot/${i}" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}"
>  				break
>  			fi
>  		done
> -- 
> 2.44.0
>
Matt Coster March 22, 2024, 5:13 p.m. UTC | #2
On 21/03/2024 15:43, Nathan Chancellor wrote:
> On Thu, Mar 21, 2024 at 11:58:51AM +0000, Matt Coster wrote:
>> From: Karolis Mituzas <karolis.mituzas@imgtec.com>
>>
>> This matches the behavior for arm64 [1] and prevents clobbering of
>> vmlinux-${KERNELRELEASE}.
>>
>> [1]: commit 0df57d90bfd6 ("kbuild: buildtar: add arm64 support")
>>
>> Fixes: 7d0bc44bd0ea ("kbuild: buildtar: add riscv support")
>> Signed-off-by: Karolis Mituzas <karolis.mituzas@imgtec.com>
>> Signed-off-by: Matt Coster <matt.coster@imgtec.com>
>> ---
>>  scripts/package/buildtar | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/package/buildtar b/scripts/package/buildtar
>> index 72c91a1b832f..a36aca2a27cc 100755
>> --- a/scripts/package/buildtar
>> +++ b/scripts/package/buildtar
>> @@ -96,7 +96,7 @@ case "${ARCH}" in
>>  	riscv)
>>  		for i in Image.bz2 Image.gz Image; do
> 
> This patch seems fine but it does introduce a slight inconsistency with
> the rest of this script, as vmlinuz implies a compressed boot image but
> Image is not compressed. Probably does not really matter but I feel like
> it is worth mentioning.

I agree this doesn't seem like the perfect solution, but I'm not sure
what that would look like. We could easily pull the Image case out of
the loop and use vmlinux there, but then the original vmlinux would
still be clobbered.

>>  			if [ -f "${objtree}/arch/riscv/boot/${i}" ] ; then
>> -				cp -v -- "${objtree}/arch/riscv/boot/${i}" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}"
>> +				cp -v -- "${objtree}/arch/riscv/boot/${i}" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}"
>>  				break
>>  			fi
>>  		done
>> -- 
>> 2.44.0
>>
Masahiro Yamada March 26, 2024, 3:41 p.m. UTC | #3
On Thu, Mar 21, 2024 at 8:59 PM Matt Coster <Matt.Coster@imgtec.com> wrote:
>
> From: Karolis Mituzas <karolis.mituzas@imgtec.com>
>
> This matches the behavior for arm64 [1] and prevents clobbering of
> vmlinux-${KERNELRELEASE}.




What problem are you trying to solve?


Why is clobbering vmlinux-${KERNELRELEASE} a problem?
Matt Coster March 26, 2024, 4:13 p.m. UTC | #4
On 26/03/2024 15:41, Masahiro Yamada wrote:
> On Thu, Mar 21, 2024 at 8:59 PM Matt Coster <Matt.Coster@imgtec.com> wrote:
>>
>> From: Karolis Mituzas <karolis.mituzas@imgtec.com>
>>
>> This matches the behavior for arm64 [1] and prevents clobbering of
>> vmlinux-${KERNELRELEASE}.
> 
> What problem are you trying to solve?
> 
> Why is clobbering vmlinux-${KERNELRELEASE} a problem?
> 

This patch makes riscv tar*-pkg builds consistent with other
architectures. Clobbering vmlinux-${KERNELRELEASE} means there's no ELF
binary produced by tar*-pkg builds; sometimes you just need an ELF
binary, e.g. to run faddr2line.

Cheers,
Matt
diff mbox series

Patch

diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index 72c91a1b832f..a36aca2a27cc 100755
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -96,7 +96,7 @@  case "${ARCH}" in
 	riscv)
 		for i in Image.bz2 Image.gz Image; do
 			if [ -f "${objtree}/arch/riscv/boot/${i}" ] ; then
-				cp -v -- "${objtree}/arch/riscv/boot/${i}" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}"
+				cp -v -- "${objtree}/arch/riscv/boot/${i}" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}"
 				break
 			fi
 		done