瀏覽代碼

util-linux: allow disabling the basic set of tools

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

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

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

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
[Thomas/Arnout: remove the choice between all/custom/no, and simply have
a list of options with the basic set of tools, and then one option for
each tool. This gives the same flexibility, but avoids the choice, which
is never nice to have.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Carlos Santos 9 年之前
父節點
當前提交
e8ddc0de9e
共有 2 個文件被更改,包括 9 次插入18 次删除
  1. 8 12
      package/util-linux/Config.in
  2. 1 6
      package/util-linux/util-linux.mk

+ 8 - 12
package/util-linux/Config.in

@@ -45,7 +45,7 @@ config BR2_PACKAGE_UTIL_LINUX_LIBUUID
 	  Install libuuid.
 	  Install libuuid.
 
 
 config BR2_PACKAGE_UTIL_LINUX_BINARIES
 config BR2_PACKAGE_UTIL_LINUX_BINARIES
-	bool "install utilities"
+	bool "basic set"
 	depends on BR2_USE_MMU # fork()
 	depends on BR2_USE_MMU # fork()
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
 	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
@@ -55,19 +55,17 @@ config BR2_PACKAGE_UTIL_LINUX_BINARIES
 	help
 	help
 	  Install the basic set of util-linux binaries.
 	  Install the basic set of util-linux binaries.
 
 
-	  blkdiscard, blkid, blockdev, cfdisk, chcpu, col, colcrt,
-	  colrm, column, ctrlaltdel, dmesg, fdisk, findfs, findmnt,
-	  flock, fsfreeze, fstrim, getopt, hexdump, ipcmk, isosize,
-	  ldattach, look, lsblk, lscpu, lsipc, lslocks, lsns, mcookie,
-	  mkfs, mkswap, namei, prlimit, readprofile, renice, rev,
-	  rtcwake, script, scriptreplay, setarch, setsid, sfdisk,
-	  swaplabel, swapoff, swapon, tailf, uuidgen, whereis, wipefs
+	  blkdiscard, blkid, blockdev, chcpu, col, colcrt, colrm,
+	  column, ctrlaltdel, dmesg, fdisk, findfs, findmnt, flock,
+	  fsfreeze, fstrim, getopt, hexdump, ipcmk, isosize, ldattach,
+	  look, lsblk, lscpu, lsipc, lslocks, lsns, mcookie, mkfs,
+	  mkswap, namei, prlimit, readprofile, renice, rev, rtcwake,
+	  script, scriptreplay, setarch, setsid, sfdisk, swaplabel,
+	  swapoff, swapon, tailf, uuidgen, whereis, wipefs
 
 
 	  The setarch utility also installs architecture-specific
 	  The setarch utility also installs architecture-specific
 	  symlinks like linux32, linux64, uname26, i386 and x86_64.
 	  symlinks like linux32, linux64, uname26, i386 and x86_64.
 
 
-if BR2_PACKAGE_UTIL_LINUX_BINARIES
-
 config BR2_PACKAGE_UTIL_LINUX_AGETTY
 config BR2_PACKAGE_UTIL_LINUX_AGETTY
 	bool "agetty"
 	bool "agetty"
 	depends on BR2_USE_MMU # fork()
 	depends on BR2_USE_MMU # fork()
@@ -371,7 +369,5 @@ config BR2_PACKAGE_UTIL_LINUX_ZRAMCTL
 
 
 endif
 endif
 
 
-endif
-
 comment "util-linux needs a toolchain w/ wchar"
 comment "util-linux needs a toolchain w/ wchar"
 	depends on !BR2_USE_WCHAR
 	depends on !BR2_USE_WCHAR

+ 1 - 6
package/util-linux/util-linux.mk

@@ -71,6 +71,7 @@ UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_LINUX_PAM),linux-pam)
 
 
 # Disable/Enable utilities
 # Disable/Enable utilities
 UTIL_LINUX_CONF_OPTS += \
 UTIL_LINUX_CONF_OPTS += \
+	$(if $(BR2_PACKAGE_UTIL_LINUX_BINARIES),--enable-all-programs,--disable-all-programs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),--enable-agetty,--disable-agetty) \
 	$(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_BFS),--enable-bfs,--disable-bfs) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CAL),--enable-cal,--disable-cal) \
 	$(if $(BR2_PACKAGE_UTIL_LINUX_CAL),--enable-cal,--disable-cal) \
@@ -142,12 +143,6 @@ else
 HOST_UTIL_LINUX_CONF_OPTS += --disable-all-programs
 HOST_UTIL_LINUX_CONF_OPTS += --disable-all-programs
 endif
 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
 # Install libmount Python bindings
 ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
 ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
 UTIL_LINUX_CONF_OPTS += --with-python
 UTIL_LINUX_CONF_OPTS += --with-python