Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] linux: allow own initramfs to be specified
@ 2009-07-27 13:45 Daniel Mack
  2009-07-27 14:21 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Mack @ 2009-07-27 13:45 UTC (permalink / raw)
  To: buildroot

The initramfs source location is removed from the given Linux kernel
configuration at the moment and only filled in again in case BR2 is
asked to provide a cpio for that feature.

This patch allows to specify an own location for such an image file.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
---
 target/linux/Config.in.advanced   |   12 ++++++++++++
 target/linux/Makefile.in.advanced |   13 +++++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/target/linux/Config.in.advanced b/target/linux/Config.in.advanced
index 3a171b5..53020ac 100644
--- a/target/linux/Config.in.advanced
+++ b/target/linux/Config.in.advanced
@@ -429,6 +429,18 @@ config BR2_KERNEL_CONFIG_METHOD
 	default "xconfig"	if BR2_MAKE_XCONFIG
 	default "menuconfig"	if BR2_MAKE_MENUCONFIG
 
+config BR2_PACKAGE_LINUX_INITRAMFS
+	string "initramfs source"
+	depends on BR2_PACKAGE_LINUX
+	help
+	  The initial RAM filesystem is a ramfs which is loaded by the
+	  boot loader (loadlin or lilo) and that is mounted as root
+	  before the normal boot procedure. It is typically used to
+	  load modules needed to mount the "real" root file system,
+	  etc.
+
+	  Specify a path relative to BR2's root folder.
+
 endmenu
 
 choice
diff --git a/target/linux/Makefile.in.advanced b/target/linux/Makefile.in.advanced
index 47a1f4e..71c0eb1 100644
--- a/target/linux/Makefile.in.advanced
+++ b/target/linux/Makefile.in.advanced
@@ -377,6 +377,19 @@ ifeq ($(BR2_PACKAGE_BUSYBOX_INITRAMFS),y)
 	echo "CONFIG_INITRAMFS_ROOT_UID=0" >> $(LINUX26_DIR)/.config
 	echo "CONFIG_INITRAMFS_ROOT_GID=0" >> $(LINUX26_DIR)/.config
 endif
+ifneq ($(BR2_PACKAGE_LINUX_INITRAMFS),)
+	$(SED) '/CONFIG_INITRAMFS_SOURCE/d' $(LINUX26_DIR)/.config
+	$(SED) '/INITRAMFS_ROOT_.ID/d' $(LINUX26_DIR)/.config
+	echo "CONFIG_BLK_DEV_INITRD=y" >> $(LINUX26_DIR)/.config
+	echo "CONFIG_INITRAMFS_COMPRESSION_GZIP=y" >> $(LINUX26_DIR)/.config
+	echo "# CONFIG_INITRAMFS_COMPRESSION_NONE is not set" >> $(LINUX26_DIR)/.config
+	echo "# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set" >> $(LINUX26_DIR)/.config
+	echo "# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set" >> $(LINUX26_DIR)/.config
+	echo "CONFIG_INITRAMFS_SOURCE=\"$(PWD)/$(BR2_PACKAGE_LINUX_INITRAMFS)\"" >> \
+		$(LINUX26_DIR)/.config
+	echo "CONFIG_INITRAMFS_ROOT_UID=0" >> $(LINUX26_DIR)/.config
+	echo "CONFIG_INITRAMFS_ROOT_GID=0" >> $(LINUX26_DIR)/.config
+endif
 	$(MAKE) $(LINUX26_MAKE_FLAGS) -C $(LINUX26_DIR) oldconfig
 	touch $@
 
-- 
1.6.3.1

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

* [Buildroot] [PATCH] linux: allow own initramfs to be specified
  2009-07-27 13:45 [Buildroot] [PATCH] linux: allow own initramfs to be specified Daniel Mack
@ 2009-07-27 14:21 ` Thomas Petazzoni
  2009-07-27 16:00   ` Daniel Mack
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2009-07-27 14:21 UTC (permalink / raw)
  To: buildroot

Le Mon, 27 Jul 2009 15:45:30 +0200,
Daniel Mack <daniel@caiaq.de> a ?crit :

> The initramfs source location is removed from the given Linux kernel
> configuration at the moment and only filled in again in case BR2 is
> asked to provide a cpio for that feature.
> 
> This patch allows to specify an own location for such an image file.

Just curious, what's the use case for this ?

Buildroot already allows to integrate the root filesystem it generated
into the initramfs. It seems your patch allows to integrate a different
initramfs that the one generated by Buildroot. Is this correct ? If so,
what's your use case ?

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH] linux: allow own initramfs to be specified
  2009-07-27 14:21 ` Thomas Petazzoni
@ 2009-07-27 16:00   ` Daniel Mack
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Mack @ 2009-07-27 16:00 UTC (permalink / raw)
  To: buildroot

On Mon, Jul 27, 2009 at 04:21:48PM +0200, Thomas Petazzoni wrote:
> Le Mon, 27 Jul 2009 15:45:30 +0200,
> Daniel Mack <daniel@caiaq.de> a ?crit :
> 
> > The initramfs source location is removed from the given Linux kernel
> > configuration at the moment and only filled in again in case BR2 is
> > asked to provide a cpio for that feature.
> > 
> > This patch allows to specify an own location for such an image file.
> 
> Just curious, what's the use case for this ?
> 
> Buildroot already allows to integrate the root filesystem it generated
> into the initramfs. It seems your patch allows to integrate a different
> initramfs that the one generated by Buildroot. Is this correct ? If so,
> what's your use case ?

Yep, you're right. We should do it that way. I was thinking of offering
a way to let a precompiled cpio image become the initramfs of the built
kernel, but it is really better to let br2 handle it all.

There are, however, two problems with the existing code.

1) the linux modules are installed unconditionally which we must avoid
   our case
2) the initramfs target is currently broken

So, forget about this patch, I'll provide two new ones to make this
work.

Thanks,
Daniel

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

end of thread, other threads:[~2009-07-27 16:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-27 13:45 [Buildroot] [PATCH] linux: allow own initramfs to be specified Daniel Mack
2009-07-27 14:21 ` Thomas Petazzoni
2009-07-27 16:00   ` Daniel Mack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox