2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2002-04-26 13:45:55 +02:00
|
|
|
#
|
|
|
|
# busybox
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2002-10-23 09:56:48 +02:00
|
|
|
|
2007-09-30 14:48:25 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX_SNAPSHOT),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
BUSYBOX_VERSION = snapshot
|
|
|
|
BUSYBOX_SITE = http://www.busybox.net/downloads/snapshots
|
2007-02-06 17:34:54 +01:00
|
|
|
else
|
2010-07-08 19:20:06 +02:00
|
|
|
BUSYBOX_VERSION = $(call qstrip,$(BR2_BUSYBOX_VERSION))
|
|
|
|
BUSYBOX_SITE = http://www.busybox.net/downloads
|
2002-10-23 09:56:48 +02:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
BUSYBOX_SOURCE = busybox-$(BUSYBOX_VERSION).tar.bz2
|
2012-08-11 22:10:12 +02:00
|
|
|
BUSYBOX_LICENSE = GPLv2
|
|
|
|
BUSYBOX_LICENSE_FILES = LICENSE
|
|
|
|
|
2012-11-04 08:34:11 +01:00
|
|
|
BUSYBOX_CFLAGS = \
|
2013-06-30 21:28:52 +02:00
|
|
|
$(TARGET_CFLAGS)
|
2012-11-04 08:34:11 +01:00
|
|
|
|
|
|
|
BUSYBOX_LDFLAGS = \
|
|
|
|
$(TARGET_LDFLAGS)
|
|
|
|
|
|
|
|
# Link against libtirpc if available so that we can leverage its RPC
|
|
|
|
# support for NFS mounting with Busybox
|
|
|
|
ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
|
|
|
|
BUSYBOX_DEPENDENCIES += libtirpc
|
|
|
|
BUSYBOX_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc/
|
2012-11-20 23:15:36 +01:00
|
|
|
# Don't use LDFLAGS for -ltirpc, because LDFLAGS is used for
|
|
|
|
# the non-final link of modules as well.
|
|
|
|
BUSYBOX_CFLAGS_busybox += -ltirpc
|
2012-11-04 08:34:11 +01:00
|
|
|
endif
|
|
|
|
|
2010-07-08 19:20:06 +02:00
|
|
|
BUSYBOX_BUILD_CONFIG = $(BUSYBOX_DIR)/.config
|
2010-07-22 15:50:08 +02:00
|
|
|
# Allows the build system to tweak CFLAGS
|
2012-11-20 23:15:36 +01:00
|
|
|
BUSYBOX_MAKE_ENV = \
|
|
|
|
$(TARGET_MAKE_ENV) \
|
|
|
|
CFLAGS="$(BUSYBOX_CFLAGS)" \
|
|
|
|
CFLAGS_busybox="$(BUSYBOX_CFLAGS_busybox)"
|
2011-01-10 15:28:39 +01:00
|
|
|
BUSYBOX_MAKE_OPTS = \
|
|
|
|
CC="$(TARGET_CC)" \
|
|
|
|
ARCH=$(KERNEL_ARCH) \
|
|
|
|
PREFIX="$(TARGET_DIR)" \
|
2012-11-04 08:34:11 +01:00
|
|
|
EXTRA_LDFLAGS="$(BUSYBOX_LDFLAGS)" \
|
2011-01-10 15:28:39 +01:00
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
2011-01-10 15:28:40 +01:00
|
|
|
CONFIG_PREFIX="$(TARGET_DIR)" \
|
|
|
|
SKIP_STRIP=y
|
2005-04-12 22:32:45 +02:00
|
|
|
|
2007-01-19 15:17:34 +01:00
|
|
|
ifndef BUSYBOX_CONFIG_FILE
|
2010-07-08 19:20:06 +02:00
|
|
|
BUSYBOX_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG))
|
2007-01-19 15:17:34 +01:00
|
|
|
endif
|
2002-04-26 13:45:55 +02:00
|
|
|
|
2012-01-11 18:53:39 +01:00
|
|
|
define BUSYBOX_PERMISSIONS
|
|
|
|
/bin/busybox f 4755 0 0 - - - - -
|
|
|
|
/usr/share/udhcpc/default.script f 755 0 0 - - - - -
|
|
|
|
endef
|
|
|
|
|
2010-09-30 14:57:53 +02:00
|
|
|
# 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)
|
|
|
|
define BUSYBOX_INSTALL_MDEV_SCRIPT
|
2011-10-26 23:09:39 +02:00
|
|
|
[ -f $(TARGET_DIR)/etc/init.d/S10mdev ] || \
|
2011-10-18 13:14:42 +02:00
|
|
|
install -D -m 0755 package/busybox/S10mdev \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S10mdev
|
2010-09-30 14:57:53 +02:00
|
|
|
endef
|
2011-07-11 12:25:51 +02:00
|
|
|
define BUSYBOX_INSTALL_MDEV_CONF
|
|
|
|
[ -f $(TARGET_DIR)/etc/mdev.conf ] || \
|
|
|
|
install -D -m 0644 package/busybox/mdev.conf \
|
|
|
|
$(TARGET_DIR)/etc/mdev.conf
|
|
|
|
endef
|
2010-09-30 14:57:53 +02:00
|
|
|
define BUSYBOX_SET_MDEV
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_MDEV,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_MDEV_CONF,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_MDEV_EXEC,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_MDEV_LOAD_FIRMWARE,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2014-02-11 14:59:16 +01:00
|
|
|
# sha passwords need USE_BB_CRYPT_SHA
|
|
|
|
ifeq ($(BR2_TARGET_GENERIC_PASSWD_SHA256)$(BR2_TARGET_GENERIC_PASSWD_SHA512),y)
|
|
|
|
define BUSYBOX_SET_CRYPT_SHA
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_USE_BB_CRYPT_SHA,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2013-08-09 21:23:39 +02:00
|
|
|
ifeq ($(BR2_USE_MMU),y)
|
|
|
|
define BUSYBOX_SET_MMU
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_NOMMU,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
|
|
|
else
|
|
|
|
define BUSYBOX_SET_MMU
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_NOMMU,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_SWAPONOFF,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_ASH,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2004-10-09 03:06:03 +02:00
|
|
|
ifeq ($(BR2_LARGEFILE),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_SET_LARGEFILE
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_LFS,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FDISK_SUPPORT_LARGE_DISKS,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2003-11-17 02:31:38 +01:00
|
|
|
else
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_SET_LARGEFILE
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_LFS,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_FDISK_SUPPORT_LARGE_DISKS,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2007-02-16 15:32:22 +01:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
|
|
|
|
# If IPv6 is enabled then enable basic ifupdown support for it
|
2007-06-27 23:07:09 +02:00
|
|
|
ifeq ($(BR2_INET_IPV6),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_SET_IPV6
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_IPV6,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_IFUPDOWN_IPV6,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2007-06-27 23:07:09 +02:00
|
|
|
else
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_SET_IPV6
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_FEATURE_IPV6,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_FEATURE_IFUPDOWN_IPV6,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2007-06-27 23:07:09 +02:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
|
|
|
|
# If we're using static libs do the same for busybox
|
2010-04-05 13:29:01 +02:00
|
|
|
ifeq ($(BR2_PREFER_STATIC_LIB),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_PREFER_STATIC
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_STATIC,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2010-04-05 13:29:01 +02:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
|
|
|
|
# Disable usage of inetd if netkit-base package is selected
|
2007-05-07 06:04:34 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_NETKITBASE),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_NETKITBASE
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_INETD,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2007-05-07 06:04:34 +02:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
|
|
|
|
# Disable usage of telnetd if netkit-telnetd package is selected
|
2007-05-07 06:04:34 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_NETKITTELNET),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_NETKITTELNET
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_TELNETD,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2003-01-10 07:00:39 +01:00
|
|
|
endif
|
2002-10-23 09:56:48 +02:00
|
|
|
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_COPY_CONFIG
|
2014-01-28 21:11:22 +01:00
|
|
|
$(INSTALL) -D -m 0644 $(BUSYBOX_CONFIG_FILE) $(BUSYBOX_BUILD_CONFIG)
|
2010-07-08 19:20:06 +02:00
|
|
|
endef
|
|
|
|
|
2011-05-30 23:56:58 +02:00
|
|
|
# Disable shadow passwords support if unsupported by the C library
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS),)
|
|
|
|
define BUSYBOX_INTERNAL_SHADOW_PASSWORDS
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_USE_BB_PWD_GRP,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_USE_BB_SHADOW,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2012-07-28 09:21:20 +02:00
|
|
|
ifeq ($(BR2_INIT_BUSYBOX),y)
|
|
|
|
define BUSYBOX_SET_INIT
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_INIT,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2011-06-29 15:46:20 +02:00
|
|
|
define BUSYBOX_INSTALL_LOGGING_SCRIPT
|
2011-07-04 21:03:37 +02:00
|
|
|
if grep -q CONFIG_SYSLOGD=y $(@D)/.config; then \
|
2011-10-18 13:14:42 +02:00
|
|
|
[ -f $(TARGET_DIR)/etc/init.d/S01logging ] || \
|
|
|
|
$(INSTALL) -m 0755 -D package/busybox/S01logging \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S01logging; \
|
2011-07-04 21:03:37 +02:00
|
|
|
else rm -f $(TARGET_DIR)/etc/init.d/S01logging; fi
|
2011-06-29 15:46:20 +02:00
|
|
|
endef
|
|
|
|
|
2012-05-04 04:02:13 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX_WATCHDOG),y)
|
|
|
|
define BUSYBOX_SET_WATCHDOG
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_WATCHDOG,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
|
|
|
define BUSYBOX_INSTALL_WATCHDOG_SCRIPT
|
|
|
|
[ -f $(TARGET_DIR)/etc/init.d/S15watchdog ] || \
|
|
|
|
install -D -m 0755 package/busybox/S15watchdog \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S15watchdog && \
|
2013-02-18 01:38:31 +01:00
|
|
|
sed -i s/PERIOD/$(call qstrip,$(BR2_PACKAGE_BUSYBOX_WATCHDOG_PERIOD))/ \
|
2012-05-04 04:02:13 +02:00
|
|
|
$(TARGET_DIR)/etc/init.d/S15watchdog
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_CONFIGURE_CMDS
|
2014-02-13 12:34:44 +01:00
|
|
|
$(BUSYBOX_COPY_CONFIG)
|
2013-08-09 21:23:39 +02:00
|
|
|
$(BUSYBOX_SET_MMU)
|
2010-07-08 19:20:06 +02:00
|
|
|
$(BUSYBOX_SET_LARGEFILE)
|
|
|
|
$(BUSYBOX_SET_IPV6)
|
|
|
|
$(BUSYBOX_PREFER_STATIC)
|
2010-09-30 14:57:53 +02:00
|
|
|
$(BUSYBOX_SET_MDEV)
|
2014-02-11 14:59:16 +01:00
|
|
|
$(BUSYBOX_SET_CRYPT_SHA)
|
2010-07-08 19:20:06 +02:00
|
|
|
$(BUSYBOX_NETKITBASE)
|
|
|
|
$(BUSYBOX_NETKITTELNET)
|
2011-05-30 23:56:58 +02:00
|
|
|
$(BUSYBOX_INTERNAL_SHADOW_PASSWORDS)
|
2012-07-28 09:21:20 +02:00
|
|
|
$(BUSYBOX_SET_INIT)
|
2012-05-04 04:02:13 +02:00
|
|
|
$(BUSYBOX_SET_WATCHDOG)
|
2010-07-08 19:20:06 +02:00
|
|
|
@yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \
|
|
|
|
-C $(@D) oldconfig
|
|
|
|
endef
|
|
|
|
|
|
|
|
define BUSYBOX_BUILD_CMDS
|
2011-01-10 15:28:39 +01:00
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(@D)
|
2010-07-08 19:20:06 +02:00
|
|
|
endef
|
2006-12-13 10:14:10 +01:00
|
|
|
|
2010-12-21 20:25:29 +01:00
|
|
|
define BUSYBOX_INSTALL_TARGET_CMDS
|
2011-01-10 15:28:39 +01:00
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(@D) install
|
2010-12-09 10:55:05 +01:00
|
|
|
if [ ! -f $(TARGET_DIR)/usr/share/udhcpc/default.script ]; then \
|
|
|
|
$(INSTALL) -m 0755 -D package/busybox/udhcpc.script \
|
|
|
|
$(TARGET_DIR)/usr/share/udhcpc/default.script; \
|
|
|
|
fi
|
2010-09-30 14:57:53 +02:00
|
|
|
$(BUSYBOX_INSTALL_MDEV_SCRIPT)
|
2011-07-11 12:25:51 +02:00
|
|
|
$(BUSYBOX_INSTALL_MDEV_CONF)
|
2011-06-29 15:46:20 +02:00
|
|
|
$(BUSYBOX_INSTALL_LOGGING_SCRIPT)
|
2012-05-04 04:02:13 +02:00
|
|
|
$(BUSYBOX_INSTALL_WATCHDOG_SCRIPT)
|
2010-07-08 19:20:06 +02:00
|
|
|
endef
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(generic-package))
|
2010-07-08 19:20:06 +02:00
|
|
|
|
2011-05-16 17:25:44 +02:00
|
|
|
busybox-menuconfig busybox-xconfig busybox-gconfig: busybox-patch
|
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(BUSYBOX_DIR) \
|
|
|
|
$(subst busybox-,,$@)
|
2010-07-08 19:20:06 +02:00
|
|
|
rm -f $(BUSYBOX_DIR)/.stamp_built
|
|
|
|
rm -f $(BUSYBOX_DIR)/.stamp_target_installed
|
2007-09-27 00:12:51 +02:00
|
|
|
|
2013-02-05 08:16:01 +01:00
|
|
|
busybox-update-config: busybox-configure
|
2010-07-08 19:20:06 +02:00
|
|
|
cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_FILE)
|