uboot-tools: add missing dependency on host-dtc for the host package
PATCH 1/1 uboot-tools: add missing dependency on host-dtc for the host package
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--- package/uboot-tools/Config.in.host | 1 + package/uboot-tools/uboot-tools.mk | 2 ++ 2 files changed, 3 insertions(+)
package/uboot-tools/Config.in.host +1 -0
@@ -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.
package/uboot-tools/uboot-tools.mk +2 -0
@@ -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
Signature · 1 line
2.5.5
PATCH 1/1 uboot-tools: add missing dependency on host-dtc for the host package
Hello,
Thanks for this patch. See my comments below.
Quoted 28 lines · Carlos Santos
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 foundSigned-off-by Carlos Santos <[email protected]>--- package/uboot-tools/Config.in.host | 1 + package/uboot-tools/uboot-tools.mk | 2 ++ 2 files changed, 3 insertions(+)package/uboot-tools/Config.in.host +1
-0@@ -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.package/uboot-tools/uboot-tools.mk +0
-0
package/uboot-tools/uboot-tools.mk define UBOOT_TOOLS_INSTALL_TARGET_CMDS · line 68
Quoted 4 lines
package/uboot-tools/uboot-tools.mk +1
-0@@ -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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 uboot-tools: add missing dependency on host-dtc for the host package
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> writes:
Hi,
Quoted 12 lines
Quoted 1 line
+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.
Quoted 7 lines
(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.
Signature · 2 lines
Venlig hilsen, Peter Korsgaard
PATCH 1/1 uboot-tools: add missing dependency on host-dtc for the host package
Peter, All,
On 2016-05-05 22:17 +0200, Peter Korsgaard spake thusly:
Quoted 17 lines
Quoted 16 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> 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.
Quoted 6 lines
Quoted 3 lines
(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...
Quoted 1 line
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.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 uboot-tools: add missing dependency on host-dtc for the host package
In reply to Thomas PetazzoniQuoted 45 lines
From: "Thomas Petazzoni" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: buildroot at buildroot.org, "Arnout Vandecappelle" <[email protected]>, "Yann E. MORIN" <[email protected]>, "Peter Korsgaard" <[email protected]>
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 packageHello,
Thanks for this patch. See my comments below.
Quoted 33 lines · Carlos Santos
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 foundSigned-off-by Carlos Santos <[email protected]>--- package/uboot-tools/Config.in.host | 1 + package/uboot-tools/uboot-tools.mk | 2 ++ 2 files changed, 3 insertions(+)package/uboot-tools/Config.in.host +1
-0@@ -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.package/uboot-tools/uboot-tools.mk +0
-0@@ -65,6 +65,8 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS $(UBOOT_TOOLS_INSTALL_DUMPIMAGE) endef
Quoted 5 lines
package/uboot-tools/uboot-tools.mk define UBOOT_TOOLS_INSTALL_TARGET_CMDS · line 68
Quoted 1 line
package/uboot-tools/uboot-tools.mk +1
-0+HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtcI 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
Quoted 5 lines
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.
Quoted 3 lines
(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.
Quoted 3 lines
(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
PATCH 1/1 uboot-tools: add missing dependency on host-dtc for the host package
Hello,
Quoted 7 lines · Carlos Santos
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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 uboot-tools: add missing dependency on host-dtc for the host package
In reply to Carlos SantosCarlos, All,
On 2016-05-05 17:32 -0300, Carlos Santos spake thusly:
Quoted 51 lines
Quoted 45 lines
From: "Thomas Petazzoni" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: buildroot at buildroot.org, "Arnout Vandecappelle" <[email protected]>, "Yann E. MORIN" <[email protected]>, "Peter Korsgaard" <[email protected]>
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 packageHello,
Thanks for this patch. See my comments below.
Quoted 33 lines · Carlos Santos
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 foundSigned-off-by Carlos Santos <[email protected]>--- package/uboot-tools/Config.in.host | 1 + package/uboot-tools/uboot-tools.mk | 2 ++ 2 files changed, 3 insertions(+)package/uboot-tools/Config.in.host +1
-0@@ -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.package/uboot-tools/uboot-tools.mk +0
-0@@ -65,6 +65,8 @@ define UBOOT_TOOLS_INSTALL_TARGET_CMDS $(UBOOT_TOOLS_INSTALL_DUMPIMAGE) endefQuoted 5 lines
package/uboot-tools/uboot-tools.mk define UBOOT_TOOLS_INSTALL_TARGET_CMDS · line 68
Quoted 1 line
package/uboot-tools/uboot-tools.mk +1
-0+HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtcI 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).
Quoted 8 lines
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).
Quoted 16 lines
Quoted 5 lines
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.
Quoted 3 lines
(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.
Quoted 6 lines
Quoted 3 lines
(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.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 uboot-tools: add missing dependency on host-dtc for the host package
Hello,
Quoted 3 lines · Yann E. MORIN
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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
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:
Quoted 10 lines · Yann E. MORIN
Quoted 3 lines
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.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 uboot-tools: add missing dependency on host-dtc for the host package
Quoted 21 lines
From: "Yann E. MORIN" <[email protected]>
To: "Thomas Petazzoni" <[email protected]>
Cc: "Carlos Santos" <[email protected]>, buildroot at buildroot.org, "Arnout Vandecappelle" <[email protected]>, "Peter Korsgaard" <[email protected]>
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 packageThomas, All,
On 2016-05-05 23:38 +0200, Thomas Petazzoni spake thusly:
Quoted 10 lines · Yann E. MORIN
Quoted 3 lines
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.
Quoted 6 lines
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
PATCH v2 1/1 uboot-tools: add missing dependency on host-dtc for the host package
In reply to Carlos SantosThe 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--- 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(-)
package/uboot-tools/Config.in +13 -3
@@ -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
package/uboot-tools/Config.in.host +1 -0
@@ -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.
package/uboot-tools/uboot-tools.mk +5 -0
@@ -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)" \
Signature · 1 line
2.5.5
PATCH v2 1/1 uboot-tools: add missing dependency on host-dtc for the host package
Hello,
Quoted 7 lines · Carlos Santos
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 foundSigned-off-by Carlos Santos <[email protected]>
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.
Quoted 1 line
-if
BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
Please keep this "if BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE" rather than using a depends on.
Quoted 1 line
+config
BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SUPPORT
This option affects the *target* version of uboot-tools.
package/uboot-tools/Config.in config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE · line 19
Quoted 3 lines
package/uboot-tools/Config.in +3
-0+ 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!).
Quoted 29 lines
package/uboot-tools/Config.in +9
-2+ 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" helppackage/uboot-tools/Config.in.host +0
-0
package/uboot-tools/Config.in.host line 3
Quoted 3 lines
package/uboot-tools/Config.in.host +1
-0@@ -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.
package/uboot-tools/uboot-tools.mk define UBOOT_TOOLS_INSTALL_TARGET_CMDS · line 69
Quoted 13 lines
package/uboot-tools/Config.in.host +0
-0help Companion tools for Das U-Boot bootloader.package/uboot-tools/uboot-tools.mk +2
-0@@ -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.
package/uboot-tools/uboot-tools.mk endef · line 83
Quoted 10 lines
package/uboot-tools/uboot-tools.mk +3
-0+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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 1/1 uboot-tools: add missing dependency on host-dtc for the host package
Quoted 12 lines
From: "Thomas Petazzoni" <[email protected]>
To: "Carlos Santos" <[email protected]>
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 packageHello,
Quoted 3 lines · Carlos Santos
The mkimage utility needs dtc when support for Flat Image Trees (FIT) is enabled. If dtc is not available mkimage may fail. Example:
Quoted 8 lines
Quoted 4 lines
$ mkimage -f firmware.its firmware.im sh: dtc: command not foundSigned-off-by Carlos Santos <[email protected]>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
PATCH v3 1/1 uboot-tools: fix FIT support and make it optional
In reply to Carlos SantosFix 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.
---
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.
--- .../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
package/uboot-tools/0004-Make-FIT-support-really-optional.patch new file +93 -0
@@ -0,0 +1,93 @@ +From 1c0040aeed5d4dc17a549ad8a1a1c3e889f74e98 Mon Sep 17 00:00:00 2001 +From: Carlos Santos <[email protected]> +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 <[email protected]> +--- + 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 +
package/uboot-tools/Config.in +34 -13
74 lines not on this page · raw message
package/uboot-tools/Config.in.host +16 -0
@@ -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
package/uboot-tools/uboot-tools.mk +25 -10
@@ -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)" \
Signature · 1 line
2.7.4
PATCH v3 1/1 uboot-tools: fix FIT support and make it optional
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.
---
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.
--- .../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
package/uboot-tools/0004-Make-FIT-support-really-optional.patch new file +93 -0
@@ -0,0 +1,93 @@ +From 1c0040aeed5d4dc17a549ad8a1a1c3e889f74e98 Mon Sep 17 00:00:00 2001 +From: Carlos Santos <[email protected]> +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 <[email protected]> +--- + 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 +
package/uboot-tools/Config.in +34 -13
74 lines not on this page · raw message
package/uboot-tools/Config.in.host +16 -0
@@ -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
package/uboot-tools/uboot-tools.mk +25 -10
@@ -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)" \
Signature · 1 line
2.7.4
PATCH v3 1/1 uboot-tools: fix FIT support and make it optional
Hello,
Quoted 18 lines · Carlos Santos
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_printenvandfw_setenv.
Quoted 7 lines
- 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 <[email protected]>
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
package/uboot-tools/0004-Make-FIT-support-really-optional.patch line 4
Quoted 4 lines
package/uboot-tools/0004-Make-FIT-support-really-optional.patch new file +4
-0+From 1c0040aeed5d4dc17a549ad8a1a1c3e889f74e98 Mon Sep 17 00:00:00 2001 +From: Carlos Santos <[email protected]> +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.
Quoted 4 lines
package/uboot-tools/0004-Make-FIT-support-really-optional.patch new file +4
-0+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: +
package/uboot-tools/0004-Make-FIT-support-really-optional.patch line 19
Quoted 10 lines
package/uboot-tools/0004-Make-FIT-support-really-optional.patch new file +10
-0+- 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 <[email protected]>
Has this patch been submitted upstream?
Quoted 12 lines
package/uboot-tools/Config.in +2
-2@@ -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"
package/uboot-tools/Config.in config BR2_PACKAGE_UBOOT_TOOLS · line 18
Quoted 10 lines
package/uboot-tools/Config.in +5
-3+ 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).
package/uboot-tools/Config.in config BR2_PACKAGE_UBOOT_TOOLS · line 18
Quoted 5 lines
package/uboot-tools/Config.in +3
-1+ 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.
Quoted 24 lines
package/uboot-tools/Config.in +13
-0+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
package/uboot-tools/Config.in config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT · line 71
Quoted 10 lines
package/uboot-tools/Config.in +7
-0generation 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?
Quoted 55 lines
package/uboot-tools/Config.in +4
-7+ 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. - endifpackage/uboot-tools/Config.in.host +16
-0@@ -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 + +endifpackage/uboot-tools/uboot-tools.mk +0
-0
package/uboot-tools/uboot-tools.mk define UBOOT_TOOLS_CONFIGURE_CMDS · line 20
Quoted 5 lines
package/uboot-tools/uboot-tools.mk +2
-0@@ -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
package/uboot-tools/uboot-tools.mk define UBOOT_TOOLS_CONFIGURE_CMDS · line 23
Quoted 3 lines
package/uboot-tools/uboot-tools.mk +3
-0+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
Quoted 4 lines
package/uboot-tools/uboot-tools.mk +4
-0+UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf +endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT +endif # BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT +
package/uboot-tools/uboot-tools.mk define UBOOT_TOOLS_CONFIGURE_CMDS · line 36
Quoted 10 lines
package/uboot-tools/uboot-tools.mk +3
-1define 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.
Quoted 32 lines
package/uboot-tools/uboot-tools.mk +2
-8tools-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
package/uboot-tools/uboot-tools.mk define UBOOT_TOOLS_INSTALL_TARGET_CMDS · line 98
Quoted 10 lines
package/uboot-tools/uboot-tools.mk +8
-0endef +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.
package/uboot-tools/uboot-tools.mk define UBOOT_TOOLS_INSTALL_TARGET_CMDS · line 106
Quoted 9 lines
package/uboot-tools/uboot-tools.mk +3
-1+ 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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v3 1/1 uboot-tools: fix FIT support and make it optional
Quoted 1 line
From: "Thomas Petazzoni" <[email protected]>
[...]
Quoted 7 lines
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_STRIPshould be one patch2/ 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.
Quoted 3 lines
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.
Quoted 7 lines
package/uboot-tools/0004-Make-FIT-support-really-optional.patch line 4
Quoted 4 lines
package/uboot-tools/0004-Make-FIT-support-really-optional.patch new file +4
-0+From 1c0040aeed5d4dc17a549ad8a1a1c3e889f74e98 Mon Sep 17 00:00:00 2001 +From: Carlos Santos <[email protected]> +Date: Sun, 8 May 2016 11:11:39 -0300 +Subject: [PATCH 4/4] Make FIT support really optionalPlease generate the patch with "git format-patch -N" so that there is no "4/4" in the patch title.
OK
[...]
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ +Signed-off-by: Carlos Santos <[email protected]>Has this patch been submitted upstream?
Yes (http://patchwork.ozlabs.org/patch/619683/).
Quoted 3 lines
Quoted 3 lines
package/uboot-tools/Config.in +0
-0
[...]
Quoted 3 lines
package/uboot-tools/Config.in
Quoted 1 line
package/uboot-tools/Config.in +1
-0+ Flattened Image Tree. FIT is formally a FDT, which can includePlease, only one space after "." (fix globally).
OK
Quoted 7 lines
Quoted 1 line
-config
BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORTSo essentially, this option gets renamed from
BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORTtoBR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT. You therefore need to addBR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORTto the Config.in.legacy file.
OK
Quoted 9 lines
package/uboot-tools/Config.in config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORT · line 71
Quoted 7 lines
package/uboot-tools/Config.in +7
-0+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.
Quoted 7 lines
Quoted 7 lines
package/uboot-tools/Config.in +0
-6-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
[...]
Quoted 7 lines
package/uboot-tools/Config.in
Quoted 2 lines
package/uboot-tools/Config.in +2
-0+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
Quoted 6 lines
Quoted 4 lines
package/uboot-tools/Config.in +3
-0+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
Quoted 18 lines
Quoted 13 lines
package/uboot-tools/Config.in +5
-1+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)\
package/uboot-tools/Config.in
Quoted 2 lines
package/uboot-tools/Config.in +2
-0+ $(UBOOT_TOOLS_CONFIG_FIT) \ + $(UBOOT_TOOLS_CONFIG_FIT_SIGNATURE) \And here:
Quoted 1 line
$(UBOOT_TOOLS_MAKE_OPTS)
OK
Quoted 2 lines
and you can probably move into
UBOOT_TOOLS_MAKE_OPTSa few other variables.
[...]
Quoted 11 lines
package/uboot-tools/Config.in
Quoted 9 lines
+ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),y)>> +HOST_UBOOT_TOOLS_CONFIG_FIT =
CONFIG_FIT=$(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT)package/uboot-tools/Config.in +3
-0+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)package/uboot-tools/Config.in +3
-0+HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl +endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT +endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORTDitto 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
PATCH v3 1/1 uboot-tools: fix FIT support and make it optional
Hello,
Quoted 5 lines · Carlos Santos
Quoted 3 lines
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.
Quoted 5 lines
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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v3 1/1 uboot-tools: fix FIT support and make it optional
Quoted 12 lines
From: "Thomas Petazzoni" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: buildroot at buildroot.org, "yann morin 1998" <[email protected]>
Sent: Tuesday, May 31, 2016 4:01:22 PM
Subject: Re: [Buildroot] [PATCH v3] uboot-tools: fix FIT support and make it optionalHello,
Quoted 2 lines · Carlos Santos
Quoted 2 lines
3/ Improving FIT support for the host variant
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
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.
Quoted 10 lines
Quoted 5 lines
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
PATCH v3 1/1 uboot-tools: fix FIT support and make it optional
Hello,
Quoted 7 lines · Carlos Santos
Quoted 2 lines
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=yin 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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
cover uboot-tools: fix support for Flat Image Trees (FIT).
In reply to Carlos SantosThe 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
Signature · 1 line
2.7.4
PATCH 1/4 uboot-tools: use $(TARGET_STRIP) for target utilities
Otherwise BR2_STRIP_xxxx setup is ignored and they are always stripped.
--- package/uboot-tools/uboot-tools.mk | 2 ++ 1 file changed, 2 insertions(+)
package/uboot-tools/uboot-tools.mk +2 -0
@@ -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
Signature · 1 line
2.7.4
PATCH 2/4 uboot-tools: improve the help text of existing options
In reply to Carlos SantosImprove the descriptions of the knobs to install mkimage, mkenvimage, dumpimage, fw_printenv and fw_setenv.
--- package/uboot-tools/Config.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
package/uboot-tools/Config.in +9 -1
@@ -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.
Signature · 1 line
2.7.4
PATCH 3/4 uboot-tools: re-generate patches to match v2016.05
In reply to Carlos SantosThey were differences against Das U-Boot versions 2015.07 and 2015.04. Generating again helps to apply them with "git am".
--- .../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(-)
package/uboot-tools/0001-drop-configh-from-tools.patch +7 -7
@@ -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?= <[email protected]> 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 <[email protected]> 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
package/uboot-tools/0002-tools-only-in-no-dot-config-targets.patch +10 -9
@@ -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?= <[email protected]> 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 <[email protected]> 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 +
Signature · 1 line
2.7.4
PATCH 4/4 uboot-tools: fix FIT support and make it optional
In reply to Carlos SantosFix 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.
--- 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
Config.in.legacy +16 -0
@@ -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
package/uboot-tools/0003-Make-FIT-support-really-optional.patch new file +93 -0
93 lines not on this page · raw message
package/uboot-tools/Config.in +20 -7
@@ -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
package/uboot-tools/Config.in.host +16 -0
@@ -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
package/uboot-tools/uboot-tools.mk +31 -28
84 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 4/4 uboot-tools: fix FIT support and make it optional
Hello,
Quoted 8 lines · Carlos Santos
Config.in.legacy +0
-0@@ -145,6 +145,22 @@ endif ############################################################################### comment "Legacy options removed in 2016.08"
Config.in.legacy endif · line 157
Quoted 10 lines
Config.in.legacy +10
-0+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.
Quoted 15 lines
package/uboot-tools/0003-Make-FIT-support-really-optional.patch new file +9
-0@@ -0,0 +1,93 @@ +From ddcd6cd622889a2d74d0a16efae8e3b2d098f717 Mon Sep 17 00:00:00 2001 +From: Carlos Santos <[email protected]> +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: +
package/uboot-tools/0003-Make-FIT-support-really-optional.patch line 19
Quoted 10 lines
package/uboot-tools/0003-Make-FIT-support-really-optional.patch new file +10
-0+- 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 <[email protected]>
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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 1/1 uboot-tools: fix FIT support and make it optional
In reply to Carlos SantosFix 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.
---
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
Config.in.legacy +14 -0
@@ -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
package/uboot-tools/0003-Make-FIT-support-really-optional.patch new file +93 -0
93 lines not on this page · raw message
package/uboot-tools/Config.in +20 -7
@@ -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
package/uboot-tools/Config.in.host +16 -0
@@ -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
package/uboot-tools/uboot-tools.mk +31 -28
84 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v5 1/1 util-linux: rework utilities menu for finer control
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.
---
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(-)
package/util-linux/Config.in +102 -15
@@ -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
package/util-linux/util-linux.mk +14 -9
@@ -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
Signature · 1 line
2.7.4
PATCH v5 1/1 util-linux: rework utilities menu for finer control
Hi Carlos,
Le 07/06/2016 ? 04:25, Carlos Santos a ?crit :
Quoted 96 lines
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 <[email protected]>Signed-off-by Carlos Santos <[email protected]>---
Changes v1 -> v2:
- Rework to incorporate ideas and suggestions from Thomas Petazzoni and Arnout Vandecappelle. At least, in spirit.Changes v2 -> v3:
- ChangeBR2_PACKAGE_UTIL_LINUX_SELECTED_BINARIEStoBR2_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 branchChanges 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 andx86_64are 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(-)package/util-linux/Config.in +33
-5@@ -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
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 82
Quoted 10 lines
package/util-linux/Config.in +5
-1help - 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.
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 83
Quoted 1 line
package/util-linux/Config.in +1
-0+ default y
missing depends on BR2_USE_MMU # fork()
Quoted 35 lines
package/util-linux/Config.in +24
-0+ 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
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_CRAMFS · line 138
Quoted 3 lines
package/util-linux/Config.in +0
-0@@ -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()
Quoted 7 lines
package/util-linux/Config.in +3
-0+ select BR2_PACKAGE_UTIL_LINUX_LIBBLKID + select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT + select BR2_PACKAGE_UTIL_LINUX_LIBUUID help Eject removable media
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_FDFORMAT · line 156
Quoted 10 lines
package/util-linux/Config.in +0
-5@@ -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()
Quoted 48 lines
package/util-linux/Config.in +21
-3+ 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"
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_MORE · line 238
Quoted 3 lines
package/util-linux/Config.in +0
-0@@ -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()
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_MORE · line 246
Quoted 8 lines
package/util-linux/Config.in +3
-0+ 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()
Quoted 13 lines
package/util-linux/Config.in +4
-1+ 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
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_NSENTER · line 278
Quoted 10 lines
package/util-linux/Config.in +5
-0comment "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()
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_UTMPDUMP · line 349
Quoted 9 lines
package/util-linux/Config.in +2
-0+ 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:
Best regards,
Romain
Quoted 86 lines
package/util-linux/Config.in +1
-0+ select BR2_PACKAGE_UTIL_LINUX_LIBUUID help UUID generation daemonpackage/util-linux/util-linux.mk +14
-9@@ -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
PATCH v5 1/1 util-linux: rework utilities menu for finer control
Quoted 111 lines
From: "Romain Naour" <[email protected]>
To: "Carlos Santos" <[email protected]>, buildroot at buildroot.org
Cc: "thomas petazzoni" <[email protected]>
Sent: Tuesday, July 5, 2016 12:11:33 PM
Subject: Re: [Buildroot] [PATCH v5] util-linux: rework utilities menu for finer controlHi Carlos,
Le 07/06/2016 ? 04:25, Carlos Santos a ?crit :
Quoted 102 lines
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 <[email protected]>Signed-off-by Carlos Santos <[email protected]>---
Changes v1 -> v2:
- Rework to incorporate ideas and suggestions from Thomas Petazzoni and Arnout Vandecappelle. At least, in spirit.Changes v2 -> v3:
- ChangeBR2_PACKAGE_UTIL_LINUX_SELECTED_BINARIEStoBR2_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 branchChanges 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 andx86_64are 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(-)package/util-linux/Config.in +36
-6@@ -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
Quoted 6 lines
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 82
Quoted 4 lines
package/util-linux/Config.in +2
-0if 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.
Quoted 4 lines
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 83
Quoted 2 lines
package/util-linux/Config.in +1
-0+ default ymissing depends on
BR2_USE_MMU#fork()
OK, I will fine-tune the declaration of these dependencies.
Carlos Santos (Casantos)
DATACOM, P&D
PATCH v6 1/1 util-linux: rework utilities menu for finer control
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.
---
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
--- package/util-linux/Config.in | 158 ++++++++++++++++++++++++++++++++------- package/util-linux/util-linux.mk | 23 +++--- 2 files changed, 144 insertions(+), 37 deletions(-)
package/util-linux/Config.in +130 -28
@@ -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
package/util-linux/util-linux.mk +14 -9
@@ -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
Signature · 1 line
2.7.4
PATCH v6 1/1 util-linux: rework utilities menu for finer control
Carlos, All,
On 2016-07-05 23:55 -0300, Carlos Santos spake thusly:
Quoted 8 lines
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.
Quoted 3 lines
Signed-off-by Danomi Manchego <[email protected]>Signed-off-by Carlos Santos <[email protected]>---
[--SNIP--]
package/util-linux/Config.in menuconfig BR2_PACKAGE_UTIL_LINUX · line 17
Quoted 13 lines
package/util-linux/Config.in +2
-2@@ -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.
package/util-linux/Config.in menuconfig BR2_PACKAGE_UTIL_LINUX · line 21
Quoted 5 lines
package/util-linux/Config.in +1
-1help 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--]
Quoted 25 lines
package/util-linux/Config.in +20
-4+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
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 76
Quoted 10 lines
package/util-linux/Config.in +8
-1+ 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
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 81
Quoted 4 lines
if
BR2_PACKAGE_UTIL_LINUX_BINARIESpackage/util-linux/Config.in +2
-0+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
Quoted 7 lines
package/util-linux/Config.in +7
-0+ 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
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 98
Quoted 10 lines
package/util-linux/Config.in +10
-0+ 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.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH v6 1/1 util-linux: rework utilities menu for finer control
Quoted 5 lines
From: "Yann E. MORIN" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: buildroot at buildroot.org, "romain naour" <[email protected]>
Sent: Wednesday, July 6, 2016 6:54:07 PM
Subject: Re: [Buildroot] [PATCH v6] util-linux: rework utilities menu for finer control
---8<---
Quoted 10 lines
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);
Quoted 8 lines
- 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<---
Quoted 32 lines
Quoted 32 lines
package/util-linux/Config.in +25
-5+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.
Quoted 8 lines
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 76
Quoted 3 lines
package/util-linux/Config.in +3
-0+ Manually select which util-linux binaries to install. + +endchoiceAs 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).
Quoted 14 lines
So, it should default to "all". And I think the entries should be re-orderd, like that:
all
none
custompackage/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 81
Quoted 4 lines
if
BR2_PACKAGE_UTIL_LINUX_BINARIESpackage/util-linux/Config.in +2
-0+config BR2_PACKAGE_UTIL_LINUX_BASIC_SET + bool "Basic set"Would it make sense to have this in the choice?
Quoted 4 lines
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.
Quoted 21 lines
Quoted 7 lines
package/util-linux/Config.in +7
-0+ 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, etcpackage/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 98
Quoted 10 lines
package/util-linux/Config.in +10
-0+ 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, wipefsIs this list supposed to change between version of util-linux? I don't think we should assume it would not.
Quoted 5 lines
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'Quoted 7 lines
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
PATCH v6 1/1 util-linux: rework utilities menu for finer control
Carlos, All,
On 2016-07-08 17:33 -0300, Carlos Santos spake thusly:
Quoted 20 lines
Quoted 5 lines
From: "Yann E. MORIN" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: buildroot at buildroot.org, "romain naour" <[email protected]>
Sent: Wednesday, July 6, 2016 6:54:07 PM
Subject: Re: [Buildroot] [PATCH v6] util-linux: rework utilities menu for finer control---8<---
Quoted 13 lines
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;
Quoted 8 lines
Quoted 5 lines
- 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! :-)
Quoted 43 lines
---8<---
Quoted 32 lines
Quoted 32 lines
package/util-linux/Config.in +25
-5+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.Quoted 8 lines
package/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 76
Quoted 3 lines
package/util-linux/Config.in +3
-0+ Manually select which util-linux binaries to install. + +endchoiceAs 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.
Quoted 5 lines
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...
Quoted 14 lines
Quoted 14 lines
So, it should default to "all". And I think the entries should be re-orderd, like that:
all
none
custompackage/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 81
Quoted 4 lines
if
BR2_PACKAGE_UTIL_LINUX_BINARIESpackage/util-linux/Config.in +2
-0+config BR2_PACKAGE_UTIL_LINUX_BASIC_SET + bool "Basic set"Would it make sense to have this in the choice?
Quoted 7 lines
Quoted 4 lines
all
basic set
none
customThe 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?
Quoted 1 line
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).
Quoted 24 lines
Quoted 24 lines
Quoted 7 lines
package/util-linux/Config.in +7
-0+ 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, etcpackage/util-linux/Config.in config BR2_PACKAGE_UTIL_LINUX_LIBUUID · line 98
Quoted 10 lines
package/util-linux/Config.in +10
-0+ 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, wipefsIs 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.
Quoted 8 lines
Quoted 2 lines
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.
Quoted 12 lines
Quoted 7 lines
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
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
v7 cover util-linux: cleanups, additions and reworked utilities menu
Original patch by Danomi Manchego <[email protected]>
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(-)
Signature · 1 line
2.7.4
PATCH v7 1/3 util-linux: clean up libraries and tools selections
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
--- package/util-linux/Config.in | 67 ++++++++++++++++++++++++++-------------- package/util-linux/util-linux.mk | 2 -- 2 files changed, 43 insertions(+), 26 deletions(-)
package/util-linux/Config.in +43 -24
@@ -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
package/util-linux/util-linux.mk +0 -2
@@ -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) \
Signature · 1 line
2.7.4
Thomas Petazzoni
AppliedPATCH v7 1/3 util-linux: clean up libraries and tools selections
Hello,
Quoted 9 lines · Carlos Santos
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 onBR2_USE_MMU, forfork()
- Put option names corresponding to package/utility/library names in lowercase, others start with capital letter
- Improve help for cramfs utilities and login utilities
Quoted 5 lines
Signed-off-by Carlos Santos <[email protected]>--- 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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v6 1/1 util-linux: rework utilities menu for finer control
In reply to Carlos SantosWhen 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.
---
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
--- package/util-linux/Config.in | 158 ++++++++++++++++++++++++++++++++------- package/util-linux/util-linux.mk | 23 +++--- 2 files changed, 144 insertions(+), 37 deletions(-)
package/util-linux/Config.in +130 -28
@@ -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
package/util-linux/util-linux.mk +14 -9
@@ -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
Signature · 1 line
2.7.4
PATCH v7 2/3 util-linux: expand selection of libraries and utilities
In reply to Carlos Santos- 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
--- package/util-linux/Config.in | 51 ++++++++++++++++++++++++++++++++++++++++ package/util-linux/util-linux.mk | 9 ++++++- 2 files changed, 59 insertions(+), 1 deletion(-)
package/util-linux/Config.in +51 -0
@@ -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()
package/util-linux/util-linux.mk +8 -1
@@ -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) \
Signature · 1 line
2.7.4
Thomas Petazzoni
AppliedPATCH v7 2/3 util-linux: expand selection of libraries and utilities
Hello,
Quoted 11 lines · Carlos Santos
- 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 andx86_64are symlinks to setarch
- Add options to install cal, ipcrm, ipcs, logger, lslogin and pgSigned-off-by Carlos Santos <[email protected]>--- 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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v7 3/3 util-linux: rework utilities menu for finer control
In reply to Carlos SantosWhen 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/
--- Config.in.legacy | 16 ++++++++++++ package/util-linux/Config.in | 53 +++++++++++++++++++++++++++++++--------- package/util-linux/util-linux.mk | 15 ++++++------ 3 files changed, 66 insertions(+), 18 deletions(-)
Config.in.legacy +16 -0
@@ -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
package/util-linux/Config.in +42 -11
69 lines not on this page · raw message
package/util-linux/util-linux.mk +8 -7
@@ -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
Signature · 1 line
2.7.4
PATCH v7 3/3 util-linux: rework utilities menu for finer control
Hello,
Quoted 12 lines · Carlos Santos
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/
Quoted 6 lines
Signed-off-by Carlos Santos <[email protected]>--- 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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v4 1/1 uboot-tools: fix FIT support and make it optional
In reply to Carlos SantosHello,
Quoted 15 lines · Carlos Santos
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:
Quoted 7 lines
$ mkimage -f firmware.its firmware.im sh: dtc: command not found- Add
BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE_FIT_SIGNATURE_SUPPORTto the Config.in.legacy file.Signed-off-by Carlos Santos <[email protected]>
Thanks, I've applied your patch, with some minor tweaks, see below.
package/uboot-tools/uboot-tools.mk define UBOOT_TOOLS_CONFIGURE_CMDS · line 31
Quoted 8 lines
package/uboot-tools/uboot-tools.mk +8
-0+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.
package/uboot-tools/uboot-tools.mk define UBOOT_TOOLS_CONFIGURE_CMDS · line 35
Quoted 2 lines
package/uboot-tools/uboot-tools.mk +2
-0+ $(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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
cover uboot-tools: fix support for Flat Image Trees (FIT).
In reply to Carlos SantosHello,
Quoted 5 lines · Carlos Santos
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_xxxxsetup is ignored and the utilities are always stripped.
Quoted 7 lines
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.
Quoted 1 line
uboot-tools: fix FIT support and make it optional
I need a bit of time to review that one.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com