linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] buildtar: add case for riscv architecture
@ 2019-09-11  7:07 Aurabindo Jayamohanan
  2019-09-11  9:05 ` Troy Benjegerdes
  0 siblings, 1 reply; 8+ messages in thread
From: Aurabindo Jayamohanan @ 2019-09-11  7:07 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou
  Cc: linux-kbuild, linux-kernel, linux-riscv

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

Hi,

I would like to know if something extra needs to be done other than copying compressed kernel image, when making tar package for riscv architecture. Please see the attached patch.

--

Thanks and Regards,
Aurabindo Jayamohanan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-buildtar-add-riscv-case.patch --]
[-- Type: text/x-patch; name="0001-buildtar-add-riscv-case.patch", Size: 1169 bytes --]

From 86feb93c62daa61314df0bbe1a11272c23b1eadb Mon Sep 17 00:00:00 2001
From: Aurabindo Jayamohanan <mail@aurabindo.in>
Date: Thu, 5 Sep 2019 12:52:45 +0530
Subject: [PATCH] buildtar: add riscv case

Copy compressed kernel image into tarball root. Similar
action for both arm64 and riscv architectures.

Signed-off-by: Aurabindo Jayamohanan <mail@aurabindo.in>
---
 scripts/package/buildtar | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index 2f66c81e4021..388d0fcbe8c2 100755
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -105,10 +105,10 @@ case "${ARCH}" in
 			cp -v -- "${objtree}/vmlinux" "${tmpdir}/boot/vmlinux-${KERNELRELEASE}"
 		fi
 		;;
-	arm64)
+	arm64|riscv)
 		for i in Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo ; do
-			if [ -f "${objtree}/arch/arm64/boot/${i}" ] ; then
-				cp -v -- "${objtree}/arch/arm64/boot/${i}" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}"
+			if [ -f "${objtree}/arch/${ARCH}/boot/${i}" ] ; then
+				cp -v -- "${objtree}/arch/${ARCH}/boot/${i}" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}"
 				break
 			fi
 		done
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [RFC] buildtar: add case for riscv architecture
  2019-09-11  7:07 [RFC] buildtar: add case for riscv architecture Aurabindo Jayamohanan
@ 2019-09-11  9:05 ` Troy Benjegerdes
  2019-09-11 12:54   ` Aurabindo Jayamohanan
  0 siblings, 1 reply; 8+ messages in thread
From: Troy Benjegerdes @ 2019-09-11  9:05 UTC (permalink / raw)
  To: Aurabindo Jayamohanan
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv,
	linux-kernel, linux-kbuild

None of the available RiscV platforms that I’m aware of use compressed images, unless there are some new bootloaders I haven’t seen yet.


> On Sep 11, 2019, at 2:07 AM, Aurabindo Jayamohanan <mail@aurabindo.in> wrote:
> 
> Hi,
> 
> I would like to know if something extra needs to be done other than copying compressed kernel image, when making tar package for riscv architecture. Please see the attached patch.
> 
> --
> 
> Thanks and Regards,
> Aurabindo Jayamohanan
> <0001-buildtar-add-riscv-case.patch>_______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC] buildtar: add case for riscv architecture
  2019-09-11  9:05 ` Troy Benjegerdes
@ 2019-09-11 12:54   ` Aurabindo Jayamohanan
  2019-09-14 12:59     ` Palmer Dabbelt
  0 siblings, 1 reply; 8+ messages in thread
From: Aurabindo Jayamohanan @ 2019-09-11 12:54 UTC (permalink / raw)
  To: Troy Benjegerdes
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv,
	linux-kernel, linux-kbuild



> None of the available RiscV platforms that I’m aware of use compressed images, unless there are some new bootloaders I haven’t seen yet.
>

I noticed that default build image is Image.gz, which is why I thought its a good idea to copy it into the tarball. Does such a copy not make sense at this point ?




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC] buildtar: add case for riscv architecture
  2019-09-11 12:54   ` Aurabindo Jayamohanan
@ 2019-09-14 12:59     ` Palmer Dabbelt
  2019-09-14 13:05       ` Anup Patel
  0 siblings, 1 reply; 8+ messages in thread
From: Palmer Dabbelt @ 2019-09-14 12:59 UTC (permalink / raw)
  To: mail
  Cc: Troy Benjegerdes, Paul Walmsley, aou, linux-riscv, linux-kernel,
	linux-kbuild

On Wed, 11 Sep 2019 05:54:07 PDT (-0700), mail@aurabindo.in wrote:
>
>
>> None of the available RiscV platforms that I’m aware of use compressed images, unless there are some new bootloaders I haven’t seen yet.
>>
>
> I noticed that default build image is Image.gz, which is why I thought its a good idea to copy it into the tarball. Does such a copy not make sense at this point ?

Image.gz can't be booted directly: it's just Image that's been compressed with 
the standard gzip command.  A bootloader would have to decompress that image 
before loading it into memory, which requires extra bootloader support.  
Contrast that with the zImage style images (which are vmlinuz on x86), which 
are self-extracting and therefor require no bootloader support.  The examples 
for u-boot all use the "booti" command, which expects uncompressed images.  
Poking around I couldn't figure out a way to have u-boot decompress the images, 
but that applies to arm64 as well so I'm not sure if I'm missing something.

If I was doing this, I'd copy over arch/riscv/boot/Image and call it 
"/boot/image-${KERNELRELEASE}", as calling it vmlinuz is a bit confusing to me 
because I'd expect vmlinuz to be a self-extracting compressed executable and 
not a raw gzip file.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [RFC] buildtar: add case for riscv architecture
  2019-09-14 12:59     ` Palmer Dabbelt
@ 2019-09-14 13:05       ` Anup Patel
  2019-09-14 19:27         ` Palmer Dabbelt
  0 siblings, 1 reply; 8+ messages in thread
From: Anup Patel @ 2019-09-14 13:05 UTC (permalink / raw)
  To: Palmer Dabbelt, mail
  Cc: Troy Benjegerdes, Paul Walmsley, aou, linux-riscv, linux-kernel,
	linux-kbuild



> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org <linux-kernel-
> owner@vger.kernel.org> On Behalf Of Palmer Dabbelt
> Sent: Saturday, September 14, 2019 6:30 PM
> To: mail@aurabindo.in
> Cc: Troy Benjegerdes <troy.benjegerdes@sifive.com>; Paul Walmsley
> <paul.walmsley@sifive.com>; aou@eecs.berkeley.edu; linux-
> riscv@lists.infradead.org; linux-kernel@vger.kernel.org; linux-
> kbuild@vger.kernel.org
> Subject: Re: [RFC] buildtar: add case for riscv architecture
> 
> On Wed, 11 Sep 2019 05:54:07 PDT (-0700), mail@aurabindo.in wrote:
> >
> >
> >> None of the available RiscV platforms that I’m aware of use compressed
> images, unless there are some new bootloaders I haven’t seen yet.
> >>
> >
> > I noticed that default build image is Image.gz, which is why I thought its a
> good idea to copy it into the tarball. Does such a copy not make sense at this
> point ?
> 
> Image.gz can't be booted directly: it's just Image that's been compressed
> with the standard gzip command.  A bootloader would have to decompress
> that image before loading it into memory, which requires extra bootloader
> support.
> Contrast that with the zImage style images (which are vmlinuz on x86), which
> are self-extracting and therefor require no bootloader support.  The
> examples for u-boot all use the "booti" command, which expects
> uncompressed images.
> Poking around I couldn't figure out a way to have u-boot decompress the
> images, but that applies to arm64 as well so I'm not sure if I'm missing
> something.
> 
> If I was doing this, I'd copy over arch/riscv/boot/Image and call it
> "/boot/image-${KERNELRELEASE}", as calling it vmlinuz is a bit confusing to
> me because I'd expect vmlinuz to be a self-extracting compressed
> executable and not a raw gzip file.

On the contrary, it is indeed possible to boot Image.gz directly using
U-Boot booti command so this patch would be useful.

Atish had got it working on U-Boot but he has deferred booti Image.gz
support due to few more dependent changes. May be he can share
more info.

Regards,
Anup

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [RFC] buildtar: add case for riscv architecture
  2019-09-14 13:05       ` Anup Patel
@ 2019-09-14 19:27         ` Palmer Dabbelt
  2019-09-17  9:35           ` Aurabindo Jayamohanan
  0 siblings, 1 reply; 8+ messages in thread
From: Palmer Dabbelt @ 2019-09-14 19:27 UTC (permalink / raw)
  To: Anup Patel
  Cc: mail, Troy Benjegerdes, Paul Walmsley, aou, linux-riscv,
	linux-kernel, linux-kbuild

On Sat, 14 Sep 2019 06:05:59 PDT (-0700), Anup Patel wrote:
> 
> 
>> -----Original Message-----
>> From: linux-kernel-owner@vger.kernel.org <linux-kernel-
>> owner@vger.kernel.org> On Behalf Of Palmer Dabbelt
>> Sent: Saturday, September 14, 2019 6:30 PM
>> To: mail@aurabindo.in
>> Cc: Troy Benjegerdes <troy.benjegerdes@sifive.com>; Paul Walmsley
>> <paul.walmsley@sifive.com>; aou@eecs.berkeley.edu; linux-
>> riscv@lists.infradead.org; linux-kernel@vger.kernel.org; linux-
>> kbuild@vger.kernel.org
>> Subject: Re: [RFC] buildtar: add case for riscv architecture
>> 
>> On Wed, 11 Sep 2019 05:54:07 PDT (-0700), mail@aurabindo.in wrote:
>> >
>> >
>> >> None of the available RiscV platforms that I’m aware of use compressed
>> images, unless there are some new bootloaders I haven’t seen yet.
>> >>
>> >
>> > I noticed that default build image is Image.gz, which is why I thought its a
>> good idea to copy it into the tarball. Does such a copy not make sense at this
>> point ?
>> 
>> Image.gz can't be booted directly: it's just Image that's been compressed
>> with the standard gzip command.  A bootloader would have to decompress
>> that image before loading it into memory, which requires extra bootloader
>> support.
>> Contrast that with the zImage style images (which are vmlinuz on x86), which
>> are self-extracting and therefor require no bootloader support.  The
>> examples for u-boot all use the "booti" command, which expects
>> uncompressed images.
>> Poking around I couldn't figure out a way to have u-boot decompress the
>> images, but that applies to arm64 as well so I'm not sure if I'm missing
>> something.
>> 
>> If I was doing this, I'd copy over arch/riscv/boot/Image and call it
>> "/boot/image-${KERNELRELEASE}", as calling it vmlinuz is a bit confusing to
>> me because I'd expect vmlinuz to be a self-extracting compressed
>> executable and not a raw gzip file.
> 
> On the contrary, it is indeed possible to boot Image.gz directly using
> U-Boot booti command so this patch would be useful.
> 
> Atish had got it working on U-Boot but he has deferred booti Image.gz
> support due to few more dependent changes. May be he can share
> more info.

Oh, great.  I guess it makes sense to just put both in the tarball, then, as 
users will still need to use the Image format for now.

> 
> Regards,
> Anup

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [RFC] buildtar: add case for riscv architecture
  2019-09-14 19:27         ` Palmer Dabbelt
@ 2019-09-17  9:35           ` Aurabindo Jayamohanan
  2019-09-20 22:40             ` Palmer Dabbelt
  0 siblings, 1 reply; 8+ messages in thread
From: Aurabindo Jayamohanan @ 2019-09-17  9:35 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: Anup Patel, Troy Benjegerdes, Paul Walmsley, aou, linux-riscv,
	linux-kernel, linux-kbuild

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Sunday, September 15, 2019 12:57 AM, Palmer Dabbelt <palmer@sifive.com> wrote:

> On Sat, 14 Sep 2019 06:05:59 PDT (-0700), Anup Patel wrote:
>
> > > -----Original Message-----
> > > From: linux-kernel-owner@vger.kernel.org <linux-kernel-
> > > owner@vger.kernel.org> On Behalf Of Palmer Dabbelt
> > > Sent: Saturday, September 14, 2019 6:30 PM
> > > To: mail@aurabindo.in
> > > Cc: Troy Benjegerdes troy.benjegerdes@sifive.com; Paul Walmsley
> > > paul.walmsley@sifive.com; aou@eecs.berkeley.edu; linux-
> > > riscv@lists.infradead.org; linux-kernel@vger.kernel.org; linux-
> > > kbuild@vger.kernel.org
> > > Subject: Re: [RFC] buildtar: add case for riscv architecture
> > > On Wed, 11 Sep 2019 05:54:07 PDT (-0700), mail@aurabindo.in wrote:
> > >
> > > > > None of the available RiscV platforms that I’m aware of use compressed
> > > > > images, unless there are some new bootloaders I haven’t seen yet.
> > > >
> > > > >
> > > >
> > > > I noticed that default build image is Image.gz, which is why I thought its a
> > > > good idea to copy it into the tarball. Does such a copy not make sense at this
> > > > point ?
> > >
> > > Image.gz can't be booted directly: it's just Image that's been compressed
> > > with the standard gzip command. A bootloader would have to decompress
> > > that image before loading it into memory, which requires extra bootloader
> > > support.
> > > Contrast that with the zImage style images (which are vmlinuz on x86), which
> > > are self-extracting and therefor require no bootloader support. The
> > > examples for u-boot all use the "booti" command, which expects
> > > uncompressed images.
> > > Poking around I couldn't figure out a way to have u-boot decompress the
> > > images, but that applies to arm64 as well so I'm not sure if I'm missing
> > > something.
> > > If I was doing this, I'd copy over arch/riscv/boot/Image and call it
> > > "/boot/image-${KERNELRELEASE}", as calling it vmlinuz is a bit confusing to
> > > me because I'd expect vmlinuz to be a self-extracting compressed
> > > executable and not a raw gzip file.
> >
> > On the contrary, it is indeed possible to boot Image.gz directly using
> > U-Boot booti command so this patch would be useful.
> > Atish had got it working on U-Boot but he has deferred booti Image.gz
> > support due to few more dependent changes. May be he can share
> > more info.
>
> Oh, great. I guess it makes sense to just put both in the tarball, then, as
> users will still need to use the Image format for now.
>

Uncompressed vmlinux is already copied by default. This patch just adds the
Image.gz into the archive as vmlinuz. But as you said, since the name vmlinuz is
reserved for self extracting archives, should I keep the original name Image.gz ?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [RFC] buildtar: add case for riscv architecture
  2019-09-17  9:35           ` Aurabindo Jayamohanan
@ 2019-09-20 22:40             ` Palmer Dabbelt
  0 siblings, 0 replies; 8+ messages in thread
From: Palmer Dabbelt @ 2019-09-20 22:40 UTC (permalink / raw)
  To: mail
  Cc: Anup Patel, Troy Benjegerdes, Paul Walmsley, aou, linux-riscv,
	linux-kernel, linux-kbuild

On Tue, 17 Sep 2019 02:35:10 PDT (-0700), mail@aurabindo.in wrote:
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Sunday, September 15, 2019 12:57 AM, Palmer Dabbelt <palmer@sifive.com> wrote:
>
>> On Sat, 14 Sep 2019 06:05:59 PDT (-0700), Anup Patel wrote:
>>
>> > > -----Original Message-----
>> > > From: linux-kernel-owner@vger.kernel.org <linux-kernel-
>> > > owner@vger.kernel.org> On Behalf Of Palmer Dabbelt
>> > > Sent: Saturday, September 14, 2019 6:30 PM
>> > > To: mail@aurabindo.in
>> > > Cc: Troy Benjegerdes troy.benjegerdes@sifive.com; Paul Walmsley
>> > > paul.walmsley@sifive.com; aou@eecs.berkeley.edu; linux-
>> > > riscv@lists.infradead.org; linux-kernel@vger.kernel.org; linux-
>> > > kbuild@vger.kernel.org
>> > > Subject: Re: [RFC] buildtar: add case for riscv architecture
>> > > On Wed, 11 Sep 2019 05:54:07 PDT (-0700), mail@aurabindo.in wrote:
>> > >
>> > > > > None of the available RiscV platforms that I’m aware of use compressed
>> > > > > images, unless there are some new bootloaders I haven’t seen yet.
>> > > >
>> > > > >
>> > > >
>> > > > I noticed that default build image is Image.gz, which is why I thought its a
>> > > > good idea to copy it into the tarball. Does such a copy not make sense at this
>> > > > point ?
>> > >
>> > > Image.gz can't be booted directly: it's just Image that's been compressed
>> > > with the standard gzip command. A bootloader would have to decompress
>> > > that image before loading it into memory, which requires extra bootloader
>> > > support.
>> > > Contrast that with the zImage style images (which are vmlinuz on x86), which
>> > > are self-extracting and therefor require no bootloader support. The
>> > > examples for u-boot all use the "booti" command, which expects
>> > > uncompressed images.
>> > > Poking around I couldn't figure out a way to have u-boot decompress the
>> > > images, but that applies to arm64 as well so I'm not sure if I'm missing
>> > > something.
>> > > If I was doing this, I'd copy over arch/riscv/boot/Image and call it
>> > > "/boot/image-${KERNELRELEASE}", as calling it vmlinuz is a bit confusing to
>> > > me because I'd expect vmlinuz to be a self-extracting compressed
>> > > executable and not a raw gzip file.
>> >
>> > On the contrary, it is indeed possible to boot Image.gz directly using
>> > U-Boot booti command so this patch would be useful.
>> > Atish had got it working on U-Boot but he has deferred booti Image.gz
>> > support due to few more dependent changes. May be he can share
>> > more info.
>>
>> Oh, great. I guess it makes sense to just put both in the tarball, then, as
>> users will still need to use the Image format for now.
>>
>
> Uncompressed vmlinux is already copied by default. This patch just adds the
> Image.gz into the archive as vmlinuz. But as you said, since the name vmlinuz is
> reserved for self extracting archives, should I keep the original name Image.gz ?

vmlinux is not the same as Image: vmlinux is an ELF file that can't be loaded 
directly by most bootloaders, Image is a mostly-flat binary with a small header 
that we're expecting can be booted by most bootloaders.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-09-20 22:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11  7:07 [RFC] buildtar: add case for riscv architecture Aurabindo Jayamohanan
2019-09-11  9:05 ` Troy Benjegerdes
2019-09-11 12:54   ` Aurabindo Jayamohanan
2019-09-14 12:59     ` Palmer Dabbelt
2019-09-14 13:05       ` Anup Patel
2019-09-14 19:27         ` Palmer Dabbelt
2019-09-17  9:35           ` Aurabindo Jayamohanan
2019-09-20 22:40             ` Palmer Dabbelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).