All of lore.kernel.org
 help / color / mirror / Atom feed
* generate initramfs for raspberry pi
@ 2020-01-23 18:29 Greg Wilson-Lindberg
  2020-01-23 18:56 ` [yocto] " Khem Raj
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Wilson-Lindberg @ 2020-01-23 18:29 UTC (permalink / raw)
  To: Yocto list discussion

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

Hello List,
I have not been able to figure out how to generate an initramfs image for a raspberry pi build of yocto. I've searched it web and have not found anything that mentions generating the actual image, lots of hits on how to configure using the initramfs, but not on generating it. Is there a standard recipe for a raspberry pi initramfs and how would I enable its generation, or maybe I'm just being clueless.

I'm running on a boot2qt build of yocto based on Qt v5.14.0 that uses warrior and I'm targeting an RPi 4 using u-boot.

Any help would be greatly appreciated.

Best regards,
Greg Wilson-Lindberg

[-- Attachment #2: Type: text/html, Size: 2394 bytes --]

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

* Re: [yocto] generate initramfs for raspberry pi
  2020-01-23 18:29 generate initramfs for raspberry pi Greg Wilson-Lindberg
@ 2020-01-23 18:56 ` Khem Raj
  2020-01-23 19:15   ` Greg Wilson-Lindberg
  0 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2020-01-23 18:56 UTC (permalink / raw)
  To: Greg Wilson-Lindberg; +Cc: Yocto list discussion

On Thu, Jan 23, 2020 at 10:44 AM Greg Wilson-Lindberg
<gwilson@sakuraus.com> wrote:
>
> Hello List,
>
> I have not been able to figure out how to generate an initramfs image for a raspberry pi build of yocto. I’ve searched it web and have not found anything that mentions generating the actual image, lots of hits on how to configure using the initramfs, but not on generating it. Is there a standard recipe for a raspberry pi initramfs and how would I enable its generation, or maybe I’m just being clueless.
>
>
>
> I’m running on a boot2qt build of yocto based on Qt v5.14.0 that uses warrior and I’m targeting an RPi 4 using u-boot.
>
>
>
> Any help would be greatly appreciated.
>
try something like below in local.conf

INITRAMFS_IMAGE_BUNDLE_rpi = "1"
INITRAMFS_IMAGE_rpi = "<your-image>"
# Enlarge boot partition to 1GiB
BOOT_SPACE = "1073741"
INITRAMFS_MAXSIZE = "315400"
IMAGE_FSTYPES_pn-${INITRAMFS_IMAGE} = "${INITRAMFS_FSTYPES}"

>
>
> Best regards,
>
> Greg Wilson-Lindberg
>
> 

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

* Re: [yocto] generate initramfs for raspberry pi
  2020-01-23 18:56 ` [yocto] " Khem Raj
@ 2020-01-23 19:15   ` Greg Wilson-Lindberg
  2020-01-23 19:24     ` Khem Raj
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Wilson-Lindberg @ 2020-01-23 19:15 UTC (permalink / raw)
  To: Khem Raj; +Cc: Yocto list discussion

Hi Kem,
I had figured out your suggestions, my problem is how do I generate the "<your-image>" image in:

INITRAMFS_IMAGE_rpi = "<your-image>"

I need a recipe for the image and a way to get Yocto to build it when I build the rest of my image. Maybe specifying the name will build it, but I still need a recipe for the image.

Regards,
Greg

-----Original Message-----
From: Khem Raj <raj.khem@gmail.com> 
Sent: Thursday, January 23, 2020 10:56 AM
To: Greg Wilson-Lindberg <GWilson@sakuraus.com>
Cc: Yocto list discussion <yocto@yoctoproject.org>
Subject: Re: [yocto] generate initramfs for raspberry pi

On Thu, Jan 23, 2020 at 10:44 AM Greg Wilson-Lindberg <gwilson@sakuraus.com> wrote:
>
> Hello List,
>
> I have not been able to figure out how to generate an initramfs image for a raspberry pi build of yocto. I’ve searched it web and have not found anything that mentions generating the actual image, lots of hits on how to configure using the initramfs, but not on generating it. Is there a standard recipe for a raspberry pi initramfs and how would I enable its generation, or maybe I’m just being clueless.
>
>
>
> I’m running on a boot2qt build of yocto based on Qt v5.14.0 that uses warrior and I’m targeting an RPi 4 using u-boot.
>
>
>
> Any help would be greatly appreciated.
>
try something like below in local.conf

INITRAMFS_IMAGE_BUNDLE_rpi = "1"
INITRAMFS_IMAGE_rpi = "<your-image>"
# Enlarge boot partition to 1GiB
BOOT_SPACE = "1073741"
INITRAMFS_MAXSIZE = "315400"
IMAGE_FSTYPES_pn-${INITRAMFS_IMAGE} = "${INITRAMFS_FSTYPES}"

>
>
> Best regards,
>
> Greg Wilson-Lindberg
>
> 

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

* Re: [yocto] generate initramfs for raspberry pi
  2020-01-23 19:15   ` Greg Wilson-Lindberg
@ 2020-01-23 19:24     ` Khem Raj
  2020-01-23 19:36       ` Mark Asselstine
  0 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2020-01-23 19:24 UTC (permalink / raw)
  To: Greg Wilson-Lindberg; +Cc: Yocto list discussion

On Thu, Jan 23, 2020 at 11:16 AM Greg Wilson-Lindberg
<GWilson@sakuraus.com> wrote:
>
> Hi Kem,
> I had figured out your suggestions, my problem is how do I generate the "<your-image>" image in:
>
> INITRAMFS_IMAGE_rpi = "<your-image>"
>
> I need a recipe for the image and a way to get Yocto to build it when I build the rest of my image. Maybe specifying the name will build it, but I still need a recipe for the image.
>

Depends what your needs are, its not clear what you want from this
initramfs image.
is it something you want to do some preboot stuff and pivot into final
image during boot
or do you want your full userspace to be running in it
for second case Just use your image if you want that to be bundled in
and build bitbake virtual/kernel
it will get you single kernel image with everything in it.

for first case. define a new image perhaps a derivative of
core-image-minimal and use that

> Regards,
> Greg
>
> -----Original Message-----
> From: Khem Raj <raj.khem@gmail.com>
> Sent: Thursday, January 23, 2020 10:56 AM
> To: Greg Wilson-Lindberg <GWilson@sakuraus.com>
> Cc: Yocto list discussion <yocto@yoctoproject.org>
> Subject: Re: [yocto] generate initramfs for raspberry pi
>
> On Thu, Jan 23, 2020 at 10:44 AM Greg Wilson-Lindberg <gwilson@sakuraus.com> wrote:
> >
> > Hello List,
> >
> > I have not been able to figure out how to generate an initramfs image for a raspberry pi build of yocto. I’ve searched it web and have not found anything that mentions generating the actual image, lots of hits on how to configure using the initramfs, but not on generating it. Is there a standard recipe for a raspberry pi initramfs and how would I enable its generation, or maybe I’m just being clueless.
> >
> >
> >
> > I’m running on a boot2qt build of yocto based on Qt v5.14.0 that uses warrior and I’m targeting an RPi 4 using u-boot.
> >
> >
> >
> > Any help would be greatly appreciated.
> >
> try something like below in local.conf
>
> INITRAMFS_IMAGE_BUNDLE_rpi = "1"
> INITRAMFS_IMAGE_rpi = "<your-image>"
> # Enlarge boot partition to 1GiB
> BOOT_SPACE = "1073741"
> INITRAMFS_MAXSIZE = "315400"
> IMAGE_FSTYPES_pn-${INITRAMFS_IMAGE} = "${INITRAMFS_FSTYPES}"
>
> >
> >
> > Best regards,
> >
> > Greg Wilson-Lindberg
> >
> > 

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

* Re: [yocto] generate initramfs for raspberry pi
  2020-01-23 19:24     ` Khem Raj
@ 2020-01-23 19:36       ` Mark Asselstine
  2020-01-23 19:54         ` Greg Wilson-Lindberg
       [not found]         ` <15EC9C2A5A8A010E.12201@lists.yoctoproject.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Mark Asselstine @ 2020-01-23 19:36 UTC (permalink / raw)
  To: yocto, Greg Wilson-Lindberg; +Cc: Khem Raj, Yocto list discussion

On Thursday, January 23, 2020 2:24:27 P.M. EST Khem Raj wrote:
> On Thu, Jan 23, 2020 at 11:16 AM Greg Wilson-Lindberg
> 
> <GWilson@sakuraus.com> wrote:
> > Hi Kem,
> > I had figured out your suggestions, my problem is how do I generate the
> > "<your-image>" image in:
> > 
> > INITRAMFS_IMAGE_rpi = "<your-image>"
> > 
> > I need a recipe for the image and a way to get Yocto to build it when I
> > build the rest of my image. Maybe specifying the name will build it, but
> > I still need a recipe for the image.
> Depends what your needs are, its not clear what you want from this
> initramfs image.
> is it something you want to do some preboot stuff and pivot into final
> image during boot
> or do you want your full userspace to be running in it
> for second case Just use your image if you want that to be bundled in
> and build bitbake virtual/kernel
> it will get you single kernel image with everything in it.
> 
> for first case. define a new image perhaps a derivative of
> core-image-minimal and use that

There are two useful starting points,
openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb
openembedded-core/meta/recipes-core/images/core-image-tiny-initramfs.bb

Both do not have
COMPATIBLE_HOST = "(i.86|x86_64).*-linux"

In the end you will most likely want to customize your image as Khem says, so 
just start by copying one of these and start making adjustments. Alternatively 
you can do something like the following in your local.conf to overcome this:
COMPATIBLE_HOST_pn-core-image-tiny-initramfs = "aarch64-poky-linux"

You will want to determine if this initramfs is going to pivot to the 'init' 
found in the main rootfs, or if you want to simply boot into the 'init' in the 
initramfs and remain there.

Lastly you can either keep the initramfs standalone or have the kernel bundle 
the initramfs. The latter is useful if you want/need to include software in 
the initramfs that is needed to get the disks up and running to then get 
access to the rootfs.

Take a look at
https://www.yoctoproject.org/docs/2.6/ref-manual/ref-manual.html#var-INITRAMFS_FSTYPES
https://www.yoctoproject.org/docs/2.6/ref-manual/ref-manual.html#var-INITRAMFS_IMAGE
https://www.yoctoproject.org/docs/2.6/ref-manual/ref-manual.html#var-INITRAMFS_IMAGE_BUNDLE

MarkA


> 
> > Regards,
> > Greg
> > 
> > -----Original Message-----
> > From: Khem Raj <raj.khem@gmail.com>
> > Sent: Thursday, January 23, 2020 10:56 AM
> > To: Greg Wilson-Lindberg <GWilson@sakuraus.com>
> > Cc: Yocto list discussion <yocto@yoctoproject.org>
> > Subject: Re: [yocto] generate initramfs for raspberry pi
> > 
> > On Thu, Jan 23, 2020 at 10:44 AM Greg Wilson-Lindberg 
<gwilson@sakuraus.com> wrote:
> > > Hello List,
> > > 
> > > I have not been able to figure out how to generate an initramfs image
> > > for a raspberry pi build of yocto. I’ve searched it web and have not
> > > found anything that mentions generating the actual image, lots of hits
> > > on how to configure using the initramfs, but not on generating it. Is
> > > there a standard recipe for a raspberry pi initramfs and how would I
> > > enable its generation, or maybe I’m just being clueless.
> > > 
> > > 
> > > 
> > > I’m running on a boot2qt build of yocto based on Qt v5.14.0 that uses
> > > warrior and I’m targeting an RPi 4 using u-boot.
> > > 
> > > 
> > > 
> > > Any help would be greatly appreciated.
> > 
> > try something like below in local.conf
> > 
> > INITRAMFS_IMAGE_BUNDLE_rpi = "1"
> > INITRAMFS_IMAGE_rpi = "<your-image>"
> > # Enlarge boot partition to 1GiB
> > BOOT_SPACE = "1073741"
> > INITRAMFS_MAXSIZE = "315400"
> > IMAGE_FSTYPES_pn-${INITRAMFS_IMAGE} = "${INITRAMFS_FSTYPES}"
> > 
> > > Best regards,
> > > 
> > > Greg Wilson-Lindberg





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

* Re: [yocto] generate initramfs for raspberry pi
  2020-01-23 19:36       ` Mark Asselstine
@ 2020-01-23 19:54         ` Greg Wilson-Lindberg
       [not found]         ` <15EC9C2A5A8A010E.12201@lists.yoctoproject.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Greg Wilson-Lindberg @ 2020-01-23 19:54 UTC (permalink / raw)
  To: Mark Asselstine, yocto; +Cc: Khem Raj, Yocto list discussion

Hi Mark, and also Khem (sorry for the miss-spelling of your name),

> -----Original Message-----
> From: yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org> On
> Behalf Of Mark Asselstine
> Sent: Thursday, January 23, 2020 11:37 AM
> To: yocto@lists.yoctoproject.org; Greg Wilson-Lindberg
> <GWilson@sakuraus.com>
> Cc: Khem Raj <raj.khem@gmail.com>; Yocto list discussion
> <yocto@yoctoproject.org>
> Subject: Re: [yocto] generate initramfs for raspberry pi
> 
> On Thursday, January 23, 2020 2:24:27 P.M. EST Khem Raj wrote:
> > On Thu, Jan 23, 2020 at 11:16 AM Greg Wilson-Lindberg
> >
> > <GWilson@sakuraus.com> wrote:
> > > Hi Kem,
> > > I had figured out your suggestions, my problem is how do I generate
> > > the "<your-image>" image in:
> > >
> > > INITRAMFS_IMAGE_rpi = "<your-image>"
> > >
> > > I need a recipe for the image and a way to get Yocto to build it
> > > when I build the rest of my image. Maybe specifying the name will
> > > build it, but I still need a recipe for the image.
> > Depends what your needs are, its not clear what you want from this
> > initramfs image.
> > is it something you want to do some preboot stuff and pivot into final
> > image during boot or do you want your full userspace to be running in
> > it for second case Just use your image if you want that to be bundled
> > in and build bitbake virtual/kernel it will get you single kernel
> > image with everything in it.
> >
> > for first case. define a new image perhaps a derivative of
> > core-image-minimal and use that
> 
> There are two useful starting points,
> openembedded-core/meta/recipes-core/images/core-image-minimal-
> initramfs.bb
> openembedded-core/meta/recipes-core/images/core-image-tiny-
> initramfs.bb
> 
> Both do not have
> COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
> 
> In the end you will most likely want to customize your image as Khem says,
> so just start by copying one of these and start making adjustments.
> Alternatively you can do something like the following in your local.conf to
> overcome this:
> COMPATIBLE_HOST_pn-core-image-tiny-initramfs = "aarch64-poky-linux"

I just need something to boot into on the way to the full image. I am doing this as a step to bringing up OStree. So maybe setting the 'COMPATIBLE_HOST' and using core-image-tiny-initramfs will work.

Thanks for the suggestions. I had thought that there must be an initramfs for the Raspberry Pi with all of the threads about using an initramfs on the Pi, but I guess that there isn't a separate one.

Best Regards,
Greg

> 
> You will want to determine if this initramfs is going to pivot to the 'init'
> found in the main rootfs, or if you want to simply boot into the 'init' in the
> initramfs and remain there.
> 
> Lastly you can either keep the initramfs standalone or have the kernel
> bundle the initramfs. The latter is useful if you want/need to include
> software in the initramfs that is needed to get the disks up and running to
> then get access to the rootfs.
> 
> Take a look at
> https://www.yoctoproject.org/docs/2.6/ref-manual/ref-manual.html#var-
> INITRAMFS_FSTYPES
> https://www.yoctoproject.org/docs/2.6/ref-manual/ref-manual.html#var-
> INITRAMFS_IMAGE
> https://www.yoctoproject.org/docs/2.6/ref-manual/ref-manual.html#var-
> INITRAMFS_IMAGE_BUNDLE
> 
> MarkA
> 
> 
> >
> > > Regards,
> > > Greg
> > >
> > > -----Original Message-----
> > > From: Khem Raj <raj.khem@gmail.com>
> > > Sent: Thursday, January 23, 2020 10:56 AM
> > > To: Greg Wilson-Lindberg <GWilson@sakuraus.com>
> > > Cc: Yocto list discussion <yocto@yoctoproject.org>
> > > Subject: Re: [yocto] generate initramfs for raspberry pi
> > >
> > > On Thu, Jan 23, 2020 at 10:44 AM Greg Wilson-Lindberg
> <gwilson@sakuraus.com> wrote:
> > > > Hello List,
> > > >
> > > > I have not been able to figure out how to generate an initramfs
> > > > image for a raspberry pi build of yocto. I’ve searched it web and
> > > > have not found anything that mentions generating the actual image,
> > > > lots of hits on how to configure using the initramfs, but not on
> > > > generating it. Is there a standard recipe for a raspberry pi
> > > > initramfs and how would I enable its generation, or maybe I’m just
> being clueless.
> > > >
> > > >
> > > >
> > > > I’m running on a boot2qt build of yocto based on Qt v5.14.0 that
> > > > uses warrior and I’m targeting an RPi 4 using u-boot.
> > > >
> > > >
> > > >
> > > > Any help would be greatly appreciated.
> > >
> > > try something like below in local.conf
> > >
> > > INITRAMFS_IMAGE_BUNDLE_rpi = "1"
> > > INITRAMFS_IMAGE_rpi = "<your-image>"
> > > # Enlarge boot partition to 1GiB
> > > BOOT_SPACE = "1073741"
> > > INITRAMFS_MAXSIZE = "315400"
> > > IMAGE_FSTYPES_pn-${INITRAMFS_IMAGE} = "${INITRAMFS_FSTYPES}"
> > >
> > > > Best regards,
> > > >
> > > > Greg Wilson-Lindberg
> 
> 
> 


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

* Re: [yocto] generate initramfs for raspberry pi
       [not found]         ` <15EC9C2A5A8A010E.12201@lists.yoctoproject.org>
@ 2020-01-23 22:29           ` Greg Wilson-Lindberg
  2020-01-24 16:24             ` Mark Asselstine
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Wilson-Lindberg @ 2020-01-23 22:29 UTC (permalink / raw)
  To: Greg Wilson-Lindberg, Mark Asselstine, yocto
  Cc: Khem Raj, Yocto list discussion


> -----Original Message-----
> From: yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org> On
> Behalf Of Greg Wilson-Lindberg
> Sent: Thursday, January 23, 2020 11:54 AM
> To: Mark Asselstine <mark.asselstine@windriver.com>;
> yocto@lists.yoctoproject.org
> Cc: Khem Raj <raj.khem@gmail.com>; Yocto list discussion
> <yocto@yoctoproject.org>
> Subject: Re: [yocto] generate initramfs for raspberry pi
> 
> Hi Mark, and also Khem (sorry for the miss-spelling of your name),
> 
> > -----Original Message-----
> > From: yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org> On
> > Behalf Of Mark Asselstine
> > Sent: Thursday, January 23, 2020 11:37 AM
> > To: yocto@lists.yoctoproject.org; Greg Wilson-Lindberg
> > <GWilson@sakuraus.com>
> > Cc: Khem Raj <raj.khem@gmail.com>; Yocto list discussion
> > <yocto@yoctoproject.org>
> > Subject: Re: [yocto] generate initramfs for raspberry pi
> >
> > On Thursday, January 23, 2020 2:24:27 P.M. EST Khem Raj wrote:
> > > On Thu, Jan 23, 2020 at 11:16 AM Greg Wilson-Lindberg
> > >
> > > <GWilson@sakuraus.com> wrote:
> > > > Hi Kem,
> > > > I had figured out your suggestions, my problem is how do I
> > > > generate the "<your-image>" image in:
> > > >
> > > > INITRAMFS_IMAGE_rpi = "<your-image>"
> > > >
> > > > I need a recipe for the image and a way to get Yocto to build it
> > > > when I build the rest of my image. Maybe specifying the name will
> > > > build it, but I still need a recipe for the image.
> > > Depends what your needs are, its not clear what you want from this
> > > initramfs image.
> > > is it something you want to do some preboot stuff and pivot into
> > > final image during boot or do you want your full userspace to be
> > > running in it for second case Just use your image if you want that
> > > to be bundled in and build bitbake virtual/kernel it will get you
> > > single kernel image with everything in it.
> > >
> > > for first case. define a new image perhaps a derivative of
> > > core-image-minimal and use that
> >
> > There are two useful starting points,
> > openembedded-core/meta/recipes-core/images/core-image-minimal-
> > initramfs.bb
> > openembedded-core/meta/recipes-core/images/core-image-tiny-
> > initramfs.bb
> >
> > Both do not have
> > COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
> >
> > In the end you will most likely want to customize your image as Khem
> > says, so just start by copying one of these and start making adjustments.
> > Alternatively you can do something like the following in your
> > local.conf to overcome this:
> > COMPATIBLE_HOST_pn-core-image-tiny-initramfs = "aarch64-poky-linux"

The core-image-tiny-initramfs.bb does have the COMPATIBLE_HOST = "(i.86|x86_64).*-linux" line in it, this requires a x86 architecture. I ended up copying the file and deleting the COMPATIBLE_HOST line.

When I do that I get the following error:
 * Problem 1/1:
 *   - nothing provides busybox-mdev needed by initramfs-live-boot-tiny-1.0-r12.raspberrypi4

What do I need to do to get busybox-mdev built for this image? Can I just add an IMAGE_INSTALL += "busybox-mdev" for it?

Regards,
Greg

> 
> I just need something to boot into on the way to the full image. I am doing
> this as a step to bringing up OStree. So maybe setting the
> 'COMPATIBLE_HOST' and using core-image-tiny-initramfs will work.
> 
> Thanks for the suggestions. I had thought that there must be an initramfs for
> the Raspberry Pi with all of the threads about using an initramfs on the Pi, but
> I guess that there isn't a separate one.
> 
> Best Regards,
> Greg
> 
> >
> > You will want to determine if this initramfs is going to pivot to the 'init'
> > found in the main rootfs, or if you want to simply boot into the
> > 'init' in the initramfs and remain there.
> >
> > Lastly you can either keep the initramfs standalone or have the kernel
> > bundle the initramfs. The latter is useful if you want/need to include
> > software in the initramfs that is needed to get the disks up and
> > running to then get access to the rootfs.
> >
> > Take a look at
> > https://www.yoctoproject.org/docs/2.6/ref-manual/ref-manual.html#var-
> > INITRAMFS_FSTYPES
> > https://www.yoctoproject.org/docs/2.6/ref-manual/ref-manual.html#var-
> > INITRAMFS_IMAGE
> > https://www.yoctoproject.org/docs/2.6/ref-manual/ref-manual.html#var-
> > INITRAMFS_IMAGE_BUNDLE
> >
> > MarkA
> >
> >
> > >
> > > > Regards,
> > > > Greg
> > > >
> > > > -----Original Message-----
> > > > From: Khem Raj <raj.khem@gmail.com>
> > > > Sent: Thursday, January 23, 2020 10:56 AM
> > > > To: Greg Wilson-Lindberg <GWilson@sakuraus.com>
> > > > Cc: Yocto list discussion <yocto@yoctoproject.org>
> > > > Subject: Re: [yocto] generate initramfs for raspberry pi
> > > >
> > > > On Thu, Jan 23, 2020 at 10:44 AM Greg Wilson-Lindberg
> > <gwilson@sakuraus.com> wrote:
> > > > > Hello List,
> > > > >
> > > > > I have not been able to figure out how to generate an initramfs
> > > > > image for a raspberry pi build of yocto. I’ve searched it web
> > > > > and have not found anything that mentions generating the actual
> > > > > image, lots of hits on how to configure using the initramfs, but
> > > > > not on generating it. Is there a standard recipe for a raspberry
> > > > > pi initramfs and how would I enable its generation, or maybe I’m
> > > > > just
> > being clueless.
> > > > >
> > > > >
> > > > >
> > > > > I’m running on a boot2qt build of yocto based on Qt v5.14.0 that
> > > > > uses warrior and I’m targeting an RPi 4 using u-boot.
> > > > >
> > > > >
> > > > >
> > > > > Any help would be greatly appreciated.
> > > >
> > > > try something like below in local.conf
> > > >
> > > > INITRAMFS_IMAGE_BUNDLE_rpi = "1"
> > > > INITRAMFS_IMAGE_rpi = "<your-image>"
> > > > # Enlarge boot partition to 1GiB
> > > > BOOT_SPACE = "1073741"
> > > > INITRAMFS_MAXSIZE = "315400"
> > > > IMAGE_FSTYPES_pn-${INITRAMFS_IMAGE} = "${INITRAMFS_FSTYPES}"
> > > >
> > > > > Best regards,
> > > > >
> > > > > Greg Wilson-Lindberg
> >
> >
> >


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

* Re: [yocto] generate initramfs for raspberry pi
  2020-01-23 22:29           ` Greg Wilson-Lindberg
@ 2020-01-24 16:24             ` Mark Asselstine
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Asselstine @ 2020-01-24 16:24 UTC (permalink / raw)
  To: Greg Wilson-Lindberg; +Cc: yocto, Khem Raj, Yocto list discussion

On Thursday, January 23, 2020 5:29:14 P.M. EST Greg Wilson-Lindberg wrote:
> > -----Original Message-----
> > From: yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org> On
> > Behalf Of Greg Wilson-Lindberg
> > Sent: Thursday, January 23, 2020 11:54 AM
> > To: Mark Asselstine <mark.asselstine@windriver.com>;
> > yocto@lists.yoctoproject.org
> > Cc: Khem Raj <raj.khem@gmail.com>; Yocto list discussion
> > <yocto@yoctoproject.org>
> > Subject: Re: [yocto] generate initramfs for raspberry pi
> > 
> > Hi Mark, and also Khem (sorry for the miss-spelling of your name),
> > 
> > > -----Original Message-----
> > > From: yocto@lists.yoctoproject.org <yocto@lists.yoctoproject.org> On
> > > Behalf Of Mark Asselstine
> > > Sent: Thursday, January 23, 2020 11:37 AM
> > > To: yocto@lists.yoctoproject.org; Greg Wilson-Lindberg
> > > <GWilson@sakuraus.com>
> > > Cc: Khem Raj <raj.khem@gmail.com>; Yocto list discussion
> > > <yocto@yoctoproject.org>
> > > Subject: Re: [yocto] generate initramfs for raspberry pi
> > > 
> > > On Thursday, January 23, 2020 2:24:27 P.M. EST Khem Raj wrote:
> > > > On Thu, Jan 23, 2020 at 11:16 AM Greg Wilson-Lindberg
> > > > 
> > > > <GWilson@sakuraus.com> wrote:
> > > > > Hi Kem,
> > > > > I had figured out your suggestions, my problem is how do I
> > > > > generate the "<your-image>" image in:
> > > > > 
> > > > > INITRAMFS_IMAGE_rpi = "<your-image>"
> > > > > 
> > > > > I need a recipe for the image and a way to get Yocto to build it
> > > > > when I build the rest of my image. Maybe specifying the name will
> > > > > build it, but I still need a recipe for the image.
> > > > 
> > > > Depends what your needs are, its not clear what you want from this
> > > > initramfs image.
> > > > is it something you want to do some preboot stuff and pivot into
> > > > final image during boot or do you want your full userspace to be
> > > > running in it for second case Just use your image if you want that
> > > > to be bundled in and build bitbake virtual/kernel it will get you
> > > > single kernel image with everything in it.
> > > > 
> > > > for first case. define a new image perhaps a derivative of
> > > > core-image-minimal and use that
> > > 
> > > There are two useful starting points,
> > > openembedded-core/meta/recipes-core/images/core-image-minimal-
> > > initramfs.bb
> > > openembedded-core/meta/recipes-core/images/core-image-tiny-
> > > initramfs.bb
> > > 
> > > Both do not have
> > > COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
> > > 
> > > In the end you will most likely want to customize your image as Khem
> > > says, so just start by copying one of these and start making
> > > adjustments.
> > > Alternatively you can do something like the following in your
> > > local.conf to overcome this:
> > > COMPATIBLE_HOST_pn-core-image-tiny-initramfs = "aarch64-poky-linux"
> 
> The core-image-tiny-initramfs.bb does have the COMPATIBLE_HOST =
> "(i.86|x86_64).*-linux" line in it, this requires a x86 architecture. I
> ended up copying the file and deleting the COMPATIBLE_HOST line.
> 
> When I do that I get the following error:
>  * Problem 1/1:
>  *   - nothing provides busybox-mdev needed by
> initramfs-live-boot-tiny-1.0-r12.raspberrypi4
> 
> What do I need to do to get busybox-mdev built for this image? Can I just
> add an IMAGE_INSTALL += "busybox-mdev" for it?
> 

This is being pulled in via initramfs-live-boot-tiny which core-image-tiny-
initramfs.bb pulls in using

PACKAGE_INSTALL = "initramfs-live-boot-tiny..."

Looking at initramfs-live-boot-tiny_1.0.bb you will see, RDEPENDS_${PN} = 
"busybox-mdev"

You also end up with VIRTUAL-RUNTIME_dev_manager="busybox-mdev"

So you have two options. If you already have your own image and you aren't 
using core-image-tiny-initramfs you can drop the use of initramfs-live-boot-
tiny and use your own 'init' script.

Or you can configure busybox to include mdev. Create a busybox_%.bbappend and 
do 
SRC_URI += "file://mdev-fragment.cfg"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

and then create the mdev-fragment.cfg which has
CONFIG_MDEV = y

MarkA




> Regards,
> Greg
> 
> > I just need something to boot into on the way to the full image. I am
> > doing
> > this as a step to bringing up OStree. So maybe setting the
> > 'COMPATIBLE_HOST' and using core-image-tiny-initramfs will work.
> > 
> > Thanks for the suggestions. I had thought that there must be an initramfs
> > for the Raspberry Pi with all of the threads about using an initramfs on
> > the Pi, but I guess that there isn't a separate one.
> > 
> > Best Regards,
> > Greg
> > 
> > > You will want to determine if this initramfs is going to pivot to the
> > > 'init' found in the main rootfs, or if you want to simply boot into the
> > > 'init' in the initramfs and remain there.
> > > 
> > > Lastly you can either keep the initramfs standalone or have the kernel
> > > bundle the initramfs. The latter is useful if you want/need to include
> > > software in the initramfs that is needed to get the disks up and
> > > running to then get access to the rootfs.
> > > 
> > > Take a look at
> > > https://www.yoctoproject.org/docs/2.6/ref-manual/ref-manual.html#var-> > > INITRAMFS_FSTYPES
> > > https://www.yoctoproject.org/docs/2.6/ref-manual/ref-manual.html#var-> > > INITRAMFS_IMAGE
> > > https://www.yoctoproject.org/docs/2.6/ref-manual/ref-manual.html#var-> > > INITRAMFS_IMAGE_BUNDLE
> > > 
> > > MarkA
> > > 
> > > > > Regards,
> > > > > Greg
> > > > > 
> > > > > -----Original Message-----
> > > > > From: Khem Raj <raj.khem@gmail.com>
> > > > > Sent: Thursday, January 23, 2020 10:56 AM
> > > > > To: Greg Wilson-Lindberg <GWilson@sakuraus.com>
> > > > > Cc: Yocto list discussion <yocto@yoctoproject.org>
> > > > > Subject: Re: [yocto] generate initramfs for raspberry pi
> > > > > 
> > > > > On Thu, Jan 23, 2020 at 10:44 AM Greg Wilson-Lindberg
> > > 
> > > <gwilson@sakuraus.com> wrote:
> > > > > > Hello List,
> > > > > > 
> > > > > > I have not been able to figure out how to generate an initramfs
> > > > > > image for a raspberry pi build of yocto. I’ve searched it web
> > > > > > and have not found anything that mentions generating the actual
> > > > > > image, lots of hits on how to configure using the initramfs, but
> > > > > > not on generating it. Is there a standard recipe for a raspberry
> > > > > > pi initramfs and how would I enable its generation, or maybe I’m
> > > > > > just
> > > 
> > > being clueless.
> > > 
> > > > > > I’m running on a boot2qt build of yocto based on Qt v5.14.0 that
> > > > > > uses warrior and I’m targeting an RPi 4 using u-boot.
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > Any help would be greatly appreciated.
> > > > > 
> > > > > try something like below in local.conf
> > > > > 
> > > > > INITRAMFS_IMAGE_BUNDLE_rpi = "1"
> > > > > INITRAMFS_IMAGE_rpi = "<your-image>"
> > > > > # Enlarge boot partition to 1GiB
> > > > > BOOT_SPACE = "1073741"
> > > > > INITRAMFS_MAXSIZE = "315400"
> > > > > IMAGE_FSTYPES_pn-${INITRAMFS_IMAGE} = "${INITRAMFS_FSTYPES}"
> > > > > 
> > > > > > Best regards,
> > > > > > 
> > > > > > Greg Wilson-Lindberg





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

end of thread, other threads:[~2020-01-24 16:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-23 18:29 generate initramfs for raspberry pi Greg Wilson-Lindberg
2020-01-23 18:56 ` [yocto] " Khem Raj
2020-01-23 19:15   ` Greg Wilson-Lindberg
2020-01-23 19:24     ` Khem Raj
2020-01-23 19:36       ` Mark Asselstine
2020-01-23 19:54         ` Greg Wilson-Lindberg
     [not found]         ` <15EC9C2A5A8A010E.12201@lists.yoctoproject.org>
2020-01-23 22:29           ` Greg Wilson-Lindberg
2020-01-24 16:24             ` Mark Asselstine

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.