All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@nvidia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] image: Implement IH_TYPE_KERNEL_ANYLOAD
Date: Thu, 10 Nov 2011 12:10:58 -0700	[thread overview]
Message-ID: <4EBC21C2.7080903@nvidia.com> (raw)
In-Reply-To: <201111101940.40863.marek.vasut@gmail.com>

On 11/10/2011 11:40 AM, Marek Vasut wrote:
>> On 11/10/2011 11:07 AM, Marek Vasut wrote:
>>> Stephen Warren wrote:
>> ...
>>
>>>> I did consider that not running mkimage at all would be simpler, but
>>>> there are other places mkimage would still be needed anyway:
>>>>
>>>> a) Any initrd would still need to be wrapped in a uImage for bootm to
>>>> recognize it. If you wrote a bootz to accept a raw unwrapped initrd, I
>>>> imagine that same raw initrd recognition code could just as easily be
>>>> applied to bootm.
>>>
>>> Well if you want an image where you have kernel+initrd, why not use
>>> initramfs ?
>>
>> As I understand it, initramfs is embedded into the kernel image, and
>> initrd is a separate file.
>>
>> (existing desktop) distros typically want their initrd as a separate
>> file, so they can rebuild the initrd separately from the kernel image -
>> i.e. ship a binary zImage for the kernel, but build the initrd at
>> (distro or kernel update) install time based on whether the user needs
>> RAID, LVM, crypto, random driver, ... modules or not. Rebuilding a
>> separate initrd file is pretty easy. Rebuilding the initramfs already
>> embedded into the kernel zImage is probably not.
> 
> This is definitelly a good point. But then, if you can load zImage, can't you 
> load initrd with u-boot?

Well maybe. I don't exactly follow what you're saying. My main point was
the if you need/want an initrd (which I think will become more common),
you're going to have to use mkimage to get U-Boot to accept it. If
you're using mkimage on the initrd anyway, then using mkimage on the
zImage seems like basically no extra work; just one more command to run
using tools you already have. I /think/ the only advantage of a bootz
command over bootm is the ability not to run mkimage on the zImage.
Hence, there's not much advantage to a bootz command.

Still, if you don't have an initrd, I guess a bootz command would save
you the mkimage step on the zImage.

Either way, I'm not really arguing against a bootz command; just
pointing out that in many cases it doesn't buy you that much. Still, it
does in other cases.

>>>> b) The distro will most likely want to specify either the entire Linux
>>>> command-line, or at least something to append to it. I imagine this will
>>>> work by the distro creating a uImage-wrapped U-Boot script e.g.
>>>> /boot/script.uimg. Creating that script would require mkimage too.
>>>> Perhaps again U-Boot could be modified to support loading scripts from
>>>> disk and executing them without requiring a uImage header though.
>>>>
>>>> So, I don't think eliminating mkimage entirely is all that likely. And
>>>> as such, using mkimage for the kernel itself doesn't seem like a big
>>>> deal.
>>>
>>> Hm, isn't FDT supposed to contain the command line now ?
>>
>> Well, I don't think FDT supoprt is far enough along for any (ARM) SoC
>> that a distro could exclusively rely on it yet. But, I may be wrong. I'm
>> also thinking only of mainline; downstream support may be far more
>> advanced in many cases.
>>
>> Either way, the physical mechanism of passing the command-line to the
>> kernel (ATAGs vs. FDT) isn't relevant to this discussion; it's just a
>> transport mechanism.
>>
>> Distros will probably still need to adjust the command-line, e.g. to add
>> "quiet splash" to it or not based on whether a recovery or regular boot
>> is required.
> 
> That's true, but you can have the generic command line in FDT and then pass 
> changed command line through u-boot environment. I don't see a reason why you'd 
> want to push it into uImage.

How can you get the cmdline modifications into U-Boot other that through
a (uImage-based) U-Boot script? I don't think a distro installer is
going to grovel in U-Boot's saved environment and modify that to its
wishes (and even if it could, it shouldn't)

-- 
nvpublic

  parent reply	other threads:[~2011-11-10 19:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09 17:47 [U-Boot] [PATCH 1/2] image: Implement IH_TYPE_KERNEL_ANYLOAD Stephen Warren
2011-11-09 17:47 ` [U-Boot] [PATCH 2/2] image: Don't detect XIP images as overlapping Stephen Warren
2011-11-10  9:58 ` [U-Boot] [PATCH 1/2] image: Implement IH_TYPE_KERNEL_ANYLOAD Marek Vasut
2011-11-10 16:04   ` Stephen Warren
2011-11-10 17:01     ` Marek Vasut
2011-11-10 17:43       ` Stephen Warren
2011-11-10 17:47         ` Marek Vasut
2011-11-10 18:02           ` Stephen Warren
2011-11-10 18:07             ` Marek Vasut
2011-11-10 18:25               ` Stephen Warren
2011-11-10 18:40                 ` Marek Vasut
2011-11-10 19:06                   ` Wolfgang Denk
2011-11-10 20:51                     ` Marek Vasut
2011-11-10 19:10                   ` Stephen Warren [this message]
2011-11-10 20:54                     ` Marek Vasut
2011-11-10 18:58               ` Wolfgang Denk
2011-11-10 11:59 ` Wolfgang Denk
2011-11-10 16:15   ` Stephen Warren
2011-11-10 18:53     ` Wolfgang Denk
2011-11-10 19:05       ` Stephen Warren
2011-11-10 19:27         ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EBC21C2.7080903@nvidia.com \
    --to=swarren@nvidia.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.