[Buildroot] [PATCH 1/1] support/scripts/genimage.sh: allow setting rootpath from parameters.

Arnout Vandecappelle arnout at mind.be
Mon Sep 23 07:55:50 UTC 2019



On 23/09/2019 09:44, Raphaël Mélotte wrote:
> Hello Thomas,
> 
> On 9/18/19 10:42 AM, Thomas Petazzoni wrote:
>> Thanks for your contribution. While I understand the issue, I am not
>> sure we want to extend support/scripts/genimage.sh for this.
>> support/scripts/genimage.sh is meant to be a simple wrapper to
>> genimage, for the simple cases.
>>
>> For the more complicated cases, your post-image script should call the
>> genimage tool directly. support/scripts/genimage.sh was only added in
>> Buildroot to avoid duplicating for our zillion defconfigs the same
>> logic over and over again. I don't think it should be extended to cover
>> more complicated cases: such complicated cases should call genimage
>> directly.
>>
>> Arnout, Peter, any feedback on this ? I see that Raphael works at
>> Essensium, so I would imagine that perhaps this contribution has been
>> discussed with you Arnout before it was posted ? Or maybe not.
> 
> Thanks for your feedback :-)
> 
> We indeed discussed it briefly together with Arnout, and one of the points was
> that the current value for the rootpath option does not make a lot of sense (but
> then, after thinking about it, choosing a better default value would probably be
> better than keeping the current one and making it customizable).

 Yes, we could do

mkdir -p $(BINARIES_DIR)/rootpath
... --rootpath $(BINARIES_DIR)/rootpath

which would allow a post-build script to install everything it needs there.


> The problem is that if you make any use of the current rootpath option by adding
> a (non-empty) partition, it will contain data that is already contained in the
> rootfs generated by Buildroot (if you choose to use it) which is a bit confusing
> for users.
>
> You could choose to not use the Buildroot-generated rootfs and use only
> genimage, but then you lack the fixes that are applied to the rootfs (changing
> ownership, setting special attributes, ...) and your rootfs will be unusable.

 Yes, the *proper* approach would be to add a genimage filesystem, where you
supply a genimage.cfg file and it creates the required filesystems (so the ext4
is not created by Buildroot, but by genimage).


> Also, I agree with your point about keeping genimage.sh for the simple cases,
> but I don't think the cases where you would want to make use of rootpath are
> that complex: it could be for example that you want to use the default
> configuration for the board, but you just want to add a (non-empty) data
> partition next to the rootfs.

 The idea for genimage.sh was really to avoid requiring a post-image script for
each and every defconfig. It's not really supposed to be used outside of
Buildroot. That's why it's in support/scripts and not in utils.

 Regards,
 Arnout


> 
> However, if it didn't come up before, maybe it's not used as much as I would
> have thought...
> 
> 
> Kind regards,
> 
> Raphaël
> 



More information about the buildroot mailing list