* [Buildroot] [PATCH v2 0/3] util-linux: rework utilities menu for finer control
@ 2015-07-11 22:09 Danomi Manchego
2015-07-11 22:09 ` [Buildroot] [PATCH v2 1/3] util-linux: add more tool select options Danomi Manchego
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Danomi Manchego @ 2015-07-11 22:09 UTC (permalink / raw)
To: buildroot
This series changes the util-linux tool setup to support more scenarios.
Previously supported by buildroot:
a. Build libraries only.
- Occurred when "install utilities" disabled.
b. Build basic set of tools which do not have separate config-time enables.
- Examples of the basic set of utils that were installed whether you wanted
them or not: dmesg, blkid, fdisk, flock, hexdump, logger, swapoff, ...
- Many of these tools overlap with BusyBox applets.
- Occurred when "install utilities" enabled, but no others.
c. Build basic set of tools, plus additional tools accessible by buildroot kconfig.
With the patch series, we introduce the possibility of:
d. Selectively build tools, without getting the basic set of utils.
- This lets us keep BusyBox for most things, and only add what is actually
needed from util-linux.
e. Build everything.
To get to this point, the patches do the following:
- Introduce new "basic set" option.
- Introduce missing options for "line" and "tunelp".
- Change boolean "install utilities" to a choice of none/all/custom.
- none:
- In menu, hide individual options.
- Configure with --disable-all-programs.
- all:
- In menu, hide individual options.
- Configure with --enable-all-programs.
- custom:
- In menu, show individual options.
- Configure with --disable-all-programs if "basic set" is not enabled.
- Hide all the util-linux options in a menuconfig, as the option list is quite long.
The series was tested as follows:
- "Install utilities" set to "none" matches (a) above. No apps are built.
- "Install utilities" set to "custom" with only the "basic set" enabled
matches (b).
- "Install utilities" set to "custom" with only one app enabled results in
only that app built, and the libraries, without the "basic set" described
in "b".
- "Install utilities" set to "all" matches the output of a custom build
with all the individual options enabled.
Danomi Manchego (3):
util-linux: add more tool select options
util-linux: rework utilities menu for finer control
util-linux: put package options in a sub-menu
package/util-linux/Config.in | 59 ++++++++++++++++++++++++++++++++++----
package/util-linux/util-linux.mk | 17 ++++++-----
2 files changed, 64 insertions(+), 12 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 7+ messages in thread* [Buildroot] [PATCH v2 1/3] util-linux: add more tool select options 2015-07-11 22:09 [Buildroot] [PATCH v2 0/3] util-linux: rework utilities menu for finer control Danomi Manchego @ 2015-07-11 22:09 ` Danomi Manchego 2015-10-04 17:32 ` Thomas Petazzoni 2015-07-11 22:10 ` [Buildroot] [PATCH v2 2/3] util-linux: rework utilities menu for finer control Danomi Manchego ` (2 subsequent siblings) 3 siblings, 1 reply; 7+ messages in thread From: Danomi Manchego @ 2015-07-11 22:09 UTC (permalink / raw) To: buildroot Add more options to Config.in to optionally select or deselect util-linux "line" and "tunelp" tools. Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com> --- package/util-linux/Config.in | 11 +++++++++++ package/util-linux/util-linux.mk | 2 ++ 2 files changed, 13 insertions(+) diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in index 39df11c..e0a25bf 100644 --- a/package/util-linux/Config.in +++ b/package/util-linux/Config.in @@ -120,6 +120,11 @@ config BR2_PACKAGE_UTIL_LINUX_LAST help Show a listing of last logged in users +config BR2_PACKAGE_UTIL_LINUX_LINE + bool "line" + help + Read one line + config BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS bool "login utilities" depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam @@ -230,6 +235,12 @@ config BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT help Switch to another filesystem as the root of the mount tree +config BR2_PACKAGE_UTIL_LINUX_TUNELP + bool "tunelp" + select BR2_PACKAGE_NCURSES + help + Set various parameters for the lp device + config BR2_PACKAGE_UTIL_LINUX_UL bool "ul" select BR2_PACKAGE_NCURSES diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk index 3ca147a..116596f 100644 --- a/package/util-linux/util-linux.mk +++ b/package/util-linux/util-linux.mk @@ -84,6 +84,7 @@ UTIL_LINUX_CONF_OPTS += \ $(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_LOSETUP),--enable-losetup,--disable-losetup) \ $(if $(BR2_PACKAGE_UTIL_LINUX_MESG),--enable-mesg,--disable-mesg) \ @@ -103,6 +104,7 @@ UTIL_LINUX_CONF_OPTS += \ $(if $(BR2_PACKAGE_UTIL_LINUX_SETPRIV),--enable-setpriv,--disable-setpriv) \ $(if $(BR2_PACKAGE_UTIL_LINUX_SETTERM),--enable-setterm,--disable-setterm) \ $(if $(BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT),--enable-switch_root,--disable-switch_root) \ + $(if $(BR2_PACKAGE_UTIL_LINUX_TUNELP),--enable-tunelp,--disable-tunelp) \ $(if $(BR2_PACKAGE_UTIL_LINUX_UL),--enable-ul,--disable-ul) \ $(if $(BR2_PACKAGE_UTIL_LINUX_UNSHARE),--enable-unshare,--disable-unshare) \ $(if $(BR2_PACKAGE_UTIL_LINUX_UTMPDUMP),--enable-utmpdump,--disable-utmpdump) \ -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH v2 1/3] util-linux: add more tool select options 2015-07-11 22:09 ` [Buildroot] [PATCH v2 1/3] util-linux: add more tool select options Danomi Manchego @ 2015-10-04 17:32 ` Thomas Petazzoni 0 siblings, 0 replies; 7+ messages in thread From: Thomas Petazzoni @ 2015-10-04 17:32 UTC (permalink / raw) To: buildroot Dear Danomi Manchego, On Sat, 11 Jul 2015 18:09:59 -0400, Danomi Manchego wrote: > Add more options to Config.in to optionally select or deselect > util-linux "line" and "tunelp" tools. > > Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com> > --- > package/util-linux/Config.in | 11 +++++++++++ > package/util-linux/util-linux.mk | 2 ++ > 2 files changed, 13 insertions(+) Applied, thanks. Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH v2 2/3] util-linux: rework utilities menu for finer control 2015-07-11 22:09 [Buildroot] [PATCH v2 0/3] util-linux: rework utilities menu for finer control Danomi Manchego 2015-07-11 22:09 ` [Buildroot] [PATCH v2 1/3] util-linux: add more tool select options Danomi Manchego @ 2015-07-11 22:10 ` Danomi Manchego 2015-07-11 22:10 ` [Buildroot] [PATCH v2 3/3] util-linux: put package options in a sub-menu Danomi Manchego 2015-07-11 22:31 ` [Buildroot] [PATCH v2 0/3] util-linux: rework utilities menu for finer control Thomas Petazzoni 3 siblings, 0 replies; 7+ messages in thread From: Danomi Manchego @ 2015-07-11 22:10 UTC (permalink / raw) To: buildroot When even a single extra util-linux utility is enabled, the default build and install will install many more programs, including many that overlap with those offered by busybox. Fix by reworking the install-utilies menu to take advantage of the new --disable-all-programs config option. This option make it possible to disable the basic set of apps, and then enable only the desired apps. Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com> --- Changes v1 -> v2: - Rework to incorporate ideas and suggestions from Thomas Petazzoni and Arnout Vandecappelle. At least, in spirit. --- package/util-linux/Config.in | 46 ++++++++++++++++++++++++++++++++++---- package/util-linux/util-linux.mk | 15 +++++++------ 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in index e0a25bf..31ef12d 100644 --- a/package/util-linux/Config.in +++ b/package/util-linux/Config.in @@ -35,17 +35,55 @@ 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_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_SELECTED_BINARIES + 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_SELECTED_BINARIES + +config BR2_PACKAGE_UTIL_LINUX_BASIC_SET + bool "Basic set" + help + Install a basic set of util-linux binaries. -if BR2_PACKAGE_UTIL_LINUX_BINARIES + blkdiscard, blkid, blockdev, cal, chcpu, col, colcrt, colrm, column, + ctrlaltdel, dmesg, fdisk, findfs, findmnt, flock, fsfreeze, fstrim, + getopt, hexdump, ipcmk, ipcrm, ipcs, isosize, ldattach, linux32, + linux64, logger, look, lsblk, lscpu, lslocks, lslogins, mcookie, + mkfs, mkswap, namei, prlimit, readprofile, renice, rev, rtcwake, + script, scriptreplay, setarch, setsid, sfdisk, swaplabel, swapoff, + swapon, tailf, uname26, uuidgen, whereis, wipefs config BR2_PACKAGE_UTIL_LINUX_AGETTY bool "agetty" diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk index 116596f..fc94a99 100644 --- a/package/util-linux/util-linux.mk +++ b/package/util-linux/util-linux.mk @@ -65,8 +65,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_SET),,--disable-all-programs) \ $(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),--enable-agetty,--disable-agetty) \ $(if $(BR2_PACKAGE_UTIL_LINUX_ARCH),--enable-arch,--disable-arch) \ $(if $(BR2_PACKAGE_UTIL_LINUX_BFS),--enable-bfs,--disable-bfs) \ @@ -114,6 +120,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 @@ -132,12 +139,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 PAM configuration files ifeq ($(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),y) define UTIL_LINUX_INSTALL_PAMFILES @@ -153,7 +154,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 -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH v2 3/3] util-linux: put package options in a sub-menu 2015-07-11 22:09 [Buildroot] [PATCH v2 0/3] util-linux: rework utilities menu for finer control Danomi Manchego 2015-07-11 22:09 ` [Buildroot] [PATCH v2 1/3] util-linux: add more tool select options Danomi Manchego 2015-07-11 22:10 ` [Buildroot] [PATCH v2 2/3] util-linux: rework utilities menu for finer control Danomi Manchego @ 2015-07-11 22:10 ` Danomi Manchego 2015-07-11 22:31 ` [Buildroot] [PATCH v2 0/3] util-linux: rework utilities menu for finer control Thomas Petazzoni 3 siblings, 0 replies; 7+ messages in thread From: Danomi Manchego @ 2015-07-11 22:10 UTC (permalink / raw) To: buildroot Hide all the util-linux options in a menuconfig, as the option list is quite long. Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com> --- package/util-linux/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in index 31ef12d..82c71d4 100644 --- a/package/util-linux/Config.in +++ b/package/util-linux/Config.in @@ -1,4 +1,4 @@ -config BR2_PACKAGE_UTIL_LINUX +menuconfig BR2_PACKAGE_UTIL_LINUX bool "util-linux" depends on BR2_USE_WCHAR select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH v2 0/3] util-linux: rework utilities menu for finer control 2015-07-11 22:09 [Buildroot] [PATCH v2 0/3] util-linux: rework utilities menu for finer control Danomi Manchego ` (2 preceding siblings ...) 2015-07-11 22:10 ` [Buildroot] [PATCH v2 3/3] util-linux: put package options in a sub-menu Danomi Manchego @ 2015-07-11 22:31 ` Thomas Petazzoni 2015-07-12 1:15 ` Danomi Manchego 3 siblings, 1 reply; 7+ messages in thread From: Thomas Petazzoni @ 2015-07-11 22:31 UTC (permalink / raw) To: buildroot Dear Danomi Manchego, On Sat, 11 Jul 2015 18:09:58 -0400, Danomi Manchego wrote: > This series changes the util-linux tool setup to support more scenarios. Thanks. util-linux definitely needs some love. However, can you comment on backward compatibility in terms of Config.in option? I.e, what happens if a Buildroot user has an existing .config which uses util-linux, and upgrades Buildroot to a version that contains your patches. What will happen? In any case, your patch 2/3 is removing BR2_PACKAGE_UTIL_LINUX_BINARIES, so you should update Config.in.legacy accordingly. Best regards, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH v2 0/3] util-linux: rework utilities menu for finer control 2015-07-11 22:31 ` [Buildroot] [PATCH v2 0/3] util-linux: rework utilities menu for finer control Thomas Petazzoni @ 2015-07-12 1:15 ` Danomi Manchego 0 siblings, 0 replies; 7+ messages in thread From: Danomi Manchego @ 2015-07-12 1:15 UTC (permalink / raw) To: buildroot Hi Thomas, On Sat, Jul 11, 2015 at 6:31 PM, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote: > Dear Danomi Manchego, > > On Sat, 11 Jul 2015 18:09:58 -0400, Danomi Manchego wrote: >> This series changes the util-linux tool setup to support more scenarios. > > Thanks. util-linux definitely needs some love. However, can you comment > on backward compatibility in terms of Config.in option? I.e, what > happens if a Buildroot user has an existing .config which uses > util-linux, and upgrades Buildroot to a version that contains your > patches. What will happen? > > In any case, your patch 2/3 is removing > BR2_PACKAGE_UTIL_LINUX_BINARIES, so you should update Config.in.legacy > accordingly. With the series as sent, it looks like the new config would cause a defconfig with tools selected to go to having no tools selected. So, not so good. I can add a legacy option with the help indicating that the "custom" choice must be selected (like some of the lua legacy options). But - we can actually preserve backwards-compatibility if I change BR2_PACKAGE_UTIL_LINUX_SELECTED_BINARIES to match the previous BR2_PACKAGE_UTIL_LINUX_BINARIES ("BINARIES" vs the other choices "ALL_BINARIES" and "NO_BINARIES"). Its not what one would do when coding from scratch, but it avoids needing to add the legacy option. (We could even claim perfect backwards compatibility if we enable the "basic set" of tools by default, though it seems like changing that particular default is not a priority for anyone.) Any objection to reusing the old config name? Danomi - > > Best regards, > > Thomas > -- > Thomas Petazzoni, CTO, Free Electrons > Embedded Linux, Kernel and Android engineering > http://free-electrons.com ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-10-04 17:32 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-07-11 22:09 [Buildroot] [PATCH v2 0/3] util-linux: rework utilities menu for finer control Danomi Manchego 2015-07-11 22:09 ` [Buildroot] [PATCH v2 1/3] util-linux: add more tool select options Danomi Manchego 2015-10-04 17:32 ` Thomas Petazzoni 2015-07-11 22:10 ` [Buildroot] [PATCH v2 2/3] util-linux: rework utilities menu for finer control Danomi Manchego 2015-07-11 22:10 ` [Buildroot] [PATCH v2 3/3] util-linux: put package options in a sub-menu Danomi Manchego 2015-07-11 22:31 ` [Buildroot] [PATCH v2 0/3] util-linux: rework utilities menu for finer control Thomas Petazzoni 2015-07-12 1:15 ` Danomi Manchego
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox