Bug 10012 - Suggested rewriting of the (currently semi-nonsensical) INITRAMFS_IMAGE glossary entry
Summary: Suggested rewriting of the (currently semi-nonsensical) INITRAMFS_IMAGE gloss...
Status: RESOLVED FIXED
Alias: None
Product: Reference
Classification: Documentation
Component: handbook (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.2 M4
Assignee: Scott Rifenbark
QA Contact:
URL:
Whiteboard: 01 August 2016: RESOLVED
Depends on:
Blocks:
 
Reported: 2016-07-24 16:10 UTC by ulfalizer
Modified: 2016-08-01 18:57 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Done (doc changes complete)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ulfalizer 2016-07-24 16:10:25 UTC
Hello,

The current glossary entry for INITRAMFS_IMAGE is difficult to understand. The following part doesn't even make any sense:

  The following example, which is set in the local.conf configuration file,
  causes a separate recipe to be created that results in an initramfs image
  named core-image-sato-initramfs.bb to be created:
 
      INITRAMFS_IMAGE = "core-image-minimal-initramfs"
                     
No recipe is created (but an image), and the image that's created is not called core-image-sato-initramfs.bb (that's a recipe name).


Since it's in pretty bad shape at the moment, I suggest rewriting the entire thing as follows:

  INITRAMFS_IMAGE:
    Specifies the ([PROVIDES]) name of an image recipe that is used to build an
    initial RAM disk (initramfs) image. An initramfs provides a temporary root
    filesystem used for early system initialization (e.g. loading of modules
    needed to locate and mount the "real" root filesystem). The recipe is added
    as a dependency of the root filesystem recipe (e.g. core-image-sato).
  
    See core-image-sato-initramfs.bb for an example initramfs image recipe. Note
    that the initramfs image recipe should set [IMAGE_FSTYPES] to
    [INITRAMFS_FSTYPES].
    
    More information can be found in local.conf.sample.extended. You can also
    reference [image.bbclass] and [kernel.bbclass] to see how the variable is
    used.
    
    If INITRAMFS_IMAGE is empty (the default), then no initramfs is built.


The following could be added to the end of the entry for INITRAMFS_FSTYPES as well:

    The default value of this variable, set in bitbake.conf, is "cpio.gz". The
    Linux kernel's initramfs mechanism (as opposed to the earlier initrd
    mechanism) expects an (optionally compressed) cpio archive.


On thing that's still confusing is how you're supposed to deal with INITRAMFS_IMAGE when building multiple images. Maybe each image recipe is meant to set INITRAMFS_IMAGE separately in that case. Maybe someone could clarify that separately though.

Cheers,
Ulf
Comment 1 ulfalizer 2016-07-24 18:44:07 UTC
Updated version (INITRAMFS_FSTYPES update stays the same):

  INITRAMFS_IMAGE:
    Specifies the ([PROVIDES]) name of an image recipe that is used to build an
    initial RAM disk (initramfs) image. An initramfs provides a temporary root
    filesystem used for early system initialization, e.g. loading of modules
    needed to locate and mount the "real" root filesystem. The specified recipe
    is added as a dependency of the root filesystem recipe (e.g.
    core-image-sato).
  
    See core-image-sato-initramfs.bb for an example initramfs image recipe. Note
    that the initramfs image recipe should set [IMAGE_FSTYPES] to
    [INITRAMFS_FSTYPES].
    
    More information can be found in [local.conf.sample.extended]. You can also
    reference [image.bbclass] and [kernel.bbclass] to see how the variable is
    used.
    
    If INITRAMFS_IMAGE is empty (the default), then no initramfs is built.

    See also [INITRAMFS_IMAGE_BUNDLE], which allows the generated image to be
    bundled inside the kernel image.
Comment 2 Scott Rifenbark 2016-07-29 18:27:26 UTC
Hi Ulf, 

See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-INITRAMFS_IMAGE for the INITRAMFS_IMAGE change.

For INITRAMF_FSTYPES, see http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-INITRAMFS_FSTYPES.  One question I have for that change is the reference to the "initrd mechanism".  I would like to spell that out and also "linkify" it.  You referenced it as something earlier, which we don't want to do.  It would be best to actually provide a link if a target exists.

thanks, 
Scott
Comment 3 ulfalizer 2016-07-29 19:11:18 UTC
(In reply to comment #2)
> Hi Ulf, 
> 
> See
> http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-
> INITRAMFS_IMAGE for the INITRAMFS_IMAGE change.

"See the core-image-sato-initramfs.bb recipe, which is created, for an example recipe" sounds weird. No recipes are created by INITRAMFS_IMAGE. I think this would better:

  See core-image-sato-initramfs.bb for an example initramfs recipe. To
  select this recipe to provide the initramfs, you would set
  INITRAMFS_IMAGE to "core-image-sato-initramfs".
 
> For INITRAMF_FSTYPES, see
> http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-
> INITRAMFS_FSTYPES.  One question I have for that change is the reference to
> the "initrd mechanism".  I would like to spell that out and also "linkify"
> it.  You referenced it as something earlier, which we don't want to do.  It
> would be best to actually provide a link if a target exists.

Not sure if there's a good place in the manual to link for for initrd. initrd and initramfs are two different mechanisms in the kernel to provide an early root filesystem during boot. If wiki links are okay, then https://en.wikipedia.org/wiki/Initrd would be a good one.

Confusingly, "initrd" is sometimes used to refer to any kind of early root filesystem. This is probably a leftover from when initrd was the only mechanism there was, before initramfs.

Cheers,
Ulf
Comment 4 Scott Rifenbark 2016-07-29 21:02:36 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Hi Ulf, 
> > 
> > See
> > http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-
> > INITRAMFS_IMAGE for the INITRAMFS_IMAGE change.
> 
> "See the core-image-sato-initramfs.bb recipe, which is created, for an
> example recipe" sounds weird. No recipes are created by INITRAMFS_IMAGE. I
> think this would better:
> 
>   See core-image-sato-initramfs.bb for an example initramfs recipe. To
>   select this recipe to provide the initramfs, you would set
>   INITRAMFS_IMAGE to "core-image-sato-initramfs".

Ulf - I took a guess that maybe the recipe was created.  I dug all through the poky repository and could not find an existing "core-image-sato-initramfs.bb" file anywhere.  Do you know where it is?  If you do, I can be more specific on where the user can find it.  http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-INITRAMFS_IMAGE

>  
> > For INITRAMF_FSTYPES, see
> > http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-
> > INITRAMFS_FSTYPES.  One question I have for that change is the reference to
> > the "initrd mechanism".  I would like to spell that out and also "linkify"
> > it.  You referenced it as something earlier, which we don't want to do.  It
> > would be best to actually provide a link if a target exists.
> 
> Not sure if there's a good place in the manual to link for for initrd.
> initrd and initramfs are two different mechanisms in the kernel to provide
> an early root filesystem during boot. If wiki links are okay, then
> https://en.wikipedia.org/wiki/Initrd would be a good one.

Ulf - thanks.  I updated that last paragraph to include the full spelling since it is an initial use and to include that link into the wiki.  See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-INITRAMFS_FSTYPES

> 
> Confusingly, "initrd" is sometimes used to refer to any kind of early root
> filesystem. This is probably a leftover from when initrd was the only
> mechanism there was, before initramfs.
> 
> Cheers,
> Ulf
Comment 5 ulfalizer 2016-07-29 21:22:59 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > Hi Ulf, 
> > > 
> > > See
> > > http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-
> > > INITRAMFS_IMAGE for the INITRAMFS_IMAGE change.
> > 
> > "See the core-image-sato-initramfs.bb recipe, which is created, for an
> > example recipe" sounds weird. No recipes are created by INITRAMFS_IMAGE. I
> > think this would better:
> > 
> >   See core-image-sato-initramfs.bb for an example initramfs recipe. To
> >   select this recipe to provide the initramfs, you would set
> >   INITRAMFS_IMAGE to "core-image-sato-initramfs".
> 
> Ulf - I took a guess that maybe the recipe was created.  I dug all through
> the poky repository and could not find an existing
> "core-image-sato-initramfs.bb" file anywhere.  Do you know where it is?  If
> you do, I can be more specific on where the user can find it. 
> http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-
> INITRAMFS_IMAGE
> 

Ops... it's supposed to be core-image-minimal-initramfs(.bb). The fact that the old version mentions both core-image-sato-initramfs and core-image-minimal-initramfs confused me. Sorry about that.

> >  
> > > For INITRAMF_FSTYPES, see
> > > http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-
> > > INITRAMFS_FSTYPES.  One question I have for that change is the reference to
> > > the "initrd mechanism".  I would like to spell that out and also "linkify"
> > > it.  You referenced it as something earlier, which we don't want to do.  It
> > > would be best to actually provide a link if a target exists.
> > 
> > Not sure if there's a good place in the manual to link for for initrd.
> > initrd and initramfs are two different mechanisms in the kernel to provide
> > an early root filesystem during boot. If wiki links are okay, then
> > https://en.wikipedia.org/wiki/Initrd would be a good one.
> 
> Ulf - thanks.  I updated that last paragraph to include the full spelling
> since it is an initial use and to include that link into the wiki.  See
> http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-
> INITRAMFS_FSTYPES

Looks good to me!

Thanks,
Ulf
Comment 6 Scott Rifenbark 2016-07-29 23:43:50 UTC
Thanks Ulf, 

See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-INITRAMFS_IMAGE.  So the core-image-minimal-initramfs.bb recipe is just the example.  The rest of the paragraph does apply to the core-image-sato-initramfs.bb recipe correct?

Scott
Comment 7 ulfalizer 2016-07-30 12:24:05 UTC
One typo left:

  To select this recipe to provide the initramfs, set INITRAMFS_IMAGE
  to "core-image-sato-initramfs". 

should be

  To select this recipe to provide the initramfs, set INITRAMFS_IMAGE
  to "core-image-minimal-initramfs".

Looks fine otherwise.
Comment 8 Scott Rifenbark 2016-08-01 18:23:27 UTC
Ulf, 

Got it.  See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-INITRAMFS_IMAGE for the change. 

Thanks,
Scott
Comment 9 ulfalizer 2016-08-01 18:45:49 UTC
Looks good to me now.

Thanks,
Ulf
Comment 10 Scott Rifenbark 2016-08-01 18:57:51 UTC
Thanks Ulf, 

Resetting to RESOLVED and placing the doc flag into "done."

Scott