2002-04-26 19:45:55 +08:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# busybox
|
|
|
|
#
|
|
|
|
#############################################################
|
2002-10-23 15:56:48 +08:00
|
|
|
|
2007-09-30 20:48:25 +08:00
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX_SNAPSHOT),y)
|
2010-07-09 01:20:06 +08:00
|
|
|
BUSYBOX_VERSION = snapshot
|
|
|
|
BUSYBOX_SITE = http://www.busybox.net/downloads/snapshots
|
2007-02-07 00:34:54 +08:00
|
|
|
else
|
2010-07-09 01:20:06 +08:00
|
|
|
BUSYBOX_VERSION = $(call qstrip,$(BR2_BUSYBOX_VERSION))
|
|
|
|
BUSYBOX_SITE = http://www.busybox.net/downloads
|
2002-10-23 15:56:48 +08:00
|
|
|
endif
|
2010-07-09 01:20:06 +08:00
|
|
|
BUSYBOX_SOURCE = busybox-$(BUSYBOX_VERSION).tar.bz2
|
|
|
|
BUSYBOX_BUILD_CONFIG = $(BUSYBOX_DIR)/.config
|
2010-07-22 21:50:08 +08:00
|
|
|
# Allows the build system to tweak CFLAGS
|
|
|
|
BUSYBOX_MAKE_ENV = $(TARGET_MAKE_ENV) CFLAGS="$(TARGET_CFLAGS) -I$(LINUX_HEADERS_DIR)/include"
|
2011-01-10 22:28:39 +08:00
|
|
|
BUSYBOX_MAKE_OPTS = \
|
|
|
|
CC="$(TARGET_CC)" \
|
|
|
|
ARCH=$(KERNEL_ARCH) \
|
|
|
|
PREFIX="$(TARGET_DIR)" \
|
|
|
|
EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
|
|
|
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
2011-01-10 22:28:40 +08:00
|
|
|
CONFIG_PREFIX="$(TARGET_DIR)" \
|
|
|
|
SKIP_STRIP=y
|
2005-04-13 04:32:45 +08:00
|
|
|
|
2007-01-19 22:17:34 +08:00
|
|
|
ifndef BUSYBOX_CONFIG_FILE
|
2010-07-09 01:20:06 +08:00
|
|
|
BUSYBOX_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG))
|
2007-01-19 22:17:34 +08:00
|
|
|
endif
|
2002-04-26 19:45:55 +08:00
|
|
|
|
2010-09-30 20:57:53 +08: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
|
|
|
|
install -m 0755 package/busybox/S10mdev $(TARGET_DIR)/etc/init.d
|
|
|
|
endef
|
|
|
|
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
|
|
|
|
|
2004-10-09 09:06:03 +08:00
|
|
|
ifeq ($(BR2_LARGEFILE),y)
|
2010-07-09 01:20:06 +08: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 09:31:38 +08:00
|
|
|
else
|
2010-07-09 01:20:06 +08: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 22:32:22 +08:00
|
|
|
endif
|
2010-07-09 01:20:06 +08:00
|
|
|
|
|
|
|
# If IPv6 is enabled then enable basic ifupdown support for it
|
2007-06-28 05:07:09 +08:00
|
|
|
ifeq ($(BR2_INET_IPV6),y)
|
2010-07-09 01:20:06 +08: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-28 05:07:09 +08:00
|
|
|
else
|
2010-07-09 01:20:06 +08: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-28 05:07:09 +08:00
|
|
|
endif
|
2010-07-09 01:20:06 +08:00
|
|
|
|
|
|
|
# If RPC is enabled then enable nfs mounts
|
2009-06-22 21:25:33 +08:00
|
|
|
ifeq ($(BR2_INET_RPC),y)
|
2010-07-09 01:20:06 +08:00
|
|
|
define BUSYBOX_SET_RPC
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_MOUNT_NFS,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2009-06-22 21:25:33 +08:00
|
|
|
else
|
2010-07-09 01:20:06 +08:00
|
|
|
define BUSYBOX_SET_RPC
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_FEATURE_MOUNT_NFS,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2009-06-22 21:25:33 +08:00
|
|
|
endif
|
2010-07-09 01:20:06 +08:00
|
|
|
|
|
|
|
# If we're using static libs do the same for busybox
|
2010-04-05 19:29:01 +08:00
|
|
|
ifeq ($(BR2_PREFER_STATIC_LIB),y)
|
2010-07-09 01:20:06 +08:00
|
|
|
define BUSYBOX_PREFER_STATIC
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_STATIC,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2010-04-05 19:29:01 +08:00
|
|
|
else
|
2010-07-09 01:20:06 +08:00
|
|
|
define BUSYBOX_PREFER_STATIC
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_STATIC,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2010-04-05 19:29:01 +08:00
|
|
|
endif
|
2010-07-09 01:20:06 +08:00
|
|
|
|
|
|
|
# Disable usage of inetd if netkit-base package is selected
|
2007-05-07 12:04:34 +08:00
|
|
|
ifeq ($(BR2_PACKAGE_NETKITBASE),y)
|
2010-07-09 01:20:06 +08:00
|
|
|
define BUSYBOX_NETKITBASE
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_INETD,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2007-05-07 12:04:34 +08:00
|
|
|
endif
|
2010-07-09 01:20:06 +08:00
|
|
|
|
|
|
|
# Disable usage of telnetd if netkit-telnetd package is selected
|
2007-05-07 12:04:34 +08:00
|
|
|
ifeq ($(BR2_PACKAGE_NETKITTELNET),y)
|
2010-07-09 01:20:06 +08:00
|
|
|
define BUSYBOX_NETKITTELNET
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_TELNETD,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
2003-01-10 14:00:39 +08:00
|
|
|
endif
|
2002-10-23 15:56:48 +08:00
|
|
|
|
2010-07-09 01:20:06 +08:00
|
|
|
define BUSYBOX_COPY_CONFIG
|
|
|
|
cp -f $(BUSYBOX_CONFIG_FILE) $(BUSYBOX_BUILD_CONFIG)
|
|
|
|
endef
|
|
|
|
|
2011-05-31 05:56:58 +08: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
|
|
|
|
|
2011-05-31 05:56:59 +08:00
|
|
|
ifeq ($(BR2_USE_MMU),)
|
|
|
|
define BUSYBOX_DISABLE_MMU_APPLETS
|
|
|
|
$(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
|
|
|
|
|
2011-06-29 21:46:20 +08:00
|
|
|
define BUSYBOX_INSTALL_LOGGING_SCRIPT
|
|
|
|
$(INSTALL) -m 0755 -D package/busybox/S01logging \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S01logging
|
|
|
|
endef
|
|
|
|
|
2010-07-09 01:20:06 +08:00
|
|
|
# We do this here to avoid busting a modified .config in configure
|
|
|
|
BUSYBOX_POST_EXTRACT_HOOKS += BUSYBOX_COPY_CONFIG
|
|
|
|
|
|
|
|
define BUSYBOX_CONFIGURE_CMDS
|
|
|
|
$(BUSYBOX_SET_SYSKLOGD)
|
|
|
|
$(BUSYBOX_SET_BB_PWD)
|
|
|
|
$(BUSYBOX_SET_LARGEFILE)
|
|
|
|
$(BUSYBOX_SET_IPV6)
|
|
|
|
$(BUSYBOX_SET_RPC)
|
|
|
|
$(BUSYBOX_PREFER_STATIC)
|
2010-09-30 20:57:53 +08:00
|
|
|
$(BUSYBOX_SET_MDEV)
|
2010-07-09 01:20:06 +08:00
|
|
|
$(BUSYBOX_NETKITBASE)
|
|
|
|
$(BUSYBOX_NETKITTELNET)
|
2011-05-31 05:56:58 +08:00
|
|
|
$(BUSYBOX_INTERNAL_SHADOW_PASSWORDS)
|
2011-05-31 05:56:59 +08:00
|
|
|
$(BUSYBOX_DISABLE_MMU_APPLETS)
|
2010-07-09 01:20:06 +08:00
|
|
|
@yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \
|
|
|
|
-C $(@D) oldconfig
|
|
|
|
endef
|
|
|
|
|
|
|
|
define BUSYBOX_BUILD_CMDS
|
2011-01-10 22:28:39 +08:00
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(@D)
|
2010-07-09 01:20:06 +08:00
|
|
|
endef
|
2006-12-13 17:14:10 +08:00
|
|
|
|
2010-12-22 03:25:29 +08:00
|
|
|
define BUSYBOX_INSTALL_TARGET_CMDS
|
2011-01-10 22:28:39 +08:00
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(@D) install
|
2010-12-09 17:55:05 +08: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 20:57:53 +08:00
|
|
|
$(BUSYBOX_INSTALL_MDEV_SCRIPT)
|
2011-06-29 21:46:20 +08:00
|
|
|
$(BUSYBOX_INSTALL_LOGGING_SCRIPT)
|
2010-07-09 01:20:06 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define BUSYBOX_UNINSTALL_TARGET_CMDS
|
2011-01-10 22:28:39 +08:00
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(@D) uninstall
|
2010-07-09 01:20:06 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define BUSYBOX_CLEAN_CMDS
|
2011-01-10 22:28:39 +08:00
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(@D) clean
|
2010-07-09 01:20:06 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call GENTARGETS,package,busybox))
|
|
|
|
|
2011-03-29 03:33:26 +08:00
|
|
|
busybox-menuconfig: busybox-patch
|
2011-01-18 16:20:38 +08:00
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(BUSYBOX_DIR) menuconfig
|
2010-07-09 01:20:06 +08:00
|
|
|
rm -f $(BUSYBOX_DIR)/.stamp_built
|
|
|
|
rm -f $(BUSYBOX_DIR)/.stamp_target_installed
|
2007-09-27 06:12:51 +08:00
|
|
|
|
|
|
|
busybox-update:
|
2010-07-09 01:20:06 +08:00
|
|
|
cp -f $(BUSYBOX_BUILD_CONFIG) $(BUSYBOX_CONFIG_FILE)
|