All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] In kernel mkimage
@ 2007-07-17  2:04 Josh Boyer
  2007-07-17  9:19 ` Clemens Koller
  0 siblings, 1 reply; 9+ messages in thread
From: Josh Boyer @ 2007-07-17  2:04 UTC (permalink / raw)
  To: u-boot

Hi All,

As part of my on-going 4xx work in the arch/powerpc kernel, I've been
toying with the idea of creating an in-kernel copy of the mkimage
tool, similar to how we have a mktree tool for the older OpenBIOS
firmware.

The main reason is that there isn't a stand-alone mkimage tool.
Currently, it's only available after you build u-boot itself for a
particular platform.  Ideally, you would be able to do 'make
tools/mkimage' and have it build, but that doesn't seem to be the
case.  And since it's a bit odd to require developers to build u-boot
before building a kernel I thought having an in-kernel copy would be
more efficient.

The tool itself doesn't get frequent updates, so keeping it in sync
shouldn't be a large issue.  However, I'd like to hear what other
people think of the idea before going off and doing that.

josh

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

* [U-Boot-Users] In kernel mkimage
  2007-07-17  2:04 [U-Boot-Users] In kernel mkimage Josh Boyer
@ 2007-07-17  9:19 ` Clemens Koller
  2007-07-17 11:15   ` Josh Boyer
  2007-07-17 14:27   ` Behan Webster
  0 siblings, 2 replies; 9+ messages in thread
From: Clemens Koller @ 2007-07-17  9:19 UTC (permalink / raw)
  To: u-boot

Josh Boyer schrieb:
> As part of my on-going 4xx work in the arch/powerpc kernel, I've been
> toying with the idea of creating an in-kernel copy of the mkimage
> tool, similar to how we have a mktree tool for the older OpenBIOS
> firmware.

Don't duplicate code, if it ain't necessary. Improve documentation
that  make <foo>  tells what's missing and how to fix it.

Regards,
-- 
Clemens Koller
__________________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Stra?e 45/1
Linhof Werksgel?nde
D-81379 M?nchen
Tel.089-741518-50
Fax 089-741518-19
http://www.anagramm-technology.com

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

* [U-Boot-Users] In kernel mkimage
  2007-07-17  9:19 ` Clemens Koller
@ 2007-07-17 11:15   ` Josh Boyer
  2007-07-17 14:27   ` Behan Webster
  1 sibling, 0 replies; 9+ messages in thread
From: Josh Boyer @ 2007-07-17 11:15 UTC (permalink / raw)
  To: u-boot

On 7/17/07, Clemens Koller <clemens.koller@anagramm.de> wrote:
> Josh Boyer schrieb:
> > As part of my on-going 4xx work in the arch/powerpc kernel, I've been
> > toying with the idea of creating an in-kernel copy of the mkimage
> > tool, similar to how we have a mktree tool for the older OpenBIOS
> > firmware.
>
> Don't duplicate code, if it ain't necessary. Improve documentation
> that  make <foo>  tells what's missing and how to fix it.

I still argue that having 'make <foo>' tell someone they need to go
download u-boot and build it for a platform just to get that tool is a
bit bizarre.

josh

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

* [U-Boot-Users] In kernel mkimage
  2007-07-17  9:19 ` Clemens Koller
  2007-07-17 11:15   ` Josh Boyer
@ 2007-07-17 14:27   ` Behan Webster
  2007-07-17 15:12     ` Stefan Roese
  1 sibling, 1 reply; 9+ messages in thread
From: Behan Webster @ 2007-07-17 14:27 UTC (permalink / raw)
  To: u-boot

Clemens Koller wrote:
> Josh Boyer schrieb:
>   
>> As part of my on-going 4xx work in the arch/powerpc kernel, I've been
>> toying with the idea of creating an in-kernel copy of the mkimage
>> tool, similar to how we have a mktree tool for the older OpenBIOS
>> firmware.
>>     
>
> Don't duplicate code, if it ain't necessary. Improve documentation
> that  make <foo>  tells what's missing and how to fix it.
>   
I agree. Code shouldn't be duplicated.

Instead, perhaps the code should be moved (and maintained) in the kernel
tree.

mkimage is used for building kernel images (and other related things
like ramdisk images).  Building u-boot (for the use of one tool) should
not be a necessary part of building a kernel image.  Many people never
need to build u-boot being content with the bootloader that shipped with
their embedded target.

Lowering the barrier to entry to the use of u-boot (i.e. by allowing
kernels to be more easily built for it) will encourage more to use it. 
More people using it will eventually lead to more people interested in
learning about the code.  It also cuts down on people asking a FAQ.

It also puts a tool in the kernel tree which encourages others to use
u-boot as their boot loader. :)

It's a win-win solution.

-- 
Behan Webster
behanw at websterwood.com

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

* [U-Boot-Users] In kernel mkimage
  2007-07-17 14:27   ` Behan Webster
@ 2007-07-17 15:12     ` Stefan Roese
  2007-07-17 15:29       ` Behan Webster
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Roese @ 2007-07-17 15:12 UTC (permalink / raw)
  To: u-boot

Hi Behan,

On Tuesday 17 July 2007, Behan Webster wrote:
> > Don't duplicate code, if it ain't necessary. Improve documentation
> > that  make <foo>  tells what's missing and how to fix it.
>
> I agree. Code shouldn't be duplicated.
>
> Instead, perhaps the code should be moved (and maintained) in the kernel
> tree.

Hmmm.

> mkimage is used for building kernel images (and other related things
> like ramdisk images).

And it is being used for building other images too. Not only Linux kernel 
images but other OS images (VxWorks, QNX, etc.), FPGA images, bitmaps and so 
on. Everything related to U-Boot in a way. So the mkimage tool should at 
least be available in the U-Boot source tree.

> Building u-boot (for the use of one tool) should 
> not be a necessary part of building a kernel image.  Many people never
> need to build u-boot being content with the bootloader that shipped with
> their embedded target.

Yes, you have a point here. I remember "porting" mkimage to Windows once 
(working for a different company of course ;-)).

> Lowering the barrier to entry to the use of u-boot (i.e. by allowing
> kernels to be more easily built for it) will encourage more to use it.
> More people using it will eventually lead to more people interested in
> learning about the code.  It also cuts down on people asking a FAQ.
>
> It also puts a tool in the kernel tree which encourages others to use
> u-boot as their boot loader. :)
>
> It's a win-win solution.

I have to support you here, that it should be easier to "use" mkimage in the 
Linux kernel generation. But completely removing it from the U-Boot source 
doesn't make sense to me because of the reasons mentioned above.

The easiest change would be to add a make target to the U-Boot top-level 
Makefile, for mkimage generation. This way the Linux "user" would at least 
not have to worry about compiling U-Boot for a not needed platform.

Just my 0.02$.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

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

* [U-Boot-Users] In kernel mkimage
  2007-07-17 15:12     ` Stefan Roese
@ 2007-07-17 15:29       ` Behan Webster
  2007-07-17 21:18         ` Josh Boyer
  0 siblings, 1 reply; 9+ messages in thread
From: Behan Webster @ 2007-07-17 15:29 UTC (permalink / raw)
  To: u-boot

Stefan Roese wrote:
> Hi Behan,
>   
Hey Stefan.

> On Tuesday 17 July 2007, Behan Webster wrote:
>   
>> mkimage is used for building kernel images (and other related things
>> like ramdisk images).
>>     
>
> And it is being used for building other images too. Not only Linux kernel 
> images but other OS images (VxWorks, QNX, etc.), FPGA images, bitmaps and so 
> on. Everything related to U-Boot in a way. So the mkimage tool should at 
> least be available in the U-Boot source tree.
>   
I was unaware.

It was merely an idea to remove the "duplication of code" concern.


>> Lowering the barrier to entry to the use of u-boot (i.e. by allowing
>> kernels to be more easily built for it) will encourage more to use it.
>> More people using it will eventually lead to more people interested in
>> learning about the code.  It also cuts down on people asking a FAQ.
>>
>> It also puts a tool in the kernel tree which encourages others to use
>> u-boot as their boot loader. :)
>>
>> It's a win-win solution.
>>     
>
> I have to support you here, that it should be easier to "use" mkimage in the 
> Linux kernel generation. But completely removing it from the U-Boot source 
> doesn't make sense to me because of the reasons mentioned above.
>   
Indeed.

> The easiest change would be to add a make target to the U-Boot top-level 
> Makefile, for mkimage generation. This way the Linux "user" would at least 
> not have to worry about compiling U-Boot for a not needed platform.
>   
This is the easiest and a good first step.

However, I agree with Josh that it's still strange that this is
necessary step to build a kernel.

Of course, if mkimage is a seperable tool, then at the very least linux
distributions can start to package it as a seperate tool. This is
something that a lot of users have asked for from what I've seen.

If it is both easy to build mkimage by itself, and can be distributed as
a package for the various distros, then most of this issue goes away.

-- 
Behan Webster
behanw at websterwood.com

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

* [U-Boot-Users] In kernel mkimage
  2007-07-17 15:29       ` Behan Webster
@ 2007-07-17 21:18         ` Josh Boyer
  2007-07-17 21:37           ` Behan Webster
  0 siblings, 1 reply; 9+ messages in thread
From: Josh Boyer @ 2007-07-17 21:18 UTC (permalink / raw)
  To: u-boot

On 7/17/07, Behan Webster <behanw@websterwood.com> wrote:
> Stefan Roese wrote:
> > The easiest change would be to add a make target to the U-Boot top-level
> > Makefile, for mkimage generation. This way the Linux "user" would at least
> > not have to worry about compiling U-Boot for a not needed platform.
> >
> This is the easiest and a good first step.
>
> However, I agree with Josh that it's still strange that this is
> necessary step to build a kernel.
>
> Of course, if mkimage is a seperable tool, then at the very least linux
> distributions can start to package it as a seperate tool. This is
> something that a lot of users have asked for from what I've seen.

Yes.  I did that with the device tree compiler for Fedora recently.

> If it is both easy to build mkimage by itself, and can be distributed as
> a package for the various distros, then most of this issue goes away.

True.  The one thing that might pop up is that distros might object to
'mkimage' being too generic.  Though I think the chance of that being
a large issue is small.  We should definitely try and make it
standalone in some fashion.

josh

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

* [U-Boot-Users] In kernel mkimage
  2007-07-17 21:18         ` Josh Boyer
@ 2007-07-17 21:37           ` Behan Webster
  2007-07-18  2:24             ` Josh Boyer
  0 siblings, 1 reply; 9+ messages in thread
From: Behan Webster @ 2007-07-17 21:37 UTC (permalink / raw)
  To: u-boot

Josh Boyer wrote:
> On 7/17/07, Behan Webster <behanw@websterwood.com> wrote:
>> If it is both easy to build mkimage by itself, and can be distributed as
>> a package for the various distros, then most of this issue goes away.
>
> True.  The one thing that might pop up is that distros might object to
> 'mkimage' being too generic.  Though I think the chance of that being
> a large issue is small.  We should definitely try and make it
> standalone in some fashion.
This is a good point.  By rights it should be uboot-mkimage or something
like that.

However, stating that the kernel code depends on mkimage being named
mkimage is a good argument.

-- 
Behan Webster
behanw at websterwood.com

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

* [U-Boot-Users] In kernel mkimage
  2007-07-17 21:37           ` Behan Webster
@ 2007-07-18  2:24             ` Josh Boyer
  0 siblings, 0 replies; 9+ messages in thread
From: Josh Boyer @ 2007-07-18  2:24 UTC (permalink / raw)
  To: u-boot

On 7/17/07, Behan Webster <behanw@websterwood.com> wrote:
> Josh Boyer wrote:
> > On 7/17/07, Behan Webster <behanw@websterwood.com> wrote:
> >> If it is both easy to build mkimage by itself, and can be distributed as
> >> a package for the various distros, then most of this issue goes away.
> >
> > True.  The one thing that might pop up is that distros might object to
> > 'mkimage' being too generic.  Though I think the chance of that being
> > a large issue is small.  We should definitely try and make it
> > standalone in some fashion.
> This is a good point.  By rights it should be uboot-mkimage or something
> like that.

mkuimage would likely suffice.

> However, stating that the kernel code depends on mkimage being named
> mkimage is a good argument.

Surely you must be joking.  What distro are you using that would care
about what an embedded kernel build requires?

Anyway, we've bantered about this long enough. Time for a patch.
Hopefully tomorrow if Stefan doesn't beat me to it *wink* ;)

josh

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

end of thread, other threads:[~2007-07-18  2:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-17  2:04 [U-Boot-Users] In kernel mkimage Josh Boyer
2007-07-17  9:19 ` Clemens Koller
2007-07-17 11:15   ` Josh Boyer
2007-07-17 14:27   ` Behan Webster
2007-07-17 15:12     ` Stefan Roese
2007-07-17 15:29       ` Behan Webster
2007-07-17 21:18         ` Josh Boyer
2007-07-17 21:37           ` Behan Webster
2007-07-18  2:24             ` Josh Boyer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.