All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package
@ 2016-05-04 14:38 Carlos Santos
  2016-05-05 20:09 ` Thomas Petazzoni
  2016-05-06 11:59 ` [Buildroot] [PATCH v2 " Carlos Santos
  0 siblings, 2 replies; 44+ messages in thread
From: Carlos Santos @ 2016-05-04 14:38 UTC (permalink / raw)
  To: buildroot

The mkimage utility needs dtc when the input is in Flat Image Trees (FIT)
format. If dtc is not available mkimage fails. Example:

    $ mkimage -f firmware.its firmware.im
    sh: dtc: command not found

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/uboot-tools/Config.in.host | 1 +
 package/uboot-tools/uboot-tools.mk | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host
index b5a42d9..5c44eaf 100644
--- a/package/uboot-tools/Config.in.host
+++ b/package/uboot-tools/Config.in.host
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_HOST_UBOOT_TOOLS
 	bool "host u-boot tools"
+	select BR2_PACKAGE_HOST_DTC
 	help
 	  Companion tools for Das U-Boot bootloader.
 
diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
index f47b3db..a07fbfa 100644
--- a/package/uboot-tools/uboot-tools.mk
+++ b/package/uboot-tools/uboot-tools.mk
@@ -65,6 +65,8 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS
 	$(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
 endef
 
+HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
+
 ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
 HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
 endif
-- 
2.5.5

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

* [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package
  2016-05-04 14:38 [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package Carlos Santos
@ 2016-05-05 20:09 ` Thomas Petazzoni
  2016-05-05 20:17   ` Peter Korsgaard
  2016-05-05 20:32   ` Carlos Santos
  2016-05-06 11:59 ` [Buildroot] [PATCH v2 " Carlos Santos
  1 sibling, 2 replies; 44+ messages in thread
From: Thomas Petazzoni @ 2016-05-05 20:09 UTC (permalink / raw)
  To: buildroot

Hello,

Thanks for this patch. See my comments below.

On Wed,  4 May 2016 11:38:29 -0300, Carlos Santos wrote:
> The mkimage utility needs dtc when the input is in Flat Image Trees (FIT)
> format. If dtc is not available mkimage fails. Example:
> 
>     $ mkimage -f firmware.its firmware.im
>     sh: dtc: command not found
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
>  package/uboot-tools/Config.in.host | 1 +
>  package/uboot-tools/uboot-tools.mk | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host
> index b5a42d9..5c44eaf 100644
> --- a/package/uboot-tools/Config.in.host
> +++ b/package/uboot-tools/Config.in.host
> @@ -1,5 +1,6 @@
>  config BR2_PACKAGE_HOST_UBOOT_TOOLS
>  	bool "host u-boot tools"
> +	select BR2_PACKAGE_HOST_DTC
>  	help
>  	  Companion tools for Das U-Boot bootloader.
>  
> diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
> index f47b3db..a07fbfa 100644
> --- a/package/uboot-tools/uboot-tools.mk
> +++ b/package/uboot-tools/uboot-tools.mk
> @@ -65,6 +65,8 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS
>  	$(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
>  endef
>  
> +HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc

I am not sure I like the idea of having host-uboot-tools always depend
on host-dtc, as it adds build time while host-dtc is only needed for
some specific use cases of mkimage (generating FIT images).

There are really three options I believe:

 (1) What you did, i.e have host-dtc as an unconditional dependency of
     host-uboot-tools. Everybody pays the price of building host-dtc
     even if it's not needed.

 (2) Add a sub-option to host-uboot-tools so that people can say "I
     need it with FIT image support", which will add host-dtc as a
     dependency.

 (3) Just do nothing, and let our users be smart enough to realize that
     when mkimage complains that dtc is missing, they should enable
     host-dtc.

Arnout, Yann, Peter?

Best regards,

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

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

* [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package
  2016-05-05 20:09 ` Thomas Petazzoni
@ 2016-05-05 20:17   ` Peter Korsgaard
  2016-05-05 21:40     ` Yann E. MORIN
  2016-05-05 20:32   ` Carlos Santos
  1 sibling, 1 reply; 44+ messages in thread
From: Peter Korsgaard @ 2016-05-05 20:17 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 >> +HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc

 > I am not sure I like the idea of having host-uboot-tools always depend
 > on host-dtc, as it adds build time while host-dtc is only needed for
 > some specific use cases of mkimage (generating FIT images).

 > There are really three options I believe:

 >  (1) What you did, i.e have host-dtc as an unconditional dependency of
 >      host-uboot-tools. Everybody pays the price of building host-dtc
 >      even if it's not needed.

 >  (2) Add a sub-option to host-uboot-tools so that people can say "I
 >      need it with FIT image support", which will add host-dtc as a
 >      dependency.

 >  (3) Just do nothing, and let our users be smart enough to realize that
 >      when mkimage complains that dtc is missing, they should enable
 >      host-dtc.

Agreed, it's quite similar to the issues with genimage and
dosfstools. Either option 2 or 3 sounds good to me.

-- 
Venlig hilsen,
Peter Korsgaard 

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

* [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package
  2016-05-05 20:09 ` Thomas Petazzoni
  2016-05-05 20:17   ` Peter Korsgaard
@ 2016-05-05 20:32   ` Carlos Santos
  2016-05-05 20:36     ` Thomas Petazzoni
  2016-05-05 21:27     ` Yann E. MORIN
  1 sibling, 2 replies; 44+ messages in thread
From: Carlos Santos @ 2016-05-05 20:32 UTC (permalink / raw)
  To: buildroot

> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: buildroot at buildroot.org, "Arnout Vandecappelle" <arnout@mind.be>, "Yann E. MORIN" <yann.morin.1998@free.fr>, "Peter
> Korsgaard" <peter@korsgaard.com>
> Sent: Thursday, May 5, 2016 5:09:01 PM
> Subject: Re: [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package

> Hello,
> 
> Thanks for this patch. See my comments below.
> 
> On Wed,  4 May 2016 11:38:29 -0300, Carlos Santos wrote:
>> The mkimage utility needs dtc when the input is in Flat Image Trees (FIT)
>> format. If dtc is not available mkimage fails. Example:
>> 
>>     $ mkimage -f firmware.its firmware.im
>>     sh: dtc: command not found
>> 
>> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
>> ---
>>  package/uboot-tools/Config.in.host | 1 +
>>  package/uboot-tools/uboot-tools.mk | 2 ++
>>  2 files changed, 3 insertions(+)
>> 
>> diff --git a/package/uboot-tools/Config.in.host
>> b/package/uboot-tools/Config.in.host
>> index b5a42d9..5c44eaf 100644
>> --- a/package/uboot-tools/Config.in.host
>> +++ b/package/uboot-tools/Config.in.host
>> @@ -1,5 +1,6 @@
>>  config BR2_PACKAGE_HOST_UBOOT_TOOLS
>>  	bool "host u-boot tools"
>> +	select BR2_PACKAGE_HOST_DTC
>>  	help
>>  	  Companion tools for Das U-Boot bootloader.
>>  
>> diff --git a/package/uboot-tools/uboot-tools.mk
>> b/package/uboot-tools/uboot-tools.mk
>> index f47b3db..a07fbfa 100644
>> --- a/package/uboot-tools/uboot-tools.mk
>> +++ b/package/uboot-tools/uboot-tools.mk
>> @@ -65,6 +65,8 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS
>>  	$(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
>>  endef
>>  
>> +HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
> 
> I am not sure I like the idea of having host-uboot-tools always depend
> on host-dtc, as it adds build time while host-dtc is only needed for
> some specific use cases of mkimage (generating FIT images).

The extra time needed to build host-dtc is negligible. This is what I get when I build it on my Core i5 notebook, including download time:

	$ time make host-dtc-dirclean host-dtc
	[...]
	real	0m8.387s
	user	0m7.552s
	sys	0m2.231s

> There are really three options I believe:
> 
> (1) What you did, i.e have host-dtc as an unconditional dependency of
>     host-uboot-tools. Everybody pays the price of building host-dtc
>     even if it's not needed.

It builds in a few seconds and does not have any impact on the size or performance of the target system, since it is a host tool.

> (2) Add a sub-option to host-uboot-tools so that people can say "I
>     need it with FIT image support", which will add host-dtc as a
>     dependency.

The user would spend more time choosing the extra option than downloading and building host-dtc.

> (3) Just do nothing, and let our users be smart enough to realize that
>     when mkimage complains that dtc is missing, they should enable
>     host-dtc.

The poor user would waste even more time attempting to find what broke the build.

Carlos Santos (Casantos)
DATACOM, P&D

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

* [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package
  2016-05-05 20:32   ` Carlos Santos
@ 2016-05-05 20:36     ` Thomas Petazzoni
  2016-05-05 21:27     ` Yann E. MORIN
  1 sibling, 0 replies; 44+ messages in thread
From: Thomas Petazzoni @ 2016-05-05 20:36 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 5 May 2016 17:32:51 -0300 (BRT), Carlos Santos wrote:

> The extra time needed to build host-dtc is negligible. This is what I get when I build it on my Core i5 notebook, including download time:
> 
> 	$ time make host-dtc-dirclean host-dtc
> 	[...]
> 	real	0m8.387s
> 	user	0m7.552s
> 	sys	0m2.231s

This is just the time for host-dtc. But host-dtc depends on host-bison
and host-flex, which in turn bring host-m4. In total, on my machine,
the time to build host-dtc from a clean build is almost one minute.

Not a big amount of time. But FIT images are not that common, and one
key aspect of Buildroot is its build time, which we try to keep low by
making sure we don't rebuild the whole world needlessly.

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

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

* [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package
  2016-05-05 20:32   ` Carlos Santos
  2016-05-05 20:36     ` Thomas Petazzoni
@ 2016-05-05 21:27     ` Yann E. MORIN
  2016-05-05 21:38       ` Thomas Petazzoni
  1 sibling, 1 reply; 44+ messages in thread
From: Yann E. MORIN @ 2016-05-05 21:27 UTC (permalink / raw)
  To: buildroot

Carlos, All,

On 2016-05-05 17:32 -0300, Carlos Santos spake thusly:
> > From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> > To: "Carlos Santos" <casantos@datacom.ind.br>
> > Cc: buildroot at buildroot.org, "Arnout Vandecappelle" <arnout@mind.be>, "Yann E. MORIN" <yann.morin.1998@free.fr>, "Peter
> > Korsgaard" <peter@korsgaard.com>
> > Sent: Thursday, May 5, 2016 5:09:01 PM
> > Subject: Re: [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package
> 
> > Hello,
> > 
> > Thanks for this patch. See my comments below.
> > 
> > On Wed,  4 May 2016 11:38:29 -0300, Carlos Santos wrote:
> >> The mkimage utility needs dtc when the input is in Flat Image Trees (FIT)
> >> format. If dtc is not available mkimage fails. Example:
> >> 
> >>     $ mkimage -f firmware.its firmware.im
> >>     sh: dtc: command not found
> >> 
> >> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> >> ---
> >>  package/uboot-tools/Config.in.host | 1 +
> >>  package/uboot-tools/uboot-tools.mk | 2 ++
> >>  2 files changed, 3 insertions(+)
> >> 
> >> diff --git a/package/uboot-tools/Config.in.host
> >> b/package/uboot-tools/Config.in.host
> >> index b5a42d9..5c44eaf 100644
> >> --- a/package/uboot-tools/Config.in.host
> >> +++ b/package/uboot-tools/Config.in.host
> >> @@ -1,5 +1,6 @@
> >>  config BR2_PACKAGE_HOST_UBOOT_TOOLS
> >>  	bool "host u-boot tools"
> >> +	select BR2_PACKAGE_HOST_DTC
> >>  	help
> >>  	  Companion tools for Das U-Boot bootloader.
> >>  
> >> diff --git a/package/uboot-tools/uboot-tools.mk
> >> b/package/uboot-tools/uboot-tools.mk
> >> index f47b3db..a07fbfa 100644
> >> --- a/package/uboot-tools/uboot-tools.mk
> >> +++ b/package/uboot-tools/uboot-tools.mk
> >> @@ -65,6 +65,8 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS
> >>  	$(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
> >>  endef
> >>  
> >> +HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
> > 
> > I am not sure I like the idea of having host-uboot-tools always depend
> > on host-dtc, as it adds build time while host-dtc is only needed for
> > some specific use cases of mkimage (generating FIT images).
> 
> The extra time needed to build host-dtc is negligible. This is what I
> get when I build it on my Core i5 notebook, including download time:
> 
> 	$ time make host-dtc-dirclean host-dtc
> 	[...]
> 	real	0m8.387s
> 	user	0m7.552s
> 	sys	0m2.231s

You forgot that dtc (and thus host-dtc) depends on host-bison and
host-flex, and host-bison pulls in host-m4. So you'd have to account for
the build time of those, too (but of course, only in case they were not
otherwise needed).

> > There are really three options I believe:
> > 
> > (1) What you did, i.e have host-dtc as an unconditional dependency of
> >     host-uboot-tools. Everybody pays the price of building host-dtc
> >     even if it's not needed.
> 
> It builds in a few seconds and does not have any impact on the size or
> performance of the target system, since it is a host tool.
> 
> > (2) Add a sub-option to host-uboot-tools so that people can say "I
> >     need it with FIT image support", which will add host-dtc as a
> >     dependency.
> 
> The user would spend more time choosing the extra option than
> downloading and building host-dtc.
> 
> > (3) Just do nothing, and let our users be smart enough to realize that
> >     when mkimage complains that dtc is missing, they should enable
> >     host-dtc.
> 
> The poor user would waste even more time attempting to find what broke
> the build.

Right, I'm not too fond of proposal #3 either.

I thought we were striving to "make it work out of the box" as much as
possible, goal that option #3 completely defeats.

Option #2 is not much better however, since it would probably not be
easy to match the build failure to that option...

Option #1 will make it just work in every cases, at the expense of a bit
longer build time (mostly because of dependencies of host-dtc).

However, given how pervasive DTC is becoming, I think it would kinda
make sense to have a mkimage that supports DT every time (I hope that
adding DT support to mkimage does not remove functionality, does it?)

So my vote would be with option #1.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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] 44+ messages in thread

* [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package
  2016-05-05 21:27     ` Yann E. MORIN
@ 2016-05-05 21:38       ` Thomas Petazzoni
  2016-05-05 21:44         ` Yann E. MORIN
  0 siblings, 1 reply; 44+ messages in thread
From: Thomas Petazzoni @ 2016-05-05 21:38 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 5 May 2016 23:27:16 +0200, Yann E. MORIN wrote:

> However, given how pervasive DTC is becoming, I think it would kinda
> make sense to have a mkimage that supports DT every time (I hope that
> adding DT support to mkimage does not remove functionality, does it?)

Read again in which cases mkimage needs host-dtc. It is *NOT* related
to Device Tree at all. It is related to the FIT image format, which
happens to rely on the Device Tree syntax and compiler, but has
*nothing* to do with the Device Tree being used by the kernel to get a
description of the HW.

Best regards,

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

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

* [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package
  2016-05-05 20:17   ` Peter Korsgaard
@ 2016-05-05 21:40     ` Yann E. MORIN
  0 siblings, 0 replies; 44+ messages in thread
From: Yann E. MORIN @ 2016-05-05 21:40 UTC (permalink / raw)
  To: buildroot

Peter, All,

On 2016-05-05 22:17 +0200, Peter Korsgaard spake thusly:
> >>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
>  >> +HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
> 
>  > I am not sure I like the idea of having host-uboot-tools always depend
>  > on host-dtc, as it adds build time while host-dtc is only needed for
>  > some specific use cases of mkimage (generating FIT images).
> 
>  > There are really three options I believe:
> 
>  >  (1) What you did, i.e have host-dtc as an unconditional dependency of
>  >      host-uboot-tools. Everybody pays the price of building host-dtc
>  >      even if it's not needed.
> 
>  >  (2) Add a sub-option to host-uboot-tools so that people can say "I
>  >      need it with FIT image support", which will add host-dtc as a
>  >      dependency.
> 
>  >  (3) Just do nothing, and let our users be smart enough to realize that
>  >      when mkimage complains that dtc is missing, they should enable
>  >      host-dtc.
> 
> Agreed, it's quite similar to the issues with genimage and
> dosfstools.

I'm always a bit uneasy speaking about genimage, as I don't use it.

However, I would contend that we should try to provide as much a "works
out of the box" experience as possible, so I'd lean on the side of
always enable optional packages to make genimage always happy.

But then, genimage being so versatile, it would be perfectly possible to
ask it to build all sorts of filesystems, or aggregate all sorts of
blobs (e.g. DTB), and so on. Should we forcibly enable all those tools
when genimage is enabled?

I guess not.

Granted, most of the boards we currently have use a VFAT partition
(except those from boundary devices, the wandboard and the
a20_olinuxino, i.e. 4 boards).

So, I'm completely undecided for genimage.

On the one side, there the "out of the box" experience; on the other
side, there's the build time...

But dosfstools has no dependency, and it does build quite fast, so we
could at least enable that one...

> Either option 2 or 3 sounds good to me.

Hmm... See my other reply for why I think option #1 is better. ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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] 44+ messages in thread

* [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package
  2016-05-05 21:38       ` Thomas Petazzoni
@ 2016-05-05 21:44         ` Yann E. MORIN
  2016-05-06 12:02           ` Carlos Santos
  0 siblings, 1 reply; 44+ messages in thread
From: Yann E. MORIN @ 2016-05-05 21:44 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2016-05-05 23:38 +0200, Thomas Petazzoni spake thusly:
> On Thu, 5 May 2016 23:27:16 +0200, Yann E. MORIN wrote:
> > However, given how pervasive DTC is becoming, I think it would kinda
> > make sense to have a mkimage that supports DT every time (I hope that
> > adding DT support to mkimage does not remove functionality, does it?)
> 
> Read again in which cases mkimage needs host-dtc. It is *NOT* related
> to Device Tree at all. It is related to the FIT image format, which
> happens to rely on the Device Tree syntax and compiler, but has
> *nothing* to do with the Device Tree being used by the kernel to get a
> description of the HW.

Oh, OK.

/me unconsciously associated dtc with generating DTB. But if it can be
used for other things as well...

Then option 2 is the best solution IMHO.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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] 44+ messages in thread

* [Buildroot] [PATCH v2 1/1] uboot-tools: add missing dependency on host-dtc for the host package
  2016-05-04 14:38 [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package Carlos Santos
  2016-05-05 20:09 ` Thomas Petazzoni
@ 2016-05-06 11:59 ` Carlos Santos
  2016-05-06 13:25   ` Thomas Petazzoni
  2016-05-08 19:46   ` [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional Carlos Santos
  1 sibling, 2 replies; 44+ messages in thread
From: Carlos Santos @ 2016-05-06 11:59 UTC (permalink / raw)
  To: buildroot

The mkimage utility needs dtc when support for Flat Image Trees (FIT)
is enabled. If dtc is not available mkimage may fail. Example:

    $ mkimage -f firmware.its firmware.im
    sh: dtc: command not found

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/uboot-tools/Config.in      | 16 +++++++++++++---
 package/uboot-tools/Config.in.host |  1 +
 package/uboot-tools/uboot-tools.mk |  5 +++++
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/package/uboot-tools/Config.in b/package/uboot-tools/Config.in
index aca310b..4622f6b 100644
--- a/package/uboot-tools/Config.in
+++ b/package/uboot-tools/Config.in
@@ -13,10 +13,22 @@ config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
 	  The mkimage tool from Das U-Boot bootloader, which allows
 	  generation of U-Boot images in various formats.
 
-if BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SUPPORT
+	bool "Flat Image Trees (FIT) support"
+	depends on BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+	select BR2_PACKAGE_HOST_DTC
+	help
+	  Enables support for FIT Signature Verification.
+
+	  This option allows to boot the new uImage structrure,
+	  Flattened Image Tree.  FIT is formally a FDT, which can include
+	  images of various types (kernel, FDT blob, ramdisk, etc.)
+	  in a single blob.  To boot this new uImage structure,
+	  pass the address of the blob to the "bootm" command.
 
 config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
 	bool "FIT signature verification support"
+	depends on BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SUPPORT
 	select BR2_PACKAGE_OPENSSL
 	help
 	  Enables support for FIT Signature Verification.
@@ -36,8 +48,6 @@ config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
 	  libcrypto, and possibly GPL/OpenSSL licensing
 	  incompatibility issues.
 
-endif
-
 config BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE
 	bool "mkenvimage"
 	help
diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host
index b5a42d9..5c44eaf 100644
--- a/package/uboot-tools/Config.in.host
+++ b/package/uboot-tools/Config.in.host
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_HOST_UBOOT_TOOLS
 	bool "host u-boot tools"
+	select BR2_PACKAGE_HOST_DTC
 	help
 	  Companion tools for Das U-Boot bootloader.
 
diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
index f47b3db..9bb2b54 100644
--- a/package/uboot-tools/uboot-tools.mk
+++ b/package/uboot-tools/uboot-tools.mk
@@ -65,6 +65,10 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS
 	$(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
 endef
 
+ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),y)
+HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
+endif
+
 ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
 HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
 endif
@@ -76,6 +80,7 @@ endef
 
 define HOST_UBOOT_TOOLS_BUILD_CMDS
 	$(MAKE1) -C $(@D) 			\
+		CONFIG_FIT=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SUPPORT) \
 		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \
 		HOSTCC="$(HOSTCC)"		\
 		HOSTCFLAGS="$(HOST_CFLAGS)"	\
-- 
2.5.5

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

* [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package
  2016-05-05 21:44         ` Yann E. MORIN
@ 2016-05-06 12:02           ` Carlos Santos
  0 siblings, 0 replies; 44+ messages in thread
From: Carlos Santos @ 2016-05-06 12:02 UTC (permalink / raw)
  To: buildroot

> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> To: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> Cc: "Carlos Santos" <casantos@datacom.ind.br>, buildroot at buildroot.org, "Arnout Vandecappelle" <arnout@mind.be>, "Peter
> Korsgaard" <peter@korsgaard.com>
> Sent: Thursday, May 5, 2016 6:44:32 PM
> Subject: Re: [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package

> Thomas, All,
> 
> On 2016-05-05 23:38 +0200, Thomas Petazzoni spake thusly:
>> On Thu, 5 May 2016 23:27:16 +0200, Yann E. MORIN wrote:
>> > However, given how pervasive DTC is becoming, I think it would kinda
>> > make sense to have a mkimage that supports DT every time (I hope that
>> > adding DT support to mkimage does not remove functionality, does it?)
>> 
>> Read again in which cases mkimage needs host-dtc. It is *NOT* related
>> to Device Tree at all. It is related to the FIT image format, which
>> happens to rely on the Device Tree syntax and compiler, but has
>> *nothing* to do with the Device Tree being used by the kernel to get a
>> description of the HW.
> 
> Oh, OK.
> 
> /me unconsciously associated dtc with generating DTB. But if it can be
> used for other things as well...
> 
> Then option 2 is the best solution IMHO.

Done (see patch v2).

Carlos Santos (Casantos)
DATACOM, P&D

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

* [Buildroot] [PATCH v2 1/1] uboot-tools: add missing dependency on host-dtc for the host package
  2016-05-06 11:59 ` [Buildroot] [PATCH v2 " Carlos Santos
@ 2016-05-06 13:25   ` Thomas Petazzoni
  2016-05-08 19:39     ` Carlos Santos
  2016-05-08 19:46   ` [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional Carlos Santos
  1 sibling, 1 reply; 44+ messages in thread
From: Thomas Petazzoni @ 2016-05-06 13:25 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri,  6 May 2016 08:59:13 -0300, Carlos Santos wrote:
> The mkimage utility needs dtc when support for Flat Image Trees (FIT)
> is enabled. If dtc is not available mkimage may fail. Example:
> 
>     $ mkimage -f firmware.its firmware.im
>     sh: dtc: command not found
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>

Thanks for this new version. Unfortunately, this patch is incorrect, as
it badly mixes things for the target version of uboot-tools with things
for the host version of uboot-tools.

> -if BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE

Please keep this "if BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE" rather than using
a depends on.

> +config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SUPPORT

This option affects the *target* version of uboot-tools.

> +	bool "Flat Image Trees (FIT) support"
> +	depends on BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
> +	select BR2_PACKAGE_HOST_DTC

So selecting host-dtc here doesn't make any sense (unless you need
host-dtc to *build* uboot-tools for the target, but my understand is
that what you need is dtc on the target!).

> +	help
> +	  Enables support for FIT Signature Verification.
> +
> +	  This option allows to boot the new uImage structrure,
> +	  Flattened Image Tree.  FIT is formally a FDT, which can include
> +	  images of various types (kernel, FDT blob, ramdisk, etc.)
> +	  in a single blob.  To boot this new uImage structure,
> +	  pass the address of the blob to the "bootm" command.
>  
>  config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
>  	bool "FIT signature verification support"
> +	depends on BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SUPPORT
>  	select BR2_PACKAGE_OPENSSL
>  	help
>  	  Enables support for FIT Signature Verification.
> @@ -36,8 +48,6 @@ config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
>  	  libcrypto, and possibly GPL/OpenSSL licensing
>  	  incompatibility issues.
>  
> -endif
> -
>  config BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE
>  	bool "mkenvimage"
>  	help
> diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host
> index b5a42d9..5c44eaf 100644
> --- a/package/uboot-tools/Config.in.host
> +++ b/package/uboot-tools/Config.in.host
> @@ -1,5 +1,6 @@
>  config BR2_PACKAGE_HOST_UBOOT_TOOLS
>  	bool "host u-boot tools"
> +	select BR2_PACKAGE_HOST_DTC

So this has not changed since v1, and was specifically the problem that
we discussed.

>  	help
>  	  Companion tools for Das U-Boot bootloader.
>  
> diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
> index f47b3db..9bb2b54 100644
> --- a/package/uboot-tools/uboot-tools.mk
> +++ b/package/uboot-tools/uboot-tools.mk
> @@ -65,6 +65,10 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS
>  	$(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
>  endef
>  
> +ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),y)
> +HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc

Option BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT does not exist, so this
piece of code is useless.

> +endif
> +
>  ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
>  HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
>  endif
> @@ -76,6 +80,7 @@ endef
>  
>  define HOST_UBOOT_TOOLS_BUILD_CMDS
>  	$(MAKE1) -C $(@D) 			\
> +		CONFIG_FIT=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SUPPORT) \

And here you're using a target option
(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SUPPORT) to configure the build of
the host version of uboot-tools.

Note that there is already something wrong in the package:

define HOST_UBOOT_TOOLS_BUILD_CMDS
        $(MAKE1) -C $(@D)                       \
                CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \

should be:

define HOST_UBOOT_TOOLS_BUILD_CMDS
        $(MAKE1) -C $(@D)                       \
                CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_HOST_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \

What you want to do is:

 *) One patch that fixes the existing bug in uboot-tools.mk that I
    mentioned.

 *) One patch that adds an option
    BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT, which will 1/ add host-dtc
    to HOST_UBOOT_TOOLS_DEPENDENCIES and 2/ pass
    CONFIG_FIT=$(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT) in
    HOST_UBOOT_TOOLS_BUILD_CMDS. This will solve the problem for the
    host version of uboot-tools.

 *) One patch that adds an option BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT,
    which will 1/ add dtc to UBOOT_TOOLS_DEPENDENCIES and 2/ pass
    CONFIG_FIT=$(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT)  in
    UBOOT_TOOLS_BUILD_CMDS. This will solve the problem for the target
    version of uboot-tools.

Thanks!

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

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

* [Buildroot] [PATCH v2 1/1] uboot-tools: add missing dependency on host-dtc for the host package
  2016-05-06 13:25   ` Thomas Petazzoni
@ 2016-05-08 19:39     ` Carlos Santos
  0 siblings, 0 replies; 44+ messages in thread
From: Carlos Santos @ 2016-05-08 19:39 UTC (permalink / raw)
  To: buildroot

> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: buildroot at buildroot.org
> Sent: Friday, May 6, 2016 10:25:39 AM
> Subject: Re: [Buildroot] [PATCH v2 1/1] uboot-tools: add missing dependency on host-dtc for the host package

> Hello,
> 
> On Fri,  6 May 2016 08:59:13 -0300, Carlos Santos wrote:
>> The mkimage utility needs dtc when support for Flat Image Trees (FIT)
>> is enabled. If dtc is not available mkimage may fail. Example:
>> 
>>     $ mkimage -f firmware.its firmware.im
>>     sh: dtc: command not found
>> 
>> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> 
> Thanks for this new version. Unfortunately, this patch is incorrect, as
> it badly mixes things for the target version of uboot-tools with things
> for the host version of uboot-tools.

Thanks for the review. After analyzing the package deeply I noticed that it has additional problems and that U-Boot needs an additional patch to allow turning FIT support on/off. I will send a new patch to solve these problems.

Carlos Santos (Casantos)
DATACOM, P&D

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

* [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional
  2016-05-06 11:59 ` [Buildroot] [PATCH v2 " Carlos Santos
  2016-05-06 13:25   ` Thomas Petazzoni
@ 2016-05-08 19:46   ` Carlos Santos
  2016-05-08 19:46     ` Carlos Santos
  2016-06-01 14:39     ` [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT) Carlos Santos
  1 sibling, 2 replies; 44+ messages in thread
From: Carlos Santos @ 2016-05-08 19:46 UTC (permalink / raw)
  To: buildroot

Fix several issues regarding the support for Flat Image Trees (FIT).

- Add a dependence on the dtc utilities because mkimage needs it when
  FIT is enabled; otherwise mkimage fails like this:

    $ mkimage -f firmware.its firmware.im
    sh: dtc: command not found

- Turn FIT support an independent switch for host and target controlled
  by BR2_PACKAGE_{HOST_,}UBOOT_TOOLS_FIT_SUPPORT

- Dettach FIT signature support from mkimage installation by means of a
  BR2_PACKAGE_{HOST_,}UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT, subordinated to
  ...TOOLS_FIT_SUPPORT.

- Improve the descriptions of the knobs to install mkimage, mkenvimage,
  dumpimage, fw_printenv and fw_setenv.

- Use $(TARGET_STRIP) to control stripping of the target utilities,
  otherwise they are always stripped.

- Add a patch to really allow turning FIT support on/off, which was not
  possible due to bugs in the code and in the tools Makefile.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>

---

Changes v2 -> v3:

Turns out that the state of uboot-tools was even worst than initially
thought. Due to some mistakes in the source code, it was not possible
to really turn FIT support off. This required an additional patch that
fixes the code and the tools Makefile. This patch was already sent
upstream.

Moreover the package had many errors that needed to be fixed, as
described above.

Changes v1 -> v2:

First attempt to allow turning FIT support on/off.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 .../0004-Make-FIT-support-really-optional.patch    | 93 ++++++++++++++++++++++
 package/uboot-tools/Config.in                      | 47 ++++++++---
 package/uboot-tools/Config.in.host                 | 16 ++++
 package/uboot-tools/uboot-tools.mk                 | 35 +++++---
 4 files changed, 168 insertions(+), 23 deletions(-)
 create mode 100644 package/uboot-tools/0004-Make-FIT-support-really-optional.patch

diff --git a/package/uboot-tools/0004-Make-FIT-support-really-optional.patch b/package/uboot-tools/0004-Make-FIT-support-really-optional.patch
new file mode 100644
index 0000000..d8b8680
--- /dev/null
+++ b/package/uboot-tools/0004-Make-FIT-support-really-optional.patch
@@ -0,0 +1,93 @@
+From 1c0040aeed5d4dc17a549ad8a1a1c3e889f74e98 Mon Sep 17 00:00:00 2001
+From: Carlos Santos <casantos@datacom.ind.br>
+Date: Sun, 8 May 2016 11:11:39 -0300
+Subject: [PATCH 4/4] Make FIT support really optional
+
+Due to some mistakes in the source code, it was not possible to really
+turn FIT support off. This commit fixes the problem by means of the
+following changes:
+
+- Enclose "bootm_host_load_image" and "bootm_host_load_images" between
+  checks for CONFIG_FIT_SIGNATURE, in common/bootm.c.
+
+- Enclose the declaration of "bootm_host_load_images" between checks for
+  CONFIG_FIT_SIGNATURE, in common/bootm.h.
+
+- Condition the compilation and linking of fit_common.o fit_image.o
+  image-host.o common/image-fit.o to CONFIG_FIT=y, in tools/Makefile.
+
+Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
+---
+ common/bootm.c  | 2 ++
+ include/bootm.h | 2 ++
+ tools/Makefile  | 6 ++----
+ 3 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/common/bootm.c b/common/bootm.c
+index c965326..ab477ba 100644
+--- a/common/bootm.c
++++ b/common/bootm.c
+@@ -891,6 +891,7 @@ void memmove_wd(void *to, void *from, size_t len, ulong chunksz)
+ 	memmove(to, from, len);
+ }
+ 
++#if defined(CONFIG_FIT_SIGNATURE)
+ static int bootm_host_load_image(const void *fit, int req_image_type)
+ {
+ 	const char *fit_uname_config = NULL;
+@@ -955,5 +956,6 @@ int bootm_host_load_images(const void *fit, int cfg_noffset)
+ 	/* Return the first error we found */
+ 	return err;
+ }
++#endif
+ 
+ #endif /* ndef USE_HOSTCC */
+diff --git a/include/bootm.h b/include/bootm.h
+index 4981377..94d62a1 100644
+--- a/include/bootm.h
++++ b/include/bootm.h
+@@ -41,7 +41,9 @@ void lynxkdi_boot(image_header_t *hdr);
+ 
+ boot_os_fn *bootm_os_get_boot_func(int os);
+ 
++#if defined(CONFIG_FIT_SIGNATURE)
+ int bootm_host_load_images(const void *fit, int cfg_noffset);
++#endif
+ 
+ int boot_selected_os(int argc, char * const argv[], int state,
+ 		     bootm_headers_t *images, boot_os_fn *boot_fn);
+diff --git a/tools/Makefile b/tools/Makefile
+index da50e1b..0a3d279 100644
+--- a/tools/Makefile
++++ b/tools/Makefile
+@@ -54,6 +54,7 @@ mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o
+ hostprogs-y += dumpimage mkimage
+ hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign
+ 
++FIT_OBJS-$(CONFIG_FIT) := fit_common.o fit_image.o image-host.o common/image-fit.o
+ FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o
+ # Flattened device tree objects
+ LIBFDT_OBJS := $(addprefix lib/libfdt/, \
+@@ -68,18 +69,15 @@ ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o
+ # common objs for dumpimage and mkimage
+ dumpimage-mkimage-objs := aisimage.o \
+ 			atmelimage.o \
++			$(FIT_OBJS-y) \
+ 			$(FIT_SIG_OBJS-y) \
+ 			common/bootm.o \
+ 			lib/crc32.o \
+ 			default_image.o \
+ 			lib/fdtdec_common.o \
+ 			lib/fdtdec.o \
+-			fit_common.o \
+-			fit_image.o \
+ 			gpimage.o \
+ 			gpimage-common.o \
+-			common/image-fit.o \
+-			image-host.o \
+ 			common/image.o \
+ 			imagetool.o \
+ 			imximage.o \
+-- 
+2.7.4
+
diff --git a/package/uboot-tools/Config.in b/package/uboot-tools/Config.in
index aca310b..eddc39f 100644
--- a/package/uboot-tools/Config.in
+++ b/package/uboot-tools/Config.in
@@ -7,15 +7,22 @@ config BR2_PACKAGE_UBOOT_TOOLS
 
 if BR2_PACKAGE_UBOOT_TOOLS
 
-config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
-	bool "mkimage"
+config BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
+	bool "Flattened Image Tree (FIT) support"
+	select BR2_PACKAGE_DTC
+	select BR2_PACKAGE_DTC_PROGRAMS
 	help
-	  The mkimage tool from Das U-Boot bootloader, which allows
-	  generation of U-Boot images in various formats.
+	  Enables support for Flattened Image Tree (FIT).
 
-if BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+	  This option allows to boot the new uImage structrure,
+	  Flattened Image Tree.  FIT is formally a FDT, which can include
+	  images of various types (kernel, FDT blob, ramdisk, etc.)
+	  in a single blob.  To boot this new uImage structure,
+	  pass the address of the blob to the "bootm" command.
 
-config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
+if BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
+
+config BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 	bool "FIT signature verification support"
 	select BR2_PACKAGE_OPENSSL
 	help
@@ -38,25 +45,39 @@ config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
 
 endif
 
+config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+	bool "mkimage"
+	help
+	  Install the mkimage tool on the target system
+
+	  The mkimage tool from Das U-Boot bootloader, which allows
+	  generation of U-Boot images in various formats.
+
 config BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE
 	bool "mkenvimage"
 	help
+	  Install the mkenvimage tool on the target system
+
 	  The mkenvimage tool from Das U-Boot bootloader, which allows
 	  generation of a valid binary environment image from a text file
 	  describing the key=value pairs of the environment.
 
+config BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE
+	bool "dumpimage"
+	help
+	  Install the dumpimage tool on the target system
+
+	  The dumpimage tool from Das U-Boot bootloader, which allows
+	  extraction of data from U-Boot images.
+
 config BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
 	bool "fw_printenv"
 	default y
 	help
-	  The fw_printenv / fw_setenv tools from Das U-Boot
+	  Install the fw_printenv / fw_setenv tools on the target system
+
+	  The fw_printenv and fw_setenv tools from Das U-Boot
 	  bootloader, which allows access to the U-Boot environment
 	  from Linux.
 
-config BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE
-	bool "dumpimage"
-	help
-	  The dumpimage tool from Das U-Boot bootloader, which allows
-	  extraction of data from U-Boot images.
-
 endif
diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host
index b5a42d9..292cc21 100644
--- a/package/uboot-tools/Config.in.host
+++ b/package/uboot-tools/Config.in.host
@@ -7,6 +7,20 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS
 
 if BR2_PACKAGE_HOST_UBOOT_TOOLS
 
+config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+	bool "Flattened Image Tree (FIT) support"
+	select BR2_PACKAGE_HOST_DTC
+	help
+	  Enables support for Flattened Image Tree (FIT).
+
+	  This option allows to boot the new uImage structrure,
+	  Flattened Image Tree.  FIT is formally a FDT, which can include
+	  images of various types (kernel, FDT blob, ramdisk, etc.)
+	  in a single blob.  To boot this new uImage structure,
+	  pass the address of the blob to the "bootm" command.
+
+if BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+
 config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 	bool "FIT signature verification support"
 	help
@@ -24,3 +38,5 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 	  be verified in this way.
 
 endif
+
+endif
diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
index d1ebd6f..a21cda5 100644
--- a/package/uboot-tools/uboot-tools.mk
+++ b/package/uboot-tools/uboot-tools.mk
@@ -16,18 +16,30 @@ define UBOOT_TOOLS_CONFIGURE_CMDS
 	touch $(@D)/include/config/auto.conf
 endef
 
+ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),y)
+UBOOT_TOOLS_CONFIG_FIT = CONFIG_FIT=$(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT)
+UBOOT_TOOLS_DEPENDENCIES += dtc
+ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
+UBOOT_TOOLS_CONFIG_FIT_SIGNATURE = CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT)
+UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
+endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
+endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
+
 define UBOOT_TOOLS_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 	\
 		CROSS_COMPILE="$(TARGET_CROSS)"	\
 		CFLAGS="$(TARGET_CFLAGS)"	\
 		LDFLAGS="$(TARGET_LDFLAGS)"	\
+		STRIP=$(TARGET_STRIP)		\
 		CROSS_BUILD_TOOLS=y		\
-		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \
+		$(UBOOT_TOOLS_CONFIG_FIT)	\
+		$(UBOOT_TOOLS_CONFIG_FIT_SIGNATURE) \
 		tools-only
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 	\
 		CROSS_COMPILE="$(TARGET_CROSS)"	\
 		CFLAGS="$(TARGET_CFLAGS)"	\
 		LDFLAGS="$(TARGET_LDFLAGS)"	\
+		STRIP=$(TARGET_STRIP)		\
 		env no-dot-config-targets=env
 endef
 
@@ -35,10 +47,7 @@ ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE),y)
 define UBOOT_TOOLS_INSTALL_MKIMAGE
 	$(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(TARGET_DIR)/usr/bin/mkimage
 endef
-ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT),y)
-UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
-endif # BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
-endif # BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+endif
 
 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE),y)
 define UBOOT_TOOLS_INSTALL_MKENVIMAGE
@@ -74,18 +83,24 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS
 	$(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
 endef
 
-ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
-HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
-endif
-
 define HOST_UBOOT_TOOLS_CONFIGURE_CMDS
 	mkdir -p $(@D)/include/config
 	touch $(@D)/include/config/auto.conf
 endef
 
+ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),y)
+HOST_UBOOT_TOOLS_CONFIG_FIT = CONFIG_FIT=$(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT)
+HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
+ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
+HOST_UBOOT_TOOLS_CONFIG_FIT_SIGNATURE = CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT)
+HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
+endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
+endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+
 define HOST_UBOOT_TOOLS_BUILD_CMDS
 	$(MAKE1) -C $(@D) 			\
-		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \
+		$(HOST_UBOOT_TOOLS_CONFIG_FIT)	\
+		$(HOST_UBOOT_TOOLS_CONFIG_FIT_SIGNATURE) \
 		HOSTCC="$(HOSTCC)"		\
 		HOSTCFLAGS="$(HOST_CFLAGS)"	\
 		HOSTLDFLAGS="$(HOST_LDFLAGS)"	\
-- 
2.7.4

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

* [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional
  2016-05-08 19:46   ` [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional Carlos Santos
@ 2016-05-08 19:46     ` Carlos Santos
  2016-05-28 13:07       ` Thomas Petazzoni
  2016-06-01 14:39     ` [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT) Carlos Santos
  1 sibling, 1 reply; 44+ messages in thread
From: Carlos Santos @ 2016-05-08 19:46 UTC (permalink / raw)
  To: buildroot

Fix several issues regarding the support for Flat Image Trees (FIT).

- Add a dependence on the dtc utilities because mkimage needs it when
  FIT is enabled; otherwise mkimage fails like this:

    $ mkimage -f firmware.its firmware.im
    sh: dtc: command not found

- Turn FIT support an independent switch for host and target controlled
  by BR2_PACKAGE_{HOST_,}UBOOT_TOOLS_FIT_SUPPORT

- Dettach FIT signature support from mkimage installation by means of a
  BR2_PACKAGE_{HOST_,}UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT, subordinated to
  ...TOOLS_FIT_SUPPORT.

- Improve the descriptions of the knobs to install mkimage, mkenvimage,
  dumpimage, fw_printenv and fw_setenv.

- Use $(TARGET_STRIP) to control stripping of the target utilities,
  otherwise they are always stripped.

- Add a patch to really allow turning FIT support on/off, which was not
  possible due to bugs in the code and in the tools Makefile.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>

---

Changes v2 -> v3:

Turns out that the state of uboot-tools was even worst than initially
thought. Due to some mistakes in the source code, it was not possible
to really turn FIT support off. This required an additional patch that
fixes the code and the tools Makefile. This patch was already sent
upstream.

Moreover the package had many errors that needed to be fixed, as
described above.

Changes v1 -> v2:

First attempt to allow turning FIT support on/off.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 .../0004-Make-FIT-support-really-optional.patch    | 93 ++++++++++++++++++++++
 package/uboot-tools/Config.in                      | 47 ++++++++---
 package/uboot-tools/Config.in.host                 | 16 ++++
 package/uboot-tools/uboot-tools.mk                 | 35 +++++---
 4 files changed, 168 insertions(+), 23 deletions(-)
 create mode 100644 package/uboot-tools/0004-Make-FIT-support-really-optional.patch

diff --git a/package/uboot-tools/0004-Make-FIT-support-really-optional.patch b/package/uboot-tools/0004-Make-FIT-support-really-optional.patch
new file mode 100644
index 0000000..d8b8680
--- /dev/null
+++ b/package/uboot-tools/0004-Make-FIT-support-really-optional.patch
@@ -0,0 +1,93 @@
+From 1c0040aeed5d4dc17a549ad8a1a1c3e889f74e98 Mon Sep 17 00:00:00 2001
+From: Carlos Santos <casantos@datacom.ind.br>
+Date: Sun, 8 May 2016 11:11:39 -0300
+Subject: [PATCH 4/4] Make FIT support really optional
+
+Due to some mistakes in the source code, it was not possible to really
+turn FIT support off. This commit fixes the problem by means of the
+following changes:
+
+- Enclose "bootm_host_load_image" and "bootm_host_load_images" between
+  checks for CONFIG_FIT_SIGNATURE, in common/bootm.c.
+
+- Enclose the declaration of "bootm_host_load_images" between checks for
+  CONFIG_FIT_SIGNATURE, in common/bootm.h.
+
+- Condition the compilation and linking of fit_common.o fit_image.o
+  image-host.o common/image-fit.o to CONFIG_FIT=y, in tools/Makefile.
+
+Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
+---
+ common/bootm.c  | 2 ++
+ include/bootm.h | 2 ++
+ tools/Makefile  | 6 ++----
+ 3 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/common/bootm.c b/common/bootm.c
+index c965326..ab477ba 100644
+--- a/common/bootm.c
++++ b/common/bootm.c
+@@ -891,6 +891,7 @@ void memmove_wd(void *to, void *from, size_t len, ulong chunksz)
+ 	memmove(to, from, len);
+ }
+ 
++#if defined(CONFIG_FIT_SIGNATURE)
+ static int bootm_host_load_image(const void *fit, int req_image_type)
+ {
+ 	const char *fit_uname_config = NULL;
+@@ -955,5 +956,6 @@ int bootm_host_load_images(const void *fit, int cfg_noffset)
+ 	/* Return the first error we found */
+ 	return err;
+ }
++#endif
+ 
+ #endif /* ndef USE_HOSTCC */
+diff --git a/include/bootm.h b/include/bootm.h
+index 4981377..94d62a1 100644
+--- a/include/bootm.h
++++ b/include/bootm.h
+@@ -41,7 +41,9 @@ void lynxkdi_boot(image_header_t *hdr);
+ 
+ boot_os_fn *bootm_os_get_boot_func(int os);
+ 
++#if defined(CONFIG_FIT_SIGNATURE)
+ int bootm_host_load_images(const void *fit, int cfg_noffset);
++#endif
+ 
+ int boot_selected_os(int argc, char * const argv[], int state,
+ 		     bootm_headers_t *images, boot_os_fn *boot_fn);
+diff --git a/tools/Makefile b/tools/Makefile
+index da50e1b..0a3d279 100644
+--- a/tools/Makefile
++++ b/tools/Makefile
+@@ -54,6 +54,7 @@ mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o
+ hostprogs-y += dumpimage mkimage
+ hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign
+ 
++FIT_OBJS-$(CONFIG_FIT) := fit_common.o fit_image.o image-host.o common/image-fit.o
+ FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o
+ # Flattened device tree objects
+ LIBFDT_OBJS := $(addprefix lib/libfdt/, \
+@@ -68,18 +69,15 @@ ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o
+ # common objs for dumpimage and mkimage
+ dumpimage-mkimage-objs := aisimage.o \
+ 			atmelimage.o \
++			$(FIT_OBJS-y) \
+ 			$(FIT_SIG_OBJS-y) \
+ 			common/bootm.o \
+ 			lib/crc32.o \
+ 			default_image.o \
+ 			lib/fdtdec_common.o \
+ 			lib/fdtdec.o \
+-			fit_common.o \
+-			fit_image.o \
+ 			gpimage.o \
+ 			gpimage-common.o \
+-			common/image-fit.o \
+-			image-host.o \
+ 			common/image.o \
+ 			imagetool.o \
+ 			imximage.o \
+-- 
+2.7.4
+
diff --git a/package/uboot-tools/Config.in b/package/uboot-tools/Config.in
index aca310b..eddc39f 100644
--- a/package/uboot-tools/Config.in
+++ b/package/uboot-tools/Config.in
@@ -7,15 +7,22 @@ config BR2_PACKAGE_UBOOT_TOOLS
 
 if BR2_PACKAGE_UBOOT_TOOLS
 
-config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
-	bool "mkimage"
+config BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
+	bool "Flattened Image Tree (FIT) support"
+	select BR2_PACKAGE_DTC
+	select BR2_PACKAGE_DTC_PROGRAMS
 	help
-	  The mkimage tool from Das U-Boot bootloader, which allows
-	  generation of U-Boot images in various formats.
+	  Enables support for Flattened Image Tree (FIT).
 
-if BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+	  This option allows to boot the new uImage structrure,
+	  Flattened Image Tree.  FIT is formally a FDT, which can include
+	  images of various types (kernel, FDT blob, ramdisk, etc.)
+	  in a single blob.  To boot this new uImage structure,
+	  pass the address of the blob to the "bootm" command.
 
-config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
+if BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
+
+config BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 	bool "FIT signature verification support"
 	select BR2_PACKAGE_OPENSSL
 	help
@@ -38,25 +45,39 @@ config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
 
 endif
 
+config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+	bool "mkimage"
+	help
+	  Install the mkimage tool on the target system
+
+	  The mkimage tool from Das U-Boot bootloader, which allows
+	  generation of U-Boot images in various formats.
+
 config BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE
 	bool "mkenvimage"
 	help
+	  Install the mkenvimage tool on the target system
+
 	  The mkenvimage tool from Das U-Boot bootloader, which allows
 	  generation of a valid binary environment image from a text file
 	  describing the key=value pairs of the environment.
 
+config BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE
+	bool "dumpimage"
+	help
+	  Install the dumpimage tool on the target system
+
+	  The dumpimage tool from Das U-Boot bootloader, which allows
+	  extraction of data from U-Boot images.
+
 config BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
 	bool "fw_printenv"
 	default y
 	help
-	  The fw_printenv / fw_setenv tools from Das U-Boot
+	  Install the fw_printenv / fw_setenv tools on the target system
+
+	  The fw_printenv and fw_setenv tools from Das U-Boot
 	  bootloader, which allows access to the U-Boot environment
 	  from Linux.
 
-config BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE
-	bool "dumpimage"
-	help
-	  The dumpimage tool from Das U-Boot bootloader, which allows
-	  extraction of data from U-Boot images.
-
 endif
diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host
index b5a42d9..292cc21 100644
--- a/package/uboot-tools/Config.in.host
+++ b/package/uboot-tools/Config.in.host
@@ -7,6 +7,20 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS
 
 if BR2_PACKAGE_HOST_UBOOT_TOOLS
 
+config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+	bool "Flattened Image Tree (FIT) support"
+	select BR2_PACKAGE_HOST_DTC
+	help
+	  Enables support for Flattened Image Tree (FIT).
+
+	  This option allows to boot the new uImage structrure,
+	  Flattened Image Tree.  FIT is formally a FDT, which can include
+	  images of various types (kernel, FDT blob, ramdisk, etc.)
+	  in a single blob.  To boot this new uImage structure,
+	  pass the address of the blob to the "bootm" command.
+
+if BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+
 config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 	bool "FIT signature verification support"
 	help
@@ -24,3 +38,5 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 	  be verified in this way.
 
 endif
+
+endif
diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
index d1ebd6f..a21cda5 100644
--- a/package/uboot-tools/uboot-tools.mk
+++ b/package/uboot-tools/uboot-tools.mk
@@ -16,18 +16,30 @@ define UBOOT_TOOLS_CONFIGURE_CMDS
 	touch $(@D)/include/config/auto.conf
 endef
 
+ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),y)
+UBOOT_TOOLS_CONFIG_FIT = CONFIG_FIT=$(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT)
+UBOOT_TOOLS_DEPENDENCIES += dtc
+ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
+UBOOT_TOOLS_CONFIG_FIT_SIGNATURE = CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT)
+UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
+endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
+endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
+
 define UBOOT_TOOLS_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 	\
 		CROSS_COMPILE="$(TARGET_CROSS)"	\
 		CFLAGS="$(TARGET_CFLAGS)"	\
 		LDFLAGS="$(TARGET_LDFLAGS)"	\
+		STRIP=$(TARGET_STRIP)		\
 		CROSS_BUILD_TOOLS=y		\
-		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \
+		$(UBOOT_TOOLS_CONFIG_FIT)	\
+		$(UBOOT_TOOLS_CONFIG_FIT_SIGNATURE) \
 		tools-only
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 	\
 		CROSS_COMPILE="$(TARGET_CROSS)"	\
 		CFLAGS="$(TARGET_CFLAGS)"	\
 		LDFLAGS="$(TARGET_LDFLAGS)"	\
+		STRIP=$(TARGET_STRIP)		\
 		env no-dot-config-targets=env
 endef
 
@@ -35,10 +47,7 @@ ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE),y)
 define UBOOT_TOOLS_INSTALL_MKIMAGE
 	$(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(TARGET_DIR)/usr/bin/mkimage
 endef
-ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT),y)
-UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
-endif # BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
-endif # BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+endif
 
 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE),y)
 define UBOOT_TOOLS_INSTALL_MKENVIMAGE
@@ -74,18 +83,24 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS
 	$(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
 endef
 
-ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
-HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
-endif
-
 define HOST_UBOOT_TOOLS_CONFIGURE_CMDS
 	mkdir -p $(@D)/include/config
 	touch $(@D)/include/config/auto.conf
 endef
 
+ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),y)
+HOST_UBOOT_TOOLS_CONFIG_FIT = CONFIG_FIT=$(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT)
+HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
+ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
+HOST_UBOOT_TOOLS_CONFIG_FIT_SIGNATURE = CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT)
+HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
+endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
+endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+
 define HOST_UBOOT_TOOLS_BUILD_CMDS
 	$(MAKE1) -C $(@D) 			\
-		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \
+		$(HOST_UBOOT_TOOLS_CONFIG_FIT)	\
+		$(HOST_UBOOT_TOOLS_CONFIG_FIT_SIGNATURE) \
 		HOSTCC="$(HOSTCC)"		\
 		HOSTCFLAGS="$(HOST_CFLAGS)"	\
 		HOSTLDFLAGS="$(HOST_LDFLAGS)"	\
-- 
2.7.4

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

* [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional
  2016-05-08 19:46     ` Carlos Santos
@ 2016-05-28 13:07       ` Thomas Petazzoni
  2016-05-31 17:33         ` Carlos Santos
  0 siblings, 1 reply; 44+ messages in thread
From: Thomas Petazzoni @ 2016-05-28 13:07 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun,  8 May 2016 16:46:40 -0300, Carlos Santos wrote:
> Fix several issues regarding the support for Flat Image Trees (FIT).
> 
> - Add a dependence on the dtc utilities because mkimage needs it when
>   FIT is enabled; otherwise mkimage fails like this:
> 
>     $ mkimage -f firmware.its firmware.im
>     sh: dtc: command not found
> 
> - Turn FIT support an independent switch for host and target controlled
>   by BR2_PACKAGE_{HOST_,}UBOOT_TOOLS_FIT_SUPPORT
> 
> - Dettach FIT signature support from mkimage installation by means of a
>   BR2_PACKAGE_{HOST_,}UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT, subordinated to
>   ...TOOLS_FIT_SUPPORT.
> 
> - Improve the descriptions of the knobs to install mkimage, mkenvimage,
>   dumpimage, fw_printenv and fw_setenv.
> 
> - Use $(TARGET_STRIP) to control stripping of the target utilities,
>   otherwise they are always stripped.
> 
> - Add a patch to really allow turning FIT support on/off, which was not
>   possible due to bugs in the code and in the tools Makefile.
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>

I was about to apply this, but spotted a few minor issues. In addition,
another concern is that this patch is doing many different things.
Those things are related, but could be done in separate patches:

 1/ Pass TARGET_STRIP should be one patch

 2/ Improving the help text of existing options should be one patch

 3/ Improving FIT support for the host variant

 4/ Improving FIT support for the target variant


> +From 1c0040aeed5d4dc17a549ad8a1a1c3e889f74e98 Mon Sep 17 00:00:00 2001
> +From: Carlos Santos <casantos@datacom.ind.br>
> +Date: Sun, 8 May 2016 11:11:39 -0300
> +Subject: [PATCH 4/4] Make FIT support really optional

Please generate the patch with "git format-patch -N" so that there is
no "4/4" in the patch title.

> +Due to some mistakes in the source code, it was not possible to really
> +turn FIT support off. This commit fixes the problem by means of the
> +following changes:
> +
> +- Enclose "bootm_host_load_image" and "bootm_host_load_images" between
> +  checks for CONFIG_FIT_SIGNATURE, in common/bootm.c.
> +
> +- Enclose the declaration of "bootm_host_load_images" between checks for
> +  CONFIG_FIT_SIGNATURE, in common/bootm.h.
> +
> +- Condition the compilation and linking of fit_common.o fit_image.o
> +  image-host.o common/image-fit.o to CONFIG_FIT=y, in tools/Makefile.
> +
> +Signed-off-by: Carlos Santos <casantos@datacom.ind.br>

Has this patch been submitted upstream?

> diff --git a/package/uboot-tools/Config.in b/package/uboot-tools/Config.in
> index aca310b..eddc39f 100644
> --- a/package/uboot-tools/Config.in
> +++ b/package/uboot-tools/Config.in
> @@ -7,15 +7,22 @@ config BR2_PACKAGE_UBOOT_TOOLS
>  
>  if BR2_PACKAGE_UBOOT_TOOLS
>  
> -config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
> -	bool "mkimage"
> +config BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
> +	bool "Flattened Image Tree (FIT) support"
> +	select BR2_PACKAGE_DTC
> +	select BR2_PACKAGE_DTC_PROGRAMS
>  	help
> -	  The mkimage tool from Das U-Boot bootloader, which allows
> -	  generation of U-Boot images in various formats.
> +	  Enables support for Flattened Image Tree (FIT).
>  
> -if BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
> +	  This option allows to boot the new uImage structrure,
> +	  Flattened Image Tree.  FIT is formally a FDT, which can include

Please, only one space after "." (fix globally).

> +	  images of various types (kernel, FDT blob, ramdisk, etc.)
> +	  in a single blob.  To boot this new uImage structure,
> +	  pass the address of the blob to the "bootm" command.
>  
> -config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT

So essentially, this option gets renamed from
BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT to
BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT. You therefore need to
add BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT to the
Config.in.legacy file.

> +if BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
> +
> +config BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
>  	bool "FIT signature verification support"
>  	select BR2_PACKAGE_OPENSSL
>  	help
> @@ -38,25 +45,39 @@ config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
>  
>  endif
>  
> +config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
> +	bool "mkimage"
> +	help
> +	  Install the mkimage tool on the target system
> +
> +	  The mkimage tool from Das U-Boot bootloader, which allows
> +	  generation of U-Boot images in various formats.
> +
>  config BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE
>  	bool "mkenvimage"
>  	help
> +	  Install the mkenvimage tool on the target system
> +
>  	  The mkenvimage tool from Das U-Boot bootloader, which allows
>  	  generation of a valid binary environment image from a text file
>  	  describing the key=value pairs of the environment.
>  
> +config BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE
> +	bool "dumpimage"
> +	help
> +	  Install the dumpimage tool on the target system
> +
> +	  The dumpimage tool from Das U-Boot bootloader, which allows
> +	  extraction of data from U-Boot images.

It's not clear why this option is moved around. Any reason for this?

> +
>  config BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
>  	bool "fw_printenv"
>  	default y
>  	help
> -	  The fw_printenv / fw_setenv tools from Das U-Boot
> +	  Install the fw_printenv / fw_setenv tools on the target system
> +
> +	  The fw_printenv and fw_setenv tools from Das U-Boot
>  	  bootloader, which allows access to the U-Boot environment
>  	  from Linux.
>  
> -config BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE
> -	bool "dumpimage"
> -	help
> -	  The dumpimage tool from Das U-Boot bootloader, which allows
> -	  extraction of data from U-Boot images.
> -
>  endif
> diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host
> index b5a42d9..292cc21 100644
> --- a/package/uboot-tools/Config.in.host
> +++ b/package/uboot-tools/Config.in.host
> @@ -7,6 +7,20 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS
>  
>  if BR2_PACKAGE_HOST_UBOOT_TOOLS
>  
> +config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
> +	bool "Flattened Image Tree (FIT) support"
> +	select BR2_PACKAGE_HOST_DTC
> +	help
> +	  Enables support for Flattened Image Tree (FIT).
> +
> +	  This option allows to boot the new uImage structrure,
> +	  Flattened Image Tree.  FIT is formally a FDT, which can include
> +	  images of various types (kernel, FDT blob, ramdisk, etc.)
> +	  in a single blob.  To boot this new uImage structure,
> +	  pass the address of the blob to the "bootm" command.
> +
> +if BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
> +
>  config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
>  	bool "FIT signature verification support"
>  	help
> @@ -24,3 +38,5 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
>  	  be verified in this way.
>  
>  endif
> +
> +endif
> diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
> index d1ebd6f..a21cda5 100644
> --- a/package/uboot-tools/uboot-tools.mk
> +++ b/package/uboot-tools/uboot-tools.mk
> @@ -16,18 +16,30 @@ define UBOOT_TOOLS_CONFIGURE_CMDS
>  	touch $(@D)/include/config/auto.conf
>  endef
>  
> +ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),y)
> +UBOOT_TOOLS_CONFIG_FIT = CONFIG_FIT=$(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT)

I think we should instead have a UBOOT_TOOLS_MAKE_OPTS, and replace
this with:

	UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT=y

> +UBOOT_TOOLS_DEPENDENCIES += dtc
> +ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
> +UBOOT_TOOLS_CONFIG_FIT_SIGNATURE = CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT)

	UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y

> +UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
> +endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
> +endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
> +
>  define UBOOT_TOOLS_BUILD_CMDS
>  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 	\
>  		CROSS_COMPILE="$(TARGET_CROSS)"	\
>  		CFLAGS="$(TARGET_CFLAGS)"	\
>  		LDFLAGS="$(TARGET_LDFLAGS)"	\
> +		STRIP=$(TARGET_STRIP)		\
>  		CROSS_BUILD_TOOLS=y		\
> -		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \
> +		$(UBOOT_TOOLS_CONFIG_FIT)	\
> +		$(UBOOT_TOOLS_CONFIG_FIT_SIGNATURE) \

And here:

		$(UBOOT_TOOLS_MAKE_OPTS)

and you can probably move into UBOOT_TOOLS_MAKE_OPTS a few other
variables.

>  		tools-only
>  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 	\
>  		CROSS_COMPILE="$(TARGET_CROSS)"	\
>  		CFLAGS="$(TARGET_CFLAGS)"	\
>  		LDFLAGS="$(TARGET_LDFLAGS)"	\
> +		STRIP=$(TARGET_STRIP)		\
>  		env no-dot-config-targets=env
>  endef
>  
> @@ -35,10 +47,7 @@ ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE),y)
>  define UBOOT_TOOLS_INSTALL_MKIMAGE
>  	$(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(TARGET_DIR)/usr/bin/mkimage
>  endef
> -ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT),y)
> -UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
> -endif # BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
> -endif # BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
> +endif
>  
>  ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE),y)
>  define UBOOT_TOOLS_INSTALL_MKENVIMAGE
> @@ -74,18 +83,24 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS
>  	$(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
>  endef
>  
> -ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
> -HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
> -endif
> -
>  define HOST_UBOOT_TOOLS_CONFIGURE_CMDS
>  	mkdir -p $(@D)/include/config
>  	touch $(@D)/include/config/auto.conf
>  endef
>  
> +ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),y)
> +HOST_UBOOT_TOOLS_CONFIG_FIT = CONFIG_FIT=$(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT)
> +HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
> +ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
> +HOST_UBOOT_TOOLS_CONFIG_FIT_SIGNATURE = CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT)
> +HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
> +endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
> +endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT

Ditto here.

> +
>  define HOST_UBOOT_TOOLS_BUILD_CMDS
>  	$(MAKE1) -C $(@D) 			\
> -		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \
> +		$(HOST_UBOOT_TOOLS_CONFIG_FIT)	\
> +		$(HOST_UBOOT_TOOLS_CONFIG_FIT_SIGNATURE) \
>  		HOSTCC="$(HOSTCC)"		\
>  		HOSTCFLAGS="$(HOST_CFLAGS)"	\
>  		HOSTLDFLAGS="$(HOST_LDFLAGS)"	\

Thanks!

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

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

* [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional
  2016-05-28 13:07       ` Thomas Petazzoni
@ 2016-05-31 17:33         ` Carlos Santos
  2016-05-31 19:01           ` Thomas Petazzoni
  0 siblings, 1 reply; 44+ messages in thread
From: Carlos Santos @ 2016-05-31 17:33 UTC (permalink / raw)
  To: buildroot

> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
[...]
> I was about to apply this, but spotted a few minor issues. In addition,
> another concern is that this patch is doing many different things.
> Those things are related, but could be done in separate patches:
> 
> 1/ Pass TARGET_STRIP should be one patch
> 
> 2/ Improving the help text of existing options should be one patch

OK. I noticed that I would need to rebase the changes, anyway, because uboot-tools was upgraded to use version 2016.05.

> 3/ Improving FIT support for the host variant
> 
> 4/ Improving FIT support for the target variant

Tasks 3 and 4 can not be separated because both depend on the new patch that makes FIT support really optional.

>> +From 1c0040aeed5d4dc17a549ad8a1a1c3e889f74e98 Mon Sep 17 00:00:00 2001
>> +From: Carlos Santos <casantos@datacom.ind.br>
>> +Date: Sun, 8 May 2016 11:11:39 -0300
>> +Subject: [PATCH 4/4] Make FIT support really optional
> 
> Please generate the patch with "git format-patch -N" so that there is
> no "4/4" in the patch title.

OK

[...]
>> +
>> +Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> 
> Has this patch been submitted upstream?

Yes (http://patchwork.ozlabs.org/patch/619683/).
> 
>> diff --git a/package/uboot-tools/Config.in b/package/uboot-tools/Config.in
>> index aca310b..eddc39f 100644
[...]
>> +	  Flattened Image Tree.  FIT is formally a FDT, which can include
> 
> Please, only one space after "." (fix globally).

OK

>> -config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
> 
> So essentially, this option gets renamed from
> BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT to
> BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT. You therefore need to
> add BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT to the
> Config.in.legacy file.

OK

>> +config BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE
>> +	bool "dumpimage"
>> +	help
>> +	  Install the dumpimage tool on the target system
>> +
>> +	  The dumpimage tool from Das U-Boot bootloader, which allows
>> +	  extraction of data from U-Boot images.
> 
> It's not clear why this option is moved around. Any reason for this?

Probably because I pasted the block at the wrong place when was editting the file. I will move it to the original position.

>> -config BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE
>> -	bool "dumpimage"
>> -	help
>> -	  The dumpimage tool from Das U-Boot bootloader, which allows
>> -	  extraction of data from U-Boot images.
>> -
>>  endif
[...]
>> +ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),y)
>> +UBOOT_TOOLS_CONFIG_FIT = CONFIG_FIT=$(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT)
> 
> I think we should instead have a UBOOT_TOOLS_MAKE_OPTS, and replace
> this with:
> 
>	UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT=y

OK

>> +UBOOT_TOOLS_DEPENDENCIES += dtc
>> +ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
>> +UBOOT_TOOLS_CONFIG_FIT_SIGNATURE =
>> CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT)
> 
>	UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y

OK

>> +UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
>> +endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
>> +endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
>> +
>>  define UBOOT_TOOLS_BUILD_CMDS
>>  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 	\
>>  		CROSS_COMPILE="$(TARGET_CROSS)"	\
>>  		CFLAGS="$(TARGET_CFLAGS)"	\
>>  		LDFLAGS="$(TARGET_LDFLAGS)"	\
>> +		STRIP=$(TARGET_STRIP)		\
>>  		CROSS_BUILD_TOOLS=y		\
>> -		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT)
>> \
>> +		$(UBOOT_TOOLS_CONFIG_FIT)	\
>> +		$(UBOOT_TOOLS_CONFIG_FIT_SIGNATURE) \
> 
> And here:
> 
>		$(UBOOT_TOOLS_MAKE_OPTS)

OK

> and you can probably move into UBOOT_TOOLS_MAKE_OPTS a few other
> variables.
[...]
>> +ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),y)>> +HOST_UBOOT_TOOLS_CONFIG_FIT =
>> CONFIG_FIT=$(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT)
>> +HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
>> +ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
>> +HOST_UBOOT_TOOLS_CONFIG_FIT_SIGNATURE =
>> CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT)
>> +HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
>> +endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
>> +endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
> 
> Ditto here.

OK, I will make these changes. I'd like to emphasize, however, that currently uboot-tools is broken. FIT support is always compiled, so run-time dependence on "dtc" persists but dtc is not selected in Config.in{.host,}. This is the problem that my initial patch intended to fix.

Carlos Santos (Casantos)
DATACOM, P&D

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

* [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional
  2016-05-31 17:33         ` Carlos Santos
@ 2016-05-31 19:01           ` Thomas Petazzoni
  2016-05-31 19:40             ` Carlos Santos
  0 siblings, 1 reply; 44+ messages in thread
From: Thomas Petazzoni @ 2016-05-31 19:01 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 31 May 2016 14:33:09 -0300 (BRT), Carlos Santos wrote:

> > 3/ Improving FIT support for the host variant
> > 
> > 4/ Improving FIT support for the target variant  
> 
> Tasks 3 and 4 can not be separated because both depend on the new patch that makes FIT support really optional.

Of course they can be separated. Just include the patch that makes FIT
support really optional into patch (3) from my list.

> OK, I will make these changes. I'd like to emphasize, however, that
> currently uboot-tools is broken. FIT support is always compiled, so
> run-time dependence on "dtc" persists but dtc is not selected in
> Config.in{.host,}. This is the problem that my initial patch intended
> to fix.

Sure, that's why I reviewed your patch, and suggested a few
improvements that should be made to allow us to apply the patch. Once
the improvements are made, I believe we should be able to apply it
pretty quickly.

Thanks!

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

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

* [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional
  2016-05-31 19:01           ` Thomas Petazzoni
@ 2016-05-31 19:40             ` Carlos Santos
  2016-05-31 19:48               ` Thomas Petazzoni
  0 siblings, 1 reply; 44+ messages in thread
From: Carlos Santos @ 2016-05-31 19:40 UTC (permalink / raw)
  To: buildroot

> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: buildroot at buildroot.org, "yann morin 1998" <yann.morin.1998@gmail.com>
> Sent: Tuesday, May 31, 2016 4:01:22 PM
> Subject: Re: [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional

> Hello,
> 
> On Tue, 31 May 2016 14:33:09 -0300 (BRT), Carlos Santos wrote:
> 
>> > 3/ Improving FIT support for the host variant
>> > 
>> > 4/ Improving FIT support for the target variant
>> 
>> Tasks 3 and 4 can not be separated because both depend on the new patch that
>> makes FIT support really optional.
> 
> Of course they can be separated. Just include the patch that makes FIT
> support really optional into patch (3) from my list.

Step 3 would make the ...MKIMAGE_FIT_SIGNATURE_SUPPORT option useless. Once the patch is applied, FIT support depends on passing CONFIG_FIT=y in the make command line, which would be made done only in step 4.

>> OK, I will make these changes. I'd like to emphasize, however, that
>> currently uboot-tools is broken. FIT support is always compiled, so
>> run-time dependence on "dtc" persists but dtc is not selected in
>> Config.in{.host,}. This is the problem that my initial patch intended
>> to fix.
> 
> Sure, that's why I reviewed your patch, and suggested a few
> improvements that should be made to allow us to apply the patch. Once
> the improvements are made, I believe we should be able to apply it
> pretty quickly.

Carlos Santos (Casantos)
DATACOM, P&D

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

* [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional
  2016-05-31 19:40             ` Carlos Santos
@ 2016-05-31 19:48               ` Thomas Petazzoni
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni @ 2016-05-31 19:48 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 31 May 2016 16:40:16 -0300 (BRT), Carlos Santos wrote:

> > Of course they can be separated. Just include the patch that makes
> > FIT support really optional into patch (3) from my list.  
> 
> Step 3 would make the ...MKIMAGE_FIT_SIGNATURE_SUPPORT option
> useless. Once the patch is applied, FIT support depends on passing
> CONFIG_FIT=y in the make command line, which would be made done only
> in step 4.

Gaah, right, you're correct. Fair enough. Please split into separate
patches what can be separated, and keep (3) and (4) in a single patch.

Thanks!

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

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

* [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT).
  2016-05-08 19:46   ` [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional Carlos Santos
  2016-05-08 19:46     ` Carlos Santos
@ 2016-06-01 14:39     ` Carlos Santos
  2016-06-01 14:39       ` [Buildroot] [PATCH next 1/4] uboot-tools: use $(TARGET_STRIP) for target utilities Carlos Santos
                         ` (4 more replies)
  1 sibling, 5 replies; 44+ messages in thread
From: Carlos Santos @ 2016-06-01 14:39 UTC (permalink / raw)
  To: buildroot

The current package is partially broken due to a bug in Das U-Boot. FIT
support is always built but requires the "dtc" utility, which is not
available because uboot-tools does not depend on it. Additionally, the
BR2_STRIP_xxxx setup is ignored and the utilities are always stripped.

This series fixes the bugs and introduces a more fine-grained selection
of features for both host and target packages,

Carlos Santos (4):
  uboot-tools: use $(TARGET_STRIP) for target utilities
  uboot-tools: improve the help text of existing options
  uboot-tools: re-generate patches to match v2016.05
  uboot-tools: fix FIT support and make it optional

 Config.in.legacy                                   | 16 ++++
 .../uboot-tools/0001-drop-configh-from-tools.patch | 14 ++--
 .../0002-tools-only-in-no-dot-config-targets.patch | 19 ++---
 .../0003-Make-FIT-support-really-optional.patch    | 93 ++++++++++++++++++++++
 package/uboot-tools/Config.in                      | 35 ++++++--
 package/uboot-tools/Config.in.host                 | 16 ++++
 package/uboot-tools/uboot-tools.mk                 | 57 +++++++------
 7 files changed, 201 insertions(+), 49 deletions(-)
 create mode 100644 package/uboot-tools/0003-Make-FIT-support-really-optional.patch

-- 
2.7.4

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

* [Buildroot] [PATCH next 1/4] uboot-tools: use $(TARGET_STRIP) for target utilities
  2016-06-01 14:39     ` [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT) Carlos Santos
@ 2016-06-01 14:39       ` Carlos Santos
  2016-06-01 14:39       ` [Buildroot] [PATCH next 2/4] uboot-tools: improve the help text of existing options Carlos Santos
                         ` (3 subsequent siblings)
  4 siblings, 0 replies; 44+ messages in thread
From: Carlos Santos @ 2016-06-01 14:39 UTC (permalink / raw)
  To: buildroot

Otherwise BR2_STRIP_xxxx setup is ignored and they are always stripped.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/uboot-tools/uboot-tools.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
index 987e89b..a6aadeb 100644
--- a/package/uboot-tools/uboot-tools.mk
+++ b/package/uboot-tools/uboot-tools.mk
@@ -21,6 +21,7 @@ define UBOOT_TOOLS_BUILD_CMDS
 		CROSS_COMPILE="$(TARGET_CROSS)"	\
 		CFLAGS="$(TARGET_CFLAGS)"	\
 		LDFLAGS="$(TARGET_LDFLAGS)"	\
+		STRIP=$(TARGET_STRIP)		\
 		CROSS_BUILD_TOOLS=y		\
 		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \
 		tools-only
@@ -28,6 +29,7 @@ define UBOOT_TOOLS_BUILD_CMDS
 		CROSS_COMPILE="$(TARGET_CROSS)"	\
 		CFLAGS="$(TARGET_CFLAGS)"	\
 		LDFLAGS="$(TARGET_LDFLAGS)"	\
+		STRIP=$(TARGET_STRIP)		\
 		env no-dot-config-targets=env
 endef
 
-- 
2.7.4

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

* [Buildroot] [PATCH next 2/4] uboot-tools: improve the help text of existing options
  2016-06-01 14:39     ` [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT) Carlos Santos
  2016-06-01 14:39       ` [Buildroot] [PATCH next 1/4] uboot-tools: use $(TARGET_STRIP) for target utilities Carlos Santos
@ 2016-06-01 14:39       ` Carlos Santos
  2016-06-01 14:39       ` [Buildroot] [PATCH next 3/4] uboot-tools: re-generate patches to match v2016.05 Carlos Santos
                         ` (2 subsequent siblings)
  4 siblings, 0 replies; 44+ messages in thread
From: Carlos Santos @ 2016-06-01 14:39 UTC (permalink / raw)
  To: buildroot

Improve the descriptions of the knobs to install mkimage, mkenvimage,
dumpimage, fw_printenv and fw_setenv.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/uboot-tools/Config.in | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/uboot-tools/Config.in b/package/uboot-tools/Config.in
index aca310b..76983f4 100644
--- a/package/uboot-tools/Config.in
+++ b/package/uboot-tools/Config.in
@@ -10,6 +10,8 @@ if BR2_PACKAGE_UBOOT_TOOLS
 config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
 	bool "mkimage"
 	help
+	  Install the mkimage tool on the target system
+
 	  The mkimage tool from Das U-Boot bootloader, which allows
 	  generation of U-Boot images in various formats.
 
@@ -41,6 +43,8 @@ endif
 config BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE
 	bool "mkenvimage"
 	help
+	  Install the mkenvimage tool on the target system
+
 	  The mkenvimage tool from Das U-Boot bootloader, which allows
 	  generation of a valid binary environment image from a text file
 	  describing the key=value pairs of the environment.
@@ -49,13 +53,17 @@ config BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
 	bool "fw_printenv"
 	default y
 	help
-	  The fw_printenv / fw_setenv tools from Das U-Boot
+	  Install the fw_printenv / fw_setenv tools on the target system
+
+	  The fw_printenv and fw_setenv tools from Das U-Boot
 	  bootloader, which allows access to the U-Boot environment
 	  from Linux.
 
 config BR2_PACKAGE_UBOOT_TOOLS_DUMPIMAGE
 	bool "dumpimage"
 	help
+	  Install the dumpimage tool on the target system
+
 	  The dumpimage tool from Das U-Boot bootloader, which allows
 	  extraction of data from U-Boot images.
 
-- 
2.7.4

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

* [Buildroot] [PATCH next 3/4] uboot-tools: re-generate patches to match v2016.05
  2016-06-01 14:39     ` [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT) Carlos Santos
  2016-06-01 14:39       ` [Buildroot] [PATCH next 1/4] uboot-tools: use $(TARGET_STRIP) for target utilities Carlos Santos
  2016-06-01 14:39       ` [Buildroot] [PATCH next 2/4] uboot-tools: improve the help text of existing options Carlos Santos
@ 2016-06-01 14:39       ` Carlos Santos
  2016-06-01 14:39       ` [Buildroot] [PATCH next 4/4] uboot-tools: fix FIT support and make it optional Carlos Santos
  2016-06-01 15:07       ` [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT) Thomas Petazzoni
  4 siblings, 0 replies; 44+ messages in thread
From: Carlos Santos @ 2016-06-01 14:39 UTC (permalink / raw)
  To: buildroot

They were differences against Das U-Boot versions 2015.07 and 2015.04.
Generating again helps to apply them with "git am".

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 .../uboot-tools/0001-drop-configh-from-tools.patch    | 14 +++++++-------
 .../0002-tools-only-in-no-dot-config-targets.patch    | 19 ++++++++++---------
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/package/uboot-tools/0001-drop-configh-from-tools.patch b/package/uboot-tools/0001-drop-configh-from-tools.patch
index e77a301..fbc9608 100644
--- a/package/uboot-tools/0001-drop-configh-from-tools.patch
+++ b/package/uboot-tools/0001-drop-configh-from-tools.patch
@@ -1,7 +1,7 @@
-From 2e54434e4dd178773e8e11e48afc81299771f3e7 Mon Sep 17 00:00:00 2001
+From b742c7590ac6d9ac72dd227679ccff79433b3512 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
 Date: Tue, 4 Aug 2015 22:13:20 +0200
-Subject: [PATCH 1/1] drop configh from tools
+Subject: [PATCH] drop configh from tools
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
@@ -18,12 +18,12 @@ Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
  1 file changed, 11 deletions(-)
 
 diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
-index 60c0517..1c5daaa 100644
+index 57149e7..50049fe 100644
 --- a/tools/env/fw_env.h
 +++ b/tools/env/fw_env.h
-@@ -5,17 +5,6 @@
-  * SPDX-License-Identifier:	GPL-2.0+
-  */
+@@ -8,17 +8,6 @@
+ #include <aes.h>
+ #include <stdint.h>
  
 -/* Pull in the current config to define the default environment */
 -#include <linux/kconfig.h>
@@ -40,5 +40,5 @@ index 60c0517..1c5daaa 100644
   * To build the utility with the static configuration
   * comment out the next line.
 -- 
-2.5.0
+2.7.4
 
diff --git a/package/uboot-tools/0002-tools-only-in-no-dot-config-targets.patch b/package/uboot-tools/0002-tools-only-in-no-dot-config-targets.patch
index fedf9be..795466f 100644
--- a/package/uboot-tools/0002-tools-only-in-no-dot-config-targets.patch
+++ b/package/uboot-tools/0002-tools-only-in-no-dot-config-targets.patch
@@ -1,7 +1,7 @@
-From 7d9bac7bf8d9ef39ab6b6e8d436e3dbdee5cd120 Mon Sep 17 00:00:00 2001
+From b8110293d70c4f43035dfd6a0904d342be6a08e0 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
 Date: Sun, 1 Feb 2015 21:53:47 +0100
-Subject: [PATCH 1/1] tools only in no dot config targets
+Subject: [PATCH] tools only in no dot config targets
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
@@ -23,17 +23,18 @@ Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Makefile b/Makefile
-index 36a9a28..f85c194 100644
+index 954a865..3ab5958 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -417,7 +417,7 @@ timestamp_h := include/generated/timestamp_autogenerated.h
-
+@@ -424,7 +424,7 @@ timestamp_h := include/generated/timestamp_autogenerated.h
+ 
  no-dot-config-targets := clean clobber mrproper distclean \
-			 help %docs check% coccicheck \
+ 			 help %docs check% coccicheck \
 -			 ubootversion backup
 +			 ubootversion backup tools-only
-
+ 
  config-targets := 0
  mixed-targets  := 0
---
-2.3.0
+-- 
+2.7.4
+
-- 
2.7.4

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

* [Buildroot] [PATCH next 4/4] uboot-tools: fix FIT support and make it optional
  2016-06-01 14:39     ` [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT) Carlos Santos
                         ` (2 preceding siblings ...)
  2016-06-01 14:39       ` [Buildroot] [PATCH next 3/4] uboot-tools: re-generate patches to match v2016.05 Carlos Santos
@ 2016-06-01 14:39       ` Carlos Santos
  2016-06-01 15:08         ` Thomas Petazzoni
  2016-06-03 19:35         ` [Buildroot] [PATCH v4] " Carlos Santos
  2016-06-01 15:07       ` [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT) Thomas Petazzoni
  4 siblings, 2 replies; 44+ messages in thread
From: Carlos Santos @ 2016-06-01 14:39 UTC (permalink / raw)
  To: buildroot

Fix several issues regarding the support for Flat Image Trees (FIT).

- Add a patch to really allow turning FIT support on/off, which was not
  possible due to bugs in the code and in the tools Makefile. This patch
  has been sent upstream but not applied there, yet.

- Use independent options to control FIT support on host and target
  packages.

- Subordinate FIT signature support to the activation of FIT support, in
  the target package, not to mkimage installation.

- Add a dependence on the dtc utilities because mkimage needs it when
  FIT is enabled; otherwise mkimage fails like this:

    $ mkimage -f firmware.its firmware.im
    sh: dtc: command not found

- Add BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT to the
  Config.in.legacy file.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 Config.in.legacy                                   | 16 ++++
 .../0003-Make-FIT-support-really-optional.patch    | 93 ++++++++++++++++++++++
 package/uboot-tools/Config.in                      | 27 +++++--
 package/uboot-tools/Config.in.host                 | 16 ++++
 package/uboot-tools/uboot-tools.mk                 | 59 +++++++-------
 5 files changed, 176 insertions(+), 35 deletions(-)
 create mode 100644 package/uboot-tools/0003-Make-FIT-support-really-optional.patch

diff --git a/Config.in.legacy b/Config.in.legacy
index a0a2059..3f565e8 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -145,6 +145,22 @@ endif
 ###############################################################################
 comment "Legacy options removed in 2016.08"
 
+config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
+	bool "FIT support in uboot-tools has been refactored"
+	select BR2_LEGACY
+	select BR2_PACKAGE_DTC
+	select BR2_PACKAGE_DTC_PROGRAMS
+	select BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
+	select BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
+	select BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+	select BR2_PACKAGE_HOST_DTC
+	select BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+	help
+	  This option has been removed in favor of a more fine-grained
+	  configuration, which is recommended. Selecting this option
+	  enables FIT and FIT signature support for both host and target
+	  packages. It will also include the dtc and openssl packages.
+
 config BR2_BINUTILS_VERSION_2_23_X
 	bool "binutils 2.23 removed"
 	select BR2_LEGACY
diff --git a/package/uboot-tools/0003-Make-FIT-support-really-optional.patch b/package/uboot-tools/0003-Make-FIT-support-really-optional.patch
new file mode 100644
index 0000000..5404e4f
--- /dev/null
+++ b/package/uboot-tools/0003-Make-FIT-support-really-optional.patch
@@ -0,0 +1,93 @@
+From ddcd6cd622889a2d74d0a16efae8e3b2d098f717 Mon Sep 17 00:00:00 2001
+From: Carlos Santos <casantos@datacom.ind.br>
+Date: Sun, 8 May 2016 11:11:39 -0300
+Subject: [PATCH] Make FIT support really optional
+
+Due to some mistakes in the source code, it was not possible to really
+turn FIT support off. This commit fixes the problem by means of the
+following changes:
+
+- Enclose "bootm_host_load_image" and "bootm_host_load_images" between
+  checks for CONFIG_FIT_SIGNATURE, in common/bootm.c.
+
+- Enclose the declaration of "bootm_host_load_images" between checks for
+  CONFIG_FIT_SIGNATURE, in common/bootm.h.
+
+- Condition the compilation and linking of fit_common.o fit_image.o
+  image-host.o common/image-fit.o to CONFIG_FIT=y, in tools/Makefile.
+
+Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
+---
+ common/bootm.c  | 2 ++
+ include/bootm.h | 2 ++
+ tools/Makefile  | 6 ++----
+ 3 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/common/bootm.c b/common/bootm.c
+index c965326..ab477ba 100644
+--- a/common/bootm.c
++++ b/common/bootm.c
+@@ -891,6 +891,7 @@ void memmove_wd(void *to, void *from, size_t len, ulong chunksz)
+ 	memmove(to, from, len);
+ }
+ 
++#if defined(CONFIG_FIT_SIGNATURE)
+ static int bootm_host_load_image(const void *fit, int req_image_type)
+ {
+ 	const char *fit_uname_config = NULL;
+@@ -955,5 +956,6 @@ int bootm_host_load_images(const void *fit, int cfg_noffset)
+ 	/* Return the first error we found */
+ 	return err;
+ }
++#endif
+ 
+ #endif /* ndef USE_HOSTCC */
+diff --git a/include/bootm.h b/include/bootm.h
+index 4981377..94d62a1 100644
+--- a/include/bootm.h
++++ b/include/bootm.h
+@@ -41,7 +41,9 @@ void lynxkdi_boot(image_header_t *hdr);
+ 
+ boot_os_fn *bootm_os_get_boot_func(int os);
+ 
++#if defined(CONFIG_FIT_SIGNATURE)
+ int bootm_host_load_images(const void *fit, int cfg_noffset);
++#endif
+ 
+ int boot_selected_os(int argc, char * const argv[], int state,
+ 		     bootm_headers_t *images, boot_os_fn *boot_fn);
+diff --git a/tools/Makefile b/tools/Makefile
+index da50e1b..0a3d279 100644
+--- a/tools/Makefile
++++ b/tools/Makefile
+@@ -54,6 +54,7 @@ mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o
+ hostprogs-y += dumpimage mkimage
+ hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign
+ 
++FIT_OBJS-$(CONFIG_FIT) := fit_common.o fit_image.o image-host.o common/image-fit.o
+ FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o
+ # Flattened device tree objects
+ LIBFDT_OBJS := $(addprefix lib/libfdt/, \
+@@ -68,18 +69,15 @@ ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o
+ # common objs for dumpimage and mkimage
+ dumpimage-mkimage-objs := aisimage.o \
+ 			atmelimage.o \
++			$(FIT_OBJS-y) \
+ 			$(FIT_SIG_OBJS-y) \
+ 			common/bootm.o \
+ 			lib/crc32.o \
+ 			default_image.o \
+ 			lib/fdtdec_common.o \
+ 			lib/fdtdec.o \
+-			fit_common.o \
+-			fit_image.o \
+ 			gpimage.o \
+ 			gpimage-common.o \
+-			common/image-fit.o \
+-			image-host.o \
+ 			common/image.o \
+ 			imagetool.o \
+ 			imximage.o \
+-- 
+2.7.4
+
diff --git a/package/uboot-tools/Config.in b/package/uboot-tools/Config.in
index 76983f4..c663230 100644
--- a/package/uboot-tools/Config.in
+++ b/package/uboot-tools/Config.in
@@ -7,17 +7,22 @@ config BR2_PACKAGE_UBOOT_TOOLS
 
 if BR2_PACKAGE_UBOOT_TOOLS
 
-config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
-	bool "mkimage"
+config BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
+	bool "Flattened Image Tree (FIT) support"
+	select BR2_PACKAGE_DTC
+	select BR2_PACKAGE_DTC_PROGRAMS
 	help
-	  Install the mkimage tool on the target system
+	  Enables support for Flattened Image Tree (FIT).
 
-	  The mkimage tool from Das U-Boot bootloader, which allows
-	  generation of U-Boot images in various formats.
+	  This option allows to boot the new uImage structrure,
+	  Flattened Image Tree. FIT is formally a FDT, which can include
+	  images of various types (kernel, FDT blob, ramdisk, etc.)
+	  in a single blob. To boot this new uImage structure,
+	  pass the address of the blob to the "bootm" command.
 
-if BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+if BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
 
-config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
+config BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 	bool "FIT signature verification support"
 	select BR2_PACKAGE_OPENSSL
 	help
@@ -40,6 +45,14 @@ config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
 
 endif
 
+config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+	bool "mkimage"
+	help
+	  Install the mkimage tool on the target system
+
+	  The mkimage tool from Das U-Boot bootloader, which allows
+	  generation of U-Boot images in various formats.
+
 config BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE
 	bool "mkenvimage"
 	help
diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host
index b5a42d9..406d9ff 100644
--- a/package/uboot-tools/Config.in.host
+++ b/package/uboot-tools/Config.in.host
@@ -7,6 +7,20 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS
 
 if BR2_PACKAGE_HOST_UBOOT_TOOLS
 
+config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+	bool "Flattened Image Tree (FIT) support"
+	select BR2_PACKAGE_HOST_DTC
+	help
+	  Enables support for Flattened Image Tree (FIT).
+
+	  This option allows to boot the new uImage structrure,
+	  Flattened Image Tree. FIT is formally a FDT, which can include
+	  images of various types (kernel, FDT blob, ramdisk, etc.)
+	  in a single blob. To boot this new uImage structure,
+	  pass the address of the blob to the "bootm" command.
+
+if BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+
 config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 	bool "FIT signature verification support"
 	help
@@ -24,3 +38,5 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 	  be verified in this way.
 
 endif
+
+endif
diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
index a6aadeb..1a29536 100644
--- a/package/uboot-tools/uboot-tools.mk
+++ b/package/uboot-tools/uboot-tools.mk
@@ -16,31 +16,30 @@ define UBOOT_TOOLS_CONFIGURE_CMDS
 	touch $(@D)/include/config/auto.conf
 endef
 
+UBOOT_TOOLS_MAKE_OPTS = CROSS_COMPILE="$(TARGET_CROSS)" \
+	CFLAGS="$(TARGET_CFLAGS)" \
+	LDFLAGS="$(TARGET_LDFLAGS)" \
+	STRIP=$(TARGET_STRIP)
+
+ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),y)
+UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT=y
+UBOOT_TOOLS_DEPENDENCIES += dtc
+ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
+UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y
+UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
+endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
+endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
+
 define UBOOT_TOOLS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 	\
-		CROSS_COMPILE="$(TARGET_CROSS)"	\
-		CFLAGS="$(TARGET_CFLAGS)"	\
-		LDFLAGS="$(TARGET_LDFLAGS)"	\
-		STRIP=$(TARGET_STRIP)		\
-		CROSS_BUILD_TOOLS=y		\
-		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \
-		tools-only
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 	\
-		CROSS_COMPILE="$(TARGET_CROSS)"	\
-		CFLAGS="$(TARGET_CFLAGS)"	\
-		LDFLAGS="$(TARGET_LDFLAGS)"	\
-		STRIP=$(TARGET_STRIP)		\
-		env no-dot-config-targets=env
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_TOOLS_MAKE_OPTS) CROSS_BUILD_TOOLS=y tools-only
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_TOOLS_MAKE_OPTS) env no-dot-config-targets=env
 endef
 
 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE),y)
 define UBOOT_TOOLS_INSTALL_MKIMAGE
 	$(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(TARGET_DIR)/usr/bin/mkimage
 endef
-ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT),y)
-UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
-endif # BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
-endif # BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+endif
 
 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE),y)
 define UBOOT_TOOLS_INSTALL_MKENVIMAGE
@@ -76,22 +75,26 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS
 	$(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
 endef
 
-ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
-HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
-endif
-
 define HOST_UBOOT_TOOLS_CONFIGURE_CMDS
 	mkdir -p $(@D)/include/config
 	touch $(@D)/include/config/auto.conf
 endef
 
+HOST_UBOOT_TOOLS_MAKE_OPTS = HOSTCC="$(HOSTCC)" \
+	HOSTCFLAGS="$(HOST_CFLAGS)" \
+	HOSTLDFLAGS="$(HOST_LDFLAGS)"
+
+ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),y)
+HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT=y
+HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
+ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
+HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y
+HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
+endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
+endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+
 define HOST_UBOOT_TOOLS_BUILD_CMDS
-	$(MAKE1) -C $(@D) 			\
-		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \
-		HOSTCC="$(HOSTCC)"		\
-		HOSTCFLAGS="$(HOST_CFLAGS)"	\
-		HOSTLDFLAGS="$(HOST_LDFLAGS)"	\
-		tools-only
+	$(MAKE1) -C $(@D) $(HOST_UBOOT_TOOLS_MAKE_OPTS) tools-only
 endef
 
 define HOST_UBOOT_TOOLS_INSTALL_CMDS
-- 
2.7.4

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

* [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT).
  2016-06-01 14:39     ` [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT) Carlos Santos
                         ` (3 preceding siblings ...)
  2016-06-01 14:39       ` [Buildroot] [PATCH next 4/4] uboot-tools: fix FIT support and make it optional Carlos Santos
@ 2016-06-01 15:07       ` Thomas Petazzoni
  4 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni @ 2016-06-01 15:07 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  1 Jun 2016 11:39:38 -0300, Carlos Santos wrote:
> The current package is partially broken due to a bug in Das U-Boot. FIT
> support is always built but requires the "dtc" utility, which is not
> available because uboot-tools does not depend on it. Additionally, the
> BR2_STRIP_xxxx setup is ignored and the utilities are always stripped.
> 
> This series fixes the bugs and introduces a more fine-grained selection
> of features for both host and target packages,
> 
> Carlos Santos (4):
>   uboot-tools: use $(TARGET_STRIP) for target utilities
>   uboot-tools: improve the help text of existing options
>   uboot-tools: re-generate patches to match v2016.05

Patches 1 to 3 applied.

>   uboot-tools: fix FIT support and make it optional

I need a bit of time to review that one.

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

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

* [Buildroot] [PATCH next 4/4] uboot-tools: fix FIT support and make it optional
  2016-06-01 14:39       ` [Buildroot] [PATCH next 4/4] uboot-tools: fix FIT support and make it optional Carlos Santos
@ 2016-06-01 15:08         ` Thomas Petazzoni
  2016-06-03 19:35         ` [Buildroot] [PATCH v4] " Carlos Santos
  1 sibling, 0 replies; 44+ messages in thread
From: Thomas Petazzoni @ 2016-06-01 15:08 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  1 Jun 2016 11:39:42 -0300, Carlos Santos wrote:

> diff --git a/Config.in.legacy b/Config.in.legacy
> index a0a2059..3f565e8 100644
> --- a/Config.in.legacy
> +++ b/Config.in.legacy
> @@ -145,6 +145,22 @@ endif
>  ###############################################################################
>  comment "Legacy options removed in 2016.08"
>  
> +config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
> +	bool "FIT support in uboot-tools has been refactored"
> +	select BR2_LEGACY
> +	select BR2_PACKAGE_DTC
> +	select BR2_PACKAGE_DTC_PROGRAMS
> +	select BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
> +	select BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
> +	select BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
> +	select BR2_PACKAGE_HOST_DTC
> +	select BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT

I did not review the entire patch, but those last two lines look
incorrect. The purpose of the
BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT option was to
enable support for FIT signature in the *target* variant of
uboot-tools. Hence, I don't see why you are selecting host-dtc and FIT
support in the host variant of uboot-tools.

> diff --git a/package/uboot-tools/0003-Make-FIT-support-really-optional.patch b/package/uboot-tools/0003-Make-FIT-support-really-optional.patch
> new file mode 100644
> index 0000000..5404e4f
> --- /dev/null
> +++ b/package/uboot-tools/0003-Make-FIT-support-really-optional.patch
> @@ -0,0 +1,93 @@
> +From ddcd6cd622889a2d74d0a16efae8e3b2d098f717 Mon Sep 17 00:00:00 2001
> +From: Carlos Santos <casantos@datacom.ind.br>
> +Date: Sun, 8 May 2016 11:11:39 -0300
> +Subject: [PATCH] Make FIT support really optional
> +
> +Due to some mistakes in the source code, it was not possible to really
> +turn FIT support off. This commit fixes the problem by means of the
> +following changes:
> +
> +- Enclose "bootm_host_load_image" and "bootm_host_load_images" between
> +  checks for CONFIG_FIT_SIGNATURE, in common/bootm.c.
> +
> +- Enclose the declaration of "bootm_host_load_images" between checks for
> +  CONFIG_FIT_SIGNATURE, in common/bootm.h.
> +
> +- Condition the compilation and linking of fit_common.o fit_image.o
> +  image-host.o common/image-fit.o to CONFIG_FIT=y, in tools/Makefile.
> +
> +Signed-off-by: Carlos Santos <casantos@datacom.ind.br>

It would be good to mention the upstream status of this patch. At least
so that I remember instead of asking you again and again if it has been
sent upstream :-)

I'll do a full review later on. Thanks!

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

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

* [Buildroot] [PATCH v4] uboot-tools: fix FIT support and make it optional
  2016-06-01 14:39       ` [Buildroot] [PATCH next 4/4] uboot-tools: fix FIT support and make it optional Carlos Santos
  2016-06-01 15:08         ` Thomas Petazzoni
@ 2016-06-03 19:35         ` Carlos Santos
  2016-06-07  2:25           ` [Buildroot] [PATCH v5] util-linux: rework utilities menu for finer control Carlos Santos
  2016-06-07 21:12           ` [Buildroot] [PATCH v4] uboot-tools: fix FIT support and make it optional Thomas Petazzoni
  1 sibling, 2 replies; 44+ messages in thread
From: Carlos Santos @ 2016-06-03 19:35 UTC (permalink / raw)
  To: buildroot

Fix several issues regarding the support for Flat Image Trees (FIT).

- Add a patch to really allow turning FIT support on/off, which was not
  possible due to bugs in the code and in the tools Makefile. This patch
  has been sent upstream but not applied there, yet.

- Use independent options to control FIT support on host and target
  packages.

- Subordinate FIT signature support to the activation of FIT support, in
  the target package, not to mkimage installation.

- Add a dependence on the dtc utilities because mkimage needs it when
  FIT is enabled; otherwise mkimage fails like this:

    $ mkimage -f firmware.its firmware.im
    sh: dtc: command not found

- Add BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT to the
  Config.in.legacy file.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---

Changes v3 -> v4:

Fix Config.in.legacy.

The purpose of the BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT option
was to enable support for FIT signature in the *target* variant of uboot-tools.
There is no reason to select host-dtc and FIT support in the host variant.

Changes v2 -> v3:

Turns out that the state of uboot-tools was even worst than initially
thought. Due to some mistakes in the source code, it was not possible
to really turn FIT support off. This required an additional patch that
fixes the code and the tools Makefile. This patch was already sent
upstream.

Moreover the package had many errors that needed to be fixed, as
described above.

Changes v1 -> v2:

First attempt to allow turning FIT support on/off.

---
 Config.in.legacy                                   | 14 ++++
 .../0003-Make-FIT-support-really-optional.patch    | 93 ++++++++++++++++++++++
 package/uboot-tools/Config.in                      | 27 +++++--
 package/uboot-tools/Config.in.host                 | 16 ++++
 package/uboot-tools/uboot-tools.mk                 | 59 +++++++-------
 5 files changed, 174 insertions(+), 35 deletions(-)
 create mode 100644 package/uboot-tools/0003-Make-FIT-support-really-optional.patch

diff --git a/Config.in.legacy b/Config.in.legacy
index b73603b..434aa5f 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -145,6 +145,20 @@ endif
 ###############################################################################
 comment "Legacy options removed in 2016.08"
 
+config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
+	bool "FIT support in uboot-tools has been refactored"
+	select BR2_LEGACY
+	select BR2_PACKAGE_DTC
+	select BR2_PACKAGE_DTC_PROGRAMS
+	select BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
+	select BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
+	select BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+	help
+	  This option has been removed in favor of a more fine-grained
+	  configuration, which is recommended. Selecting this option
+	  enables FIT and FIT signature support for the target packages.
+	  It will also select the dtc and openssl packages.
+
 config BR2_PTHREADS_OLD
 	bool "linuxthreads (stable/old)"
 	select BR2_LEGACY
diff --git a/package/uboot-tools/0003-Make-FIT-support-really-optional.patch b/package/uboot-tools/0003-Make-FIT-support-really-optional.patch
new file mode 100644
index 0000000..5404e4f
--- /dev/null
+++ b/package/uboot-tools/0003-Make-FIT-support-really-optional.patch
@@ -0,0 +1,93 @@
+From ddcd6cd622889a2d74d0a16efae8e3b2d098f717 Mon Sep 17 00:00:00 2001
+From: Carlos Santos <casantos@datacom.ind.br>
+Date: Sun, 8 May 2016 11:11:39 -0300
+Subject: [PATCH] Make FIT support really optional
+
+Due to some mistakes in the source code, it was not possible to really
+turn FIT support off. This commit fixes the problem by means of the
+following changes:
+
+- Enclose "bootm_host_load_image" and "bootm_host_load_images" between
+  checks for CONFIG_FIT_SIGNATURE, in common/bootm.c.
+
+- Enclose the declaration of "bootm_host_load_images" between checks for
+  CONFIG_FIT_SIGNATURE, in common/bootm.h.
+
+- Condition the compilation and linking of fit_common.o fit_image.o
+  image-host.o common/image-fit.o to CONFIG_FIT=y, in tools/Makefile.
+
+Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
+---
+ common/bootm.c  | 2 ++
+ include/bootm.h | 2 ++
+ tools/Makefile  | 6 ++----
+ 3 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/common/bootm.c b/common/bootm.c
+index c965326..ab477ba 100644
+--- a/common/bootm.c
++++ b/common/bootm.c
+@@ -891,6 +891,7 @@ void memmove_wd(void *to, void *from, size_t len, ulong chunksz)
+ 	memmove(to, from, len);
+ }
+ 
++#if defined(CONFIG_FIT_SIGNATURE)
+ static int bootm_host_load_image(const void *fit, int req_image_type)
+ {
+ 	const char *fit_uname_config = NULL;
+@@ -955,5 +956,6 @@ int bootm_host_load_images(const void *fit, int cfg_noffset)
+ 	/* Return the first error we found */
+ 	return err;
+ }
++#endif
+ 
+ #endif /* ndef USE_HOSTCC */
+diff --git a/include/bootm.h b/include/bootm.h
+index 4981377..94d62a1 100644
+--- a/include/bootm.h
++++ b/include/bootm.h
+@@ -41,7 +41,9 @@ void lynxkdi_boot(image_header_t *hdr);
+ 
+ boot_os_fn *bootm_os_get_boot_func(int os);
+ 
++#if defined(CONFIG_FIT_SIGNATURE)
+ int bootm_host_load_images(const void *fit, int cfg_noffset);
++#endif
+ 
+ int boot_selected_os(int argc, char * const argv[], int state,
+ 		     bootm_headers_t *images, boot_os_fn *boot_fn);
+diff --git a/tools/Makefile b/tools/Makefile
+index da50e1b..0a3d279 100644
+--- a/tools/Makefile
++++ b/tools/Makefile
+@@ -54,6 +54,7 @@ mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o
+ hostprogs-y += dumpimage mkimage
+ hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign
+ 
++FIT_OBJS-$(CONFIG_FIT) := fit_common.o fit_image.o image-host.o common/image-fit.o
+ FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o
+ # Flattened device tree objects
+ LIBFDT_OBJS := $(addprefix lib/libfdt/, \
+@@ -68,18 +69,15 @@ ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o
+ # common objs for dumpimage and mkimage
+ dumpimage-mkimage-objs := aisimage.o \
+ 			atmelimage.o \
++			$(FIT_OBJS-y) \
+ 			$(FIT_SIG_OBJS-y) \
+ 			common/bootm.o \
+ 			lib/crc32.o \
+ 			default_image.o \
+ 			lib/fdtdec_common.o \
+ 			lib/fdtdec.o \
+-			fit_common.o \
+-			fit_image.o \
+ 			gpimage.o \
+ 			gpimage-common.o \
+-			common/image-fit.o \
+-			image-host.o \
+ 			common/image.o \
+ 			imagetool.o \
+ 			imximage.o \
+-- 
+2.7.4
+
diff --git a/package/uboot-tools/Config.in b/package/uboot-tools/Config.in
index 76983f4..c663230 100644
--- a/package/uboot-tools/Config.in
+++ b/package/uboot-tools/Config.in
@@ -7,17 +7,22 @@ config BR2_PACKAGE_UBOOT_TOOLS
 
 if BR2_PACKAGE_UBOOT_TOOLS
 
-config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
-	bool "mkimage"
+config BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
+	bool "Flattened Image Tree (FIT) support"
+	select BR2_PACKAGE_DTC
+	select BR2_PACKAGE_DTC_PROGRAMS
 	help
-	  Install the mkimage tool on the target system
+	  Enables support for Flattened Image Tree (FIT).
 
-	  The mkimage tool from Das U-Boot bootloader, which allows
-	  generation of U-Boot images in various formats.
+	  This option allows to boot the new uImage structrure,
+	  Flattened Image Tree. FIT is formally a FDT, which can include
+	  images of various types (kernel, FDT blob, ramdisk, etc.)
+	  in a single blob. To boot this new uImage structure,
+	  pass the address of the blob to the "bootm" command.
 
-if BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+if BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
 
-config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
+config BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 	bool "FIT signature verification support"
 	select BR2_PACKAGE_OPENSSL
 	help
@@ -40,6 +45,14 @@ config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
 
 endif
 
+config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+	bool "mkimage"
+	help
+	  Install the mkimage tool on the target system
+
+	  The mkimage tool from Das U-Boot bootloader, which allows
+	  generation of U-Boot images in various formats.
+
 config BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE
 	bool "mkenvimage"
 	help
diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host
index b5a42d9..406d9ff 100644
--- a/package/uboot-tools/Config.in.host
+++ b/package/uboot-tools/Config.in.host
@@ -7,6 +7,20 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS
 
 if BR2_PACKAGE_HOST_UBOOT_TOOLS
 
+config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+	bool "Flattened Image Tree (FIT) support"
+	select BR2_PACKAGE_HOST_DTC
+	help
+	  Enables support for Flattened Image Tree (FIT).
+
+	  This option allows to boot the new uImage structrure,
+	  Flattened Image Tree. FIT is formally a FDT, which can include
+	  images of various types (kernel, FDT blob, ramdisk, etc.)
+	  in a single blob. To boot this new uImage structure,
+	  pass the address of the blob to the "bootm" command.
+
+if BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+
 config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 	bool "FIT signature verification support"
 	help
@@ -24,3 +38,5 @@ config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 	  be verified in this way.
 
 endif
+
+endif
diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
index a6aadeb..1a29536 100644
--- a/package/uboot-tools/uboot-tools.mk
+++ b/package/uboot-tools/uboot-tools.mk
@@ -16,31 +16,30 @@ define UBOOT_TOOLS_CONFIGURE_CMDS
 	touch $(@D)/include/config/auto.conf
 endef
 
+UBOOT_TOOLS_MAKE_OPTS = CROSS_COMPILE="$(TARGET_CROSS)" \
+	CFLAGS="$(TARGET_CFLAGS)" \
+	LDFLAGS="$(TARGET_LDFLAGS)" \
+	STRIP=$(TARGET_STRIP)
+
+ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),y)
+UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT=y
+UBOOT_TOOLS_DEPENDENCIES += dtc
+ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
+UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y
+UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
+endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
+endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT
+
 define UBOOT_TOOLS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 	\
-		CROSS_COMPILE="$(TARGET_CROSS)"	\
-		CFLAGS="$(TARGET_CFLAGS)"	\
-		LDFLAGS="$(TARGET_LDFLAGS)"	\
-		STRIP=$(TARGET_STRIP)		\
-		CROSS_BUILD_TOOLS=y		\
-		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \
-		tools-only
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) 	\
-		CROSS_COMPILE="$(TARGET_CROSS)"	\
-		CFLAGS="$(TARGET_CFLAGS)"	\
-		LDFLAGS="$(TARGET_LDFLAGS)"	\
-		STRIP=$(TARGET_STRIP)		\
-		env no-dot-config-targets=env
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_TOOLS_MAKE_OPTS) CROSS_BUILD_TOOLS=y tools-only
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_TOOLS_MAKE_OPTS) env no-dot-config-targets=env
 endef
 
 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE),y)
 define UBOOT_TOOLS_INSTALL_MKIMAGE
 	$(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(TARGET_DIR)/usr/bin/mkimage
 endef
-ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT),y)
-UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
-endif # BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT
-endif # BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+endif
 
 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE),y)
 define UBOOT_TOOLS_INSTALL_MKENVIMAGE
@@ -76,22 +75,26 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS
 	$(UBOOT_TOOLS_INSTALL_DUMPIMAGE)
 endef
 
-ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
-HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
-endif
-
 define HOST_UBOOT_TOOLS_CONFIGURE_CMDS
 	mkdir -p $(@D)/include/config
 	touch $(@D)/include/config/auto.conf
 endef
 
+HOST_UBOOT_TOOLS_MAKE_OPTS = HOSTCC="$(HOSTCC)" \
+	HOSTCFLAGS="$(HOST_CFLAGS)" \
+	HOSTLDFLAGS="$(HOST_LDFLAGS)"
+
+ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),y)
+HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT=y
+HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
+ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
+HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y
+HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
+endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
+endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+
 define HOST_UBOOT_TOOLS_BUILD_CMDS
-	$(MAKE1) -C $(@D) 			\
-		CONFIG_FIT_SIGNATURE=$(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT) \
-		HOSTCC="$(HOSTCC)"		\
-		HOSTCFLAGS="$(HOST_CFLAGS)"	\
-		HOSTLDFLAGS="$(HOST_LDFLAGS)"	\
-		tools-only
+	$(MAKE1) -C $(@D) $(HOST_UBOOT_TOOLS_MAKE_OPTS) tools-only
 endef
 
 define HOST_UBOOT_TOOLS_INSTALL_CMDS
-- 
2.7.4

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

* [Buildroot] [PATCH v5] util-linux: rework utilities menu for finer control
  2016-06-03 19:35         ` [Buildroot] [PATCH v4] " Carlos Santos
@ 2016-06-07  2:25           ` Carlos Santos
  2016-07-05 15:11             ` Romain Naour
  2016-06-07 21:12           ` [Buildroot] [PATCH v4] uboot-tools: fix FIT support and make it optional Thomas Petazzoni
  1 sibling, 1 reply; 44+ messages in thread
From: Carlos Santos @ 2016-06-07  2:25 UTC (permalink / raw)
  To: buildroot

When even a single extra util-linux utility is enabled, the
default build and install will install many more programs,
including many that overlap with those offered by busybox.

Fix by reworking the install-utilies menu to take advantage
of the new --disable-all-programs config option.  This option
make it possible to disable the basic set of apps, and then
enable only the desired apps.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---

Changes v1 -> v2:
  - Rework to incorporate ideas and suggestions from Thomas Petazzoni
    and Arnout Vandecappelle.  At least, in spirit.

Changes v2 -> v3:
  - Change BR2_PACKAGE_UTIL_LINUX_SELECTED_BINARIES to
    BR2_PACKAGE_UTIL_LINUX_BINARIES, to conserve backwards-
    compatibility without need for a legacy option.
  - Enable 'Basic set' by default to match output of previous
    build when binaries were selected.

Changes v3 -> v4:
  - Rework to apply on top of master branch

Changes v4 -> v5:
  - Add option to control installation of libfdisk.
  - Fine-grained selection of libraries in custom selection of
    utilities.
  - Document that linux32, linux64, uname26, i386 and x86_64 are
    setarch aliases.
  - Add options to instal cal, ipcrm, ipcs, logger, lslogin and pg.
  - Remove options to install findfs and lsblk because there are no
    corresponding --enable- and --disable- configure options.
---
 package/util-linux/Config.in     | 117 ++++++++++++++++++++++++++++++++++-----
 package/util-linux/util-linux.mk |  23 +++++---
 2 files changed, 116 insertions(+), 24 deletions(-)

diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in
index 8a36c0a..d002495 100644
--- a/package/util-linux/Config.in
+++ b/package/util-linux/Config.in
@@ -18,6 +18,14 @@ config BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	help
 	  Install libblkid.
 
+config BR2_PACKAGE_UTIL_LINUX_LIBFDISK
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	depends on BR2_USE_MMU # fork
+	bool "libfdisk"
+	help
+	  Install libfdisk.
+
 config BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	depends on BR2_USE_MMU # util-linux/libblkid
@@ -36,18 +44,62 @@ config BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Install libuuid.
 
+choice
+	prompt "Install utilities"
+	default BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
+
+config BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
+	bool "none"
+	help
+	  Disable all util-linux binaries.
+
+config BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES
+	bool "all"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
+	select BR2_PACKAGE_LINUX_PAM  # login utils
+	select BR2_PACKAGE_ZLIB  # cramfs
+	select BR2_PACKAGE_NCURSES  # more, setterm, ul
+	select BR2_PACKAGE_LIBCAP_NG  # setpriv
+	help
+	  Install the complete set of util-linux binaries.
+
 config BR2_PACKAGE_UTIL_LINUX_BINARIES
-	bool "install utilities"
+	bool "custom"
 	depends on BR2_USE_MMU # fork()
-	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
-	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
-	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
-	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
-	  Install the basic set of util-linux binaries.
+	  Manually select which util-linux binaries to install.
+
+endchoice
 
 if BR2_PACKAGE_UTIL_LINUX_BINARIES
 
+config BR2_PACKAGE_UTIL_LINUX_BASIC_SET
+	bool "Basic set"
+	default y
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
+	help
+	  Install a basic set of util-linux binaries.
+
+	  blkdiscard, blkid, blockdev, chcpu, col, colcrt, colrm,
+	  column, ctrlaltdel, dmesg, fdisk, findfs, findmnt, flock,
+	  fsfreeze, fstrim, getopt, hexdump, ipcmk, isosize, ldattach,
+	  look, lsblk, lscpu, lsipc, lslocks, lsns, mcookie, mkfs,
+	  mkswap, namei, prlimit, readprofile, renice, rev, rtcwake,
+	  script, scriptreplay, setarch, setsid, sfdisk, swaplabel,
+	  swapoff, swapon, tailf, uuidgen, whereis, wipefs
+
+	  The setarch utility may also install architecture-specific
+	  "aliases" like linux32, linux64, uname26, i386 and x86_64.
+
 config BR2_PACKAGE_UTIL_LINUX_AGETTY
 	bool "agetty"
 	help
@@ -58,6 +110,11 @@ config BR2_PACKAGE_UTIL_LINUX_BFS
 	help
 	  SCO bfs filesystem support
 
+config BR2_PACKAGE_UTIL_LINUX_CAL
+	bool "cal"
+	help
+	  Display a calendar, or some part of it
+
 config BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH
 	bool "chfn/chsh"
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
@@ -79,6 +136,9 @@ config BR2_PACKAGE_UTIL_LINUX_CRAMFS
 
 config BR2_PACKAGE_UTIL_LINUX_EJECT
 	bool "eject"
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Eject removable media
 
@@ -92,13 +152,11 @@ config BR2_PACKAGE_UTIL_LINUX_FDFORMAT
 	help
 	  Low-level format a floppy disk
 
-config BR2_PACKAGE_UTIL_LINUX_FINDFS
-	bool "findfs"
-	help
-	  Find a filesystem by label or UUID
-
 config BR2_PACKAGE_UTIL_LINUX_FSCK
 	bool "fsck"
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Check and repair a linux filesystem
 
@@ -107,6 +165,16 @@ config BR2_PACKAGE_UTIL_LINUX_HWCLOCK
 	help
 	  Query or set the hardware clock (RTC)
 
+config BR2_PACKAGE_UTIL_LINUX_IPCRM
+	bool "ipcrm"
+	help
+	  Remove certain IPC resources
+
+config BR2_PACKAGE_UTIL_LINUX_IPCS
+	bool "ipcs"
+	help
+	  Show information on IPC facilities
+
 config BR2_PACKAGE_UTIL_LINUX_KILL
 	bool "kill"
 	help
@@ -135,15 +203,20 @@ comment "login utilities needs a uClibc or (e)glibc toolchain w/ wchar, locale,
 	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
 		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
 
+config BR2_PACKAGE_UTIL_LINUX_LOGGER
+	bool "logger"
+	help
+	  Enter messages into the system log
+
 config BR2_PACKAGE_UTIL_LINUX_LOSETUP
 	bool "losetup"
 	help
 	  Set up and control loop devices
 
-config BR2_PACKAGE_UTIL_LINUX_LSBLK
-	bool "lsblk"
+config BR2_PACKAGE_UTIL_LINUX_LSLOGINS
+	bool "lslogin"
 	help
-	  List block devices.
+	  Display information about known users in the system
 
 config BR2_PACKAGE_UTIL_LINUX_MESG
 	bool "mesg"
@@ -163,11 +236,17 @@ config BR2_PACKAGE_UTIL_LINUX_MORE
 
 config BR2_PACKAGE_UTIL_LINUX_MOUNT
 	bool "mount/umount"
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Mount/unmount filesystems
 
 config BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT
 	bool "mountpoint"
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  See if a directory is a mountpoint
 
@@ -185,13 +264,20 @@ config BR2_PACKAGE_UTIL_LINUX_NSENTER
 	bool "nsenter"
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 	help
-	  Enter the namespaces of another process.
+	  Enter the namespaces of another process
 
 comment "nsenter needs a toolchain w/ headers >= 3.0"
 	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 
+config BR2_PACKAGE_UTIL_LINUX_PG
+	bool "pg"
+	help
+	  Browse pagewise through text files
+
 config BR2_PACKAGE_UTIL_LINUX_PARTX
 	bool "partition utilities"
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Partition tools (addpart, delpart, partx)
 
@@ -261,6 +347,7 @@ config BR2_PACKAGE_UTIL_LINUX_UTMPDUMP
 
 config BR2_PACKAGE_UTIL_LINUX_UUIDD
 	bool "uuidd"
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  UUID generation daemon
 
diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk
index 93f45c2..d979852 100644
--- a/package/util-linux/util-linux.mk
+++ b/package/util-linux/util-linux.mk
@@ -63,18 +63,26 @@ UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_ZLIB),zlib)
 # Used by login-utils
 UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_LINUX_PAM),linux-pam)
 
+ifeq ($(BR2_PACKAGE_UTIL_LINUX_NO_BINARIES),y)
+UTIL_LINUX_CONF_OPTS += --disable-all-programs
+else ifeq ($(BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES),y)
+UTIL_LINUX_CONF_OPTS += --enable-all-programs
+else
 # Disable/Enable utilities
 UTIL_LINUX_CONF_OPTS += \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_BASIC_SET),,--disable-all-programs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),--enable-agetty,--disable-agetty) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_BFS),--enable-bfs,--disable-bfs) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_CAL),--enable-cal,--disable-cal) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH),--enable-chfn-chsh,--disable-chfn-chsh) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CRAMFS),--enable-cramfs,--disable-cramfs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_EJECT),--enable-eject,--disable-eject) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FALLOCATE),--enable-fallocate,--disable-fallocate) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FDFORMAT),--enable-fdformat,--disable-fdformat) \
-	$(if $(BR2_PACKAGE_UTIL_LINUX_FINDFS),--enable-findfs,--disable-findfs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FSCK),--enable-fsck,--disable-fsck) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_HWCLOCK),--enable-hwclock,--disable-hwclock) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_IPCRM),--enable-ipcrm,--disable-ipcrm) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_IPCS),--enable-ipcs,--disable-ipcs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_KILL),--enable-kill,--disable-kill) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LAST),--enable-last,--disable-last) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),--enable-libblkid,--disable-libblkid) \
@@ -83,8 +91,9 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBUUID),--enable-libuuid,--disable-libuuid) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LINE),--enable-line,--disable-line) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),--enable-last --enable-login --enable-runuser --enable-su --enable-sulogin,--disable-last --disable-login --disable-runuser --disable-su --disable-sulogin) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGGER),--enable-logger,--disable-logger) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LOSETUP),--enable-losetup,--disable-losetup) \
-	$(if $(BR2_PACKAGE_UTIL_LINUX_LSBLK),--enable-lsblk,--disable-lsblk) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_LSLOGINS),--enable-lslogins,--disable-lslogins) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MESG),--enable-mesg,--disable-mesg) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MINIX),--enable-minix,--disable-minix) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MORE),--enable-more,--disable-more) \
@@ -94,6 +103,7 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_NOLOGIN),--enable-nologin,--disable-nologin) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_NSENTER),--enable-nsenter,--disable-nsenter) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_PARTX),--enable-partx,--disable-partx) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_PG),--enable-pg,--disable-pg) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT),--enable-pivot_root,--disable-pivot_root) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_RAW),--enable-raw,--disable-raw) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_RENAME),--enable-rename,--disable-rename) \
@@ -112,6 +122,7 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_WDCTL),--enable-wdctl,--disable-wdctl) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_WRITE),--enable-write,--disable-write) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_ZRAMCTL),--enable-zramctl,--disable-zramctl)
+endif
 
 # In the host version of util-linux, we so far only require libuuid,
 # and none of the util-linux utilities, so we disable all of them, unless
@@ -130,12 +141,6 @@ else
 HOST_UTIL_LINUX_CONF_OPTS += --disable-all-programs
 endif
 
-# Avoid building the tools if they are disabled since we can't install on
-# a per-directory basis.
-ifeq ($(BR2_PACKAGE_UTIL_LINUX_BINARIES),)
-UTIL_LINUX_CONF_OPTS += --disable-all-programs
-endif
-
 # Install libmount Python bindings
 ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
 UTIL_LINUX_CONF_OPTS += --with-python
@@ -162,7 +167,7 @@ endif
 UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_INSTALL_PAMFILES
 
 # Install agetty->getty symlink to avoid breakage when there's no busybox
-ifeq ($(BR2_PACKAGE_UTIL_LINUX_AGETTY),y)
+ifneq ($(BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES)$(BR2_PACKAGE_UTIL_LINUX_AGETTY),)
 ifeq ($(BR2_PACKAGE_BUSYBOX),)
 define UTIL_LINUX_GETTY_SYMLINK
 	ln -sf agetty $(TARGET_DIR)/sbin/getty
-- 
2.7.4

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

* [Buildroot] [PATCH v4] uboot-tools: fix FIT support and make it optional
  2016-06-03 19:35         ` [Buildroot] [PATCH v4] " Carlos Santos
  2016-06-07  2:25           ` [Buildroot] [PATCH v5] util-linux: rework utilities menu for finer control Carlos Santos
@ 2016-06-07 21:12           ` Thomas Petazzoni
  1 sibling, 0 replies; 44+ messages in thread
From: Thomas Petazzoni @ 2016-06-07 21:12 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri,  3 Jun 2016 16:35:39 -0300, Carlos Santos wrote:
> Fix several issues regarding the support for Flat Image Trees (FIT).
> 
> - Add a patch to really allow turning FIT support on/off, which was not
>   possible due to bugs in the code and in the tools Makefile. This patch
>   has been sent upstream but not applied there, yet.
> 
> - Use independent options to control FIT support on host and target
>   packages.
> 
> - Subordinate FIT signature support to the activation of FIT support, in
>   the target package, not to mkimage installation.
> 
> - Add a dependence on the dtc utilities because mkimage needs it when
>   FIT is enabled; otherwise mkimage fails like this:
> 
>     $ mkimage -f firmware.its firmware.im
>     sh: dtc: command not found
> 
> - Add BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT to the
>   Config.in.legacy file.
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>

Thanks, I've applied your patch, with some minor tweaks, see below.


> +ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),y)
> +UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT=y
> +UBOOT_TOOLS_DEPENDENCIES += dtc
> +ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
> +UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y
> +UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
> +endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
> +endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT

Nesting the two conditions is not needed, since the Config.in options
already depend on each other. So I've "un-nested" the conditions.

> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_TOOLS_MAKE_OPTS) CROSS_BUILD_TOOLS=y tools-only
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(UBOOT_TOOLS_MAKE_OPTS) env no-dot-config-targets=env

These lines were a bit too long, so I've split them.

Thanks again!

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

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

* [Buildroot] [PATCH v5] util-linux: rework utilities menu for finer control
  2016-06-07  2:25           ` [Buildroot] [PATCH v5] util-linux: rework utilities menu for finer control Carlos Santos
@ 2016-07-05 15:11             ` Romain Naour
  2016-07-06  2:43               ` Carlos Santos
  0 siblings, 1 reply; 44+ messages in thread
From: Romain Naour @ 2016-07-05 15:11 UTC (permalink / raw)
  To: buildroot

Hi Carlos,

Le 07/06/2016 ? 04:25, Carlos Santos a ?crit :
> When even a single extra util-linux utility is enabled, the
> default build and install will install many more programs,
> including many that overlap with those offered by busybox.
> 
> Fix by reworking the install-utilies menu to take advantage
> of the new --disable-all-programs config option.  This option
> make it possible to disable the basic set of apps, and then
> enable only the desired apps.
> 
> Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
> 
> Changes v1 -> v2:
>   - Rework to incorporate ideas and suggestions from Thomas Petazzoni
>     and Arnout Vandecappelle.  At least, in spirit.
> 
> Changes v2 -> v3:
>   - Change BR2_PACKAGE_UTIL_LINUX_SELECTED_BINARIES to
>     BR2_PACKAGE_UTIL_LINUX_BINARIES, to conserve backwards-
>     compatibility without need for a legacy option.
>   - Enable 'Basic set' by default to match output of previous
>     build when binaries were selected.
> 
> Changes v3 -> v4:
>   - Rework to apply on top of master branch
> 
> Changes v4 -> v5:
>   - Add option to control installation of libfdisk.
>   - Fine-grained selection of libraries in custom selection of
>     utilities.
>   - Document that linux32, linux64, uname26, i386 and x86_64 are
>     setarch aliases.
>   - Add options to instal cal, ipcrm, ipcs, logger, lslogin and pg.
>   - Remove options to install findfs and lsblk because there are no
>     corresponding --enable- and --disable- configure options.
> ---
>  package/util-linux/Config.in     | 117 ++++++++++++++++++++++++++++++++++-----
>  package/util-linux/util-linux.mk |  23 +++++---
>  2 files changed, 116 insertions(+), 24 deletions(-)
> 
> diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in
> index 8a36c0a..d002495 100644
> --- a/package/util-linux/Config.in
> +++ b/package/util-linux/Config.in
> @@ -18,6 +18,14 @@ config BR2_PACKAGE_UTIL_LINUX_LIBBLKID
>  	help
>  	  Install libblkid.
>  
> +config BR2_PACKAGE_UTIL_LINUX_LIBFDISK
> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
> +	depends on BR2_USE_MMU # fork
> +	bool "libfdisk"
> +	help
> +	  Install libfdisk.
> +
>  config BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
>  	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
>  	depends on BR2_USE_MMU # util-linux/libblkid
> @@ -36,18 +44,62 @@ config BR2_PACKAGE_UTIL_LINUX_LIBUUID
>  	help
>  	  Install libuuid.
>  
> +choice
> +	prompt "Install utilities"
> +	default BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
> +
> +config BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
> +	bool "none"
> +	help
> +	  Disable all util-linux binaries.
> +
> +config BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES
> +	bool "all"
> +	depends on BR2_USE_MMU # fork()
> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
> +	select BR2_PACKAGE_LINUX_PAM  # login utils
> +	select BR2_PACKAGE_ZLIB  # cramfs
> +	select BR2_PACKAGE_NCURSES  # more, setterm, ul
> +	select BR2_PACKAGE_LIBCAP_NG  # setpriv
> +	help
> +	  Install the complete set of util-linux binaries.
> +
>  config BR2_PACKAGE_UTIL_LINUX_BINARIES
> -	bool "install utilities"
> +	bool "custom"
>  	depends on BR2_USE_MMU # fork()
> -	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
> -	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
> -	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
> -	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
>  	help
> -	  Install the basic set of util-linux binaries.
> +	  Manually select which util-linux binaries to install.
> +
> +endchoice
>  
>  if BR2_PACKAGE_UTIL_LINUX_BINARIES
>  
> +config BR2_PACKAGE_UTIL_LINUX_BASIC_SET
> +	bool "Basic set"

Use "basic set" instead since all other option are lowercase.

> +	default y

missing depends on BR2_USE_MMU # fork()

> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
> +	help
> +	  Install a basic set of util-linux binaries.
> +
> +	  blkdiscard, blkid, blockdev, chcpu, col, colcrt, colrm,
> +	  column, ctrlaltdel, dmesg, fdisk, findfs, findmnt, flock,
> +	  fsfreeze, fstrim, getopt, hexdump, ipcmk, isosize, ldattach,
> +	  look, lsblk, lscpu, lsipc, lslocks, lsns, mcookie, mkfs,
> +	  mkswap, namei, prlimit, readprofile, renice, rev, rtcwake,
> +	  script, scriptreplay, setarch, setsid, sfdisk, swaplabel,
> +	  swapoff, swapon, tailf, uuidgen, whereis, wipefs
> +
> +	  The setarch utility may also install architecture-specific
> +	  "aliases" like linux32, linux64, uname26, i386 and x86_64.
> +
>  config BR2_PACKAGE_UTIL_LINUX_AGETTY
>  	bool "agetty"
>  	help
> @@ -58,6 +110,11 @@ config BR2_PACKAGE_UTIL_LINUX_BFS
>  	help
>  	  SCO bfs filesystem support
>  
> +config BR2_PACKAGE_UTIL_LINUX_CAL
> +	bool "cal"
> +	help
> +	  Display a calendar, or some part of it
> +
>  config BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH
>  	bool "chfn/chsh"
>  	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
> @@ -79,6 +136,9 @@ config BR2_PACKAGE_UTIL_LINUX_CRAMFS
>  
>  config BR2_PACKAGE_UTIL_LINUX_EJECT
>  	bool "eject"

missing depends on BR2_USE_MMU # fork()

> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
>  	help
>  	  Eject removable media
>  
> @@ -92,13 +152,11 @@ config BR2_PACKAGE_UTIL_LINUX_FDFORMAT
>  	help
>  	  Low-level format a floppy disk
>  
> -config BR2_PACKAGE_UTIL_LINUX_FINDFS
> -	bool "findfs"
> -	help
> -	  Find a filesystem by label or UUID
> -
>  config BR2_PACKAGE_UTIL_LINUX_FSCK
>  	bool "fsck"

missing depends on BR2_USE_MMU # fork()

> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
>  	help
>  	  Check and repair a linux filesystem
>  
> @@ -107,6 +165,16 @@ config BR2_PACKAGE_UTIL_LINUX_HWCLOCK
>  	help
>  	  Query or set the hardware clock (RTC)
>  
> +config BR2_PACKAGE_UTIL_LINUX_IPCRM
> +	bool "ipcrm"
> +	help
> +	  Remove certain IPC resources
> +
> +config BR2_PACKAGE_UTIL_LINUX_IPCS
> +	bool "ipcs"
> +	help
> +	  Show information on IPC facilities
> +
>  config BR2_PACKAGE_UTIL_LINUX_KILL
>  	bool "kill"
>  	help
> @@ -135,15 +203,20 @@ comment "login utilities needs a uClibc or (e)glibc toolchain w/ wchar, locale,
>  	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
>  		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
>  
> +config BR2_PACKAGE_UTIL_LINUX_LOGGER
> +	bool "logger"
> +	help
> +	  Enter messages into the system log
> +
>  config BR2_PACKAGE_UTIL_LINUX_LOSETUP
>  	bool "losetup"
>  	help
>  	  Set up and control loop devices
>  
> -config BR2_PACKAGE_UTIL_LINUX_LSBLK
> -	bool "lsblk"
> +config BR2_PACKAGE_UTIL_LINUX_LSLOGINS
> +	bool "lslogin"
>  	help
> -	  List block devices.
> +	  Display information about known users in the system
>  
>  config BR2_PACKAGE_UTIL_LINUX_MESG
>  	bool "mesg"
> @@ -163,11 +236,17 @@ config BR2_PACKAGE_UTIL_LINUX_MORE
>  
>  config BR2_PACKAGE_UTIL_LINUX_MOUNT
>  	bool "mount/umount"

missing depends on BR2_USE_MMU # fork()

> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
>  	help
>  	  Mount/unmount filesystems
>  
>  config BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT
>  	bool "mountpoint"

missing depends on BR2_USE_MMU # fork()

> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
>  	help
>  	  See if a directory is a mountpoint
>  
> @@ -185,13 +264,20 @@ config BR2_PACKAGE_UTIL_LINUX_NSENTER
>  	bool "nsenter"
>  	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
>  	help
> -	  Enter the namespaces of another process.
> +	  Enter the namespaces of another process
>  
>  comment "nsenter needs a toolchain w/ headers >= 3.0"
>  	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
>  
> +config BR2_PACKAGE_UTIL_LINUX_PG
> +	bool "pg"
> +	help
> +	  Browse pagewise through text files
> +
>  config BR2_PACKAGE_UTIL_LINUX_PARTX
>  	bool "partition utilities"

missing depends on BR2_USE_MMU # fork()

> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
>  	help
>  	  Partition tools (addpart, delpart, partx)
>  
> @@ -261,6 +347,7 @@ config BR2_PACKAGE_UTIL_LINUX_UTMPDUMP
>  
>  config BR2_PACKAGE_UTIL_LINUX_UUIDD
>  	bool "uuidd"

missing depends on BR2_USE_MMU # fork()

With that fixed:
  Reviewed-by: Romain Naour <romain.naour@gmail.com>

Best regards,
Romain


> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
>  	help
>  	  UUID generation daemon
>  
> diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk
> index 93f45c2..d979852 100644
> --- a/package/util-linux/util-linux.mk
> +++ b/package/util-linux/util-linux.mk
> @@ -63,18 +63,26 @@ UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_ZLIB),zlib)
>  # Used by login-utils
>  UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_LINUX_PAM),linux-pam)
>  
> +ifeq ($(BR2_PACKAGE_UTIL_LINUX_NO_BINARIES),y)
> +UTIL_LINUX_CONF_OPTS += --disable-all-programs
> +else ifeq ($(BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES),y)
> +UTIL_LINUX_CONF_OPTS += --enable-all-programs
> +else
>  # Disable/Enable utilities
>  UTIL_LINUX_CONF_OPTS += \
> +	$(if $(BR2_PACKAGE_UTIL_LINUX_BASIC_SET),,--disable-all-programs) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),--enable-agetty,--disable-agetty) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_BFS),--enable-bfs,--disable-bfs) \
> +	$(if $(BR2_PACKAGE_UTIL_LINUX_CAL),--enable-cal,--disable-cal) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH),--enable-chfn-chsh,--disable-chfn-chsh) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_CRAMFS),--enable-cramfs,--disable-cramfs) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_EJECT),--enable-eject,--disable-eject) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_FALLOCATE),--enable-fallocate,--disable-fallocate) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_FDFORMAT),--enable-fdformat,--disable-fdformat) \
> -	$(if $(BR2_PACKAGE_UTIL_LINUX_FINDFS),--enable-findfs,--disable-findfs) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_FSCK),--enable-fsck,--disable-fsck) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_HWCLOCK),--enable-hwclock,--disable-hwclock) \
> +	$(if $(BR2_PACKAGE_UTIL_LINUX_IPCRM),--enable-ipcrm,--disable-ipcrm) \
> +	$(if $(BR2_PACKAGE_UTIL_LINUX_IPCS),--enable-ipcs,--disable-ipcs) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_KILL),--enable-kill,--disable-kill) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_LAST),--enable-last,--disable-last) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),--enable-libblkid,--disable-libblkid) \
> @@ -83,8 +91,9 @@ UTIL_LINUX_CONF_OPTS += \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBUUID),--enable-libuuid,--disable-libuuid) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_LINE),--enable-line,--disable-line) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),--enable-last --enable-login --enable-runuser --enable-su --enable-sulogin,--disable-last --disable-login --disable-runuser --disable-su --disable-sulogin) \
> +	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGGER),--enable-logger,--disable-logger) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_LOSETUP),--enable-losetup,--disable-losetup) \
> -	$(if $(BR2_PACKAGE_UTIL_LINUX_LSBLK),--enable-lsblk,--disable-lsblk) \
> +	$(if $(BR2_PACKAGE_UTIL_LINUX_LSLOGINS),--enable-lslogins,--disable-lslogins) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_MESG),--enable-mesg,--disable-mesg) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_MINIX),--enable-minix,--disable-minix) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_MORE),--enable-more,--disable-more) \
> @@ -94,6 +103,7 @@ UTIL_LINUX_CONF_OPTS += \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_NOLOGIN),--enable-nologin,--disable-nologin) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_NSENTER),--enable-nsenter,--disable-nsenter) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_PARTX),--enable-partx,--disable-partx) \
> +	$(if $(BR2_PACKAGE_UTIL_LINUX_PG),--enable-pg,--disable-pg) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT),--enable-pivot_root,--disable-pivot_root) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_RAW),--enable-raw,--disable-raw) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_RENAME),--enable-rename,--disable-rename) \
> @@ -112,6 +122,7 @@ UTIL_LINUX_CONF_OPTS += \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_WDCTL),--enable-wdctl,--disable-wdctl) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_WRITE),--enable-write,--disable-write) \
>  	$(if $(BR2_PACKAGE_UTIL_LINUX_ZRAMCTL),--enable-zramctl,--disable-zramctl)
> +endif
>  
>  # In the host version of util-linux, we so far only require libuuid,
>  # and none of the util-linux utilities, so we disable all of them, unless
> @@ -130,12 +141,6 @@ else
>  HOST_UTIL_LINUX_CONF_OPTS += --disable-all-programs
>  endif
>  
> -# Avoid building the tools if they are disabled since we can't install on
> -# a per-directory basis.
> -ifeq ($(BR2_PACKAGE_UTIL_LINUX_BINARIES),)
> -UTIL_LINUX_CONF_OPTS += --disable-all-programs
> -endif
> -
>  # Install libmount Python bindings
>  ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
>  UTIL_LINUX_CONF_OPTS += --with-python
> @@ -162,7 +167,7 @@ endif
>  UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_INSTALL_PAMFILES
>  
>  # Install agetty->getty symlink to avoid breakage when there's no busybox
> -ifeq ($(BR2_PACKAGE_UTIL_LINUX_AGETTY),y)
> +ifneq ($(BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES)$(BR2_PACKAGE_UTIL_LINUX_AGETTY),)
>  ifeq ($(BR2_PACKAGE_BUSYBOX),)
>  define UTIL_LINUX_GETTY_SYMLINK
>  	ln -sf agetty $(TARGET_DIR)/sbin/getty
> 

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

* [Buildroot] [PATCH v5] util-linux: rework utilities menu for finer control
  2016-07-05 15:11             ` Romain Naour
@ 2016-07-06  2:43               ` Carlos Santos
  2016-07-06  2:55                 ` [Buildroot] [PATCH v6] " Carlos Santos
  0 siblings, 1 reply; 44+ messages in thread
From: Carlos Santos @ 2016-07-06  2:43 UTC (permalink / raw)
  To: buildroot

> From: "Romain Naour" <romain.naour@gmail.com>
> To: "Carlos Santos" <casantos@datacom.ind.br>, buildroot at buildroot.org
> Cc: "thomas petazzoni" <thomas.petazzoni@free-electrons.com>
> Sent: Tuesday, July 5, 2016 12:11:33 PM
> Subject: Re: [Buildroot] [PATCH v5] util-linux: rework utilities menu for finer control

> Hi Carlos,
> 
> Le 07/06/2016 ? 04:25, Carlos Santos a ?crit :
>> When even a single extra util-linux utility is enabled, the
>> default build and install will install many more programs,
>> including many that overlap with those offered by busybox.
>> 
>> Fix by reworking the install-utilies menu to take advantage
>> of the new --disable-all-programs config option.  This option
>> make it possible to disable the basic set of apps, and then
>> enable only the desired apps.
>> 
>> Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
>> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
>> ---
>> 
>> Changes v1 -> v2:
>>   - Rework to incorporate ideas and suggestions from Thomas Petazzoni
>>     and Arnout Vandecappelle.  At least, in spirit.
>> 
>> Changes v2 -> v3:
>>   - Change BR2_PACKAGE_UTIL_LINUX_SELECTED_BINARIES to
>>     BR2_PACKAGE_UTIL_LINUX_BINARIES, to conserve backwards-
>>     compatibility without need for a legacy option.
>>   - Enable 'Basic set' by default to match output of previous
>>     build when binaries were selected.
>> 
>> Changes v3 -> v4:
>>   - Rework to apply on top of master branch
>> 
>> Changes v4 -> v5:
>>   - Add option to control installation of libfdisk.
>>   - Fine-grained selection of libraries in custom selection of
>>     utilities.
>>   - Document that linux32, linux64, uname26, i386 and x86_64 are
>>     setarch aliases.
>>   - Add options to instal cal, ipcrm, ipcs, logger, lslogin and pg.
>>   - Remove options to install findfs and lsblk because there are no
>>     corresponding --enable- and --disable- configure options.
>> ---
>>  package/util-linux/Config.in     | 117 ++++++++++++++++++++++++++++++++++-----
>>  package/util-linux/util-linux.mk |  23 +++++---
>>  2 files changed, 116 insertions(+), 24 deletions(-)
>> 
>> diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in
>> index 8a36c0a..d002495 100644
>> --- a/package/util-linux/Config.in
>> +++ b/package/util-linux/Config.in
>> @@ -18,6 +18,14 @@ config BR2_PACKAGE_UTIL_LINUX_LIBBLKID
>>  	help
>>  	  Install libblkid.
>>  
>> +config BR2_PACKAGE_UTIL_LINUX_LIBFDISK
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
>> +	depends on BR2_USE_MMU # fork
>> +	bool "libfdisk"
>> +	help
>> +	  Install libfdisk.
>> +
>>  config BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
>>  	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
>>  	depends on BR2_USE_MMU # util-linux/libblkid
>> @@ -36,18 +44,62 @@ config BR2_PACKAGE_UTIL_LINUX_LIBUUID
>>  	help
>>  	  Install libuuid.
>>  
>> +choice
>> +	prompt "Install utilities"
>> +	default BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
>> +
>> +config BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
>> +	bool "none"
>> +	help
>> +	  Disable all util-linux binaries.
>> +
>> +config BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES
>> +	bool "all"
>> +	depends on BR2_USE_MMU # fork()
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
>> +	select BR2_PACKAGE_LINUX_PAM  # login utils
>> +	select BR2_PACKAGE_ZLIB  # cramfs
>> +	select BR2_PACKAGE_NCURSES  # more, setterm, ul
>> +	select BR2_PACKAGE_LIBCAP_NG  # setpriv
>> +	help
>> +	  Install the complete set of util-linux binaries.
>> +
>>  config BR2_PACKAGE_UTIL_LINUX_BINARIES
>> -	bool "install utilities"
>> +	bool "custom"
>>  	depends on BR2_USE_MMU # fork()
>> -	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
>> -	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
>> -	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
>> -	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
>>  	help
>> -	  Install the basic set of util-linux binaries.
>> +	  Manually select which util-linux binaries to install.
>> +
>> +endchoice
>>  
>>  if BR2_PACKAGE_UTIL_LINUX_BINARIES
>>  
>> +config BR2_PACKAGE_UTIL_LINUX_BASIC_SET
>> +	bool "Basic set"
> 
> Use "basic set" instead since all other option are lowercase.

Lowercase options correspond to package/utility/library names. I will change the other options to match this criterion.

> 
>> +	default y
> 
> missing depends on BR2_USE_MMU # fork()

OK, I will fine-tune the declaration of these dependencies.

Carlos Santos (Casantos)
DATACOM, P&D

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

* [Buildroot] [PATCH v6] util-linux: rework utilities menu for finer control
  2016-07-06  2:43               ` Carlos Santos
@ 2016-07-06  2:55                 ` Carlos Santos
  2016-07-06 21:54                   ` Yann E. MORIN
  0 siblings, 1 reply; 44+ messages in thread
From: Carlos Santos @ 2016-07-06  2:55 UTC (permalink / raw)
  To: buildroot

When even a single extra util-linux utility is enabled, the
default build and install will install many more programs,
including many that overlap with those offered by busybox.

Fix by reworking the install-utilies menu to take advantage
of the new --disable-all-programs config option.  This option
make it possible to disable the basic set of apps, and then
enable only the desired apps.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---

Changes v1 -> v2:
  - Rework to incorporate ideas and suggestions from Thomas Petazzoni
    and Arnout Vandecappelle.  At least, in spirit.

Changes v2 -> v3:
  - Change BR2_PACKAGE_UTIL_LINUX_SELECTED_BINARIES to
    BR2_PACKAGE_UTIL_LINUX_BINARIES, to conserve backwards-
    compatibility without need for a legacy option.
  - Enable 'Basic set' by default to match output of previous
    build when binaries were selected.

Changes v3 -> v4:
  - Rework to apply on top of master branch

Changes v4 -> v5:
  - Add option to control installation of libfdisk.
  - Fine-grained selection of libraries in custom selection of
    utilities.
  - Document that linux32, linux64, uname26, i386 and x86_64 are
    setarch aliases.
  - Add options to instal cal, ipcrm, ipcs, logger, lslogin and pg.
  - Remove options to install findfs and lsblk because there are no
    corresponding --enable- and --disable- configure options.

CHanges v5 -> v6:
  - Make 'bool "lib<foo>"' the first item in each block
  - Add several missing dependencies on BR2_USE_MMU, for fork()
  - Options corresponding to package/utility/library names in
    lowercase (do the same for "none", "all" and "custom")
  - Improve help for cramfs utilities and login utilities

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/util-linux/Config.in     | 158 ++++++++++++++++++++++++++++++++-------
 package/util-linux/util-linux.mk |  23 +++---
 2 files changed, 144 insertions(+), 37 deletions(-)

diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in
index 429dfa7..3a56f7c 100644
--- a/package/util-linux/Config.in
+++ b/package/util-linux/Config.in
@@ -12,22 +12,30 @@ menuconfig BR2_PACKAGE_UTIL_LINUX
 if BR2_PACKAGE_UTIL_LINUX
 
 config BR2_PACKAGE_UTIL_LINUX_LIBBLKID
-	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
-	depends on BR2_USE_MMU # fork
 	bool "libblkid"
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	depends on BR2_USE_MMU # fork()
 	help
 	  Install libblkid.
 
-config BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+config BR2_PACKAGE_UTIL_LINUX_LIBFDISK
+	bool "libfdisk"
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
-	depends on BR2_USE_MMU # util-linux/libblkid
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	depends on BR2_USE_MMU # fork()
+	help
+	  Install libfdisk.
+
+config BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
 	bool "libmount"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	help
 	  Install libmount.
 
 config BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
 	bool "libsmartcols"
-	depends on BR2_USE_MMU # fork
+	depends on BR2_USE_MMU # fork()
 	help
 	  Install libsmartcols.
 
@@ -36,20 +44,65 @@ config BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Install libuuid.
 
-config BR2_PACKAGE_UTIL_LINUX_BINARIES
-	bool "install utilities"
+choice
+	prompt "Install utilities"
+	default BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
+
+config BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
+	bool "none"
+	help
+	  Disable all util-linux binaries.
+
+config BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES
+	bool "all"
 	depends on BR2_USE_MMU # fork()
-	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
-	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
-	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
-	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
+	select BR2_PACKAGE_LINUX_PAM  # login utils
+	select BR2_PACKAGE_ZLIB  # cramfs
+	select BR2_PACKAGE_NCURSES  # more, setterm, ul
+	select BR2_PACKAGE_LIBCAP_NG  # setpriv
+	help
+	  Install the complete set of util-linux binaries.
+
+config BR2_PACKAGE_UTIL_LINUX_BINARIES
+	bool "custom"
 	help
-	  Install the basic set of util-linux binaries.
+	  Manually select which util-linux binaries to install.
+
+endchoice
 
 if BR2_PACKAGE_UTIL_LINUX_BINARIES
 
+config BR2_PACKAGE_UTIL_LINUX_BASIC_SET
+	bool "Basic set"
+	default y
+	depends on BR2_USE_MMU # fork() (dmesg, flock, script, setsid, swapon)
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
+	help
+	  Install a basic set of util-linux binaries.
+
+	  blkdiscard, blkid, blockdev, chcpu, col, colcrt, colrm,
+	  column, ctrlaltdel, dmesg, fdisk, findfs, findmnt, flock,
+	  fsfreeze, fstrim, getopt, hexdump, ipcmk, isosize, ldattach,
+	  look, lsblk, lscpu, lsipc, lslocks, lsns, mcookie, mkfs,
+	  mkswap, namei, prlimit, readprofile, renice, rev, rtcwake,
+	  script, scriptreplay, setarch, setsid, sfdisk, swaplabel,
+	  swapoff, swapon, tailf, uuidgen, whereis, wipefs
+
+	  The setarch utility may also install architecture-specific
+	  "aliases" like linux32, linux64, uname26, i386 and x86_64.
+
 config BR2_PACKAGE_UTIL_LINUX_AGETTY
 	bool "agetty"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Alternative linux getty
 
@@ -58,6 +111,11 @@ config BR2_PACKAGE_UTIL_LINUX_BFS
 	help
 	  SCO bfs filesystem support
 
+config BR2_PACKAGE_UTIL_LINUX_CAL
+	bool "cal"
+	help
+	  Display a calendar, or some part of it
+
 config BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH
 	bool "chfn/chsh"
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
@@ -75,10 +133,14 @@ config BR2_PACKAGE_UTIL_LINUX_CRAMFS
 	bool "cramfs utilities"
 	select BR2_PACKAGE_ZLIB
 	help
-	  Build fsck.cramfs and mkfs.cramfs
+	  Utilities for compressed ROM file system (fsck.cramfs, mkfs.cramfs)
 
 config BR2_PACKAGE_UTIL_LINUX_EJECT
 	bool "eject"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Eject removable media
 
@@ -92,13 +154,12 @@ config BR2_PACKAGE_UTIL_LINUX_FDFORMAT
 	help
 	  Low-level format a floppy disk
 
-config BR2_PACKAGE_UTIL_LINUX_FINDFS
-	bool "findfs"
-	help
-	  Find a filesystem by label or UUID
-
 config BR2_PACKAGE_UTIL_LINUX_FSCK
 	bool "fsck"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Check and repair a linux filesystem
 
@@ -107,6 +168,16 @@ config BR2_PACKAGE_UTIL_LINUX_HWCLOCK
 	help
 	  Query or set the hardware clock (RTC)
 
+config BR2_PACKAGE_UTIL_LINUX_IPCRM
+	bool "ipcrm"
+	help
+	  Remove certain IPC resources
+
+config BR2_PACKAGE_UTIL_LINUX_IPCS
+	bool "ipcs"
+	help
+	  Show information on IPC facilities
+
 config BR2_PACKAGE_UTIL_LINUX_KILL
 	bool "kill"
 	help
@@ -123,27 +194,33 @@ config BR2_PACKAGE_UTIL_LINUX_LINE
 	  Read one line
 
 config BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS
-	bool "login utilities"
+	bool "Login utilities"
+	depends on BR2_USE_MMU # fork() (login, runuser, su, sulogin)
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
 	depends on !BR2_STATIC_LIBS
 	depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
 	select BR2_PACKAGE_LINUX_PAM
 	help
-	  Build login utilities (last, login, su, sulogin)
+	  Login utilities (last, login, runuser, su, sulogin)
 
-comment "login utilities needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
+comment "Login utilities needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
 	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
 		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
 
+config BR2_PACKAGE_UTIL_LINUX_LOGGER
+	bool "logger"
+	help
+	  Enter messages into the system log
+
 config BR2_PACKAGE_UTIL_LINUX_LOSETUP
 	bool "losetup"
 	help
 	  Set up and control loop devices
 
-config BR2_PACKAGE_UTIL_LINUX_LSBLK
-	bool "lsblk"
+config BR2_PACKAGE_UTIL_LINUX_LSLOGINS
+	bool "lslogin"
 	help
-	  List block devices.
+	  Display information about known users in the system
 
 config BR2_PACKAGE_UTIL_LINUX_MESG
 	bool "mesg"
@@ -157,17 +234,26 @@ config BR2_PACKAGE_UTIL_LINUX_MINIX
 
 config BR2_PACKAGE_UTIL_LINUX_MORE
 	bool "more"
+	depends on BR2_USE_MMU # fork()
 	select BR2_PACKAGE_NCURSES
 	help
 	  File perusal filter for crt viewing
 
 config BR2_PACKAGE_UTIL_LINUX_MOUNT
 	bool "mount/umount"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Mount/unmount filesystems
 
 config BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT
 	bool "mountpoint"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  See if a directory is a mountpoint
 
@@ -183,17 +269,27 @@ config BR2_PACKAGE_UTIL_LINUX_NOLOGIN
 
 config BR2_PACKAGE_UTIL_LINUX_NSENTER
 	bool "nsenter"
+	depends on BR2_USE_MMU # fork()
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 	help
-	  Enter the namespaces of another process.
+	  Enter the namespaces of another process
 
 comment "nsenter needs a toolchain w/ headers >= 3.0"
 	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 
+config BR2_PACKAGE_UTIL_LINUX_PG
+	bool "pg"
+	depends on BR2_USE_MMU # fork()
+	help
+	  Browse pagewise through text files
+
 config BR2_PACKAGE_UTIL_LINUX_PARTX
-	bool "partition utilities"
+	bool "Partition utilities"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
-	  Partition tools (addpart, delpart, partx)
+	  Partition utilities (addpart, delpart, partx)
 
 config BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT
 	bool "pivot_root"
@@ -216,7 +312,7 @@ config BR2_PACKAGE_UTIL_LINUX_RESET
 	  Reset the terminal
 
 config BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS
-	bool "schedutils"
+	bool "Scheduling utilities"
 	help
 	  Scheduling utilities (chrt, ionice, taskset)
 
@@ -234,6 +330,7 @@ config BR2_PACKAGE_UTIL_LINUX_SETTERM
 
 config BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT
 	bool "switch_root"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Switch to another filesystem as the root of the mount tree
 
@@ -251,6 +348,7 @@ config BR2_PACKAGE_UTIL_LINUX_UL
 
 config BR2_PACKAGE_UTIL_LINUX_UNSHARE
 	bool "unshare"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Run program with some namespaces unshared from parent
 
@@ -261,16 +359,20 @@ config BR2_PACKAGE_UTIL_LINUX_UTMPDUMP
 
 config BR2_PACKAGE_UTIL_LINUX_UUIDD
 	bool "uuidd"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  UUID generation daemon
 
 config BR2_PACKAGE_UTIL_LINUX_VIPW
 	bool "vipw"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Edit the password, group, shadow-password or shadow-group file
 
 config BR2_PACKAGE_UTIL_LINUX_WALL
 	bool "wall"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Send a message to everybody's terminal
 
diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk
index 93f45c2..d979852 100644
--- a/package/util-linux/util-linux.mk
+++ b/package/util-linux/util-linux.mk
@@ -63,18 +63,26 @@ UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_ZLIB),zlib)
 # Used by login-utils
 UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_LINUX_PAM),linux-pam)
 
+ifeq ($(BR2_PACKAGE_UTIL_LINUX_NO_BINARIES),y)
+UTIL_LINUX_CONF_OPTS += --disable-all-programs
+else ifeq ($(BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES),y)
+UTIL_LINUX_CONF_OPTS += --enable-all-programs
+else
 # Disable/Enable utilities
 UTIL_LINUX_CONF_OPTS += \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_BASIC_SET),,--disable-all-programs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),--enable-agetty,--disable-agetty) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_BFS),--enable-bfs,--disable-bfs) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_CAL),--enable-cal,--disable-cal) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH),--enable-chfn-chsh,--disable-chfn-chsh) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CRAMFS),--enable-cramfs,--disable-cramfs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_EJECT),--enable-eject,--disable-eject) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FALLOCATE),--enable-fallocate,--disable-fallocate) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FDFORMAT),--enable-fdformat,--disable-fdformat) \
-	$(if $(BR2_PACKAGE_UTIL_LINUX_FINDFS),--enable-findfs,--disable-findfs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FSCK),--enable-fsck,--disable-fsck) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_HWCLOCK),--enable-hwclock,--disable-hwclock) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_IPCRM),--enable-ipcrm,--disable-ipcrm) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_IPCS),--enable-ipcs,--disable-ipcs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_KILL),--enable-kill,--disable-kill) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LAST),--enable-last,--disable-last) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),--enable-libblkid,--disable-libblkid) \
@@ -83,8 +91,9 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBUUID),--enable-libuuid,--disable-libuuid) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LINE),--enable-line,--disable-line) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),--enable-last --enable-login --enable-runuser --enable-su --enable-sulogin,--disable-last --disable-login --disable-runuser --disable-su --disable-sulogin) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGGER),--enable-logger,--disable-logger) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LOSETUP),--enable-losetup,--disable-losetup) \
-	$(if $(BR2_PACKAGE_UTIL_LINUX_LSBLK),--enable-lsblk,--disable-lsblk) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_LSLOGINS),--enable-lslogins,--disable-lslogins) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MESG),--enable-mesg,--disable-mesg) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MINIX),--enable-minix,--disable-minix) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MORE),--enable-more,--disable-more) \
@@ -94,6 +103,7 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_NOLOGIN),--enable-nologin,--disable-nologin) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_NSENTER),--enable-nsenter,--disable-nsenter) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_PARTX),--enable-partx,--disable-partx) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_PG),--enable-pg,--disable-pg) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT),--enable-pivot_root,--disable-pivot_root) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_RAW),--enable-raw,--disable-raw) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_RENAME),--enable-rename,--disable-rename) \
@@ -112,6 +122,7 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_WDCTL),--enable-wdctl,--disable-wdctl) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_WRITE),--enable-write,--disable-write) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_ZRAMCTL),--enable-zramctl,--disable-zramctl)
+endif
 
 # In the host version of util-linux, we so far only require libuuid,
 # and none of the util-linux utilities, so we disable all of them, unless
@@ -130,12 +141,6 @@ else
 HOST_UTIL_LINUX_CONF_OPTS += --disable-all-programs
 endif
 
-# Avoid building the tools if they are disabled since we can't install on
-# a per-directory basis.
-ifeq ($(BR2_PACKAGE_UTIL_LINUX_BINARIES),)
-UTIL_LINUX_CONF_OPTS += --disable-all-programs
-endif
-
 # Install libmount Python bindings
 ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
 UTIL_LINUX_CONF_OPTS += --with-python
@@ -162,7 +167,7 @@ endif
 UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_INSTALL_PAMFILES
 
 # Install agetty->getty symlink to avoid breakage when there's no busybox
-ifeq ($(BR2_PACKAGE_UTIL_LINUX_AGETTY),y)
+ifneq ($(BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES)$(BR2_PACKAGE_UTIL_LINUX_AGETTY),)
 ifeq ($(BR2_PACKAGE_BUSYBOX),)
 define UTIL_LINUX_GETTY_SYMLINK
 	ln -sf agetty $(TARGET_DIR)/sbin/getty
-- 
2.7.4

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

* [Buildroot] [PATCH v6] util-linux: rework utilities menu for finer control
  2016-07-06  2:55                 ` [Buildroot] [PATCH v6] " Carlos Santos
@ 2016-07-06 21:54                   ` Yann E. MORIN
  2016-07-08 20:33                     ` Carlos Santos
  0 siblings, 1 reply; 44+ messages in thread
From: Yann E. MORIN @ 2016-07-06 21:54 UTC (permalink / raw)
  To: buildroot

Carlos, All,

On 2016-07-05 23:55 -0300, Carlos Santos spake thusly:
> When even a single extra util-linux utility is enabled, the
> default build and install will install many more programs,
> including many that overlap with those offered by busybox.
> 
> Fix by reworking the install-utilies menu to take advantage
> of the new --disable-all-programs config option.  This option
> make it possible to disable the basic set of apps, and then
> enable only the desired apps.

Thanks for respining this patch.

I know this is already version 6 of the patch, yet, there are still
issues with this patch. It lacked more reviews so far becasue it is too
big.

First, it is too big because it groups together at least three different
changes:

  - cleanups in the libraries and tools selections: this should be a
    patch on its own (but see more comments below);

  - addition of new libs and tools: this should be a second, separate
    patch too;

  - addition of the biggish choice: this should be done as a separate
    third patch, on its own. Furthemore, it should default to installign
    everything (or at least, as much as possible), otherwise the
    autobuilders would default to installing nothing, and thus we would
    never exercise this package at all.

Basically, the idea is that each patch is a separate, autonomous, atomic
and semantically-unique change. In your big patch, there are things that
are not controversial (fixing dependencies, adding new libs and tools),
whiel the choice is more prone to discussion.

Having the non-controversial changes as separate patches means those can
be applied (relatively) quickly, thus reducing the amount of maintenance
of the changes on your side.

> Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
[--SNIP--]
> diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in
> index 429dfa7..3a56f7c 100644
> --- a/package/util-linux/Config.in
> +++ b/package/util-linux/Config.in
> @@ -12,22 +12,30 @@ menuconfig BR2_PACKAGE_UTIL_LINUX
>  if BR2_PACKAGE_UTIL_LINUX
>  
>  config BR2_PACKAGE_UTIL_LINUX_LIBBLKID
> -	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
> -	depends on BR2_USE_MMU # fork
>  	bool "libblkid"
> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
> +	depends on BR2_USE_MMU # fork()

While you are at it, move the depends before the selects:

    config BR2_PACKAGE_UTIL_LINUX_LIBBLKID
        bool "libblkid"
        depends on BR2_USE_MMU # fork()
        select BR2_PACKAGE_UTIL_LINUX_LIBUUID

This kind of fixups should be in the first patch.

>  	help
>  	  Install libblkid.
>  
> -config BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
> +config BR2_PACKAGE_UTIL_LINUX_LIBFDISK

Here, you ar adding a new library: it should be part of the second
patch.

[--SNIP--]
> +choice
> +	prompt "Install utilities"
> +	default BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
> +
> +config BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
> +	bool "none"
> +	help
> +	  Disable all util-linux binaries.
> +
> +config BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES
> +	bool "all"
>  	depends on BR2_USE_MMU # fork()
> -	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
> -	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
> -	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
> -	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
> +	select BR2_PACKAGE_LINUX_PAM  # login utils
> +	select BR2_PACKAGE_ZLIB  # cramfs
> +	select BR2_PACKAGE_NCURSES  # more, setterm, ul
> +	select BR2_PACKAGE_LIBCAP_NG  # setpriv
> +	help
> +	  Install the complete set of util-linux binaries.
> +
> +config BR2_PACKAGE_UTIL_LINUX_BINARIES
> +	bool "custom"
>  	help
> -	  Install the basic set of util-linux binaries.
> +	  Manually select which util-linux binaries to install.
> +
> +endchoice

As said above, this choice would default to "none", which is not nice
for the user (if util-linux is selected, surely the user wants things
from it). It laso means the autobuilders (which can't randomise the
choices) would never really test util-linux.

So, it should default to "all". And I think the entries should be
re-orderd, like that:

    all
    none
    custom

>  if BR2_PACKAGE_UTIL_LINUX_BINARIES
>  
> +config BR2_PACKAGE_UTIL_LINUX_BASIC_SET
> +	bool "Basic set"

Would it make sense to have this in the choice?

    all
    basic set
    none
    custom

> +	default y
> +	depends on BR2_USE_MMU # fork() (dmesg, flock, script, setsid, swapon)
> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
> +	help
> +	  Install a basic set of util-linux binaries.
> +
> +	  blkdiscard, blkid, blockdev, chcpu, col, colcrt, colrm,
> +	  column, ctrlaltdel, dmesg, fdisk, findfs, findmnt, flock,
> +	  fsfreeze, fstrim, getopt, hexdump, ipcmk, isosize, ldattach,
> +	  look, lsblk, lscpu, lsipc, lslocks, lsns, mcookie, mkfs,
> +	  mkswap, namei, prlimit, readprofile, renice, rev, rtcwake,
> +	  script, scriptreplay, setarch, setsid, sfdisk, swaplabel,
> +	  swapoff, swapon, tailf, uuidgen, whereis, wipefs

Is this list supposed to change between version of util-linux?
I don't think we should assume it would not.

This will make it rather difficult to maintain that list when bumping to
a new version.

I would suggest that we do not mention that list at all (unless there is
a super-easy way to get it just by extracting the source of util-linux).

I've stopped reviewing here, becasue all the following changes are
partly due to each of the three changes your patch does.

Could you please split it on three, as explained above, and respin?

To be honest, I'm not sure if the biggish choice will eventually land,
but at least the fixups and the additions of new libs and tools will.

Thanks!

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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] 44+ messages in thread

* [Buildroot] [PATCH v6] util-linux: rework utilities menu for finer control
  2016-07-06 21:54                   ` Yann E. MORIN
@ 2016-07-08 20:33                     ` Carlos Santos
  2016-07-08 20:52                       ` Yann E. MORIN
  0 siblings, 1 reply; 44+ messages in thread
From: Carlos Santos @ 2016-07-08 20:33 UTC (permalink / raw)
  To: buildroot

> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: buildroot at buildroot.org, "romain naour" <romain.naour@gmail.com>
> Sent: Wednesday, July 6, 2016 6:54:07 PM
> Subject: Re: [Buildroot] [PATCH v6] util-linux: rework utilities menu for finer control

---8<---
> I know this is already version 6 of the patch, yet, there are still
> issues with this patch. It lacked more reviews so far becasue it is too
> big.
> 
> First, it is too big because it groups together at least three different
> changes:
> 
>  - cleanups in the libraries and tools selections: this should be a
>    patch on its own (but see more comments below);
> 
>  - addition of new libs and tools: this should be a second, separate
>    patch too;
> 
>  - addition of the biggish choice: this should be done as a separate
>    third patch, on its own. Furthemore, it should default to installign
>    everything (or at least, as much as possible), otherwise the
>    autobuilders would default to installing nothing, and thus we would
>    never exercise this package at all.
---8<---

OK, I will split the patch as suggested.

---8<--- 

>> +choice
>> +	prompt "Install utilities"
>> +	default BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
>> +
>> +config BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
>> +	bool "none"
>> +	help
>> +	  Disable all util-linux binaries.
>> +
>> +config BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES
>> +	bool "all"
>>  	depends on BR2_USE_MMU # fork()
>> -	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
>> -	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
>> -	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
>> -	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
>> +	select BR2_PACKAGE_LINUX_PAM  # login utils
>> +	select BR2_PACKAGE_ZLIB  # cramfs
>> +	select BR2_PACKAGE_NCURSES  # more, setterm, ul
>> +	select BR2_PACKAGE_LIBCAP_NG  # setpriv
>> +	help
>> +	  Install the complete set of util-linux binaries.
>> +
>> +config BR2_PACKAGE_UTIL_LINUX_BINARIES
>> +	bool "custom"
>>  	help
>> -	  Install the basic set of util-linux binaries.
>> +	  Manually select which util-linux binaries to install.
>> +
>> +endchoice
> 
> As said above, this choice would default to "none", which is not nice
> for the user (if util-linux is selected, surely the user wants things
> from it). It laso means the autobuilders (which can't randomise the
> choices) would never really test util-linux.

I can make "basic set" the default but this will be different from the current default and potentally conflict with busybox. Remember that installing only the libraries is a valid option because other packages require them (bcache-tools, btrfs-progs, e2fsprogs, efl, eudev, systemd and xfsprogs select BR2_PACKAGE_UTIL_LINUX_LIBBLKID).

> So, it should default to "all". And I think the entries should be
> re-orderd, like that:
> 
>    all
>    none
>    custom
> 
>>  if BR2_PACKAGE_UTIL_LINUX_BINARIES
>>  
>> +config BR2_PACKAGE_UTIL_LINUX_BASIC_SET
>> +	bool "Basic set"
> 
> Would it make sense to have this in the choice?
> 
>    all
>    basic set
>    none
>    custom

The problem is that both "all" and "custom" are supersets of "basic set". I will look for a better way to group them.

>> +	default y
>> +	depends on BR2_USE_MMU # fork() (dmesg, flock, script, setsid, swapon)
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
>> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
>> +	help
>> +	  Install a basic set of util-linux binaries.
>> +
>> +	  blkdiscard, blkid, blockdev, chcpu, col, colcrt, colrm,
>> +	  column, ctrlaltdel, dmesg, fdisk, findfs, findmnt, flock,
>> +	  fsfreeze, fstrim, getopt, hexdump, ipcmk, isosize, ldattach,
>> +	  look, lsblk, lscpu, lsipc, lslocks, lsns, mcookie, mkfs,
>> +	  mkswap, namei, prlimit, readprofile, renice, rev, rtcwake,
>> +	  script, scriptreplay, setarch, setsid, sfdisk, swaplabel,
>> +	  swapoff, swapon, tailf, uuidgen, whereis, wipefs
> 
> Is this list supposed to change between version of util-linux?
> I don't think we should assume it would not.
> 
> This will make it rather difficult to maintain that list when bumping to
> a new version.
> 
> I would suggest that we do not mention that list at all (unless there is
> a super-easy way to get it just by extracting the source of util-linux).


It is easy to obtain. Just choose the basic set, make run

    $ make util-linux-dirclean util-linux
    $ make util-linux-reinstall TARGET_DIR=/tmp/util-linux-target
    $ echo $(find /tmp/util-linux-target/{usr/,}{s,}bin -type f | sed -e 's:.*/::g'|sort)|sed 's/ /, /g'

> I've stopped reviewing here, becasue all the following changes are
> partly due to each of the three changes your patch does.
> 
> Could you please split it on three, as explained above, and respin?
> 
> To be honest, I'm not sure if the biggish choice will eventually land,
> but at least the fixups and the additions of new libs and tools will.

Thanks for the review!

Carlos Santos (Casantos)
DATACOM, P&D

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

* [Buildroot] [PATCH v6] util-linux: rework utilities menu for finer control
  2016-07-08 20:33                     ` Carlos Santos
@ 2016-07-08 20:52                       ` Yann E. MORIN
  2016-07-10  1:16                         ` [Buildroot] [PATCH v7 0/3] util-linux: cleanups, additions and reworked utilities menu Carlos Santos
  0 siblings, 1 reply; 44+ messages in thread
From: Yann E. MORIN @ 2016-07-08 20:52 UTC (permalink / raw)
  To: buildroot

Carlos, All,

On 2016-07-08 17:33 -0300, Carlos Santos spake thusly:
> > From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > To: "Carlos Santos" <casantos@datacom.ind.br>
> > Cc: buildroot at buildroot.org, "romain naour" <romain.naour@gmail.com>
> > Sent: Wednesday, July 6, 2016 6:54:07 PM
> > Subject: Re: [Buildroot] [PATCH v6] util-linux: rework utilities menu for finer control
> 
> ---8<---
> > I know this is already version 6 of the patch, yet, there are still
> > issues with this patch. It lacked more reviews so far becasue it is too
> > big.
> > 
> > First, it is too big because it groups together at least three different
> > changes:
> > 
> >  - cleanups in the libraries and tools selections: this should be a
> >    patch on its own (but see more comments below);
> > 
> >  - addition of new libs and tools: this should be a second, separate
> >    patch too;
> > 
> >  - addition of the biggish choice: this should be done as a separate
> >    third patch, on its own. Furthemore, it should default to installign
> >    everything (or at least, as much as possible), otherwise the
> >    autobuilders would default to installing nothing, and thus we would
> >    never exercise this package at all.
> ---8<---
> 
> OK, I will split the patch as suggested.

Great, thanks! :-)

> ---8<--- 
> 
> >> +choice
> >> +	prompt "Install utilities"
> >> +	default BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
> >> +
> >> +config BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
> >> +	bool "none"
> >> +	help
> >> +	  Disable all util-linux binaries.
> >> +
> >> +config BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES
> >> +	bool "all"
> >>  	depends on BR2_USE_MMU # fork()
> >> -	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
> >> -	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
> >> -	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
> >> -	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
> >> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
> >> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
> >> +	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
> >> +	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
> >> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
> >> +	select BR2_PACKAGE_LINUX_PAM  # login utils
> >> +	select BR2_PACKAGE_ZLIB  # cramfs
> >> +	select BR2_PACKAGE_NCURSES  # more, setterm, ul
> >> +	select BR2_PACKAGE_LIBCAP_NG  # setpriv
> >> +	help
> >> +	  Install the complete set of util-linux binaries.
> >> +
> >> +config BR2_PACKAGE_UTIL_LINUX_BINARIES
> >> +	bool "custom"
> >>  	help
> >> -	  Install the basic set of util-linux binaries.
> >> +	  Manually select which util-linux binaries to install.
> >> +
> >> +endchoice
> > 
> > As said above, this choice would default to "none", which is not nice
> > for the user (if util-linux is selected, surely the user wants things
> > from it). It laso means the autobuilders (which can't randomise the
> > choices) would never really test util-linux.
> 
> I can make "basic set" the default but this will be different from the
> current default and potentally conflict with busybox. Remember that
> installing only the libraries is a valid option because other packages
> require them (bcache-tools, btrfs-progs, e2fsprogs, efl, eudev,
> systemd and xfsprogs select BR2_PACKAGE_UTIL_LINUX_LIBBLKID).

[please wrap your lines at ~80 chars]

See below for my stake on this...

> > So, it should default to "all". And I think the entries should be
> > re-orderd, like that:
> > 
> >    all
> >    none
> >    custom
> > 
> >>  if BR2_PACKAGE_UTIL_LINUX_BINARIES
> >>  
> >> +config BR2_PACKAGE_UTIL_LINUX_BASIC_SET
> >> +	bool "Basic set"
> > 
> > Would it make sense to have this in the choice?
> > 
> >    all
> >    basic set
> >    none
> >    custom
> 
> The problem is that both "all" and "custom" are supersets of "basic
> set".

Hmm... So it is not possible to install a custom list that does not
include the basic set?

> I will look for a better way to group them.

Well, in light of what you explained above, I'm indeed no longer so sure
what should be the default.

However, I would argue that we add new options to existing packages
every now and then, especially implicit options.

For example, consider an hypotetical package bar that has an optional
dependency on libfoo. We first package bar but not libnfoo, so we have
--disable-libfoo (e.g. because there is a bug or whatever) and we do a
release of Buidlroot with just bar. Now, months later, someone fixes
that bug (or bumps the pcakges or whatever) and adds this optional
implicit dependency of bar to libfoo and passes the correct
--enable-libfoo, then we do a new release of Buidlroot.

Someone with a configuration for the previous release will see a
different behaviour of bar, possibly with an extra size impact on the
rootfs, when updating to the next release.

Yes, we do change such things between releases. No, we do not guarantee
exact (feature-wise) reproducible builds between releases (not that we
could, even if we wanted).

All we try to guarantee is that we only "add", and not "remove",
features and behaviour. Yes, we _try_, which means sometimes we can't
(or fail to).

So, I for one would be rather fine if the default would change over to
"all" (as long as BUSYBOX_SHOW_OTHERS is enabled, of course).

> >> +	default y
> >> +	depends on BR2_USE_MMU # fork() (dmesg, flock, script, setsid, swapon)
> >> +	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
> >> +	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
> >> +	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
> >> +	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
> >> +	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
> >> +	help
> >> +	  Install a basic set of util-linux binaries.
> >> +
> >> +	  blkdiscard, blkid, blockdev, chcpu, col, colcrt, colrm,
> >> +	  column, ctrlaltdel, dmesg, fdisk, findfs, findmnt, flock,
> >> +	  fsfreeze, fstrim, getopt, hexdump, ipcmk, isosize, ldattach,
> >> +	  look, lsblk, lscpu, lsipc, lslocks, lsns, mcookie, mkfs,
> >> +	  mkswap, namei, prlimit, readprofile, renice, rev, rtcwake,
> >> +	  script, scriptreplay, setarch, setsid, sfdisk, swaplabel,
> >> +	  swapoff, swapon, tailf, uuidgen, whereis, wipefs
> > 
> > Is this list supposed to change between version of util-linux?
> > I don't think we should assume it would not.
> > 
> > This will make it rather difficult to maintain that list when bumping to
> > a new version.
> > 
> > I would suggest that we do not mention that list at all (unless there is
> > a super-easy way to get it just by extracting the source of util-linux).
> 
> It is easy to obtain. Just choose the basic set, make run
> 
>     $ make util-linux-dirclean util-linux
>     $ make util-linux-reinstall TARGET_DIR=/tmp/util-linux-target
>     $ echo $(find /tmp/util-linux-target/{usr/,}{s,}bin -type f | sed -e 's:.*/::g'|sort)|sed 's/ /, /g'

Meh...

When I said "super-easy" I really meant it, like:

    sed -e -r '/^BASIC_SET = (.*)/!d; s//\1/' configure.ac

(or whatever, something really trivial)

Regards,
Yann E. MORIN.

> > I've stopped reviewing here, becasue all the following changes are
> > partly due to each of the three changes your patch does.
> > 
> > Could you please split it on three, as explained above, and respin?
> > 
> > To be honest, I'm not sure if the biggish choice will eventually land,
> > but at least the fixups and the additions of new libs and tools will.
> 
> Thanks for the review!
> 
> Carlos Santos (Casantos)
> DATACOM, P&D

-- 
.-----------------.--------------------.------------------.--------------------.
|  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] 44+ messages in thread

* [Buildroot] [PATCH v7 0/3] util-linux: cleanups, additions and reworked utilities menu
  2016-07-08 20:52                       ` Yann E. MORIN
@ 2016-07-10  1:16                         ` Carlos Santos
  2016-07-10  1:16                           ` [Buildroot] [PATCH v7 1/3] util-linux: clean up libraries and tools selections Carlos Santos
                                             ` (3 more replies)
  0 siblings, 4 replies; 44+ messages in thread
From: Carlos Santos @ 2016-07-10  1:16 UTC (permalink / raw)
  To: buildroot

Original patch by Danomi Manchego <danomimanchego123@gmail.com>

Changes v1 -> v2:
  - Rework to incorporate ideas and suggestions from Thomas Petazzoni
    and Arnout Vandecappelle.  At least, in spirit.

Changes v2 -> v3:
  - Change BR2_PACKAGE_UTIL_LINUX_SELECTED_BINARIES to
    BR2_PACKAGE_UTIL_LINUX_BINARIES, to conserve backwards-
    compatibility without need for a legacy option.
  - Enable 'Basic set' by default to match output of previous
    build when binaries were selected.

Changes v3 -> v4:
  - Rework to apply on top of master branch

Changes v4 -> v5:
  - Add option to control installation of libfdisk.
  - Fine-grained selection of libraries in custom selection of
    utilities.
  - Document that linux32, linux64, uname26, i386 and x86_64 are
    setarch aliases.
  - Add options to instal cal, ipcrm, ipcs, logger, lslogin and pg.
  - Remove options to install findfs and lsblk because there are no
    corresponding --enable- and --disable- configure options.

CHanges v5 -> v6:
  - Make 'bool "lib<foo>"' the first item in each block
  - Add several missing dependencies on BR2_USE_MMU, for fork()
  - Options corresponding to package/utility/library names in
    lowercase (do the same for "none", "all" and "custom")
  - Improve help for cramfs utilities and login utilities

Changes v6 -> v7:
  - Split big patch into 3 patches, as suggested by Yann E. MORIN
  - Leave the default utilities choice as "none", which is controversial
    but is the less harmful (it can be changed in a future patch, if we
    change our minds, without breaking backwards compatibility)
  - Add a compatibility entry to Config.in.legacy that selects the basic
    set of utilities, as BR2_PACKAGE_UTIL_LINUX_BINARIES=y would do, so
    existing defconfigs will not fail

Carlos Santos (3):
  util-linux: clean up libraries and tools selections
  util-linux: expand selection of libraries and utilities
  util-linux: rework utilities menu for finer control

 Config.in.legacy                 |  16 +++++
 package/util-linux/Config.in     | 149 ++++++++++++++++++++++++++++++++-------
 package/util-linux/util-linux.mk |  26 ++++---
 3 files changed, 157 insertions(+), 34 deletions(-)

-- 
2.7.4

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

* [Buildroot] [PATCH v7 1/3] util-linux: clean up libraries and tools selections
  2016-07-10  1:16                         ` [Buildroot] [PATCH v7 0/3] util-linux: cleanups, additions and reworked utilities menu Carlos Santos
@ 2016-07-10  1:16                           ` Carlos Santos
  2016-10-16 13:55                             ` Thomas Petazzoni
  2016-07-10  1:16                           ` [Buildroot] [PATCH v6] util-linux: rework utilities menu for finer control Carlos Santos
                                             ` (2 subsequent siblings)
  3 siblings, 1 reply; 44+ messages in thread
From: Carlos Santos @ 2016-07-10  1:16 UTC (permalink / raw)
  To: buildroot

Fix several problems in the package recipe:

- Make 'bool "lib<foo>"' the first item in each block
- Move the depends before the selects
- Add missing dependencies on BR2_USE_MMU, for fork()
- Put option names corresponding to package/utility/library names in
  lowercase, others start with capital letter
- Improve help for cramfs utilities and login utilities

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/util-linux/Config.in     | 67 ++++++++++++++++++++++++++--------------
 package/util-linux/util-linux.mk |  2 --
 2 files changed, 43 insertions(+), 26 deletions(-)

diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in
index 429dfa7..3b32bc7 100644
--- a/package/util-linux/Config.in
+++ b/package/util-linux/Config.in
@@ -12,22 +12,22 @@ menuconfig BR2_PACKAGE_UTIL_LINUX
 if BR2_PACKAGE_UTIL_LINUX
 
 config BR2_PACKAGE_UTIL_LINUX_LIBBLKID
-	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
-	depends on BR2_USE_MMU # fork
 	bool "libblkid"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Install libblkid.
 
 config BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
-	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
-	depends on BR2_USE_MMU # util-linux/libblkid
 	bool "libmount"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	help
 	  Install libmount.
 
 config BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
 	bool "libsmartcols"
-	depends on BR2_USE_MMU # fork
+	depends on BR2_USE_MMU # fork()
 	help
 	  Install libsmartcols.
 
@@ -37,7 +37,7 @@ config BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	  Install libuuid.
 
 config BR2_PACKAGE_UTIL_LINUX_BINARIES
-	bool "install utilities"
+	bool "Install utilities"
 	depends on BR2_USE_MMU # fork()
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
@@ -50,6 +50,7 @@ if BR2_PACKAGE_UTIL_LINUX_BINARIES
 
 config BR2_PACKAGE_UTIL_LINUX_AGETTY
 	bool "agetty"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Alternative linux getty
 
@@ -75,10 +76,14 @@ config BR2_PACKAGE_UTIL_LINUX_CRAMFS
 	bool "cramfs utilities"
 	select BR2_PACKAGE_ZLIB
 	help
-	  Build fsck.cramfs and mkfs.cramfs
+	  Utilities for compressed ROM file system (fsck.cramfs, mkfs.cramfs)
 
 config BR2_PACKAGE_UTIL_LINUX_EJECT
 	bool "eject"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Eject removable media
 
@@ -92,13 +97,12 @@ config BR2_PACKAGE_UTIL_LINUX_FDFORMAT
 	help
 	  Low-level format a floppy disk
 
-config BR2_PACKAGE_UTIL_LINUX_FINDFS
-	bool "findfs"
-	help
-	  Find a filesystem by label or UUID
-
 config BR2_PACKAGE_UTIL_LINUX_FSCK
 	bool "fsck"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Check and repair a linux filesystem
 
@@ -123,15 +127,16 @@ config BR2_PACKAGE_UTIL_LINUX_LINE
 	  Read one line
 
 config BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS
-	bool "login utilities"
+	bool "Login utilities"
+	depends on BR2_USE_MMU # fork() (login, runuser, su, sulogin)
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
 	depends on !BR2_STATIC_LIBS
 	depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
 	select BR2_PACKAGE_LINUX_PAM
 	help
-	  Build login utilities (last, login, su, sulogin)
+	  Login utilities (last, login, runuser, su, sulogin)
 
-comment "login utilities needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
+comment "Login utilities needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
 	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
 		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
 
@@ -140,11 +145,6 @@ config BR2_PACKAGE_UTIL_LINUX_LOSETUP
 	help
 	  Set up and control loop devices
 
-config BR2_PACKAGE_UTIL_LINUX_LSBLK
-	bool "lsblk"
-	help
-	  List block devices.
-
 config BR2_PACKAGE_UTIL_LINUX_MESG
 	bool "mesg"
 	help
@@ -157,17 +157,26 @@ config BR2_PACKAGE_UTIL_LINUX_MINIX
 
 config BR2_PACKAGE_UTIL_LINUX_MORE
 	bool "more"
+	depends on BR2_USE_MMU # fork()
 	select BR2_PACKAGE_NCURSES
 	help
 	  File perusal filter for crt viewing
 
 config BR2_PACKAGE_UTIL_LINUX_MOUNT
 	bool "mount/umount"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Mount/unmount filesystems
 
 config BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT
 	bool "mountpoint"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  See if a directory is a mountpoint
 
@@ -183,17 +192,21 @@ config BR2_PACKAGE_UTIL_LINUX_NOLOGIN
 
 config BR2_PACKAGE_UTIL_LINUX_NSENTER
 	bool "nsenter"
+	depends on BR2_USE_MMU # fork()
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 	help
-	  Enter the namespaces of another process.
+	  Enter the namespaces of another process
 
 comment "nsenter needs a toolchain w/ headers >= 3.0"
 	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 
 config BR2_PACKAGE_UTIL_LINUX_PARTX
-	bool "partition utilities"
+	bool "Partition utilities"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
-	  Partition tools (addpart, delpart, partx)
+	  Partition utilities (addpart, delpart, partx)
 
 config BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT
 	bool "pivot_root"
@@ -216,7 +229,7 @@ config BR2_PACKAGE_UTIL_LINUX_RESET
 	  Reset the terminal
 
 config BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS
-	bool "schedutils"
+	bool "Scheduling utilities"
 	help
 	  Scheduling utilities (chrt, ionice, taskset)
 
@@ -234,6 +247,7 @@ config BR2_PACKAGE_UTIL_LINUX_SETTERM
 
 config BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT
 	bool "switch_root"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Switch to another filesystem as the root of the mount tree
 
@@ -251,6 +265,7 @@ config BR2_PACKAGE_UTIL_LINUX_UL
 
 config BR2_PACKAGE_UTIL_LINUX_UNSHARE
 	bool "unshare"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Run program with some namespaces unshared from parent
 
@@ -261,16 +276,20 @@ config BR2_PACKAGE_UTIL_LINUX_UTMPDUMP
 
 config BR2_PACKAGE_UTIL_LINUX_UUIDD
 	bool "uuidd"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  UUID generation daemon
 
 config BR2_PACKAGE_UTIL_LINUX_VIPW
 	bool "vipw"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Edit the password, group, shadow-password or shadow-group file
 
 config BR2_PACKAGE_UTIL_LINUX_WALL
 	bool "wall"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Send a message to everybody's terminal
 
diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk
index 93f45c2..ed734b0 100644
--- a/package/util-linux/util-linux.mk
+++ b/package/util-linux/util-linux.mk
@@ -72,7 +72,6 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_EJECT),--enable-eject,--disable-eject) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FALLOCATE),--enable-fallocate,--disable-fallocate) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FDFORMAT),--enable-fdformat,--disable-fdformat) \
-	$(if $(BR2_PACKAGE_UTIL_LINUX_FINDFS),--enable-findfs,--disable-findfs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FSCK),--enable-fsck,--disable-fsck) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_HWCLOCK),--enable-hwclock,--disable-hwclock) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_KILL),--enable-kill,--disable-kill) \
@@ -84,7 +83,6 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LINE),--enable-line,--disable-line) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),--enable-last --enable-login --enable-runuser --enable-su --enable-sulogin,--disable-last --disable-login --disable-runuser --disable-su --disable-sulogin) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LOSETUP),--enable-losetup,--disable-losetup) \
-	$(if $(BR2_PACKAGE_UTIL_LINUX_LSBLK),--enable-lsblk,--disable-lsblk) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MESG),--enable-mesg,--disable-mesg) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MINIX),--enable-minix,--disable-minix) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MORE),--enable-more,--disable-more) \
-- 
2.7.4

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

* [Buildroot] [PATCH v6] util-linux: rework utilities menu for finer control
  2016-07-10  1:16                         ` [Buildroot] [PATCH v7 0/3] util-linux: cleanups, additions and reworked utilities menu Carlos Santos
  2016-07-10  1:16                           ` [Buildroot] [PATCH v7 1/3] util-linux: clean up libraries and tools selections Carlos Santos
@ 2016-07-10  1:16                           ` Carlos Santos
  2016-07-10  1:16                           ` [Buildroot] [PATCH v7 2/3] util-linux: expand selection of libraries and utilities Carlos Santos
  2016-07-10  1:16                           ` [Buildroot] [PATCH v7 3/3] util-linux: rework utilities menu for finer control Carlos Santos
  3 siblings, 0 replies; 44+ messages in thread
From: Carlos Santos @ 2016-07-10  1:16 UTC (permalink / raw)
  To: buildroot

When even a single extra util-linux utility is enabled, the
default build and install will install many more programs,
including many that overlap with those offered by busybox.

Fix by reworking the install-utilies menu to take advantage
of the new --disable-all-programs config option.  This option
make it possible to disable the basic set of apps, and then
enable only the desired apps.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---

Changes v1 -> v2:
  - Rework to incorporate ideas and suggestions from Thomas Petazzoni
    and Arnout Vandecappelle.  At least, in spirit.

Changes v2 -> v3:
  - Change BR2_PACKAGE_UTIL_LINUX_SELECTED_BINARIES to
    BR2_PACKAGE_UTIL_LINUX_BINARIES, to conserve backwards-
    compatibility without need for a legacy option.
  - Enable 'Basic set' by default to match output of previous
    build when binaries were selected.

Changes v3 -> v4:
  - Rework to apply on top of master branch

Changes v4 -> v5:
  - Add option to control installation of libfdisk.
  - Fine-grained selection of libraries in custom selection of
    utilities.
  - Document that linux32, linux64, uname26, i386 and x86_64 are
    setarch aliases.
  - Add options to instal cal, ipcrm, ipcs, logger, lslogin and pg.
  - Remove options to install findfs and lsblk because there are no
    corresponding --enable- and --disable- configure options.

CHanges v5 -> v6:
  - Make 'bool "lib<foo>"' the first item in each block
  - Add several missing dependencies on BR2_USE_MMU, for fork()
  - Options corresponding to package/utility/library names in
    lowercase (do the same for "none", "all" and "custom")
  - Improve help for cramfs utilities and login utilities

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/util-linux/Config.in     | 158 ++++++++++++++++++++++++++++++++-------
 package/util-linux/util-linux.mk |  23 +++---
 2 files changed, 144 insertions(+), 37 deletions(-)

diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in
index 429dfa7..3a56f7c 100644
--- a/package/util-linux/Config.in
+++ b/package/util-linux/Config.in
@@ -12,22 +12,30 @@ menuconfig BR2_PACKAGE_UTIL_LINUX
 if BR2_PACKAGE_UTIL_LINUX
 
 config BR2_PACKAGE_UTIL_LINUX_LIBBLKID
-	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
-	depends on BR2_USE_MMU # fork
 	bool "libblkid"
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	depends on BR2_USE_MMU # fork()
 	help
 	  Install libblkid.
 
-config BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+config BR2_PACKAGE_UTIL_LINUX_LIBFDISK
+	bool "libfdisk"
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
-	depends on BR2_USE_MMU # util-linux/libblkid
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	depends on BR2_USE_MMU # fork()
+	help
+	  Install libfdisk.
+
+config BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
 	bool "libmount"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	help
 	  Install libmount.
 
 config BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
 	bool "libsmartcols"
-	depends on BR2_USE_MMU # fork
+	depends on BR2_USE_MMU # fork()
 	help
 	  Install libsmartcols.
 
@@ -36,20 +44,65 @@ config BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Install libuuid.
 
-config BR2_PACKAGE_UTIL_LINUX_BINARIES
-	bool "install utilities"
+choice
+	prompt "Install utilities"
+	default BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
+
+config BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
+	bool "none"
+	help
+	  Disable all util-linux binaries.
+
+config BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES
+	bool "all"
 	depends on BR2_USE_MMU # fork()
-	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
-	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
-	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
-	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
+	select BR2_PACKAGE_LINUX_PAM  # login utils
+	select BR2_PACKAGE_ZLIB  # cramfs
+	select BR2_PACKAGE_NCURSES  # more, setterm, ul
+	select BR2_PACKAGE_LIBCAP_NG  # setpriv
+	help
+	  Install the complete set of util-linux binaries.
+
+config BR2_PACKAGE_UTIL_LINUX_BINARIES
+	bool "custom"
 	help
-	  Install the basic set of util-linux binaries.
+	  Manually select which util-linux binaries to install.
+
+endchoice
 
 if BR2_PACKAGE_UTIL_LINUX_BINARIES
 
+config BR2_PACKAGE_UTIL_LINUX_BASIC_SET
+	bool "Basic set"
+	default y
+	depends on BR2_USE_MMU # fork() (dmesg, flock, script, setsid, swapon)
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID     # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT     # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK     # fdisk, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS # findmnt, etc
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID      # findmnt, etc
+	help
+	  Install a basic set of util-linux binaries.
+
+	  blkdiscard, blkid, blockdev, chcpu, col, colcrt, colrm,
+	  column, ctrlaltdel, dmesg, fdisk, findfs, findmnt, flock,
+	  fsfreeze, fstrim, getopt, hexdump, ipcmk, isosize, ldattach,
+	  look, lsblk, lscpu, lsipc, lslocks, lsns, mcookie, mkfs,
+	  mkswap, namei, prlimit, readprofile, renice, rev, rtcwake,
+	  script, scriptreplay, setarch, setsid, sfdisk, swaplabel,
+	  swapoff, swapon, tailf, uuidgen, whereis, wipefs
+
+	  The setarch utility may also install architecture-specific
+	  "aliases" like linux32, linux64, uname26, i386 and x86_64.
+
 config BR2_PACKAGE_UTIL_LINUX_AGETTY
 	bool "agetty"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Alternative linux getty
 
@@ -58,6 +111,11 @@ config BR2_PACKAGE_UTIL_LINUX_BFS
 	help
 	  SCO bfs filesystem support
 
+config BR2_PACKAGE_UTIL_LINUX_CAL
+	bool "cal"
+	help
+	  Display a calendar, or some part of it
+
 config BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH
 	bool "chfn/chsh"
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
@@ -75,10 +133,14 @@ config BR2_PACKAGE_UTIL_LINUX_CRAMFS
 	bool "cramfs utilities"
 	select BR2_PACKAGE_ZLIB
 	help
-	  Build fsck.cramfs and mkfs.cramfs
+	  Utilities for compressed ROM file system (fsck.cramfs, mkfs.cramfs)
 
 config BR2_PACKAGE_UTIL_LINUX_EJECT
 	bool "eject"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Eject removable media
 
@@ -92,13 +154,12 @@ config BR2_PACKAGE_UTIL_LINUX_FDFORMAT
 	help
 	  Low-level format a floppy disk
 
-config BR2_PACKAGE_UTIL_LINUX_FINDFS
-	bool "findfs"
-	help
-	  Find a filesystem by label or UUID
-
 config BR2_PACKAGE_UTIL_LINUX_FSCK
 	bool "fsck"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Check and repair a linux filesystem
 
@@ -107,6 +168,16 @@ config BR2_PACKAGE_UTIL_LINUX_HWCLOCK
 	help
 	  Query or set the hardware clock (RTC)
 
+config BR2_PACKAGE_UTIL_LINUX_IPCRM
+	bool "ipcrm"
+	help
+	  Remove certain IPC resources
+
+config BR2_PACKAGE_UTIL_LINUX_IPCS
+	bool "ipcs"
+	help
+	  Show information on IPC facilities
+
 config BR2_PACKAGE_UTIL_LINUX_KILL
 	bool "kill"
 	help
@@ -123,27 +194,33 @@ config BR2_PACKAGE_UTIL_LINUX_LINE
 	  Read one line
 
 config BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS
-	bool "login utilities"
+	bool "Login utilities"
+	depends on BR2_USE_MMU # fork() (login, runuser, su, sulogin)
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
 	depends on !BR2_STATIC_LIBS
 	depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
 	select BR2_PACKAGE_LINUX_PAM
 	help
-	  Build login utilities (last, login, su, sulogin)
+	  Login utilities (last, login, runuser, su, sulogin)
 
-comment "login utilities needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
+comment "Login utilities needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library"
 	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
 		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
 
+config BR2_PACKAGE_UTIL_LINUX_LOGGER
+	bool "logger"
+	help
+	  Enter messages into the system log
+
 config BR2_PACKAGE_UTIL_LINUX_LOSETUP
 	bool "losetup"
 	help
 	  Set up and control loop devices
 
-config BR2_PACKAGE_UTIL_LINUX_LSBLK
-	bool "lsblk"
+config BR2_PACKAGE_UTIL_LINUX_LSLOGINS
+	bool "lslogin"
 	help
-	  List block devices.
+	  Display information about known users in the system
 
 config BR2_PACKAGE_UTIL_LINUX_MESG
 	bool "mesg"
@@ -157,17 +234,26 @@ config BR2_PACKAGE_UTIL_LINUX_MINIX
 
 config BR2_PACKAGE_UTIL_LINUX_MORE
 	bool "more"
+	depends on BR2_USE_MMU # fork()
 	select BR2_PACKAGE_NCURSES
 	help
 	  File perusal filter for crt viewing
 
 config BR2_PACKAGE_UTIL_LINUX_MOUNT
 	bool "mount/umount"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Mount/unmount filesystems
 
 config BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT
 	bool "mountpoint"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  See if a directory is a mountpoint
 
@@ -183,17 +269,27 @@ config BR2_PACKAGE_UTIL_LINUX_NOLOGIN
 
 config BR2_PACKAGE_UTIL_LINUX_NSENTER
 	bool "nsenter"
+	depends on BR2_USE_MMU # fork()
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 	help
-	  Enter the namespaces of another process.
+	  Enter the namespaces of another process
 
 comment "nsenter needs a toolchain w/ headers >= 3.0"
 	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 
+config BR2_PACKAGE_UTIL_LINUX_PG
+	bool "pg"
+	depends on BR2_USE_MMU # fork()
+	help
+	  Browse pagewise through text files
+
 config BR2_PACKAGE_UTIL_LINUX_PARTX
-	bool "partition utilities"
+	bool "Partition utilities"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
-	  Partition tools (addpart, delpart, partx)
+	  Partition utilities (addpart, delpart, partx)
 
 config BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT
 	bool "pivot_root"
@@ -216,7 +312,7 @@ config BR2_PACKAGE_UTIL_LINUX_RESET
 	  Reset the terminal
 
 config BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS
-	bool "schedutils"
+	bool "Scheduling utilities"
 	help
 	  Scheduling utilities (chrt, ionice, taskset)
 
@@ -234,6 +330,7 @@ config BR2_PACKAGE_UTIL_LINUX_SETTERM
 
 config BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT
 	bool "switch_root"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Switch to another filesystem as the root of the mount tree
 
@@ -251,6 +348,7 @@ config BR2_PACKAGE_UTIL_LINUX_UL
 
 config BR2_PACKAGE_UTIL_LINUX_UNSHARE
 	bool "unshare"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Run program with some namespaces unshared from parent
 
@@ -261,16 +359,20 @@ config BR2_PACKAGE_UTIL_LINUX_UTMPDUMP
 
 config BR2_PACKAGE_UTIL_LINUX_UUIDD
 	bool "uuidd"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  UUID generation daemon
 
 config BR2_PACKAGE_UTIL_LINUX_VIPW
 	bool "vipw"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Edit the password, group, shadow-password or shadow-group file
 
 config BR2_PACKAGE_UTIL_LINUX_WALL
 	bool "wall"
+	depends on BR2_USE_MMU # fork()
 	help
 	  Send a message to everybody's terminal
 
diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk
index 93f45c2..d979852 100644
--- a/package/util-linux/util-linux.mk
+++ b/package/util-linux/util-linux.mk
@@ -63,18 +63,26 @@ UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_ZLIB),zlib)
 # Used by login-utils
 UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_LINUX_PAM),linux-pam)
 
+ifeq ($(BR2_PACKAGE_UTIL_LINUX_NO_BINARIES),y)
+UTIL_LINUX_CONF_OPTS += --disable-all-programs
+else ifeq ($(BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES),y)
+UTIL_LINUX_CONF_OPTS += --enable-all-programs
+else
 # Disable/Enable utilities
 UTIL_LINUX_CONF_OPTS += \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_BASIC_SET),,--disable-all-programs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),--enable-agetty,--disable-agetty) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_BFS),--enable-bfs,--disable-bfs) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_CAL),--enable-cal,--disable-cal) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH),--enable-chfn-chsh,--disable-chfn-chsh) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CRAMFS),--enable-cramfs,--disable-cramfs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_EJECT),--enable-eject,--disable-eject) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FALLOCATE),--enable-fallocate,--disable-fallocate) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FDFORMAT),--enable-fdformat,--disable-fdformat) \
-	$(if $(BR2_PACKAGE_UTIL_LINUX_FINDFS),--enable-findfs,--disable-findfs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FSCK),--enable-fsck,--disable-fsck) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_HWCLOCK),--enable-hwclock,--disable-hwclock) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_IPCRM),--enable-ipcrm,--disable-ipcrm) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_IPCS),--enable-ipcs,--disable-ipcs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_KILL),--enable-kill,--disable-kill) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LAST),--enable-last,--disable-last) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),--enable-libblkid,--disable-libblkid) \
@@ -83,8 +91,9 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBUUID),--enable-libuuid,--disable-libuuid) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LINE),--enable-line,--disable-line) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),--enable-last --enable-login --enable-runuser --enable-su --enable-sulogin,--disable-last --disable-login --disable-runuser --disable-su --disable-sulogin) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGGER),--enable-logger,--disable-logger) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LOSETUP),--enable-losetup,--disable-losetup) \
-	$(if $(BR2_PACKAGE_UTIL_LINUX_LSBLK),--enable-lsblk,--disable-lsblk) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_LSLOGINS),--enable-lslogins,--disable-lslogins) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MESG),--enable-mesg,--disable-mesg) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MINIX),--enable-minix,--disable-minix) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MORE),--enable-more,--disable-more) \
@@ -94,6 +103,7 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_NOLOGIN),--enable-nologin,--disable-nologin) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_NSENTER),--enable-nsenter,--disable-nsenter) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_PARTX),--enable-partx,--disable-partx) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_PG),--enable-pg,--disable-pg) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT),--enable-pivot_root,--disable-pivot_root) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_RAW),--enable-raw,--disable-raw) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_RENAME),--enable-rename,--disable-rename) \
@@ -112,6 +122,7 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_WDCTL),--enable-wdctl,--disable-wdctl) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_WRITE),--enable-write,--disable-write) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_ZRAMCTL),--enable-zramctl,--disable-zramctl)
+endif
 
 # In the host version of util-linux, we so far only require libuuid,
 # and none of the util-linux utilities, so we disable all of them, unless
@@ -130,12 +141,6 @@ else
 HOST_UTIL_LINUX_CONF_OPTS += --disable-all-programs
 endif
 
-# Avoid building the tools if they are disabled since we can't install on
-# a per-directory basis.
-ifeq ($(BR2_PACKAGE_UTIL_LINUX_BINARIES),)
-UTIL_LINUX_CONF_OPTS += --disable-all-programs
-endif
-
 # Install libmount Python bindings
 ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
 UTIL_LINUX_CONF_OPTS += --with-python
@@ -162,7 +167,7 @@ endif
 UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_INSTALL_PAMFILES
 
 # Install agetty->getty symlink to avoid breakage when there's no busybox
-ifeq ($(BR2_PACKAGE_UTIL_LINUX_AGETTY),y)
+ifneq ($(BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES)$(BR2_PACKAGE_UTIL_LINUX_AGETTY),)
 ifeq ($(BR2_PACKAGE_BUSYBOX),)
 define UTIL_LINUX_GETTY_SYMLINK
 	ln -sf agetty $(TARGET_DIR)/sbin/getty
-- 
2.7.4

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

* [Buildroot] [PATCH v7 2/3] util-linux: expand selection of libraries and utilities
  2016-07-10  1:16                         ` [Buildroot] [PATCH v7 0/3] util-linux: cleanups, additions and reworked utilities menu Carlos Santos
  2016-07-10  1:16                           ` [Buildroot] [PATCH v7 1/3] util-linux: clean up libraries and tools selections Carlos Santos
  2016-07-10  1:16                           ` [Buildroot] [PATCH v6] util-linux: rework utilities menu for finer control Carlos Santos
@ 2016-07-10  1:16                           ` Carlos Santos
  2016-10-16 13:56                             ` Thomas Petazzoni
  2016-07-10  1:16                           ` [Buildroot] [PATCH v7 3/3] util-linux: rework utilities menu for finer control Carlos Santos
  3 siblings, 1 reply; 44+ messages in thread
From: Carlos Santos @ 2016-07-10  1:16 UTC (permalink / raw)
  To: buildroot

- Add option to control installation of libfdisk
- Add libfdisk license to the comment in util-linux.mk
- List all utilities provided by the basic set and document that
  linux32, linux64, uname26, i386 and x86_64 are symlinks to setarch
- Add options to install cal, ipcrm, ipcs, logger, lslogin and pg

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/util-linux/Config.in     | 51 ++++++++++++++++++++++++++++++++++++++++
 package/util-linux/util-linux.mk |  9 ++++++-
 2 files changed, 59 insertions(+), 1 deletion(-)

diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in
index 3b32bc7..266dc47 100644
--- a/package/util-linux/Config.in
+++ b/package/util-linux/Config.in
@@ -18,6 +18,14 @@ config BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	help
 	  Install libblkid.
 
+config BR2_PACKAGE_UTIL_LINUX_LIBFDISK
+	bool "libfdisk"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	help
+	  Install libfdisk.
+
 config BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
 	bool "libmount"
 	depends on BR2_USE_MMU # fork()
@@ -41,11 +49,23 @@ config BR2_PACKAGE_UTIL_LINUX_BINARIES
 	depends on BR2_USE_MMU # fork()
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK
 	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
 	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Install the basic set of util-linux binaries.
 
+	  blkdiscard, blkid, blockdev, cfdisk, chcpu, col, colcrt,
+	  colrm, column, ctrlaltdel, dmesg, fdisk, findfs, findmnt,
+	  flock, fsfreeze, fstrim, getopt, hexdump, ipcmk, isosize,
+	  ldattach, look, lsblk, lscpu, lsipc, lslocks, lsns, mcookie,
+	  mkfs, mkswap, namei, prlimit, readprofile, renice, rev,
+	  rtcwake, script, scriptreplay, setarch, setsid, sfdisk,
+	  swaplabel, swapoff, swapon, tailf, uuidgen, whereis, wipefs
+
+	  The setarch utility also installs architecture-specific
+	  symlinks like linux32, linux64, uname26, i386 and x86_64.
+
 if BR2_PACKAGE_UTIL_LINUX_BINARIES
 
 config BR2_PACKAGE_UTIL_LINUX_AGETTY
@@ -59,6 +79,11 @@ config BR2_PACKAGE_UTIL_LINUX_BFS
 	help
 	  SCO bfs filesystem support
 
+config BR2_PACKAGE_UTIL_LINUX_CAL
+	bool "cal"
+	help
+	  Display a calendar, or some part of it
+
 config BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH
 	bool "chfn/chsh"
 	depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
@@ -111,6 +136,16 @@ config BR2_PACKAGE_UTIL_LINUX_HWCLOCK
 	help
 	  Query or set the hardware clock (RTC)
 
+config BR2_PACKAGE_UTIL_LINUX_IPCRM
+	bool "ipcrm"
+	help
+	  Remove certain IPC resources
+
+config BR2_PACKAGE_UTIL_LINUX_IPCS
+	bool "ipcs"
+	help
+	  Show information on IPC facilities
+
 config BR2_PACKAGE_UTIL_LINUX_KILL
 	bool "kill"
 	help
@@ -140,11 +175,21 @@ comment "Login utilities needs a uClibc or glibc toolchain w/ wchar, locale, dyn
 	depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
 		|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
 
+config BR2_PACKAGE_UTIL_LINUX_LOGGER
+	bool "logger"
+	help
+	  Enter messages into the system log
+
 config BR2_PACKAGE_UTIL_LINUX_LOSETUP
 	bool "losetup"
 	help
 	  Set up and control loop devices
 
+config BR2_PACKAGE_UTIL_LINUX_LSLOGINS
+	bool "lslogins"
+	help
+	  Display information about known users in the system
+
 config BR2_PACKAGE_UTIL_LINUX_MESG
 	bool "mesg"
 	help
@@ -200,6 +245,12 @@ config BR2_PACKAGE_UTIL_LINUX_NSENTER
 comment "nsenter needs a toolchain w/ headers >= 3.0"
 	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 
+config BR2_PACKAGE_UTIL_LINUX_PG
+	bool "pg"
+	depends on BR2_USE_MMU # fork()
+	help
+	  Browse pagewise through text files
+
 config BR2_PACKAGE_UTIL_LINUX_PARTX
 	bool "Partition utilities"
 	depends on BR2_USE_MMU # fork()
diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk
index ed734b0..097291d 100644
--- a/package/util-linux/util-linux.mk
+++ b/package/util-linux/util-linux.mk
@@ -10,7 +10,7 @@ UTIL_LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/util-linux/v$(UTIL_LINUX_VERS
 
 # README.licensing claims that some files are GPLv2-only, but this is not true.
 # Some files are GPLv3+ but only in tests.
-UTIL_LINUX_LICENSE = GPLv2+, BSD-4c, libblkid and libmount LGPLv2.1+, libuuid BSD-3c
+UTIL_LINUX_LICENSE = GPLv2+, BSD-4c, libblkid, libfdisk and libmount LGPLv2.1+, libuuid BSD-3c
 UTIL_LINUX_LICENSE_FILES = README.licensing Documentation/licenses/COPYING.GPLv2 Documentation/licenses/COPYING.UCB Documentation/licenses/COPYING.LGPLv2.1 Documentation/licenses/COPYING.BSD-3
 # For 0001-Fix-libmount-build-under-uClibc.patch
 UTIL_LINUX_AUTORECONF = YES
@@ -67,6 +67,7 @@ UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_LINUX_PAM),linux-pam)
 UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),--enable-agetty,--disable-agetty) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_BFS),--enable-bfs,--disable-bfs) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_CAL),--enable-cal,--disable-cal) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH),--enable-chfn-chsh,--disable-chfn-chsh) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CRAMFS),--enable-cramfs,--disable-cramfs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_EJECT),--enable-eject,--disable-eject) \
@@ -74,15 +75,20 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FDFORMAT),--enable-fdformat,--disable-fdformat) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_FSCK),--enable-fsck,--disable-fsck) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_HWCLOCK),--enable-hwclock,--disable-hwclock) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_IPCRM),--enable-ipcrm,--disable-ipcrm) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_IPCS),--enable-ipcs,--disable-ipcs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_KILL),--enable-kill,--disable-kill) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LAST),--enable-last,--disable-last) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),--enable-libblkid,--disable-libblkid) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBFDISK),--enable-libfdisk,--disable-libfdisk) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT),--enable-libmount,--disable-libmount) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS),--enable-libsmartcols,--disable-libsmartcols) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBUUID),--enable-libuuid,--disable-libuuid) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LINE),--enable-line,--disable-line) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),--enable-last --enable-login --enable-runuser --enable-su --enable-sulogin,--disable-last --disable-login --disable-runuser --disable-su --disable-sulogin) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_LOGGER),--enable-logger,--disable-logger) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_LOSETUP),--enable-losetup,--disable-losetup) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_LSLOGINS),--enable-lslogins,--disable-lslogins) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MESG),--enable-mesg,--disable-mesg) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MINIX),--enable-minix,--disable-minix) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_MORE),--enable-more,--disable-more) \
@@ -92,6 +98,7 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_NOLOGIN),--enable-nologin,--disable-nologin) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_NSENTER),--enable-nsenter,--disable-nsenter) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_PARTX),--enable-partx,--disable-partx) \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_PG),--enable-pg,--disable-pg) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT),--enable-pivot_root,--disable-pivot_root) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_RAW),--enable-raw,--disable-raw) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_RENAME),--enable-rename,--disable-rename) \
-- 
2.7.4

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

* [Buildroot] [PATCH v7 3/3] util-linux: rework utilities menu for finer control
  2016-07-10  1:16                         ` [Buildroot] [PATCH v7 0/3] util-linux: cleanups, additions and reworked utilities menu Carlos Santos
                                             ` (2 preceding siblings ...)
  2016-07-10  1:16                           ` [Buildroot] [PATCH v7 2/3] util-linux: expand selection of libraries and utilities Carlos Santos
@ 2016-07-10  1:16                           ` Carlos Santos
  2016-10-16 14:02                             ` Thomas Petazzoni
  3 siblings, 1 reply; 44+ messages in thread
From: Carlos Santos @ 2016-07-10  1:16 UTC (permalink / raw)
  To: buildroot

When even a single extra util-linux utility is enabled, the
default build and install will install many more programs,
including many that overlap with those offered by busybox.

Fix by reworking the install-utilies menu to take advantage
of the new --disable-all-programs config option.  This option
make it possible to disable the basic set of apps, and then
enable only the desired apps.

Original patch by Danomi Manchego, visible at
http://patchwork.ozlabs.org/patch/494866/

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 Config.in.legacy                 | 16 ++++++++++++
 package/util-linux/Config.in     | 53 +++++++++++++++++++++++++++++++---------
 package/util-linux/util-linux.mk | 15 ++++++------
 3 files changed, 66 insertions(+), 18 deletions(-)

diff --git a/Config.in.legacy b/Config.in.legacy
index 4101cb0..78a6866 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -145,6 +145,22 @@ endif
 ###############################################################################
 comment "Legacy options removed in 2016.08"
 
+config BR2_PACKAGE_UTIL_LINUX_BINARIES
+	bool "utility selection in util-linux has been refactored"
+	select BR2_LEGACY
+	select BR2_PACKAGE_UTIL_LINUX_CUSTOM_BINARIES
+	select BR2_PACKAGE_UTIL_LINUX_BASIC_BINARIES
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK
+	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	help
+	  This option has been removed in favor of a more fine-grained
+	  configuration, which is recommended. Selecting this option
+	  enables building and installing the basic set of utilities.
+	  It will also install all util-linux libraries.
+
 config BR2_PACKAGE_SYSTEMD_COMPAT
 	bool "systemd compatibility libraries have been removed"
 	help
diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in
index 266dc47..0ca961d 100644
--- a/package/util-linux/Config.in
+++ b/package/util-linux/Config.in
@@ -44,8 +44,41 @@ config BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	help
 	  Install libuuid.
 
-config BR2_PACKAGE_UTIL_LINUX_BINARIES
-	bool "Install utilities"
+choice
+	prompt "Install utilities"
+	default BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
+
+config BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES
+	bool "all"
+	depends on BR2_USE_MMU # fork()
+	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
+	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
+	select BR2_PACKAGE_UTIL_LINUX_LIBFDISK
+	select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
+	select BR2_PACKAGE_UTIL_LINUX_LIBUUID
+	select BR2_PACKAGE_LINUX_PAM
+	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_NCURSES
+	select BR2_PACKAGE_LIBCAP_NG
+	help
+	  Install the complete set of util-linux binaries.
+
+config BR2_PACKAGE_UTIL_LINUX_CUSTOM_BINARIES
+	bool "custom"
+	help
+	  Manually select which util-linux binaries to install.
+
+config BR2_PACKAGE_UTIL_LINUX_NO_BINARIES
+	bool "none"
+	help
+	  Disable all util-linux binaries.
+
+endchoice
+
+if BR2_PACKAGE_UTIL_LINUX_CUSTOM_BINARIES
+
+config BR2_PACKAGE_UTIL_LINUX_BASIC_BINARIES
+	bool "Basic set"
 	depends on BR2_USE_MMU # fork()
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
@@ -55,19 +88,17 @@ config BR2_PACKAGE_UTIL_LINUX_BINARIES
 	help
 	  Install the basic set of util-linux binaries.
 
-	  blkdiscard, blkid, blockdev, cfdisk, chcpu, col, colcrt,
-	  colrm, column, ctrlaltdel, dmesg, fdisk, findfs, findmnt,
-	  flock, fsfreeze, fstrim, getopt, hexdump, ipcmk, isosize,
-	  ldattach, look, lsblk, lscpu, lsipc, lslocks, lsns, mcookie,
-	  mkfs, mkswap, namei, prlimit, readprofile, renice, rev,
-	  rtcwake, script, scriptreplay, setarch, setsid, sfdisk,
-	  swaplabel, swapoff, swapon, tailf, uuidgen, whereis, wipefs
+	  blkdiscard, blkid, blockdev, chcpu, col, colcrt, colrm,
+	  column, ctrlaltdel, dmesg, fdisk, findfs, findmnt, flock,
+	  fsfreeze, fstrim, getopt, hexdump, ipcmk, isosize, ldattach,
+	  look, lsblk, lscpu, lsipc, lslocks, lsns, mcookie, mkfs,
+	  mkswap, namei, prlimit, readprofile, renice, rev, rtcwake,
+	  script, scriptreplay, setarch, setsid, sfdisk, swaplabel,
+	  swapoff, swapon, tailf, uuidgen, whereis, wipefs
 
 	  The setarch utility also installs architecture-specific
 	  symlinks like linux32, linux64, uname26, i386 and x86_64.
 
-if BR2_PACKAGE_UTIL_LINUX_BINARIES
-
 config BR2_PACKAGE_UTIL_LINUX_AGETTY
 	bool "agetty"
 	depends on BR2_USE_MMU # fork()
diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk
index 097291d..c78ca7d 100644
--- a/package/util-linux/util-linux.mk
+++ b/package/util-linux/util-linux.mk
@@ -63,8 +63,14 @@ UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_ZLIB),zlib)
 # Used by login-utils
 UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_LINUX_PAM),linux-pam)
 
+ifeq ($(BR2_PACKAGE_UTIL_LINUX_NO_BINARIES),y)
+UTIL_LINUX_CONF_OPTS += --disable-all-programs
+else ifeq ($(BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES),y)
+UTIL_LINUX_CONF_OPTS += --enable-all-programs
+else
 # Disable/Enable utilities
 UTIL_LINUX_CONF_OPTS += \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_BASIC_BINARIES),,--disable-all-programs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),--enable-agetty,--disable-agetty) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_BFS),--enable-bfs,--disable-bfs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CAL),--enable-cal,--disable-cal) \
@@ -117,6 +123,7 @@ UTIL_LINUX_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_WDCTL),--enable-wdctl,--disable-wdctl) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_WRITE),--enable-write,--disable-write) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_ZRAMCTL),--enable-zramctl,--disable-zramctl)
+endif
 
 # In the host version of util-linux, we so far only require libuuid,
 # and none of the util-linux utilities, so we disable all of them, unless
@@ -135,12 +142,6 @@ else
 HOST_UTIL_LINUX_CONF_OPTS += --disable-all-programs
 endif
 
-# Avoid building the tools if they are disabled since we can't install on
-# a per-directory basis.
-ifeq ($(BR2_PACKAGE_UTIL_LINUX_BINARIES),)
-UTIL_LINUX_CONF_OPTS += --disable-all-programs
-endif
-
 # Install libmount Python bindings
 ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
 UTIL_LINUX_CONF_OPTS += --with-python
@@ -167,7 +168,7 @@ endif
 UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_INSTALL_PAMFILES
 
 # Install agetty->getty symlink to avoid breakage when there's no busybox
-ifeq ($(BR2_PACKAGE_UTIL_LINUX_AGETTY),y)
+ifeq ($(or $(BR2_PACKAGE_UTIL_LINUX_ALL_BINARIES),$(BR2_PACKAGE_UTIL_LINUX_AGETTY)),y)
 ifeq ($(BR2_PACKAGE_BUSYBOX),)
 define UTIL_LINUX_GETTY_SYMLINK
 	ln -sf agetty $(TARGET_DIR)/sbin/getty
-- 
2.7.4

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

* [Buildroot] [PATCH v7 1/3] util-linux: clean up libraries and tools selections
  2016-07-10  1:16                           ` [Buildroot] [PATCH v7 1/3] util-linux: clean up libraries and tools selections Carlos Santos
@ 2016-10-16 13:55                             ` Thomas Petazzoni
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni @ 2016-10-16 13:55 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat,  9 Jul 2016 22:16:06 -0300, Carlos Santos wrote:
> Fix several problems in the package recipe:
> 
> - Make 'bool "lib<foo>"' the first item in each block
> - Move the depends before the selects
> - Add missing dependencies on BR2_USE_MMU, for fork()
> - Put option names corresponding to package/utility/library names in
>   lowercase, others start with capital letter
> - Improve help for cramfs utilities and login utilities
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
>  package/util-linux/Config.in     | 67 ++++++++++++++++++++++++++--------------
>  package/util-linux/util-linux.mk |  2 --
>  2 files changed, 43 insertions(+), 26 deletions(-)

Applied to master, with the following changes:

    [Thomas:
     - remove capitalization of prompts, for consistency
     - add missing dependencies on libsmartcols, and therefore !MMU]

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

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

* [Buildroot] [PATCH v7 2/3] util-linux: expand selection of libraries and utilities
  2016-07-10  1:16                           ` [Buildroot] [PATCH v7 2/3] util-linux: expand selection of libraries and utilities Carlos Santos
@ 2016-10-16 13:56                             ` Thomas Petazzoni
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni @ 2016-10-16 13:56 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat,  9 Jul 2016 22:16:08 -0300, Carlos Santos wrote:
> - Add option to control installation of libfdisk
> - Add libfdisk license to the comment in util-linux.mk
> - List all utilities provided by the basic set and document that
>   linux32, linux64, uname26, i386 and x86_64 are symlinks to setarch
> - Add options to install cal, ipcrm, ipcs, logger, lslogin and pg
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
>  package/util-linux/Config.in     | 51 ++++++++++++++++++++++++++++++++++++++++
>  package/util-linux/util-linux.mk |  9 ++++++-
>  2 files changed, 59 insertions(+), 1 deletion(-)

Applied to master, with the following changes:

    [Thomas: add missing dependency of the new lslogins option on
    libsmartcols, and therefore !MMU.]

Also, I added a patch that adjusts the way the license string is
formatted, to match with what we do in the rest of Buildroot.

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

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

* [Buildroot] [PATCH v7 3/3] util-linux: rework utilities menu for finer control
  2016-07-10  1:16                           ` [Buildroot] [PATCH v7 3/3] util-linux: rework utilities menu for finer control Carlos Santos
@ 2016-10-16 14:02                             ` Thomas Petazzoni
  0 siblings, 0 replies; 44+ messages in thread
From: Thomas Petazzoni @ 2016-10-16 14:02 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat,  9 Jul 2016 22:16:09 -0300, Carlos Santos wrote:
> When even a single extra util-linux utility is enabled, the
> default build and install will install many more programs,
> including many that overlap with those offered by busybox.
> 
> Fix by reworking the install-utilies menu to take advantage
> of the new --disable-all-programs config option.  This option
> make it possible to disable the basic set of apps, and then
> enable only the desired apps.
> 
> Original patch by Danomi Manchego, visible at
> http://patchwork.ozlabs.org/patch/494866/
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
>  Config.in.legacy                 | 16 ++++++++++++
>  package/util-linux/Config.in     | 53 +++++++++++++++++++++++++++++++---------
>  package/util-linux/util-linux.mk | 15 ++++++------
>  3 files changed, 66 insertions(+), 18 deletions(-)

We've applied your patch, but after doing some fairly significant
change. Namely, we have removed the choice...endchoice entirely. It is
indeed not necessary at all: simply make the per-tool options visible
even if the "basic set" option is disabled. It allows the same
flexibility, with less options, no legacy, etc.

Thanks!

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

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

end of thread, other threads:[~2016-10-16 14:02 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-04 14:38 [Buildroot] [PATCH 1/1] uboot-tools: add missing dependency on host-dtc for the host package Carlos Santos
2016-05-05 20:09 ` Thomas Petazzoni
2016-05-05 20:17   ` Peter Korsgaard
2016-05-05 21:40     ` Yann E. MORIN
2016-05-05 20:32   ` Carlos Santos
2016-05-05 20:36     ` Thomas Petazzoni
2016-05-05 21:27     ` Yann E. MORIN
2016-05-05 21:38       ` Thomas Petazzoni
2016-05-05 21:44         ` Yann E. MORIN
2016-05-06 12:02           ` Carlos Santos
2016-05-06 11:59 ` [Buildroot] [PATCH v2 " Carlos Santos
2016-05-06 13:25   ` Thomas Petazzoni
2016-05-08 19:39     ` Carlos Santos
2016-05-08 19:46   ` [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optional Carlos Santos
2016-05-08 19:46     ` Carlos Santos
2016-05-28 13:07       ` Thomas Petazzoni
2016-05-31 17:33         ` Carlos Santos
2016-05-31 19:01           ` Thomas Petazzoni
2016-05-31 19:40             ` Carlos Santos
2016-05-31 19:48               ` Thomas Petazzoni
2016-06-01 14:39     ` [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT) Carlos Santos
2016-06-01 14:39       ` [Buildroot] [PATCH next 1/4] uboot-tools: use $(TARGET_STRIP) for target utilities Carlos Santos
2016-06-01 14:39       ` [Buildroot] [PATCH next 2/4] uboot-tools: improve the help text of existing options Carlos Santos
2016-06-01 14:39       ` [Buildroot] [PATCH next 3/4] uboot-tools: re-generate patches to match v2016.05 Carlos Santos
2016-06-01 14:39       ` [Buildroot] [PATCH next 4/4] uboot-tools: fix FIT support and make it optional Carlos Santos
2016-06-01 15:08         ` Thomas Petazzoni
2016-06-03 19:35         ` [Buildroot] [PATCH v4] " Carlos Santos
2016-06-07  2:25           ` [Buildroot] [PATCH v5] util-linux: rework utilities menu for finer control Carlos Santos
2016-07-05 15:11             ` Romain Naour
2016-07-06  2:43               ` Carlos Santos
2016-07-06  2:55                 ` [Buildroot] [PATCH v6] " Carlos Santos
2016-07-06 21:54                   ` Yann E. MORIN
2016-07-08 20:33                     ` Carlos Santos
2016-07-08 20:52                       ` Yann E. MORIN
2016-07-10  1:16                         ` [Buildroot] [PATCH v7 0/3] util-linux: cleanups, additions and reworked utilities menu Carlos Santos
2016-07-10  1:16                           ` [Buildroot] [PATCH v7 1/3] util-linux: clean up libraries and tools selections Carlos Santos
2016-10-16 13:55                             ` Thomas Petazzoni
2016-07-10  1:16                           ` [Buildroot] [PATCH v6] util-linux: rework utilities menu for finer control Carlos Santos
2016-07-10  1:16                           ` [Buildroot] [PATCH v7 2/3] util-linux: expand selection of libraries and utilities Carlos Santos
2016-10-16 13:56                             ` Thomas Petazzoni
2016-07-10  1:16                           ` [Buildroot] [PATCH v7 3/3] util-linux: rework utilities menu for finer control Carlos Santos
2016-10-16 14:02                             ` Thomas Petazzoni
2016-06-07 21:12           ` [Buildroot] [PATCH v4] uboot-tools: fix FIT support and make it optional Thomas Petazzoni
2016-06-01 15:07       ` [Buildroot] [PATCH next 0/4] uboot-tools: fix support for Flat Image Trees (FIT) 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.