[git commit] Fix non-Linux builds

Denys Vlasenko vda.linux at googlemail.com
Tue Nov 29 13:10:22 UTC 2022


commit: https://git.busybox.net/busybox/commit/?id=77216c368f3ae65c3a9fc504d28d3fadd46d6d8d
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Various tools are Linuxish and should thus only attempted to build on
Linux only. Some features are also Linux-only.

Also, libresolv is used on all GNU platforms, notably GNU/Hurd and
GNU/kfreeBSD.

Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 Makefile.flags              |  2 +-
 console-tools/loadfont.c    |  1 +
 console-tools/openvt.c      |  1 +
 coreutils/dd.c              | 20 ++++++++++++++++++--
 klibc-utils/run-init.c      |  1 +
 miscutils/adjtimex.c        |  1 +
 miscutils/i2c_tools.c       |  5 +++++
 miscutils/partprobe.c       |  1 +
 miscutils/ubirename.c       |  1 +
 miscutils/watchdog.c        |  1 +
 modutils/Config.src         |  1 +
 modutils/depmod.c           |  1 +
 modutils/insmod.c           |  1 +
 modutils/lsmod.c            |  1 +
 modutils/modinfo.c          |  1 +
 modutils/modprobe.c         |  1 +
 modutils/rmmod.c            |  1 +
 networking/arp.c            |  1 +
 networking/arping.c         |  1 +
 networking/brctl.c          |  1 +
 networking/ifconfig.c       |  1 +
 networking/ifplugd.c        |  1 +
 networking/ip.c             |  6 ++++++
 networking/nameif.c         |  1 +
 networking/route.c          |  1 +
 networking/tc.c             |  1 +
 networking/traceroute.c     |  2 ++
 networking/tunctl.c         |  1 +
 networking/udhcp/Config.src |  3 +++
 procps/free.c               |  1 +
 procps/uptime.c             |  1 +
 sysklogd/klogd.c            |  1 +
 util-linux/acpid.c          |  1 +
 util-linux/blkdiscard.c     |  1 +
 util-linux/blkid.c          |  1 +
 util-linux/dmesg.c          |  1 +
 util-linux/fdisk.c          |  1 +
 util-linux/findfs.c         |  1 +
 util-linux/freeramdisk.c    |  2 ++
 util-linux/fsfreeze.c       |  1 +
 util-linux/fstrim.c         |  1 +
 util-linux/hwclock.c        |  1 +
 util-linux/ionice.c         |  1 +
 util-linux/losetup.c        |  1 +
 util-linux/mdev.c           |  1 +
 util-linux/mkfs_ext2.c      |  1 +
 util-linux/mkfs_vfat.c      |  1 +
 util-linux/mount.c          |  1 +
 util-linux/nsenter.c        |  1 +
 util-linux/pivot_root.c     |  1 +
 util-linux/setarch.c        |  3 +++
 util-linux/setpriv.c        |  1 +
 util-linux/swaponoff.c      |  2 ++
 util-linux/switch_root.c    |  1 +
 util-linux/uevent.c         |  1 +
 util-linux/unshare.c        |  1 +
 56 files changed, 89 insertions(+), 3 deletions(-)

diff --git a/Makefile.flags b/Makefile.flags
index 84cb00a75..50137a78e 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -184,7 +184,7 @@ LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%
 endif
 
 ifeq ($(CONFIG_FEATURE_NSLOOKUP_BIG),y)
-ifneq (,$(findstring linux,$(shell $(CC) $(CFLAGS) -dumpmachine)))
+ifneq (,$(findstring gnu,$(shell $(CC) $(CFLAGS) -dumpmachine)))
 LDLIBS += resolv
 endif
 endif
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index 81a0e6aa8..3f36cabe0 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -12,6 +12,7 @@
 //config:config LOADFONT
 //config:	bool "loadfont (5.2 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	This program loads a console font from standard input.
 //config:
diff --git a/console-tools/openvt.c b/console-tools/openvt.c
index db2f073b2..9e6cffecc 100644
--- a/console-tools/openvt.c
+++ b/console-tools/openvt.c
@@ -10,6 +10,7 @@
 //config:config OPENVT
 //config:	bool "openvt (7.2 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	This program is used to start a command on an unused
 //config:	virtual terminal.
diff --git a/coreutils/dd.c b/coreutils/dd.c
index 06c1b7b9c..3e034eb1e 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -200,6 +200,7 @@ static void dd_output_status(int UNUSED_PARAM cur_signal)
 }
 
 #if ENABLE_FEATURE_DD_IBS_OBS
+# ifdef O_DIRECT
 static int clear_O_DIRECT(int fd)
 {
 	if (errno == EINVAL) {
@@ -211,6 +212,7 @@ static int clear_O_DIRECT(int fd)
 	}
 	return 0;
 }
+# endif
 #endif
 
 static ssize_t dd_read(void *ibuf, size_t ibs)
@@ -225,8 +227,10 @@ static ssize_t dd_read(void *ibuf, size_t ibs)
 #endif
 		n = safe_read(ifd, ibuf, ibs);
 #if ENABLE_FEATURE_DD_IBS_OBS
+# ifdef O_DIRECT
 	if (n < 0 && (G.flags & FLAG_IDIRECT) && clear_O_DIRECT(ifd))
 		goto read_again;
+# endif
 #endif
 	return n;
 }
@@ -239,8 +243,10 @@ static bool write_and_stats(const void *buf, size_t len, size_t obs,
  IF_FEATURE_DD_IBS_OBS(write_again:)
 	n = full_write(ofd, buf, len);
 #if ENABLE_FEATURE_DD_IBS_OBS
+# ifdef O_DIRECT
 	if (n < 0 && (G.flags & FLAG_ODIRECT) && clear_O_DIRECT(ofd))
 		goto write_again;
+# endif
 #endif
 
 #if ENABLE_FEATURE_DD_THIRD_STATUS_LINE
@@ -501,8 +507,13 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
 	if (infile) {
 		int iflag = O_RDONLY;
 #if ENABLE_FEATURE_DD_IBS_OBS
-		if (G.flags & FLAG_IDIRECT)
+		if (G.flags & FLAG_IDIRECT) {
+# ifdef O_DIRECT
 			iflag |= O_DIRECT;
+# else
+			bb_error_msg_and_die("O_DIRECT not supported on this platform");
+# endif
+		}
 #endif
 		xmove_fd(xopen(infile, iflag), ifd);
 	} else {
@@ -516,8 +527,13 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
 		if (G.flags & FLAG_APPEND)
 			oflag |= O_APPEND;
 #if ENABLE_FEATURE_DD_IBS_OBS
-		if (G.flags & FLAG_ODIRECT)
+		if (G.flags & FLAG_ODIRECT) {
+# ifdef O_DIRECT
 			oflag |= O_DIRECT;
+# else
+			bb_error_msg_and_die("O_DIRECT not supported on this platform");
+# endif
+		}
 #endif
 		xmove_fd(xopen(outfile, oflag), ofd);
 
diff --git a/klibc-utils/run-init.c b/klibc-utils/run-init.c
index 73c677bab..77fc0e60c 100644
--- a/klibc-utils/run-init.c
+++ b/klibc-utils/run-init.c
@@ -8,6 +8,7 @@
 //config:config RUN_INIT
 //config:	bool "run-init (7.7 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	The run-init utility is used from initramfs to select a new
 //config:	root device. Under initramfs, you have to use this instead of
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c
index 209d1d560..c289245c0 100644
--- a/miscutils/adjtimex.c
+++ b/miscutils/adjtimex.c
@@ -13,6 +13,7 @@
 //config:config ADJTIMEX
 //config:	bool "adjtimex (4.7 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Adjtimex reads and optionally sets adjustment parameters for
 //config:	the Linux clock adjustment algorithm.
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c
index da26f5e19..46749fb9c 100644
--- a/miscutils/i2c_tools.c
+++ b/miscutils/i2c_tools.c
@@ -11,30 +11,35 @@
 //config:config I2CGET
 //config:	bool "i2cget (5.5 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Read from I2C/SMBus chip registers.
 //config:
 //config:config I2CSET
 //config:	bool "i2cset (6.7 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Set I2C registers.
 //config:
 //config:config I2CDUMP
 //config:	bool "i2cdump (7.1 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Examine I2C registers.
 //config:
 //config:config I2CDETECT
 //config:	bool "i2cdetect (7.1 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Detect I2C chips.
 //config:
 //config:config I2CTRANSFER
 //config:	bool "i2ctransfer (4.0 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Send user-defined I2C messages in one transfer.
 //config:
diff --git a/miscutils/partprobe.c b/miscutils/partprobe.c
index 0fb1927b7..0abed6ff1 100644
--- a/miscutils/partprobe.c
+++ b/miscutils/partprobe.c
@@ -7,6 +7,7 @@
 //config:config PARTPROBE
 //config:	bool "partprobe (3.5 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Ask kernel to rescan partition table.
 
diff --git a/miscutils/ubirename.c b/miscutils/ubirename.c
index 06a0adacf..e7c56640c 100644
--- a/miscutils/ubirename.c
+++ b/miscutils/ubirename.c
@@ -9,6 +9,7 @@
 //config:config UBIRENAME
 //config:	bool "ubirename (2.4 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Utility to rename UBI volumes
 
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c
index 9f5a4b849..91a20239d 100644
--- a/miscutils/watchdog.c
+++ b/miscutils/watchdog.c
@@ -11,6 +11,7 @@
 //config:config WATCHDOG
 //config:	bool "watchdog (5.3 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	The watchdog utility is used with hardware or software watchdog
 //config:	device drivers. It opens the specified watchdog device special file
diff --git a/modutils/Config.src b/modutils/Config.src
index 188296814..b8ba3b7b6 100644
--- a/modutils/Config.src
+++ b/modutils/Config.src
@@ -8,6 +8,7 @@ menu "Linux Module Utilities"
 config MODPROBE_SMALL
 	bool "Simplified modutils"
 	default y
+	select PLATFORM_LINUX
 	help
 	Build smaller (~1.5 kbytes), simplified module tools.
 
diff --git a/modutils/depmod.c b/modutils/depmod.c
index bb42bbefe..9e39481c5 100644
--- a/modutils/depmod.c
+++ b/modutils/depmod.c
@@ -10,6 +10,7 @@
 //config:config DEPMOD
 //config:	bool "depmod (27 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	depmod generates modules.dep (and potentially modules.alias
 //config:	and modules.symbols) that contain dependency information
diff --git a/modutils/insmod.c b/modutils/insmod.c
index 8f7163e25..85b46cdd6 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -9,6 +9,7 @@
 //config:config INSMOD
 //config:	bool "insmod (22 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	insmod is used to load specified modules in the running kernel.
 
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index 2beb12362..39dc8e6b7 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -10,6 +10,7 @@
 //config:config LSMOD
 //config:	bool "lsmod (1.9 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	lsmod is used to display a list of loaded modules.
 //config:
diff --git a/modutils/modinfo.c b/modutils/modinfo.c
index 0a86c3296..5d01179a0 100644
--- a/modutils/modinfo.c
+++ b/modutils/modinfo.c
@@ -8,6 +8,7 @@
 //config:config MODINFO
 //config:	bool "modinfo (24 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Show information about a Linux Kernel module
 
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index 235706fd5..77c4bb74d 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -10,6 +10,7 @@
 //config:config MODPROBE
 //config:	bool "modprobe (28 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Handle the loading of modules, and their dependencies on a high
 //config:	level.
diff --git a/modutils/rmmod.c b/modutils/rmmod.c
index 2b3c39153..8d4639f50 100644
--- a/modutils/rmmod.c
+++ b/modutils/rmmod.c
@@ -10,6 +10,7 @@
 //config:config RMMOD
 //config:	bool "rmmod (3.3 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	rmmod is used to unload specified modules from the kernel.
 
diff --git a/networking/arp.c b/networking/arp.c
index 16783ab95..6519f8156 100644
--- a/networking/arp.c
+++ b/networking/arp.c
@@ -15,6 +15,7 @@
 //config:config ARP
 //config:	bool "arp (10 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Manipulate the system ARP cache.
 
diff --git a/networking/arping.c b/networking/arping.c
index 86f0221ed..fd0e1b276 100644
--- a/networking/arping.c
+++ b/networking/arping.c
@@ -8,6 +8,7 @@
 //config:config ARPING
 //config:	bool "arping (9 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Ping hosts by ARP packets.
 
diff --git a/networking/brctl.c b/networking/brctl.c
index 956bd91f3..b353210d7 100644
--- a/networking/brctl.c
+++ b/networking/brctl.c
@@ -12,6 +12,7 @@
 //config:config BRCTL
 //config:	bool "brctl (4.7 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Manage ethernet bridges.
 //config:	Supports addbr/delbr and addif/delif.
diff --git a/networking/ifconfig.c b/networking/ifconfig.c
index 9ee232a66..4090959b8 100644
--- a/networking/ifconfig.c
+++ b/networking/ifconfig.c
@@ -27,6 +27,7 @@
 //config:config IFCONFIG
 //config:	bool "ifconfig (12 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Ifconfig is used to configure the kernel-resident network interfaces.
 //config:
diff --git a/networking/ifplugd.c b/networking/ifplugd.c
index 0b55bf4e5..bc4303ef0 100644
--- a/networking/ifplugd.c
+++ b/networking/ifplugd.c
@@ -9,6 +9,7 @@
 //config:config IFPLUGD
 //config:	bool "ifplugd (10 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Network interface plug detection daemon.
 
diff --git a/networking/ip.c b/networking/ip.c
index 7c3208699..23ee7d24b 100644
--- a/networking/ip.c
+++ b/networking/ip.c
@@ -11,6 +11,7 @@
 //config:config IP
 //config:	bool "ip (35 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	The "ip" applet is a TCP/IP interface configuration and routing
 //config:	utility.
@@ -21,6 +22,7 @@
 //config:config IPADDR
 //config:	bool "ipaddr (14 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	select FEATURE_IP_ADDRESS
 //config:	help
 //config:	Short form of "ip addr"
@@ -28,6 +30,7 @@
 //config:config IPLINK
 //config:	bool "iplink (17 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	select FEATURE_IP_LINK
 //config:	help
 //config:	Short form of "ip link"
@@ -35,6 +38,7 @@
 //config:config IPROUTE
 //config:	bool "iproute (15 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	select FEATURE_IP_ROUTE
 //config:	help
 //config:	Short form of "ip route"
@@ -49,6 +53,7 @@
 //config:config IPRULE
 //config:	bool "iprule (10 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	select FEATURE_IP_RULE
 //config:	help
 //config:	Short form of "ip rule"
@@ -56,6 +61,7 @@
 //config:config IPNEIGH
 //config:	bool "ipneigh (8.3 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	select FEATURE_IP_NEIGH
 //config:	help
 //config:	Short form of "ip neigh"
diff --git a/networking/nameif.c b/networking/nameif.c
index 66e042688..3ccd935b8 100644
--- a/networking/nameif.c
+++ b/networking/nameif.c
@@ -12,6 +12,7 @@
 //config:config NAMEIF
 //config:	bool "nameif (6.6 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	select FEATURE_SYSLOG
 //config:	help
 //config:	nameif is used to rename network interface by its MAC address.
diff --git a/networking/route.c b/networking/route.c
index 26146f8e9..616572814 100644
--- a/networking/route.c
+++ b/networking/route.c
@@ -27,6 +27,7 @@
 //config:config ROUTE
 //config:	bool "route (8.7 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Route displays or manipulates the kernel's IP routing tables.
 
diff --git a/networking/tc.c b/networking/tc.c
index 43187f7ee..1f4bcce2b 100644
--- a/networking/tc.c
+++ b/networking/tc.c
@@ -9,6 +9,7 @@
 //config:config TC
 //config:	bool "tc (8.3 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Show / manipulate traffic control settings
 //config:
diff --git a/networking/traceroute.c b/networking/traceroute.c
index 4bbe1ab8e..2ba990fd0 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -963,8 +963,10 @@ traceroute_init(int op, char **argv)
 	if (af == AF_INET) {
 		xmove_fd(xsocket(AF_INET, SOCK_RAW, IPPROTO_ICMP), rcvsock);
 #if ENABLE_FEATURE_TRACEROUTE_VERBOSE
+# ifdef IP_PKTINFO
 		/* want recvmsg to report target local address (for -v) */
 		setsockopt_1(rcvsock, IPPROTO_IP, IP_PKTINFO);
+# endif
 #endif
 	}
 #if ENABLE_TRACEROUTE6
diff --git a/networking/tunctl.c b/networking/tunctl.c
index 97e6917aa..59cae331c 100644
--- a/networking/tunctl.c
+++ b/networking/tunctl.c
@@ -12,6 +12,7 @@
 //config:config TUNCTL
 //config:	bool "tunctl (6.2 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	tunctl creates or deletes tun devices.
 //config:
diff --git a/networking/udhcp/Config.src b/networking/udhcp/Config.src
index 8c8c11c26..23e2b40d8 100644
--- a/networking/udhcp/Config.src
+++ b/networking/udhcp/Config.src
@@ -6,6 +6,7 @@
 config UDHCPD
 	bool "udhcpd (21 kb)"
 	default y
+	select PLATFORM_LINUX
 	help
 	udhcpd is a DHCP server geared primarily toward embedded systems,
 	while striving to be fully functional and RFC compliant.
@@ -53,6 +54,7 @@ config DUMPLEASES
 config DHCPRELAY
 	bool "dhcprelay (5.2 kb)"
 	default y
+	select PLATFORM_LINUX
 	help
 	dhcprelay listens for DHCP requests on one or more interfaces
 	and forwards these requests to a different interface or DHCP
@@ -61,6 +63,7 @@ config DHCPRELAY
 config UDHCPC
 	bool "udhcpc (24 kb)"
 	default y
+	select PLATFORM_LINUX
 	help
 	udhcpc is a DHCP client geared primarily toward embedded systems,
 	while striving to be fully functional and RFC compliant.
diff --git a/procps/free.c b/procps/free.c
index 0b68e1b88..c734f757d 100644
--- a/procps/free.c
+++ b/procps/free.c
@@ -9,6 +9,7 @@
 //config:config FREE
 //config:	bool "free (3.1 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	free displays the total amount of free and used physical and swap
 //config:	memory in the system, as well as the buffers used by the kernel.
diff --git a/procps/uptime.c b/procps/uptime.c
index 4fd0c9d2d..4992c263e 100644
--- a/procps/uptime.c
+++ b/procps/uptime.c
@@ -14,6 +14,7 @@
 //config:config UPTIME
 //config:	bool "uptime (3.7 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	uptime gives a one line display of the current time, how long
 //config:	the system has been running, how many users are currently logged
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index df0edee0a..ddf50071d 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -19,6 +19,7 @@
 //config:config KLOGD
 //config:	bool "klogd (5.7 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	klogd is a utility which intercepts and logs all
 //config:	messages from the Linux kernel and sends the messages
diff --git a/util-linux/acpid.c b/util-linux/acpid.c
index 00613f8e3..7bce8abea 100644
--- a/util-linux/acpid.c
+++ b/util-linux/acpid.c
@@ -9,6 +9,7 @@
 //config:config ACPID
 //config:	bool "acpid (9 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	acpid listens to ACPI events coming either in textual form from
 //config:	/proc/acpi/event (though it is marked deprecated it is still widely
diff --git a/util-linux/blkdiscard.c b/util-linux/blkdiscard.c
index 7ac8045f9..2291eec21 100644
--- a/util-linux/blkdiscard.c
+++ b/util-linux/blkdiscard.c
@@ -8,6 +8,7 @@
 //config:config BLKDISCARD
 //config:	bool "blkdiscard (4.3 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	blkdiscard discards sectors on a given device.
 
diff --git a/util-linux/blkid.c b/util-linux/blkid.c
index 4a820771f..008ae5d9e 100644
--- a/util-linux/blkid.c
+++ b/util-linux/blkid.c
@@ -9,6 +9,7 @@
 //config:config BLKID
 //config:	bool "blkid (12 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	select VOLUMEID
 //config:	help
 //config:	Lists labels and UUIDs of all filesystems.
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index 6670b84de..5da887f0e 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -11,6 +11,7 @@
 //config:config DMESG
 //config:	bool "dmesg (3.7 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	dmesg is used to examine or control the kernel ring buffer. When the
 //config:	Linux kernel prints messages to the system log, they are stored in
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index 20e7d56fa..e9ebbd5d4 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -10,6 +10,7 @@
 //config:config FDISK
 //config:	bool "fdisk (37 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	The fdisk utility is used to divide hard disks into one or more
 //config:	logical disks, which are generally called partitions. This utility
diff --git a/util-linux/findfs.c b/util-linux/findfs.c
index f5621a1fa..7ca9dc96b 100644
--- a/util-linux/findfs.c
+++ b/util-linux/findfs.c
@@ -10,6 +10,7 @@
 //config:config FINDFS
 //config:	bool "findfs (12 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	select VOLUMEID
 //config:	help
 //config:	Prints the name of a filesystem with given label or UUID.
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c
index 309169d25..d27113d97 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -11,6 +11,7 @@
 //config:config FDFLUSH
 //config:	bool "fdflush (1.3 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	fdflush is only needed when changing media on slightly-broken
 //config:	removable media drives. It is used to make Linux believe that a
@@ -23,6 +24,7 @@
 //config:config FREERAMDISK
 //config:	bool "freeramdisk (1.3 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Linux allows you to create ramdisks. This utility allows you to
 //config:	delete them and completely free all memory that was used for the
diff --git a/util-linux/fsfreeze.c b/util-linux/fsfreeze.c
index 6e2ff0a54..fb0b3c4bd 100644
--- a/util-linux/fsfreeze.c
+++ b/util-linux/fsfreeze.c
@@ -7,6 +7,7 @@
 //config:config FSFREEZE
 //config:	bool "fsfreeze (3.5 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	select LONG_OPTS
 //config:	help
 //config:	Halt new accesses and flush writes on a mounted filesystem.
diff --git a/util-linux/fstrim.c b/util-linux/fstrim.c
index 6d673002f..12bab40d1 100644
--- a/util-linux/fstrim.c
+++ b/util-linux/fstrim.c
@@ -10,6 +10,7 @@
 //config:config FSTRIM
 //config:	bool "fstrim (4.4 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Discard unused blocks on a mounted filesystem.
 
diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c
index 723b09589..2edadfa4d 100644
--- a/util-linux/hwclock.c
+++ b/util-linux/hwclock.c
@@ -9,6 +9,7 @@
 //config:config HWCLOCK
 //config:	bool "hwclock (5.8 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	The hwclock utility is used to read and set the hardware clock
 //config:	on a system. This is primarily used to set the current time on
diff --git a/util-linux/ionice.c b/util-linux/ionice.c
index 82bd309d1..b30d5f78d 100644
--- a/util-linux/ionice.c
+++ b/util-linux/ionice.c
@@ -9,6 +9,7 @@
 //config:config IONICE
 //config:	bool "ionice (3.8 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Set/set program io scheduling class and priority
 //config:	Requires kernel >= 2.6.13
diff --git a/util-linux/losetup.c b/util-linux/losetup.c
index 24f7a2349..ec0cf04e4 100644
--- a/util-linux/losetup.c
+++ b/util-linux/losetup.c
@@ -9,6 +9,7 @@
 //config:config LOSETUP
 //config:	bool "losetup (5.5 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	losetup is used to associate or detach a loop device with a regular
 //config:	file or block device, and to query the status of a loop device. This
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index ebdc0c254..f6de7ad2a 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -10,6 +10,7 @@
 //config:config MDEV
 //config:	bool "mdev (17 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	mdev is a mini-udev implementation for dynamically creating device
 //config:	nodes in the /dev directory.
diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c
index fcf374b2d..892b0867a 100644
--- a/util-linux/mkfs_ext2.c
+++ b/util-linux/mkfs_ext2.c
@@ -10,6 +10,7 @@
 //config:config MKE2FS
 //config:	bool "mke2fs (10 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Utility to create EXT2 filesystems.
 //config:
diff --git a/util-linux/mkfs_vfat.c b/util-linux/mkfs_vfat.c
index 821371953..5136446eb 100644
--- a/util-linux/mkfs_vfat.c
+++ b/util-linux/mkfs_vfat.c
@@ -10,6 +10,7 @@
 //config:config MKDOSFS
 //config:	bool "mkdosfs (7.2 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Utility to create FAT32 filesystems.
 //config:
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 4e65b6b46..e3aeda666 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -20,6 +20,7 @@
 //config:config MOUNT
 //config:	bool "mount (23 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	All files and filesystems in Unix are arranged into one big directory
 //config:	tree. The 'mount' utility is used to graft a filesystem onto a
diff --git a/util-linux/nsenter.c b/util-linux/nsenter.c
index 1aa045b35..8652e803a 100644
--- a/util-linux/nsenter.c
+++ b/util-linux/nsenter.c
@@ -9,6 +9,7 @@
 //config:config NSENTER
 //config:	bool "nsenter (6.5 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Run program with namespaces of other processes.
 
diff --git a/util-linux/pivot_root.c b/util-linux/pivot_root.c
index ecc891100..41f29da32 100644
--- a/util-linux/pivot_root.c
+++ b/util-linux/pivot_root.c
@@ -11,6 +11,7 @@
 //config:config PIVOT_ROOT
 //config:	bool "pivot_root (1.1 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	The pivot_root utility swaps the mount points for the root filesystem
 //config:	with some other mounted filesystem. This allows you to do all sorts
diff --git a/util-linux/setarch.c b/util-linux/setarch.c
index cf8ef0064..57051a683 100644
--- a/util-linux/setarch.c
+++ b/util-linux/setarch.c
@@ -9,6 +9,7 @@
 //config:config SETARCH
 //config:	bool "setarch (3.6 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	The linux32 utility is used to create a 32bit environment for the
 //config:	specified program (usually a shell). It only makes sense to have
@@ -18,12 +19,14 @@
 //config:config LINUX32
 //config:	bool "linux32 (3.3 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Alias to "setarch linux32".
 //config:
 //config:config LINUX64
 //config:	bool "linux64 (3.3 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Alias to "setarch linux64".
 
diff --git a/util-linux/setpriv.c b/util-linux/setpriv.c
index 6904cf019..bfe2c7a7a 100644
--- a/util-linux/setpriv.c
+++ b/util-linux/setpriv.c
@@ -9,6 +9,7 @@
 //config:config SETPRIV
 //config:	bool "setpriv (6.6 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	select LONG_OPTS
 //config:	help
 //config:	Run a program with different Linux privilege settings.
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index e2ff4b5cc..567869cc7 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -9,6 +9,7 @@
 //config:config SWAPON
 //config:	bool "swapon (15 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	Once you have created some swap space using 'mkswap', you also need
 //config:	to enable your swap space with the 'swapon' utility. The 'swapoff'
@@ -35,6 +36,7 @@
 //config:config SWAPOFF
 //config:	bool "swapoff (14 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:
 //config:config FEATURE_SWAPONOFF_LABEL
 //config:	bool "Support specifying devices by label or UUID"
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c
index 901c0b8db..f61002236 100644
--- a/util-linux/switch_root.c
+++ b/util-linux/switch_root.c
@@ -9,6 +9,7 @@
 //config:config SWITCH_ROOT
 //config:	bool "switch_root (5.5 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	The switch_root utility is used from initramfs to select a new
 //config:	root device. Under initramfs, you have to use this instead of
diff --git a/util-linux/uevent.c b/util-linux/uevent.c
index db11746d0..bd39c3acd 100644
--- a/util-linux/uevent.c
+++ b/util-linux/uevent.c
@@ -6,6 +6,7 @@
 //config:config UEVENT
 //config:	bool "uevent (3.1 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	help
 //config:	uevent is a netlink listener for kernel uevent notifications
 //config:	sent via netlink. It is usually used for dynamic device creation.
diff --git a/util-linux/unshare.c b/util-linux/unshare.c
index 06b938074..156a96d94 100644
--- a/util-linux/unshare.c
+++ b/util-linux/unshare.c
@@ -9,6 +9,7 @@
 //config:config UNSHARE
 //config:	bool "unshare (7.2 kb)"
 //config:	default y
+//config:	select PLATFORM_LINUX
 //config:	depends on !NOMMU
 //config:	select LONG_OPTS
 //config:	help


More information about the busybox-cvs mailing list