2013-06-06 07:53:30 +08:00
|
|
|
################################################################################
|
2002-04-26 19:45:55 +08:00
|
|
|
#
|
|
|
|
# busybox
|
|
|
|
#
|
2013-06-06 07:53:30 +08:00
|
|
|
################################################################################
|
2002-10-23 15:56:48 +08:00
|
|
|
|
2015-03-25 23:18:01 +08:00
|
|
|
BUSYBOX_VERSION = 1.23.2
|
2010-07-09 01:20:06 +08:00
|
|
|
BUSYBOX_SITE = http://www.busybox.net/downloads
|
|
|
|
BUSYBOX_SOURCE = busybox-$(BUSYBOX_VERSION).tar.bz2
|
2012-08-12 04:10:12 +08:00
|
|
|
BUSYBOX_LICENSE = GPLv2
|
|
|
|
BUSYBOX_LICENSE_FILES = LICENSE
|
|
|
|
|
2012-11-04 15:34:11 +08:00
|
|
|
BUSYBOX_CFLAGS = \
|
2013-07-01 03:28:52 +08:00
|
|
|
$(TARGET_CFLAGS)
|
2012-11-04 15:34:11 +08:00
|
|
|
|
|
|
|
BUSYBOX_LDFLAGS = \
|
|
|
|
$(TARGET_LDFLAGS)
|
|
|
|
|
|
|
|
# Link against libtirpc if available so that we can leverage its RPC
|
2014-05-31 15:55:35 +08:00
|
|
|
# support for NFS mounting with BusyBox
|
2012-11-04 15:34:11 +08:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
|
|
|
|
BUSYBOX_DEPENDENCIES += libtirpc
|
|
|
|
BUSYBOX_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc/
|
2012-11-21 06:15:36 +08: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 15:34:11 +08:00
|
|
|
endif
|
|
|
|
|
2010-07-09 01:20:06 +08:00
|
|
|
BUSYBOX_BUILD_CONFIG = $(BUSYBOX_DIR)/.config
|
2010-07-22 21:50:08 +08:00
|
|
|
# Allows the build system to tweak CFLAGS
|
2012-11-21 06:15:36 +08:00
|
|
|
BUSYBOX_MAKE_ENV = \
|
|
|
|
$(TARGET_MAKE_ENV) \
|
|
|
|
CFLAGS="$(BUSYBOX_CFLAGS)" \
|
|
|
|
CFLAGS_busybox="$(BUSYBOX_CFLAGS_busybox)"
|
2011-01-10 22:28:39 +08:00
|
|
|
BUSYBOX_MAKE_OPTS = \
|
|
|
|
CC="$(TARGET_CC)" \
|
|
|
|
ARCH=$(KERNEL_ARCH) \
|
|
|
|
PREFIX="$(TARGET_DIR)" \
|
2012-11-04 15:34:11 +08:00
|
|
|
EXTRA_LDFLAGS="$(BUSYBOX_LDFLAGS)" \
|
2011-01-10 22:28:39 +08:00
|
|
|
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
|
|
|
|
2014-08-03 23:32:43 +08:00
|
|
|
BUSYBOX_KCONFIG_FILE = $(BUSYBOX_CONFIG_FILE)
|
|
|
|
BUSYBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig
|
2014-09-28 03:32:47 +08:00
|
|
|
BUSYBOX_KCONFIG_OPTS = $(BUSYBOX_MAKE_OPTS)
|
2014-08-03 23:32:43 +08:00
|
|
|
|
2012-01-12 01:53:39 +08:00
|
|
|
define BUSYBOX_PERMISSIONS
|
2014-11-16 00:29:16 +08:00
|
|
|
/bin/busybox f 4755 0 0 - - - - -
|
|
|
|
/usr/share/udhcpc/default.script f 755 0 0 - - - - -
|
2012-01-12 01:53:39 +08:00
|
|
|
endef
|
|
|
|
|
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
|
2014-11-30 22:18:41 +08:00
|
|
|
$(INSTALL) -D -m 0755 package/busybox/S10mdev \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S10mdev
|
2010-09-30 20:57:53 +08:00
|
|
|
endef
|
2011-07-11 18:25:51 +08:00
|
|
|
define BUSYBOX_INSTALL_MDEV_CONF
|
2014-11-30 22:18:41 +08:00
|
|
|
$(INSTALL) -D -m 0644 package/busybox/mdev.conf \
|
|
|
|
$(TARGET_DIR)/etc/mdev.conf
|
2011-07-11 18:25:51 +08:00
|
|
|
endef
|
2010-09-30 20:57:53 +08: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 21:59:16 +08: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-10 03:23:39 +08: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
|
|
|
|
|
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
|
|
|
|
|
|
|
|
# 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 we're using static libs do the same for busybox
|
2014-12-04 05:41:29 +08:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),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
|
|
|
endif
|
2010-07-09 01:20:06 +08:00
|
|
|
|
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
|
|
|
|
|
2014-05-06 05:17:07 +08:00
|
|
|
# We also need to use internal functions when using the musl C
|
|
|
|
# library, since some of them are not yet implemented by musl.
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
|
|
|
|
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 15:21:20 +08:00
|
|
|
ifeq ($(BR2_INIT_BUSYBOX),y)
|
|
|
|
define BUSYBOX_SET_INIT
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_INIT,$(BUSYBOX_BUILD_CONFIG))
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2011-06-29 21:46:20 +08:00
|
|
|
define BUSYBOX_INSTALL_LOGGING_SCRIPT
|
2011-07-05 03:03:37 +08:00
|
|
|
if grep -q CONFIG_SYSLOGD=y $(@D)/.config; then \
|
2014-11-30 22:18:41 +08:00
|
|
|
$(INSTALL) -m 0755 -D package/busybox/S01logging \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S01logging; \
|
2011-07-05 03:03:37 +08:00
|
|
|
else rm -f $(TARGET_DIR)/etc/init.d/S01logging; fi
|
2011-06-29 21:46:20 +08:00
|
|
|
endef
|
|
|
|
|
2012-05-04 10:02:13 +08:00
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX_WATCHDOG),y)
|
|
|
|
define BUSYBOX_SET_WATCHDOG
|
2014-10-26 02:29:31 +08:00
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_WATCHDOG,$(BUSYBOX_BUILD_CONFIG))
|
2012-05-04 10:02:13 +08:00
|
|
|
endef
|
|
|
|
define BUSYBOX_INSTALL_WATCHDOG_SCRIPT
|
2014-11-30 22:18:41 +08:00
|
|
|
$(INSTALL) -D -m 0755 package/busybox/S15watchdog \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S15watchdog
|
|
|
|
$(SED) s/PERIOD/$(call qstrip,$(BR2_PACKAGE_BUSYBOX_WATCHDOG_PERIOD))/ \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S15watchdog
|
2012-05-04 10:02:13 +08:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2014-07-13 03:21:16 +08:00
|
|
|
# Enable "noclobber" in install.sh, to prevent BusyBox from overwriting any
|
busybox: enable noclobber option in install.sh
We support a busybox-menuconfig target so that the BusyBox
configuration can be adjusted as needed. However, depending
on what other packages are enabled, re-installing BusyBox
symlinks that duplicate "real" apps after the configuration
change can result in bad behaviors:
* At best, the BusyBox applet will be used after the
install, versus the desired "real" app.
* At worst, the built rootfs can become unbootable.
The BusyBox install.sh has some capability to avoid this issue
by means of a --noclobber option. By default, this option is
disabled. When enabled, the install.sh will not overwrite a
target file with a symlink or hardlink, be it an actual file
or a previously installed BusyBox link.
The install.sh's argument processing is somewhat broken, so this
patch simply changes the default value of the noclobber option
to on, rather than add --noclobber to the install.sh invocation.
Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-06-04 09:53:24 +08:00
|
|
|
# full-blown versions of apps installed by other packages with sym/hard links.
|
|
|
|
define BUSYBOX_NOCLOBBER_INSTALL
|
|
|
|
$(SED) 's/^noclobber="0"$$/noclobber="1"/' $(@D)/applets/install.sh
|
|
|
|
endef
|
|
|
|
|
2014-08-03 23:32:43 +08:00
|
|
|
define BUSYBOX_KCONFIG_FIXUP_CMDS
|
2013-08-10 03:23:39 +08:00
|
|
|
$(BUSYBOX_SET_MMU)
|
2010-07-09 01:20:06 +08:00
|
|
|
$(BUSYBOX_SET_LARGEFILE)
|
|
|
|
$(BUSYBOX_SET_IPV6)
|
|
|
|
$(BUSYBOX_PREFER_STATIC)
|
2010-09-30 20:57:53 +08:00
|
|
|
$(BUSYBOX_SET_MDEV)
|
2014-02-11 21:59:16 +08:00
|
|
|
$(BUSYBOX_SET_CRYPT_SHA)
|
2011-05-31 05:56:58 +08:00
|
|
|
$(BUSYBOX_INTERNAL_SHADOW_PASSWORDS)
|
2012-07-28 15:21:20 +08:00
|
|
|
$(BUSYBOX_SET_INIT)
|
2012-05-04 10:02:13 +08:00
|
|
|
$(BUSYBOX_SET_WATCHDOG)
|
2014-08-03 23:32:43 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define BUSYBOX_CONFIGURE_CMDS
|
busybox: enable noclobber option in install.sh
We support a busybox-menuconfig target so that the BusyBox
configuration can be adjusted as needed. However, depending
on what other packages are enabled, re-installing BusyBox
symlinks that duplicate "real" apps after the configuration
change can result in bad behaviors:
* At best, the BusyBox applet will be used after the
install, versus the desired "real" app.
* At worst, the built rootfs can become unbootable.
The BusyBox install.sh has some capability to avoid this issue
by means of a --noclobber option. By default, this option is
disabled. When enabled, the install.sh will not overwrite a
target file with a symlink or hardlink, be it an actual file
or a previously installed BusyBox link.
The install.sh's argument processing is somewhat broken, so this
patch simply changes the default value of the noclobber option
to on, rather than add --noclobber to the install.sh invocation.
Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-06-04 09:53:24 +08:00
|
|
|
$(BUSYBOX_NOCLOBBER_INSTALL)
|
2010-07-09 01:20:06 +08:00
|
|
|
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
|
2014-11-30 22:18:41 +08:00
|
|
|
$(INSTALL) -m 0755 -D package/busybox/udhcpc.script \
|
|
|
|
$(TARGET_DIR)/usr/share/udhcpc/default.script
|
2014-06-17 13:21:47 +08:00
|
|
|
$(INSTALL) -m 0755 -d \
|
|
|
|
$(TARGET_DIR)/usr/share/udhcpc/default.script.d
|
2011-07-11 18:25:51 +08:00
|
|
|
$(BUSYBOX_INSTALL_MDEV_CONF)
|
2014-11-30 22:17:54 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define BUSYBOX_INSTALL_INIT_SYSV
|
|
|
|
$(BUSYBOX_INSTALL_MDEV_SCRIPT)
|
2011-06-29 21:46:20 +08:00
|
|
|
$(BUSYBOX_INSTALL_LOGGING_SCRIPT)
|
2012-05-04 10:02:13 +08:00
|
|
|
$(BUSYBOX_INSTALL_WATCHDOG_SCRIPT)
|
2010-07-09 01:20:06 +08:00
|
|
|
endef
|
|
|
|
|
2014-08-03 23:32:43 +08:00
|
|
|
$(eval $(kconfig-package))
|