All of lore.kernel.org
 help / color / mirror / Atom feed
* How to build initramfs with modules but without bzImage
@ 2017-05-21 22:05 Ferry Toth
  2017-05-22 22:11 ` Ferry Toth
  0 siblings, 1 reply; 3+ messages in thread
From: Ferry Toth @ 2017-05-21 22:05 UTC (permalink / raw)
  To: yocto

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

I am building 2 images. One has my rootfs, the other builds a kernel with
builtin initramfs.

To build the initramfs I did the following:
In the .../conf directory, I create a file named initramfs.conf and add
the following:
 
INITRAMFS_IMAGE = "core-image-minimal-initramfs"
INITRAMFS_IMAGE_BUNDLE = "1"
 
IMAGE_FSTYPES = "cpio.gz"
 
Then to build the initramfs based on the core-image-base recipe, I execute
the following bitbake command:
 
     bitbake -R conf/initramfs.conf core-image-minimal-initramfs
 
When it completes, there is a kernel + initramfs file in the .../tmp/
deploy/images/..../  directory.
 
This image boots to the init script, but then hangs as the mmc drivers
have not been included.

Now I create a core-image-minimal-initramfs.bbappend file and
PACKAGE_INSTALL the modules I need (also tried kernel-modules).

Unfortunately this also installs the kernel bzImage in the /boot
directory, that appears to be a dependancy. This adds another 6MB to my
initramfs, which is now to load.

I expect it should be possible to add the modules without adding the
kernel, but haven't been able to find a way to do that. Or it should be
possible to remove the contents of /boot after do_rootfs.

But I have no clue how to do that.

Or am I just generating the initramfs in the wrong way?

Ferry

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

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

* Re: How to build initramfs with modules but without bzImage
  2017-05-21 22:05 How to build initramfs with modules but without bzImage Ferry Toth
@ 2017-05-22 22:11 ` Ferry Toth
  0 siblings, 0 replies; 3+ messages in thread
From: Ferry Toth @ 2017-05-22 22:11 UTC (permalink / raw)
  To: yocto

Op Mon, 22 May 2017 00:05:41 +0200, schreef Ferry Toth:

> I am building 2 images. One has my rootfs, the other builds a kernel
> with builtin initramfs.
> 
> To build the initramfs I did the following:
> In the .../conf directory, I create a file named initramfs.conf and add
> the following:
>  
> INITRAMFS_IMAGE = "core-image-minimal-initramfs"
> INITRAMFS_IMAGE_BUNDLE = "1"
>  
> IMAGE_FSTYPES = "cpio.gz"
>  
> Then to build the initramfs based on the core-image-base recipe, I
> execute the following bitbake command:
>  
>      bitbake -R conf/initramfs.conf core-image-minimal-initramfs
>  
> When it completes, there is a kernel + initramfs file in the .../tmp/
> deploy/images/..../  directory.
>  
> This image boots to the init script, but then hangs as the mmc drivers
> have not been included.
> 
> Now I create a core-image-minimal-initramfs.bbappend file and
> PACKAGE_INSTALL the modules I need (also tried kernel-modules).
> 
> Unfortunately this also installs the kernel bzImage in the /boot
> directory, that appears to be a dependancy. This adds another 6MB to my
> initramfs, which is now to load.
> 
> I expect it should be possible to add the modules without adding the
> kernel, but haven't been able to find a way to do that. Or it should be
> possible to remove the contents of /boot after do_rootfs.
> 
> But I have no clue how to do that.
> 
> Or am I just generating the initramfs in the wrong way?

Thanks people especially paulg and khem on irc,

I added to my core-image-minimal-initramfs.bbappend:

ROOTFS_POSTPROCESS_COMMAND += "clobber_unused"

clobber_unused () {
        rm ${IMAGE_ROOTFS}/boot/*
}

This shrink my initramfs just enough to boot. Of course I can remove more 
files if needed, by adding dir's to the clobber function.



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

* How to build initramfs with modules but without bzImage
@ 2017-05-21 21:54 Ferry Toth
  0 siblings, 0 replies; 3+ messages in thread
From: Ferry Toth @ 2017-05-21 21:54 UTC (permalink / raw)
  To: yocto

I am building 2 images. One has my rootfs, the other builds a kernel with 
builtin initramfs.

To build the initramfs I did the following:
In the .../conf directory, I create a file named initramfs.conf and add 
the following:
 
INITRAMFS_IMAGE = "core-image-minimal-initramfs"
INITRAMFS_IMAGE_BUNDLE = "1"
 
IMAGE_FSTYPES = "cpio.gz"
 
Then to build the initramfs based on the core-image-base recipe, I 
execute the following bitbake command:
 
     bitbake -R conf/initramfs.conf core-image-minimal-initramfs
 
When it completes, there is a kernel + initramfs file in the .../tmp/
deploy/images/..../  directory.
 
This image boots to the init script, but then hangs as the mmc drivers 
have not been included.

Now I create a core-image-minimal-initramfs.bbappend file and
PACKAGE_INSTALL the modules I need (also tried kernel-modules).

Unfortunately this also installs the kernel bzImage in the /boot 
directory, that appears to be a dependancy. This adds another 6MB to my 
initramfs, which is now to load.

I expect it should be possible to add the modules without adding the 
kernel, but haven't been able to find a way to do that. Or it should be 
possible to remove the contents of /boot after do_rootfs.

But I have no clue how to do that.

Or am I just generating the initramfs in the wrong way?

Ferry



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

end of thread, other threads:[~2017-05-22 22:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-21 22:05 How to build initramfs with modules but without bzImage Ferry Toth
2017-05-22 22:11 ` Ferry Toth
  -- strict thread matches above, loose matches on Subject: below --
2017-05-21 21:54 Ferry Toth

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.