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
|
|
|
|
2022-01-27 13:18:24 +01:00
|
|
|
BUSYBOX_VERSION = 1.35.0
|
2021-01-08 20:06:03 +01:00
|
|
|
BUSYBOX_SITE = https://www.busybox.net/downloads
|
2010-07-08 19:20:06 +02:00
|
|
|
BUSYBOX_SOURCE = busybox-$(BUSYBOX_VERSION).tar.bz2
|
2020-10-27 16:12:29 +01:00
|
|
|
BUSYBOX_LICENSE = GPL-2.0, bzip2-1.0.4
|
|
|
|
BUSYBOX_LICENSE_FILES = LICENSE archival/libarchive/bz/LICENSE
|
2021-01-14 23:34:30 +01:00
|
|
|
BUSYBOX_CPE_ID_VENDOR = busybox
|
2012-08-11 22:10:12 +02:00
|
|
|
|
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)
|
|
|
|
|
2018-07-08 11:45:27 +02:00
|
|
|
# Packages that provide commands that may also be busybox applets:
|
|
|
|
BUSYBOX_DEPENDENCIES = \
|
2018-07-08 11:46:14 +02:00
|
|
|
$(if $(BR2_PACKAGE_ATTR),attr) \
|
2018-07-08 11:46:13 +02:00
|
|
|
$(if $(BR2_PACKAGE_BASH),bash) \
|
2018-07-08 11:46:12 +02:00
|
|
|
$(if $(BR2_PACKAGE_BC),bc) \
|
2018-07-08 11:46:11 +02:00
|
|
|
$(if $(BR2_PACKAGE_BINUTILS),binutils) \
|
2018-07-08 11:46:10 +02:00
|
|
|
$(if $(BR2_PACKAGE_COREUTILS),coreutils) \
|
2018-07-08 11:46:09 +02:00
|
|
|
$(if $(BR2_PACKAGE_CPIO),cpio) \
|
2018-07-08 11:46:08 +02:00
|
|
|
$(if $(BR2_PACKAGE_DCRON),dcron) \
|
2018-07-08 11:46:07 +02:00
|
|
|
$(if $(BR2_PACKAGE_DEBIANUTILS),debianutils) \
|
2018-07-08 11:46:06 +02:00
|
|
|
$(if $(BR2_PACKAGE_DIFFUTILS),diffutils) \
|
2018-07-08 11:46:05 +02:00
|
|
|
$(if $(BR2_PACKAGE_DOS2UNIX),dos2unix) \
|
2019-06-03 06:29:49 +02:00
|
|
|
$(if $(BR2_PACKAGE_DOSFSTOOLS),dosfstools) \
|
2018-07-08 11:46:04 +02:00
|
|
|
$(if $(BR2_PACKAGE_E2FSPROGS),e2fsprogs) \
|
2018-07-08 11:46:03 +02:00
|
|
|
$(if $(BR2_PACKAGE_FBSET),fbset) \
|
2018-07-08 11:46:02 +02:00
|
|
|
$(if $(BR2_PACKAGE_GAWK),gawk) \
|
2018-07-08 11:46:01 +02:00
|
|
|
$(if $(BR2_PACKAGE_GREP),grep) \
|
2018-07-08 11:46:00 +02:00
|
|
|
$(if $(BR2_PACKAGE_GZIP),gzip) \
|
2018-07-08 11:45:59 +02:00
|
|
|
$(if $(BR2_PACKAGE_I2C_TOOLS),i2c-tools) \
|
2018-07-08 11:45:58 +02:00
|
|
|
$(if $(BR2_PACKAGE_IFENSLAVE),ifenslave) \
|
2018-07-08 11:45:57 +02:00
|
|
|
$(if $(BR2_PACKAGE_IFPLUGD),ifplugd) \
|
2018-07-08 11:45:56 +02:00
|
|
|
$(if $(BR2_PACKAGE_IFUPDOWN),ifupdown) \
|
2020-10-14 21:06:14 +02:00
|
|
|
$(if $(BR2_PACKAGE_IPCALC),ipcalc) \
|
2018-07-08 11:45:55 +02:00
|
|
|
$(if $(BR2_PACKAGE_IPROUTE2),iproute2) \
|
2018-07-08 11:45:54 +02:00
|
|
|
$(if $(BR2_PACKAGE_IPUTILS),iputils) \
|
2018-07-08 11:45:53 +02:00
|
|
|
$(if $(BR2_PACKAGE_KMOD),kmod) \
|
2018-07-08 11:45:52 +02:00
|
|
|
$(if $(BR2_PACKAGE_LESS),less) \
|
2018-07-08 11:45:51 +02:00
|
|
|
$(if $(BR2_PACKAGE_LSOF),lsof) \
|
2018-07-08 11:45:50 +02:00
|
|
|
$(if $(BR2_PACKAGE_MTD),mtd) \
|
2018-07-08 11:45:49 +02:00
|
|
|
$(if $(BR2_PACKAGE_NET_TOOLS),net-tools) \
|
2018-07-08 11:45:48 +02:00
|
|
|
$(if $(BR2_PACKAGE_NETCAT),netcat) \
|
2018-07-08 11:45:47 +02:00
|
|
|
$(if $(BR2_PACKAGE_NETCAT_OPENSBSD),netcat-openbsd) \
|
2018-07-08 11:45:46 +02:00
|
|
|
$(if $(BR2_PACKAGE_NMAP),nmap) \
|
2018-07-08 11:45:45 +02:00
|
|
|
$(if $(BR2_PACKAGE_NTP),ntp) \
|
2018-07-08 11:45:44 +02:00
|
|
|
$(if $(BR2_PACKAGE_PCIUTILS),pciutils) \
|
2018-07-08 11:45:43 +02:00
|
|
|
$(if $(BR2_PACKAGE_PROCPS_NG),procps-ng) \
|
2018-07-08 11:45:42 +02:00
|
|
|
$(if $(BR2_PACKAGE_PSMISC),psmisc) \
|
2018-07-08 11:45:40 +02:00
|
|
|
$(if $(BR2_PACKAGE_START_STOP_DAEMON),start-stop-daemon) \
|
2018-07-08 11:45:39 +02:00
|
|
|
$(if $(BR2_PACKAGE_SYSKLOGD),sysklogd) \
|
2018-07-08 11:45:37 +02:00
|
|
|
$(if $(BR2_PACKAGE_SYSTEMD),systemd) \
|
2018-07-08 11:45:36 +02:00
|
|
|
$(if $(BR2_PACKAGE_SYSVINIT),sysvinit) \
|
2018-07-08 11:45:35 +02:00
|
|
|
$(if $(BR2_PACKAGE_TAR),tar) \
|
2018-07-08 11:45:34 +02:00
|
|
|
$(if $(BR2_PACKAGE_TFTPD),tftpd) \
|
2018-07-08 11:45:33 +02:00
|
|
|
$(if $(BR2_PACKAGE_TRACEROUTE),traceroute) \
|
2018-07-08 11:45:32 +02:00
|
|
|
$(if $(BR2_PACKAGE_UNZIP),unzip) \
|
2018-07-08 11:45:31 +02:00
|
|
|
$(if $(BR2_PACKAGE_USBUTILS),usbutils) \
|
2018-07-08 11:45:30 +02:00
|
|
|
$(if $(BR2_PACKAGE_UTIL_LINUX),util-linux) \
|
2018-07-08 11:45:29 +02:00
|
|
|
$(if $(BR2_PACKAGE_VIM),vim) \
|
2020-08-08 23:48:15 +02:00
|
|
|
$(if $(BR2_PACKAGE_WATCHDOG),watchdog) \
|
2018-07-08 11:45:28 +02:00
|
|
|
$(if $(BR2_PACKAGE_WGET),wget) \
|
2018-07-08 11:45:27 +02:00
|
|
|
$(if $(BR2_PACKAGE_WHOIS),whois)
|
|
|
|
|
2012-11-04 08:34:11 +01:00
|
|
|
# Link against libtirpc if available so that we can leverage its RPC
|
2014-05-31 09:55:35 +02:00
|
|
|
# support for NFS mounting with BusyBox
|
2012-11-04 08:34:11 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
|
2015-07-26 20:45:15 +02:00
|
|
|
BUSYBOX_DEPENDENCIES += libtirpc host-pkgconf
|
|
|
|
BUSYBOX_CFLAGS += "`$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`"
|
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.
|
2015-07-26 20:45:15 +02:00
|
|
|
BUSYBOX_CFLAGS_busybox += "`$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`"
|
2012-11-04 08:34:11 +01:00
|
|
|
endif
|
|
|
|
|
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)"
|
2016-11-23 13:58:46 +01:00
|
|
|
|
|
|
|
ifeq ($(BR2_REPRODUCIBLE),y)
|
|
|
|
BUSYBOX_MAKE_ENV += \
|
|
|
|
KCONFIG_NOTIMESTAMP=1
|
|
|
|
endif
|
|
|
|
|
2011-01-10 15:28:39 +01:00
|
|
|
BUSYBOX_MAKE_OPTS = \
|
2020-10-18 00:17:42 +02:00
|
|
|
AR="$(TARGET_AR)" \
|
|
|
|
NM="$(TARGET_NM)" \
|
|
|
|
RANLIB="$(TARGET_RANLIB)" \
|
2011-01-10 15:28:39 +01:00
|
|
|
CC="$(TARGET_CC)" \
|
core: introduce NORMALIZED_ARCH as non-kernel replacement for KERNEL_ARCH
The variable 'KERNEL_ARCH' is actually a normalized version of
'ARCH'/'BR2_ARCH'. For example, 'arcle' and 'arceb' both become 'arc', just
as all powerpc variants become 'powerpc'.
It is presumably called 'KERNEL_ARCH' because the Linux kernel is typically
the first place where support for a new architecture is added, and thus is
the entity that defines the normalized name.
However, the term 'KERNEL_ARCH' can also be interpreted as 'the architecture
used by the kernel', which need not be exactly the same as 'the normalized
name for a certain arch'. In particular, for cases where a 64-bit
architecture is running a 64-bit kernel but 32-bit userspace. Examples
include:
* aarch64 architecture, with aarch64 kernel and 32-bit (ARM) userspace
* x86_64 architecture, with x86_64 kernel and 32-bit (i386) userspace
In such cases, the 'architecture used by the kernel' needs to refer to the
64-bit name (aarch64, x86_64), whereas all userspace applications need to
refer the, potentially normalized, 32-bit name.
This means that there need to be two different variables:
KERNEL_ARCH: the architecture used by the kernel
NORMALIZED_ARCH: the normalized name for the current userspace architecture
At this moment, both will actually have the same content. But a subsequent
patch will add basic support for situations described above, in which
KERNEL_ARCH may become overwritten to the 64-bit architecture, while
NORMALIZED_ARCH needs to remain the same (32-bit) case.
This commit replaces use of KERNEL_ARCH where actually the userspace arch is
needed. Places that use KERNEL_ARCH in combination with building of kernel
modules are not touched.
There may be cases where a package builds both a kernel module as userspace,
in which case it may need to know about both KERNEL_ARCH and
NORMALIZED_ARCH, for the case where they differ. But this is to be fixed on
a per-need basis.
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
[Arnout: Also rename BR2_KERNEL_ARCH to BR2_NORMALIZED_ARCH]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-15 21:03:00 +01:00
|
|
|
ARCH=$(NORMALIZED_ARCH) \
|
2011-01-10 15:28:39 +01:00
|
|
|
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
|
2017-04-21 17:24:49 +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
|
|
|
|
2021-07-25 15:43:20 +02:00
|
|
|
BUSYBOX_KCONFIG_SUPPORTS_DEFCONFIG = NO
|
2014-08-03 17:32:43 +02:00
|
|
|
BUSYBOX_KCONFIG_FILE = $(BUSYBOX_CONFIG_FILE)
|
2015-04-28 16:34:33 +02:00
|
|
|
BUSYBOX_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES))
|
2014-08-03 17:32:43 +02:00
|
|
|
BUSYBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig
|
2014-09-27 21:32:47 +02:00
|
|
|
BUSYBOX_KCONFIG_OPTS = $(BUSYBOX_MAKE_OPTS)
|
2014-08-03 17:32:43 +02:00
|
|
|
|
2017-07-03 23:00:49 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX_INDIVIDUAL_BINARIES),y)
|
|
|
|
define BUSYBOX_PERMISSIONS
|
|
|
|
# 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" \
|
2017-11-30 00:08:43 +01:00
|
|
|
# $(@D)/include/applets.h
|
2017-07-03 23:00:49 +02:00
|
|
|
# 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
|
2012-01-11 18:53:39 +01:00
|
|
|
define BUSYBOX_PERMISSIONS
|
2014-11-15 17:29:16 +01:00
|
|
|
/bin/busybox f 4755 0 0 - - - - -
|
2012-01-11 18:53:39 +01:00
|
|
|
endef
|
2017-07-03 23:00:49 +02:00
|
|
|
endif
|
2012-01-11 18:53:39 +01:00
|
|
|
|
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
|
2014-11-30 15:18:41 +01: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
|
2014-11-30 15:18:41 +01:00
|
|
|
$(INSTALL) -D -m 0644 package/busybox/mdev.conf \
|
|
|
|
$(TARGET_DIR)/etc/mdev.conf
|
2011-07-11 12:25:51 +02:00
|
|
|
endef
|
2010-09-30 14:57:53 +02:00
|
|
|
define BUSYBOX_SET_MDEV
|
2020-04-04 14:10:17 +02:00
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_MDEV)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_MDEV_CONF)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_MDEV_EXEC)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_MDEV_LOAD_FIRMWARE)
|
2010-09-30 14:57:53 +02:00
|
|
|
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
|
2020-04-04 14:10:17 +02:00
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_USE_BB_CRYPT_SHA)
|
2014-02-11 14:59:16 +01:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2013-08-09 21:23:39 +02:00
|
|
|
ifeq ($(BR2_USE_MMU),y)
|
|
|
|
define BUSYBOX_SET_MMU
|
2020-04-04 14:10:17 +02:00
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_NOMMU)
|
2013-08-09 21:23:39 +02:00
|
|
|
endef
|
|
|
|
else
|
|
|
|
define BUSYBOX_SET_MMU
|
2020-04-04 14:10:17 +02:00
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_NOMMU)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_SWAPON)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_SWAPOFF)
|
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_ASH)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_BASH_COMPAT)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_BRACE_EXPANSION)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_HELP)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_INTERACTIVE)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_SAVEHISTORY)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_JOB)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_TICK)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_IF)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_LOOPS)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_CASE)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_FUNCTIONS)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_LOCAL)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_RANDOM_SUPPORT)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_EXPORT_N)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_HUSH_MODE_X)
|
2013-08-09 21:23:39 +02:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2010-07-08 19:20:06 +02:00
|
|
|
# If we're using static libs do the same for busybox
|
2014-12-03 22:41:29 +01:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
2010-07-08 19:20:06 +02:00
|
|
|
define BUSYBOX_PREFER_STATIC
|
2020-04-04 14:10:17 +02:00
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_STATIC)
|
2010-07-08 19:20:06 +02:00
|
|
|
endef
|
2010-04-05 13:29:01 +02:00
|
|
|
endif
|
2010-07-08 19:20:06 +02:00
|
|
|
|
2015-07-11 17:51:05 +02:00
|
|
|
define BUSYBOX_INSTALL_UDHCPC_SCRIPT
|
|
|
|
if grep -q CONFIG_UDHCPC=y $(@D)/.config; then \
|
|
|
|
$(INSTALL) -m 0755 -D package/busybox/udhcpc.script \
|
|
|
|
$(TARGET_DIR)/usr/share/udhcpc/default.script; \
|
|
|
|
$(INSTALL) -m 0755 -d \
|
|
|
|
$(TARGET_DIR)/usr/share/udhcpc/default.script.d; \
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
2020-10-21 12:33:43 +02:00
|
|
|
define BUSYBOX_INSTALL_ZCIP_SCRIPT
|
|
|
|
if grep -q CONFIG_ZCIP=y $(@D)/.config; then \
|
|
|
|
$(INSTALL) -m 0755 -D $(@D)/examples/zcip.script \
|
|
|
|
$(TARGET_DIR)/usr/share/zcip/default.script; \
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
2012-07-28 09:21:20 +02:00
|
|
|
ifeq ($(BR2_INIT_BUSYBOX),y)
|
2017-07-18 19:25:32 +02:00
|
|
|
|
2012-07-28 09:21:20 +02:00
|
|
|
define BUSYBOX_SET_INIT
|
2020-04-04 14:10:17 +02:00
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_INIT)
|
2012-07-28 09:21:20 +02:00
|
|
|
endef
|
2017-07-18 19:25:32 +02:00
|
|
|
|
|
|
|
ifeq ($(BR2_TARGET_GENERIC_GETTY),y)
|
|
|
|
define BUSYBOX_SET_GETTY
|
|
|
|
$(SED) '/# GENERIC_SERIAL$$/s~^.*#~$(SYSTEM_GETTY_PORT)::respawn:/sbin/getty -L $(SYSTEM_GETTY_OPTIONS) $(SYSTEM_GETTY_PORT) $(SYSTEM_GETTY_BAUDRATE) $(SYSTEM_GETTY_TERM) #~' \
|
|
|
|
$(TARGET_DIR)/etc/inittab
|
|
|
|
endef
|
2019-10-01 15:09:48 +02:00
|
|
|
else
|
|
|
|
define BUSYBOX_SET_GETTY
|
|
|
|
$(SED) '/# GENERIC_SERIAL$$/s~^.*#~#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 #~' $(TARGET_DIR)/etc/inittab
|
|
|
|
endef
|
2017-07-18 19:25:32 +02:00
|
|
|
endif # BR2_TARGET_GENERIC_GETTY
|
2019-10-01 15:09:48 +02:00
|
|
|
BUSYBOX_TARGET_FINALIZE_HOOKS += BUSYBOX_SET_GETTY
|
2017-07-18 19:25:32 +02:00
|
|
|
|
2017-07-18 19:25:33 +02:00
|
|
|
BUSYBOX_TARGET_FINALIZE_HOOKS += SYSTEM_REMOUNT_ROOT_INITTAB
|
|
|
|
|
2017-07-18 19:25:32 +02:00
|
|
|
endif # BR2_INIT_BUSYBOX
|
2012-07-28 09:21:20 +02:00
|
|
|
|
2015-07-14 22:20:17 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX_SELINUX),y)
|
|
|
|
BUSYBOX_DEPENDENCIES += host-pkgconf libselinux libsepol
|
|
|
|
define BUSYBOX_SET_SELINUX
|
2020-04-04 14:10:17 +02:00
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_SELINUX)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_SELINUXENABLED)
|
2015-07-14 22:20:17 +02:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2020-07-17 12:18:36 +02:00
|
|
|
# enable relevant options to allow the Busybox less applet to be used
|
|
|
|
# as a systemd pager
|
|
|
|
ifeq ($(BR2_PACKAGE_SYSTEMD):$(BR2_PACKAGE_LESS),y:)
|
|
|
|
define BUSYBOX_SET_LESS_FLAGS
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_LESS_DASHCMD)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_LESS_RAW)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_LESS_TRUNCATE)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_LESS_FLAGS)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_LESS_ENV)
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2017-07-03 23:00:49 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX_INDIVIDUAL_BINARIES),y)
|
|
|
|
define BUSYBOX_SET_INDIVIDUAL_BINARIES
|
2020-04-04 14:10:17 +02:00
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_BUILD_LIBBUSYBOX)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_INDIVIDUAL)
|
2017-07-03 23:00:49 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define BUSYBOX_INSTALL_INDIVIDUAL_BINARIES
|
|
|
|
rm -f $(TARGET_DIR)/bin/busybox
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2018-11-07 01:49:09 +01:00
|
|
|
# Only install our logging scripts if no other package does it.
|
|
|
|
ifeq ($(BR2_PACKAGE_SYSKLOGD)$(BR2_PACKAGE_RSYSLOG)$(BR2_PACKAGE_SYSLOG_NG),)
|
2011-06-29 15:46:20 +02:00
|
|
|
define BUSYBOX_INSTALL_LOGGING_SCRIPT
|
2018-11-07 01:49:09 +01:00
|
|
|
if grep -q CONFIG_SYSLOGD=y $(@D)/.config; \
|
2018-07-08 11:45:38 +02:00
|
|
|
then \
|
2018-11-07 01:49:09 +01:00
|
|
|
$(INSTALL) -m 0755 -D package/busybox/S01syslogd \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S01syslogd; \
|
|
|
|
fi; \
|
|
|
|
if grep -q CONFIG_KLOGD=y $(@D)/.config; \
|
|
|
|
then \
|
|
|
|
$(INSTALL) -m 0755 -D package/busybox/S02klogd \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S02klogd; \
|
2018-01-10 23:03:59 +01:00
|
|
|
fi
|
2011-06-29 15:46:20 +02:00
|
|
|
endef
|
2018-11-07 01:49:09 +01:00
|
|
|
endif
|
2011-06-29 15:46:20 +02:00
|
|
|
|
2019-05-02 01:11:40 +02:00
|
|
|
# Only install our sysctl scripts if no other package does it.
|
|
|
|
ifeq ($(BR2_PACKAGE_PROCPS_NG),)
|
|
|
|
define BUSYBOX_INSTALL_SYSCTL_SCRIPT
|
|
|
|
if grep -q CONFIG_BB_SYSCTL=y $(@D)/.config; \
|
|
|
|
then \
|
|
|
|
$(INSTALL) -m 0755 -D package/busybox/S02sysctl \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S02sysctl ; \
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2015-07-13 23:00:08 +02:00
|
|
|
ifeq ($(BR2_INIT_BUSYBOX),y)
|
|
|
|
define BUSYBOX_INSTALL_INITTAB
|
2019-12-06 13:31:54 +01:00
|
|
|
if test ! -e $(TARGET_DIR)/etc/inittab; then \
|
|
|
|
$(INSTALL) -D -m 0644 package/busybox/inittab $(TARGET_DIR)/etc/inittab; \
|
|
|
|
fi
|
2015-07-13 23:00:08 +02:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2012-05-04 04:02:13 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX_WATCHDOG),y)
|
|
|
|
define BUSYBOX_SET_WATCHDOG
|
2020-04-04 14:10:17 +02:00
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_WATCHDOG)
|
2012-05-04 04:02:13 +02:00
|
|
|
endef
|
|
|
|
define BUSYBOX_INSTALL_WATCHDOG_SCRIPT
|
2014-11-30 15:18:41 +01: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 04:02:13 +02:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
2015-07-04 15:48:04 +02:00
|
|
|
# PAM support requires thread support in the toolchain
|
|
|
|
ifeq ($(BR2_PACKAGE_LINUX_PAM)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
|
2015-06-02 15:28:26 +02:00
|
|
|
define BUSYBOX_LINUX_PAM
|
2020-04-04 14:10:17 +02:00
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_PAM)
|
2015-06-02 15:28:26 +02:00
|
|
|
endef
|
|
|
|
BUSYBOX_DEPENDENCIES += linux-pam
|
2018-03-26 14:00:06 +02:00
|
|
|
else
|
|
|
|
define BUSYBOX_LINUX_PAM
|
2020-04-04 14:10:17 +02:00
|
|
|
$(call KCONFIG_DISABLE_OPT,CONFIG_PAM)
|
2018-03-26 14:00:06 +02:00
|
|
|
endef
|
2015-06-02 15:28:26 +02:00
|
|
|
endif
|
|
|
|
|
2015-07-13 11:05:36 +02:00
|
|
|
# Telnet support
|
|
|
|
define BUSYBOX_INSTALL_TELNET_SCRIPT
|
|
|
|
if grep -q CONFIG_FEATURE_TELNETD_STANDALONE=y $(@D)/.config; then \
|
|
|
|
$(INSTALL) -m 0755 -D package/busybox/S50telnet \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S50telnet ; \
|
|
|
|
fi
|
|
|
|
endef
|
2021-08-26 23:02:40 +02:00
|
|
|
define BUSYBOX_INSTALL_TELNET_SERVICE
|
|
|
|
if grep -q CONFIG_FEATURE_TELNETD_STANDALONE=y $(@D)/.config; then \
|
|
|
|
$(INSTALL) -D -m 0644 package/busybox/telnetd.service \
|
|
|
|
$(TARGET_DIR)/usr/lib/systemd/system/telnetd.service ; \
|
|
|
|
fi
|
|
|
|
endef
|
2015-07-13 11:05:36 +02:00
|
|
|
|
2018-01-19 11:15:02 +01:00
|
|
|
# Add /bin/{a,hu}sh to /etc/shells otherwise some login tools like dropbear
|
|
|
|
# can reject the user connection. See man shells.
|
|
|
|
define BUSYBOX_INSTALL_ADD_TO_SHELLS
|
2020-03-25 01:30:53 +01:00
|
|
|
if grep -q CONFIG_ASH=y $(BUSYBOX_DIR)/.config; then \
|
2018-01-19 11:15:02 +01:00
|
|
|
grep -qsE '^/bin/ash$$' $(TARGET_DIR)/etc/shells \
|
|
|
|
|| echo "/bin/ash" >> $(TARGET_DIR)/etc/shells; \
|
|
|
|
fi
|
2020-03-25 01:30:53 +01:00
|
|
|
if grep -q CONFIG_HUSH=y $(BUSYBOX_DIR)/.config; then \
|
2018-01-19 11:15:02 +01:00
|
|
|
grep -qsE '^/bin/hush$$' $(TARGET_DIR)/etc/shells \
|
|
|
|
|| echo "/bin/hush" >> $(TARGET_DIR)/etc/shells; \
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
BUSYBOX_TARGET_FINALIZE_HOOKS += BUSYBOX_INSTALL_ADD_TO_SHELLS
|
|
|
|
|
2014-08-03 17:32:43 +02:00
|
|
|
define BUSYBOX_KCONFIG_FIXUP_CMDS
|
2013-08-09 21:23:39 +02:00
|
|
|
$(BUSYBOX_SET_MMU)
|
2010-07-08 19:20:06 +02:00
|
|
|
$(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)
|
2015-06-02 15:28:26 +02:00
|
|
|
$(BUSYBOX_LINUX_PAM)
|
2012-07-28 09:21:20 +02:00
|
|
|
$(BUSYBOX_SET_INIT)
|
2012-05-04 04:02:13 +02:00
|
|
|
$(BUSYBOX_SET_WATCHDOG)
|
2015-07-14 22:20:17 +02:00
|
|
|
$(BUSYBOX_SET_SELINUX)
|
2020-07-17 12:18:36 +02:00
|
|
|
$(BUSYBOX_SET_LESS_FLAGS)
|
2017-07-03 23:00:49 +02:00
|
|
|
$(BUSYBOX_SET_INDIVIDUAL_BINARIES)
|
2014-08-03 17:32:43 +02:00
|
|
|
endef
|
|
|
|
|
2010-07-08 19:20:06 +02:00
|
|
|
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
|
2018-07-08 11:45:26 +02:00
|
|
|
# Use the 'noclobber' install rule, to prevent BusyBox from overwriting
|
|
|
|
# any full-blown versions of apps installed by other packages.
|
|
|
|
$(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(@D) install-noclobber
|
2020-02-23 11:59:12 +01:00
|
|
|
$(BUSYBOX_INSTALL_INDIVIDUAL_BINARIES)
|
2015-07-13 23:00:08 +02:00
|
|
|
$(BUSYBOX_INSTALL_INITTAB)
|
2015-07-11 17:51:05 +02:00
|
|
|
$(BUSYBOX_INSTALL_UDHCPC_SCRIPT)
|
2020-10-21 12:33:43 +02:00
|
|
|
$(BUSYBOX_INSTALL_ZCIP_SCRIPT)
|
2011-07-11 12:25:51 +02:00
|
|
|
$(BUSYBOX_INSTALL_MDEV_CONF)
|
2014-11-30 15:17:54 +01:00
|
|
|
endef
|
|
|
|
|
2020-04-18 23:39:23 +02:00
|
|
|
# Install the sysvinit scripts, for the moment, but not those that already
|
|
|
|
# have a corresponding one in openrc.
|
|
|
|
define BUSYBOX_INSTALL_INIT_OPENRC
|
|
|
|
$(BUSYBOX_INSTALL_MDEV_SCRIPT)
|
|
|
|
$(BUSYBOX_INSTALL_LOGGING_SCRIPT)
|
|
|
|
$(BUSYBOX_INSTALL_WATCHDOG_SCRIPT)
|
|
|
|
$(BUSYBOX_INSTALL_TELNET_SCRIPT)
|
|
|
|
endef
|
|
|
|
|
2021-08-26 23:02:40 +02:00
|
|
|
define BUSYBOX_INSTALL_INIT_SYSTEMD
|
|
|
|
$(BUSYBOX_INSTALL_TELNET_SERVICE)
|
|
|
|
endef
|
|
|
|
|
2014-11-30 15:17:54 +01:00
|
|
|
define BUSYBOX_INSTALL_INIT_SYSV
|
|
|
|
$(BUSYBOX_INSTALL_MDEV_SCRIPT)
|
2011-06-29 15:46:20 +02:00
|
|
|
$(BUSYBOX_INSTALL_LOGGING_SCRIPT)
|
2012-05-04 04:02:13 +02:00
|
|
|
$(BUSYBOX_INSTALL_WATCHDOG_SCRIPT)
|
2019-05-02 01:11:40 +02:00
|
|
|
$(BUSYBOX_INSTALL_SYSCTL_SCRIPT)
|
2015-07-13 11:05:36 +02:00
|
|
|
$(BUSYBOX_INSTALL_TELNET_SCRIPT)
|
2010-07-08 19:20:06 +02:00
|
|
|
endef
|
|
|
|
|
2015-07-13 12:32:03 +02:00
|
|
|
# Checks to give errors that the user can understand
|
|
|
|
# Must be before we call to kconfig-package
|
2015-07-14 12:13:21 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX)$(BR_BUILDING),yy)
|
2015-07-13 12:32:03 +02:00
|
|
|
ifeq ($(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG)),)
|
|
|
|
$(error No BusyBox configuration file specified, check your BR2_PACKAGE_BUSYBOX_CONFIG setting)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2014-08-03 17:32:43 +02:00
|
|
|
$(eval $(kconfig-package))
|