All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/1] fs/cpio: add option to manually specify file list
       [not found] <Multiple root filesystems for single kernel/toolchain>
@ 2017-10-26 19:16 ` Seamus Connor
  2017-10-26 19:16   ` [Buildroot] [PATCH 1/1] " Seamus Connor
  0 siblings, 1 reply; 9+ messages in thread
From: Seamus Connor @ 2017-10-26 19:16 UTC (permalink / raw)
  To: buildroot

Hello All,

Again, in my use case I require an initramfs.  However my system is
memory restricted so I cannot use my full rootfs image.  This series
contains the modifications that I made to support this. I am not sure if
this is generally useful to the larger buildroot community, but I
figured since Arnout and Peter were kind enough to give me pointers I
should share the changes I made in case someone else can benefit from
them.

-Seamus

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

* [Buildroot] [PATCH 1/1] fs/cpio: add option to manually specify file list
  2017-10-26 19:16 ` [Buildroot] [PATCH 0/1] fs/cpio: add option to manually specify file list Seamus Connor
@ 2017-10-26 19:16   ` Seamus Connor
  2017-10-26 20:13     ` Seamus Connor
                       ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Seamus Connor @ 2017-10-26 19:16 UTC (permalink / raw)
  To: buildroot

For some systems it may be desireable to have an initramfs that is
smaller than the full root filesystem. This commit adds support for
creating an initramfs based on a manually specified set of files. It is
up to the user to define a sensible set of files. This file list could
either be statically created, or it could be created as the result of a
pre-fs hook script.

Signed-off-by: Seamus Connor <sconnor@lynx.com>
---
 fs/cpio/Config.in | 30 ++++++++++++++++++++++++++++++
 fs/cpio/cpio.mk   | 10 ++++++++++
 2 files changed, 40 insertions(+)

diff --git a/fs/cpio/Config.in b/fs/cpio/Config.in
index 206baca677..21aa2c6fb8 100644
--- a/fs/cpio/Config.in
+++ b/fs/cpio/Config.in
@@ -7,6 +7,36 @@ config BR2_TARGET_ROOTFS_CPIO
 
 if BR2_TARGET_ROOTFS_CPIO
 
+choice
+	prompt "Seleted Fileset"
+	default BR2_TARGET_ROOTFS_CPIO_INCLUDE_ALL
+	help
+	  Select the set of files to include in the cpio of the root filesystem.
+	  This may either be all files installed to the target, or it may be a
+	  subset defined in the custom file list.
+
+config BR2_TARGET_ROOTFS_CPIO_INCLUDE_ALL
+	bool "Include all files from target"
+	help
+	  Include all files from the target directory in the root filesystem.
+
+config BR2_TARGET_ROOTFS_CPIO_INCLUDE_CUSTOM
+	bool "Include a subset of files from target"
+	help
+	  Include a subset of the files from the target directory in the root filesystem.
+	  This requires a custom file list to be defined.  The actual file list may be
+	  generated by a user script defined as part of the pre-fs hook.
+
+endchoice
+
+config BR2_TARGET_ROOTFS_CPIO_CUSTOM_FILELIST
+	string "path to a custom file list"
+	depends on BR2_TARGET_ROOTFS_CPIO && BR2_TARGET_ROOTFS_CPIO_INCLUDE_CUSTOM
+	help
+	  This file defines the contents of the rootfilesystem.  All files and folders
+	  created in the rootfilesystem must be defined here.  This file can be statically
+	  defined, or created as part of the pre-fs hook.
+
 choice
 	prompt "Compression method"
 	default BR2_TARGET_ROOTFS_CPIO_NONE
diff --git a/fs/cpio/cpio.mk b/fs/cpio/cpio.mk
index e82167e512..984ff37895 100644
--- a/fs/cpio/cpio.mk
+++ b/fs/cpio/cpio.mk
@@ -27,10 +27,20 @@ endif # BR2_ROOTFS_DEVICE_CREATION_STATIC
 
 ROOTFS_CPIO_PRE_GEN_HOOKS += ROOTFS_CPIO_ADD_INIT
 
+ifeq ($(BR2_TARGET_ROOTFS_CPIO_INCLUDE_ALL),y)
+
 define ROOTFS_CPIO_CMD
 	cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $@
 endef
 
+else
+
+define ROOTFS_CPIO_CMD
+	cd $(TARGET_DIR) && cpio --quiet -o -H newc < $(BR2_TARGET_ROOTFS_CPIO_CUSTOM_FILELIST) > $@
+endef
+
+endif
+
 $(BINARIES_DIR)/rootfs.cpio.uboot: $(BINARIES_DIR)/rootfs.cpio host-uboot-tools
 	$(MKIMAGE) -A $(MKIMAGE_ARCH) -T ramdisk \
 		-C none -d $<$(ROOTFS_CPIO_COMPRESS_EXT) $@
-- 
2.14.2

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

* [Buildroot] [PATCH 1/1] fs/cpio: add option to manually specify file list
  2017-10-26 19:16   ` [Buildroot] [PATCH 1/1] " Seamus Connor
@ 2017-10-26 20:13     ` Seamus Connor
  2018-01-01 11:54     ` Thomas Petazzoni
  2018-02-16 22:51     ` Thomas Petazzoni
  2 siblings, 0 replies; 9+ messages in thread
From: Seamus Connor @ 2017-10-26 20:13 UTC (permalink / raw)
  To: buildroot

I was thinking that a good improvement to this patch would be to specify 
the file list in a gitignore format.? That way you could just chop off 
the portions of the rootfs you dont need, or manually include the 
portions that you do need.


On 10/26/2017 12:16 PM, Seamus Connor wrote:
> For some systems it may be desireable to have an initramfs that is
> smaller than the full root filesystem. This commit adds support for
> creating an initramfs based on a manually specified set of files. It is
> up to the user to define a sensible set of files. This file list could
> either be statically created, or it could be created as the result of a
> pre-fs hook script.
>
> Signed-off-by: Seamus Connor <sconnor@lynx.com>
> ---
>   fs/cpio/Config.in | 30 ++++++++++++++++++++++++++++++
>   fs/cpio/cpio.mk   | 10 ++++++++++
>   2 files changed, 40 insertions(+)
>
> diff --git a/fs/cpio/Config.in b/fs/cpio/Config.in
> index 206baca677..21aa2c6fb8 100644
> --- a/fs/cpio/Config.in
> +++ b/fs/cpio/Config.in
> @@ -7,6 +7,36 @@ config BR2_TARGET_ROOTFS_CPIO
>   
>   if BR2_TARGET_ROOTFS_CPIO
>   
> +choice
> +	prompt "Seleted Fileset"
> +	default BR2_TARGET_ROOTFS_CPIO_INCLUDE_ALL
> +	help
> +	  Select the set of files to include in the cpio of the root filesystem.
> +	  This may either be all files installed to the target, or it may be a
> +	  subset defined in the custom file list.
> +
> +config BR2_TARGET_ROOTFS_CPIO_INCLUDE_ALL
> +	bool "Include all files from target"
> +	help
> +	  Include all files from the target directory in the root filesystem.
> +
> +config BR2_TARGET_ROOTFS_CPIO_INCLUDE_CUSTOM
> +	bool "Include a subset of files from target"
> +	help
> +	  Include a subset of the files from the target directory in the root filesystem.
> +	  This requires a custom file list to be defined.  The actual file list may be
> +	  generated by a user script defined as part of the pre-fs hook.
> +
> +endchoice
> +
> +config BR2_TARGET_ROOTFS_CPIO_CUSTOM_FILELIST
> +	string "path to a custom file list"
> +	depends on BR2_TARGET_ROOTFS_CPIO && BR2_TARGET_ROOTFS_CPIO_INCLUDE_CUSTOM
> +	help
> +	  This file defines the contents of the rootfilesystem.  All files and folders
> +	  created in the rootfilesystem must be defined here.  This file can be statically
> +	  defined, or created as part of the pre-fs hook.
> +
>   choice
>   	prompt "Compression method"
>   	default BR2_TARGET_ROOTFS_CPIO_NONE
> diff --git a/fs/cpio/cpio.mk b/fs/cpio/cpio.mk
> index e82167e512..984ff37895 100644
> --- a/fs/cpio/cpio.mk
> +++ b/fs/cpio/cpio.mk
> @@ -27,10 +27,20 @@ endif # BR2_ROOTFS_DEVICE_CREATION_STATIC
>   
>   ROOTFS_CPIO_PRE_GEN_HOOKS += ROOTFS_CPIO_ADD_INIT
>   
> +ifeq ($(BR2_TARGET_ROOTFS_CPIO_INCLUDE_ALL),y)
> +
>   define ROOTFS_CPIO_CMD
>   	cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $@
>   endef
>   
> +else
> +
> +define ROOTFS_CPIO_CMD
> +	cd $(TARGET_DIR) && cpio --quiet -o -H newc < $(BR2_TARGET_ROOTFS_CPIO_CUSTOM_FILELIST) > $@
> +endef
> +
> +endif
> +
>   $(BINARIES_DIR)/rootfs.cpio.uboot: $(BINARIES_DIR)/rootfs.cpio host-uboot-tools
>   	$(MKIMAGE) -A $(MKIMAGE_ARCH) -T ramdisk \
>   		-C none -d $<$(ROOTFS_CPIO_COMPRESS_EXT) $@

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

* [Buildroot] [PATCH 1/1] fs/cpio: add option to manually specify file list
  2017-10-26 19:16   ` [Buildroot] [PATCH 1/1] " Seamus Connor
  2017-10-26 20:13     ` Seamus Connor
@ 2018-01-01 11:54     ` Thomas Petazzoni
  2018-01-01 13:22       ` Yann E. MORIN
  2018-02-16 22:51     ` Thomas Petazzoni
  2 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2018-01-01 11:54 UTC (permalink / raw)
  To: buildroot

Peter, Arnout, Yann, all,

This patch has been pending since ~2 months with no feedback. Do we
want something like this?

One thing that bothers me a bit is that it would make the
initramfs/cpio image contain a filesystem that is different from other
root filesystem images. But perhaps this is OK, because initramfs is
indeed special.

So I'm inclined to just apply this, as it may be useful for some users.
If you don't voice a concern within the next days, I'll apply.

Thanks!

Thmas

On Thu, 26 Oct 2017 12:16:27 -0700, Seamus Connor wrote:
> For some systems it may be desireable to have an initramfs that is
> smaller than the full root filesystem. This commit adds support for
> creating an initramfs based on a manually specified set of files. It is
> up to the user to define a sensible set of files. This file list could
> either be statically created, or it could be created as the result of a
> pre-fs hook script.
> 
> Signed-off-by: Seamus Connor <sconnor@lynx.com>
> ---
>  fs/cpio/Config.in | 30 ++++++++++++++++++++++++++++++
>  fs/cpio/cpio.mk   | 10 ++++++++++
>  2 files changed, 40 insertions(+)
> 
> diff --git a/fs/cpio/Config.in b/fs/cpio/Config.in
> index 206baca677..21aa2c6fb8 100644
> --- a/fs/cpio/Config.in
> +++ b/fs/cpio/Config.in
> @@ -7,6 +7,36 @@ config BR2_TARGET_ROOTFS_CPIO
>  
>  if BR2_TARGET_ROOTFS_CPIO
>  
> +choice
> +	prompt "Seleted Fileset"
> +	default BR2_TARGET_ROOTFS_CPIO_INCLUDE_ALL
> +	help
> +	  Select the set of files to include in the cpio of the root filesystem.
> +	  This may either be all files installed to the target, or it may be a
> +	  subset defined in the custom file list.
> +
> +config BR2_TARGET_ROOTFS_CPIO_INCLUDE_ALL
> +	bool "Include all files from target"
> +	help
> +	  Include all files from the target directory in the root filesystem.
> +
> +config BR2_TARGET_ROOTFS_CPIO_INCLUDE_CUSTOM
> +	bool "Include a subset of files from target"
> +	help
> +	  Include a subset of the files from the target directory in the root filesystem.
> +	  This requires a custom file list to be defined.  The actual file list may be
> +	  generated by a user script defined as part of the pre-fs hook.
> +
> +endchoice
> +
> +config BR2_TARGET_ROOTFS_CPIO_CUSTOM_FILELIST
> +	string "path to a custom file list"
> +	depends on BR2_TARGET_ROOTFS_CPIO && BR2_TARGET_ROOTFS_CPIO_INCLUDE_CUSTOM
> +	help
> +	  This file defines the contents of the rootfilesystem.  All files and folders
> +	  created in the rootfilesystem must be defined here.  This file can be statically
> +	  defined, or created as part of the pre-fs hook.
> +
>  choice
>  	prompt "Compression method"
>  	default BR2_TARGET_ROOTFS_CPIO_NONE
> diff --git a/fs/cpio/cpio.mk b/fs/cpio/cpio.mk
> index e82167e512..984ff37895 100644
> --- a/fs/cpio/cpio.mk
> +++ b/fs/cpio/cpio.mk
> @@ -27,10 +27,20 @@ endif # BR2_ROOTFS_DEVICE_CREATION_STATIC
>  
>  ROOTFS_CPIO_PRE_GEN_HOOKS += ROOTFS_CPIO_ADD_INIT
>  
> +ifeq ($(BR2_TARGET_ROOTFS_CPIO_INCLUDE_ALL),y)
> +
>  define ROOTFS_CPIO_CMD
>  	cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $@
>  endef
>  
> +else
> +
> +define ROOTFS_CPIO_CMD
> +	cd $(TARGET_DIR) && cpio --quiet -o -H newc < $(BR2_TARGET_ROOTFS_CPIO_CUSTOM_FILELIST) > $@
> +endef
> +
> +endif
> +
>  $(BINARIES_DIR)/rootfs.cpio.uboot: $(BINARIES_DIR)/rootfs.cpio host-uboot-tools
>  	$(MKIMAGE) -A $(MKIMAGE_ARCH) -T ramdisk \
>  		-C none -d $<$(ROOTFS_CPIO_COMPRESS_EXT) $@



-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 1/1] fs/cpio: add option to manually specify file list
  2018-01-01 11:54     ` Thomas Petazzoni
@ 2018-01-01 13:22       ` Yann E. MORIN
  2018-01-01 14:47         ` Thomas Petazzoni
  0 siblings, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2018-01-01 13:22 UTC (permalink / raw)
  To: buildroot

Thomas, Seanus, All,

On 2018-01-01 12:54 +0100, Thomas Petazzoni spake thusly:
> Peter, Arnout, Yann, all,
> 
> This patch has been pending since ~2 months with no feedback. Do we
> want something like this?
> 
> One thing that bothers me a bit is that it would make the
> initramfs/cpio image contain a filesystem that is different from other
> root filesystem images. But perhaps this is OK, because initramfs is
> indeed special.
> 
> So I'm inclined to just apply this, as it may be useful for some users.
> If you don't voice a concern within the next days, I'll apply.

I don't like this much, in fact.

In such a case, I would say that the initramfs filesystem is a different
system, and thus should be built with a different .config.

Basically, what I do in this situation:

  - have a first .config for kernel+modules + initramfs, and with a
    post-build script that:
    1. copy all the kernel modules "somewhere",
    2. trim the kernel modules that end up in the initramfs, to keep
       just what is needed to boot;

  - have a second .config with just userland, plus a post-build script
    that vampirises the kernel modules from "somwehere" (as saved above)

Of course, the "somewhere" is agreed on because I know it.

Besides, this is much more flexible than what this patch proposes.

Really, the core of the issue is to believe that the two systems are
one. They are not: they are two different systems.

So, I am not in favour of this patch.

Regards,
Yann E. MORIN.

> Thanks!
> 
> Thmas
> 
> On Thu, 26 Oct 2017 12:16:27 -0700, Seamus Connor wrote:
> > For some systems it may be desireable to have an initramfs that is
> > smaller than the full root filesystem. This commit adds support for
> > creating an initramfs based on a manually specified set of files. It is
> > up to the user to define a sensible set of files. This file list could
> > either be statically created, or it could be created as the result of a
> > pre-fs hook script.
> > 
> > Signed-off-by: Seamus Connor <sconnor@lynx.com>
> > ---
> >  fs/cpio/Config.in | 30 ++++++++++++++++++++++++++++++
> >  fs/cpio/cpio.mk   | 10 ++++++++++
> >  2 files changed, 40 insertions(+)
> > 
> > diff --git a/fs/cpio/Config.in b/fs/cpio/Config.in
> > index 206baca677..21aa2c6fb8 100644
> > --- a/fs/cpio/Config.in
> > +++ b/fs/cpio/Config.in
> > @@ -7,6 +7,36 @@ config BR2_TARGET_ROOTFS_CPIO
> >  
> >  if BR2_TARGET_ROOTFS_CPIO
> >  
> > +choice
> > +	prompt "Seleted Fileset"
> > +	default BR2_TARGET_ROOTFS_CPIO_INCLUDE_ALL
> > +	help
> > +	  Select the set of files to include in the cpio of the root filesystem.
> > +	  This may either be all files installed to the target, or it may be a
> > +	  subset defined in the custom file list.
> > +
> > +config BR2_TARGET_ROOTFS_CPIO_INCLUDE_ALL
> > +	bool "Include all files from target"
> > +	help
> > +	  Include all files from the target directory in the root filesystem.
> > +
> > +config BR2_TARGET_ROOTFS_CPIO_INCLUDE_CUSTOM
> > +	bool "Include a subset of files from target"
> > +	help
> > +	  Include a subset of the files from the target directory in the root filesystem.
> > +	  This requires a custom file list to be defined.  The actual file list may be
> > +	  generated by a user script defined as part of the pre-fs hook.
> > +
> > +endchoice
> > +
> > +config BR2_TARGET_ROOTFS_CPIO_CUSTOM_FILELIST
> > +	string "path to a custom file list"
> > +	depends on BR2_TARGET_ROOTFS_CPIO && BR2_TARGET_ROOTFS_CPIO_INCLUDE_CUSTOM
> > +	help
> > +	  This file defines the contents of the rootfilesystem.  All files and folders
> > +	  created in the rootfilesystem must be defined here.  This file can be statically
> > +	  defined, or created as part of the pre-fs hook.
> > +
> >  choice
> >  	prompt "Compression method"
> >  	default BR2_TARGET_ROOTFS_CPIO_NONE
> > diff --git a/fs/cpio/cpio.mk b/fs/cpio/cpio.mk
> > index e82167e512..984ff37895 100644
> > --- a/fs/cpio/cpio.mk
> > +++ b/fs/cpio/cpio.mk
> > @@ -27,10 +27,20 @@ endif # BR2_ROOTFS_DEVICE_CREATION_STATIC
> >  
> >  ROOTFS_CPIO_PRE_GEN_HOOKS += ROOTFS_CPIO_ADD_INIT
> >  
> > +ifeq ($(BR2_TARGET_ROOTFS_CPIO_INCLUDE_ALL),y)
> > +
> >  define ROOTFS_CPIO_CMD
> >  	cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $@
> >  endef
> >  
> > +else
> > +
> > +define ROOTFS_CPIO_CMD
> > +	cd $(TARGET_DIR) && cpio --quiet -o -H newc < $(BR2_TARGET_ROOTFS_CPIO_CUSTOM_FILELIST) > $@
> > +endef
> > +
> > +endif
> > +
> >  $(BINARIES_DIR)/rootfs.cpio.uboot: $(BINARIES_DIR)/rootfs.cpio host-uboot-tools
> >  	$(MKIMAGE) -A $(MKIMAGE_ARCH) -T ramdisk \
> >  		-C none -d $<$(ROOTFS_CPIO_COMPRESS_EXT) $@
> 
> 
> 
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/1] fs/cpio: add option to manually specify file list
  2018-01-01 13:22       ` Yann E. MORIN
@ 2018-01-01 14:47         ` Thomas Petazzoni
  2018-02-06 14:55           ` Sam Voss
  2018-02-06 23:30           ` Arnout Vandecappelle
  0 siblings, 2 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2018-01-01 14:47 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 1 Jan 2018 14:22:42 +0100, Yann E. MORIN wrote:

> > So I'm inclined to just apply this, as it may be useful for some users.
> > If you don't voice a concern within the next days, I'll apply.  
> 
> I don't like this much, in fact.
> 
> In such a case, I would say that the initramfs filesystem is a different
> system, and thus should be built with a different .config.
> 
> Basically, what I do in this situation:
> 
>   - have a first .config for kernel+modules + initramfs, and with a
>     post-build script that:
>     1. copy all the kernel modules "somewhere",
>     2. trim the kernel modules that end up in the initramfs, to keep
>        just what is needed to boot;
> 
>   - have a second .config with just userland, plus a post-build script
>     that vampirises the kernel modules from "somwehere" (as saved above)
> 
> Of course, the "somewhere" is agreed on because I know it.
> 
> Besides, this is much more flexible than what this patch proposes.
> 
> Really, the core of the issue is to believe that the two systems are
> one. They are not: they are two different systems.

On the other hand, the initramfs is very often a subset of the complete
root filesystem, and being able to generate an image of this subset
directly from the same configuration as the full-blown system is
definitely a nice thing.

I agree that a separate configuration to build the initramfs is more
flexible, but it also has its drawbacks (to handle kernel modules, as
you mentioned, but also in terms of rebuilding the toolchain if you're
using an internal toolchain). One example where it might be annoying to
have a separate configuration is if you have a single package that
builds both a kernel module and a user-space counterpart.

So yeah, Seamus proposal is not ideal in terms of flexibility, but it
does solve one common use-case with little complexity.

Again, I'm not 100% convinced either, so it's good to have this
discussion.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 1/1] fs/cpio: add option to manually specify file list
  2018-01-01 14:47         ` Thomas Petazzoni
@ 2018-02-06 14:55           ` Sam Voss
  2018-02-06 23:30           ` Arnout Vandecappelle
  1 sibling, 0 replies; 9+ messages in thread
From: Sam Voss @ 2018-02-06 14:55 UTC (permalink / raw)
  To: buildroot

All,

On Mon, Jan 1, 2018 at 3:47 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Mon, 1 Jan 2018 14:22:42 +0100, Yann E. MORIN wrote:
>
>> > So I'm inclined to just apply this, as it may be useful for some users.
>> > If you don't voice a concern within the next days, I'll apply.
>>
>> I don't like this much, in fact.
>>
>> In such a case, I would say that the initramfs filesystem is a different
>> system, and thus should be built with a different .config.
>>
>> Basically, what I do in this situation:
>>
>>   - have a first .config for kernel+modules + initramfs, and with a
>>     post-build script that:
>>     1. copy all the kernel modules "somewhere",
>>     2. trim the kernel modules that end up in the initramfs, to keep
>>        just what is needed to boot;
>>
>>   - have a second .config with just userland, plus a post-build script
>>     that vampirises the kernel modules from "somwehere" (as saved above)
>>
>> Of course, the "somewhere" is agreed on because I know it.

I'm not a fan of this method, because it introduces more complexity
than I think is worth for such a simple concept.

>>
>> Besides, this is much more flexible than what this patch proposes.
>>
>> Really, the core of the issue is to believe that the two systems are
>> one. They are not: they are two different systems.
>
> On the other hand, the initramfs is very often a subset of the complete
> root filesystem, and being able to generate an image of this subset
> directly from the same configuration as the full-blown system is
> definitely a nice thing.
>
> I agree that a separate configuration to build the initramfs is more
> flexible, but it also has its drawbacks (to handle kernel modules, as
> you mentioned, but also in terms of rebuilding the toolchain if you're
> using an internal toolchain).

We often use internal toolchain, and rebuilding it for a pure subset
seems excessive.

> One example where it might be annoying to
> have a separate configuration is if you have a single package that
> builds both a kernel module and a user-space counterpart.
>
> So yeah, Seamus proposal is not ideal in terms of flexibility, but it
> does solve one common use-case with little complexity.
>
> Again, I'm not 100% convinced either, so it's good to have this
> discussion.

Overall, I think this is a reasonable solution, however maybe not the
"best" solution.

Sam

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

* [Buildroot] [PATCH 1/1] fs/cpio: add option to manually specify file list
  2018-01-01 14:47         ` Thomas Petazzoni
  2018-02-06 14:55           ` Sam Voss
@ 2018-02-06 23:30           ` Arnout Vandecappelle
  1 sibling, 0 replies; 9+ messages in thread
From: Arnout Vandecappelle @ 2018-02-06 23:30 UTC (permalink / raw)
  To: buildroot



On 01-01-18 15:47, Thomas Petazzoni wrote:
[snip]
> So yeah, Seamus proposal is not ideal in terms of flexibility, but it
> does solve one common use-case with little complexity.

 I don't think it's a very common usecase. In fact, usually there will be some
additional files in the initramfs, e.g. to do a pivotroot.

 More importantly, though: the same result can be relatively easily achieved in
a POST_FAKEROOT_SCRIPT, and completely flexible.

 Regards,
 Arnout

> 
> Again, I'm not 100% convinced either, so it's good to have this
> discussion.
> 
> Thomas
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH 1/1] fs/cpio: add option to manually specify file list
  2017-10-26 19:16   ` [Buildroot] [PATCH 1/1] " Seamus Connor
  2017-10-26 20:13     ` Seamus Connor
  2018-01-01 11:54     ` Thomas Petazzoni
@ 2018-02-16 22:51     ` Thomas Petazzoni
  2 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2018-02-16 22:51 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 26 Oct 2017 12:16:27 -0700, Seamus Connor wrote:
> For some systems it may be desireable to have an initramfs that is
> smaller than the full root filesystem. This commit adds support for
> creating an initramfs based on a manually specified set of files. It is
> up to the user to define a sensible set of files. This file list could
> either be statically created, or it could be created as the result of a
> pre-fs hook script.
> 
> Signed-off-by: Seamus Connor <sconnor@lynx.com>

Considering the replies from both Yann and Arnout who were both not
very convinced by the approach, and Arnout's idea of using a fakeroot
script to achieve the same thing in a more flexible way, I've marked
this patch as Rejected in our patch tracking system.

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com

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

end of thread, other threads:[~2018-02-16 22:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Multiple root filesystems for single kernel/toolchain>
2017-10-26 19:16 ` [Buildroot] [PATCH 0/1] fs/cpio: add option to manually specify file list Seamus Connor
2017-10-26 19:16   ` [Buildroot] [PATCH 1/1] " Seamus Connor
2017-10-26 20:13     ` Seamus Connor
2018-01-01 11:54     ` Thomas Petazzoni
2018-01-01 13:22       ` Yann E. MORIN
2018-01-01 14:47         ` Thomas Petazzoni
2018-02-06 14:55           ` Sam Voss
2018-02-06 23:30           ` Arnout Vandecappelle
2018-02-16 22:51     ` Thomas Petazzoni

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.