@@ -54,6 +54,15 @@ config BR2_PACKAGE_BUSYBOX_SELINUX
crond, then individual binaries have to be enabled for the
SELinux type transitions to occur properly.
+config BR2_PACKAGE_BUSYBOX_INDIVIDUAL_BINARIES
+ bool "Individual binaries"
+ depends on !BR2_STATIC_LIBS
+ depends on !BR2_bfin # libbusybox.so link issue
+
+comment "Busybox individual binaries depends on dynamic libraries"
+ depends on BR2_STATIC_LIBS
+ depends on !BR2_bfin
+
config BR2_PACKAGE_BUSYBOX_WATCHDOG
bool "Install the watchdog daemon startup script"
help
@@ -54,9 +54,36 @@ BUSYBOX_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG_FRAG
BUSYBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig
BUSYBOX_KCONFIG_OPTS = $(BUSYBOX_MAKE_OPTS)
+ifeq ($(BR2_PACKAGE_BUSYBOX_INDIVIDUAL_BINARIES),y)
+define BUSYBOX_PERMISSIONS
+ /usr/share/udhcpc/default.script f 755 0 0 - - - - -
+# Set permissions on all applets with BB_SUID_REQUIRE and BB_SUID_MAYBE.
+# 12 Applets are pulled from applets.h using grep command :
+# grep -r -e "APPLET.*BB_SUID_REQUIRE\|APPLET.*BB_SUID_MAYBE" \
+# $(@D)/include/applets.h
+# o/p:
+# wall,ping,ping6,crontab,findfs,login,mount,passwd,su,traceroute
+# traceroute6 and vlock.
+# These applets are added to the device table and the makedev file
+# ignores the files with type 'F' ( optional files).
+ /usr/bin/wall F 4755 0 0 - - - - -
+ /bin/ping f 4755 0 0 - - - - -
+ /bin/ping6 F 4755 0 0 - - - - -
+ /usr/bin/crontab f 4755 0 0 - - - - -
+ /sbin/findfs F 4755 0 0 - - - - -
+ /bin/login F 4755 0 0 - - - - -
+ /bin/mount f 4755 0 0 - - - - -
+ /usr/bin/passwd F 4755 0 0 - - - - -
+ /bin/su F 4755 0 0 - - - - -
+ /usr/bin/traceroute f 4755 0 0 - - - - -
+ /usr/bin/traceroute6 F 4755 0 0 - - - - -
+ /usr/bin/vlock F 4755 0 0 - - - - -
+endef
+else
define BUSYBOX_PERMISSIONS
/bin/busybox f 4755 0 0 - - - - -
endef
+endif
# If mdev will be used for device creation enable it and copy S10mdev to /etc/init.d
ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV),y)
@@ -164,6 +191,17 @@ define BUSYBOX_SET_SELINUX
endef
endif
+ifeq ($(BR2_PACKAGE_BUSYBOX_INDIVIDUAL_BINARIES),y)
+define BUSYBOX_CONFIGURE_INDIVIDUAL_BINARIES
+ $(call KCONFIG_ENABLE_OPT,CONFIG_BUILD_LIBBUSYBOX,$(BUSYBOX_BUILD_CONFIG))
+ $(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_INDIVIDUAL,$(BUSYBOX_BUILD_CONFIG))
+endef
+
+define BUSYBOX_INSTALL_INDIVIDUAL_BINARIES
+ rm -f $(TARGET_DIR)/bin/busybox
+endef
+endif
+
define BUSYBOX_INSTALL_LOGGING_SCRIPT
if grep -q CONFIG_SYSLOGD=y $(@D)/.config; then \
$(INSTALL) -m 0755 -D package/busybox/S01logging \
@@ -221,6 +259,7 @@ define BUSYBOX_KCONFIG_FIXUP_CMDS
$(BUSYBOX_SET_INIT)
$(BUSYBOX_SET_WATCHDOG)
$(BUSYBOX_SET_SELINUX)
+ $(BUSYBOX_CONFIGURE_INDIVIDUAL_BINARIES)
$(BUSYBOX_MUSL_TWEAKS)
endef
@@ -244,6 +283,7 @@ define BUSYBOX_INSTALL_INIT_SYSV
$(BUSYBOX_INSTALL_LOGGING_SCRIPT)
$(BUSYBOX_INSTALL_WATCHDOG_SCRIPT)
$(BUSYBOX_INSTALL_TELNET_SCRIPT)
+ $(BUSYBOX_INSTALL_INDIVIDUAL_BINARIES)
endef
# Checks to give errors that the user can understand
@@ -587,6 +587,8 @@ int main(int argc, char **argv)
ret = EXIT_FAILURE;
goto loop;
}
+ } else if (type == 'F') {
+ continue; /*Ignore optional files*/
} else if (type == 'r') {
recursive_uid = uid;
recursive_gid = gid;