initial buildroot for linux 5.15

This commit is contained in:
Huan.Feng
2021-12-06 14:12:13 +08:00
parent d7767d594e
commit 7b6fc358fa
12736 changed files with 508822 additions and 0 deletions
+181
View File
@@ -0,0 +1,181 @@
menu "Linux Kernel Tools"
# No prompt, this is sourced by linux/Config.in as this
# is no real package and really belongs to the kernel.
config BR2_PACKAGE_LINUX_TOOLS
bool
config BR2_PACKAGE_LINUX_TOOLS_BPFTOOL
bool "bpftool"
depends on !BR2_nios2 # binutils
depends on BR2_USE_WCHAR # binutils, elfutils
depends on !BR2_STATIC_LIBS # elfutils
depends on BR2_TOOLCHAIN_HAS_THREADS # elfutils
depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils
select BR2_PACKAGE_LINUX_TOOLS
select BR2_PACKAGE_BINUTILS
select BR2_PACKAGE_ELFUTILS
help
bpftool is a tool for for inspection and simple manipulation
of eBPF programs and maps.
These tools are available only from kernel version 4.15.
comment "bpftool needs a uClibc or glibc toolchain w/ wchar, dynamic library, threads"
depends on !BR2_nios2
depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS \
|| !BR2_TOOLCHAIN_HAS_THREADS \
|| !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC)
config BR2_PACKAGE_LINUX_TOOLS_CPUPOWER
bool "cpupower"
select BR2_PACKAGE_LINUX_TOOLS
select BR2_PACKAGE_PCIUTILS
help
cpupower is a collection of tools to examine and tune power
saving related features of your processor.
config BR2_PACKAGE_LINUX_TOOLS_GPIO
bool "gpio"
select BR2_PACKAGE_LINUX_TOOLS
help
gpio is a collection of tools to get information about,
control and monitor gpios present on system.
These tools use new gpio ABI which will deprecate sysfs gpio
interface in the future.
These tools are available only from kernel version 4.8.
config BR2_PACKAGE_LINUX_TOOLS_IIO
bool "iio"
select BR2_PACKAGE_LINUX_TOOLS
help
iio is a collection of tools to get information about,
control and monitor iio devices present on system.
These tools are available only from kernel version 4.7.
config BR2_PACKAGE_LINUX_TOOLS_PCI
bool "pci"
select BR2_PACKAGE_LINUX_TOOLS
help
pcitest is a tool for testing capabilities related to a
PCI Endpoint (only works with specific Endpoints).
These tools are available only from kernel version 4.20.
config BR2_PACKAGE_LINUX_TOOLS_PERF
bool "perf"
depends on BR2_TOOLCHAIN_HAS_SYNC_4
select BR2_PACKAGE_LINUX_TOOLS
help
perf (sometimes "Perf Events" or perf tools, originally
"Performance Counters for Linux") - is a performance
analyzing tool in Linux, available from kernel version
2.6.31. User-space controlling utility, called 'perf' has
git-like interface with subcommands. It is capable of
statistical profiling of entire system (both kernel and user
code), single CPU or severals threads.
This will build and install the userspace 'perf'
command.
Your kernel must have CONFIG_PERF_EVENTS enabled to use perf
profiling. Buildroot automatically enables this in the kernel
configuration.
https://perf.wiki.kernel.org/
if BR2_PACKAGE_LINUX_TOOLS_PERF
config BR2_PACKAGE_LINUX_TOOLS_PERF_TUI
bool "enable perf TUI"
depends on BR2_USE_MMU # slang
select BR2_PACKAGE_SLANG
help
Enable the TUI interface for perf which requires a TTY and
enables zooming into DSOs and threads as well as other
features.
endif
config BR2_PACKAGE_LINUX_TOOLS_SELFTESTS
bool"selftests"
depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # bash
depends on BR2_USE_MMU # bash
depends on !BR2_STATIC_LIBS
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14 # util-linux schedutils
select BR2_PACKAGE_LINUX_TOOLS
select BR2_PACKAGE_BASH # runtime
select BR2_PACKAGE_NCURSES
select BR2_PACKAGE_NCURSES_TARGET_PROGS # runtime (tput)
select BR2_PACKAGE_KMOD
select BR2_PACKAGE_KMOD_TOOLS # runtime (modprobe -n)
select BR2_PACKAGE_POPT
select BR2_PACKAGE_LIBCAP_NG
select BR2_PACKAGE_UTIL_LINUX
select BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS # runtime (taskset)
help
Build and install (to /usr/lib/kselftests) kernel selftests.
Use of this option implies you know the process of using and
compiling the kernel selftests. The Makefile to build and
install these is very noisy and may appear to cause your
build to fail for strange reasons.
This is very much a use at your risk option and may not work
for every setup or every architecture.
comment "selftests needs BR2_PACKAGE_BUSYBOX_SHOW_OTHERS and a toolchain w/ dynamic library and headers >= 3.14"
depends on BR2_USE_MMU
depends on !BR2_PACKAGE_BUSYBOX_SHOW_OTHERS || \
BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
config BR2_PACKAGE_LINUX_TOOLS_TMON
bool "tmon"
select BR2_PACKAGE_LINUX_TOOLS
select BR2_PACKAGE_NCURSES
help
tmon is a terminal-based tool (using curses) that allows the
user to access thermal information about the system.
config BR2_PACKAGE_LINUX_TOOLS_HV
bool "hv"
depends on BR2_i386 || BR2_x86_64
select BR2_PACKAGE_LINUX_TOOLS
select BR2_PACKAGE_LINUX_TOOLS_HV_KVP_DAEMON if !BR2_PACKAGE_LINUX_TOOLS_HV_HAS_ONE
help
Microsoft HyperV integration services
Relevant kernel configuration options: CONFIG_HYPERV,
CONFIG_HYPERV_UTILS.
if BR2_PACKAGE_LINUX_TOOLS_HV
config BR2_PACKAGE_LINUX_TOOLS_HV_HAS_ONE
bool
config BR2_PACKAGE_LINUX_TOOLS_HV_KVP_DAEMON
bool "hypervkvpd (hv_kvp_daemon)"
help
HyperV uses hypervkvpd (Key/Value Pair daemon) to retrieve
status information from your virtualized guest OS
config BR2_PACKAGE_LINUX_TOOLS_HV_FCOPY_DAEMON
bool "hypervfcopyd (hv_fcopy_daemon)"
select BR2_PACKAGE_LINUX_TOOLS_HV_HAS_ONE
help
HyperV uses hypervfcopyd (File Copy daemon) to easily transfer
files to and from your virtualized guest OS
config BR2_PACKAGE_LINUX_TOOLS_HV_VSS_DAEMON
bool "hypervvssd (hv_vss_daemon)"
select BR2_PACKAGE_LINUX_TOOLS_HV_HAS_ONE
help
HyperV uses hypervvssd (Volume Snapshot Service daemon) to
freeze your filesystems during snapshots and backups
endif # BR2_PACKAGE_LINUX_TOOLS_HV
endmenu
+66
View File
@@ -0,0 +1,66 @@
#!/bin/sh
PROGS="@PROGS@"
PIDDIR="/var/run"
# shellcheck source=/dev/null
[ -r "/etc/default/hyperv" ] && . "/etc/default/hyperv"
start_one() {
printf 'Starting %s: ' "$1"
# shellcheck disable=SC2086 # we need the word splitting
start-stop-daemon -b -m -S -q -p "$PIDDIR/$1.pid" -x "/sbin/$1" -- -n
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return $status
}
start() {
# shellcheck disable=SC2086 # we need the word splitting
for prog in ${PROGS}; do
start_one "${prog}" || ret=$?
done
return $ret
}
stop_one() {
printf 'Stopping %s: ' "$1"
start-stop-daemon -K -q -p "$PIDDIR/$1.pid"
status=$?
if [ "$status" -eq 0 ]; then
rm -f "$PIDDIR/$1.pid"
echo "OK"
else
echo "FAIL"
fi
return $status
}
stop() {
# shellcheck disable=SC2086 # we need the word splitting
for prog in ${PROGS}; do
stop_one "${prog}" || ret=$?
done
return $ret
}
restart() {
stop
sleep 1
start
}
case "$1" in
start|stop|restart)
"$1";;
reload)
# Restart, since there is no true "reload" feature.
restart;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=HyperV FCopy daemon
After=syslog.target
ConditionVirtualization=microsoft
[Service]
Type=simple
ExecStart=/usr/sbin/hypervfcopyd -n
[Install]
WantedBy=multi-user.target
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=HyperV KVP daemon
After=syslog.target
ConditionVirtualization=microsoft
[Service]
Type=simple
ExecStart=/usr/sbin/hypervkvpd -n
[Install]
WantedBy=multi-user.target
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=HyperV VSS daemon
After=syslog.target
ConditionVirtualization=microsoft
[Service]
Type=simple
ExecStart=/usr/sbin/hypervvssd -n
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,37 @@
################################################################################
#
# bpftool
#
################################################################################
LINUX_TOOLS += bpftool
BPFTOOL_DEPENDENCIES = binutils elfutils
ifeq ($(BR2_PACKAGE_LIBCAP),y)
BPFTOOL_DEPENDENCIES += libcap
endif
ifeq ($(BR2_PACKAGE_ZLIB),y)
BPFTOOL_DEPENDENCIES += zlib
endif
BPFTOOL_MAKE_OPTS = $(LINUX_MAKE_FLAGS)
define BPFTOOL_BUILD_CMDS
$(Q)if ! grep install $(LINUX_DIR)/tools/bpf/bpftool/Makefile >/dev/null 2>&1 ; then \
echo "Your kernel version is too old and does not have install section in the bpf tools." ; \
echo "At least kernel 4.15 must be used." ; \
exit 1 ; \
fi
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/bpf/bpftool \
$(BPFTOOL_MAKE_OPTS)
endef
define BPFTOOL_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/bpf/bpftool \
$(BPFTOOL_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) \
install
endef
@@ -0,0 +1,41 @@
################################################################################
#
# cpupower
#
################################################################################
LINUX_TOOLS += cpupower
CPUPOWER_DEPENDENCIES = pciutils $(TARGET_NLS_DEPENDENCIES)
CPUPOWER_MAKE_OPTS = CROSS=$(TARGET_CROSS) \
CPUFREQ_BENCH=false \
NLS=false \
LDFLAGS=$(TARGET_NLS_LIBS) \
DEBUG=false
define CPUPOWER_BUILD_CMDS
$(Q)if test ! -f $(LINUX_DIR)/tools/power/cpupower/Makefile ; then \
echo "Your kernel version is too old and does not have the cpupower tool." ; \
echo "At least kernel 3.4 must be used." ; \
exit 1 ; \
fi
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
$(CPUPOWER_MAKE_OPTS) \
cpupower
endef
define CPUPOWER_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
$(CPUPOWER_MAKE_OPTS) \
DESTDIR=$(STAGING_DIR) \
cpupower_install
endef
define CPUPOWER_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
$(CPUPOWER_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) \
cpupower_install
endef
+28
View File
@@ -0,0 +1,28 @@
################################################################################
#
# gpio
#
################################################################################
LINUX_TOOLS += gpio
GPIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS)
define GPIO_BUILD_CMDS
$(Q)if ! grep install $(LINUX_DIR)/tools/gpio/Makefile >/dev/null 2>&1 ; then \
echo "Your kernel version is too old and does not have the gpio tools." ; \
echo "At least kernel 4.8 must be used." ; \
exit 1 ; \
fi
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools \
$(GPIO_MAKE_OPTS) \
gpio
endef
define GPIO_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools \
$(GPIO_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) \
gpio_install
endef
+61
View File
@@ -0,0 +1,61 @@
################################################################################
#
# hv_fcopy_daemon
#
################################################################################
LINUX_TOOLS += hv
# The programs to build, as known by the kernel:
HV_PROGS_$(BR2_PACKAGE_LINUX_TOOLS_HV_KVP_DAEMON) += hv_kvp_daemon
HV_PROGS_$(BR2_PACKAGE_LINUX_TOOLS_HV_FCOPY_DAEMON) += hv_fcopy_daemon
HV_PROGS_$(BR2_PACKAGE_LINUX_TOOLS_HV_VSS_DAEMON) += hv_vss_daemon
# Give each tools the name most distros install them as:
HV_hv_kvp_daemon = hypervkvpd
HV_hv_fcopy_daemon = hypervfcopyd
HV_hv_vss_daemon = hypervvssd
HV_MAKE_OPTS = CC="$(TARGET_CC)" CFLAGS="$(filter-out -g%,$(TARGET_CFLAGS))"
define HV_BUILD_CMDS
$(Q)for prog in $(HV_PROGS_y); do \
if test ! -f $(LINUX_DIR)/tools/hv/$${prog}.c ; then \
printf "Your kernel version is too old and does not have the HyperV %s tool." "$${prog}" ; \
exit 1 ; \
fi; \
done
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/hv \
$(HV_MAKE_OPTS) \
$(HV_PROGS_y)
endef
ifeq ($(BR2_PACKAGE_LINUX_TOOLS_HV_KVP_DAEMON),y)
define HV_KVP_HELPER
@mkdir -p $(TARGET_DIR)/usr/libexec/hypervkvpd
$(Q)ln -sf /bin/true $(TARGET_DIR)/usr/libexec/hypervkvpd/hv_set_ifconfig
endef
endif
define HV_INSTALL_TARGET_CMDS
$(foreach prog,$(HV_PROGS_y), \
$(INSTALL) -m 0755 -D $(LINUX_DIR)/tools/hv/$(prog) \
$(TARGET_DIR)/usr/sbin/$(HV_$(prog))
)
$(HV_KVP_HELPER)
endef
define HV_INSTALL_INIT_SYSTEMD
$(foreach prog,$(HV_PROGS_y), \
$(INSTALL) -m 0644 -D package/linux-tools/$(HV_$(prog)).service \
$(TARGET_DIR)/usr/lib/systemd/system/$(HV_$(prog)).service
)
endef
define HV_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 -D package/linux-tools/S10hyperv \
$(TARGET_DIR)/etc/init.d/S10hyperv
$(SED) 's/@PROGS@/$(foreach prog,$(HV_PROGS_y),$(HV_$(prog)))/' \
$(TARGET_DIR)/etc/init.d/S10hyperv
endef
+29
View File
@@ -0,0 +1,29 @@
################################################################################
#
# iio
#
################################################################################
LINUX_TOOLS += iio
IIO_MAKE_OPTS = $(LINUX_MAKE_FLAGS)
define IIO_BUILD_CMDS
$(Q)if ! grep install $(LINUX_DIR)/tools/iio/Makefile >/dev/null 2>&1 ; then \
echo "Your kernel version is too old and does not have install section in the iio tools." ; \
echo "At least kernel 4.7 must be used." ; \
exit 1 ; \
fi
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/iio \
$(IIO_MAKE_OPTS)
endef
# DESTDIR used since kernel version 4.14
define IIO_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/iio \
$(IIO_MAKE_OPTS) \
INSTALL_ROOT=$(TARGET_DIR) \
DESTDIR=$(TARGET_DIR) \
install
endef
+27
View File
@@ -0,0 +1,27 @@
################################################################################
#
# pci
#
################################################################################
LINUX_TOOLS += pci
PCI_MAKE_OPTS = $(LINUX_MAKE_FLAGS)
define PCI_BUILD_CMDS
$(Q)if ! grep install $(LINUX_DIR)/tools/pci/Makefile >/dev/null 2>&1 ; then \
echo "Your kernel version is too old and does not have install section in the pci tools." ; \
echo "At least kernel 4.20 must be used." ; \
exit 1 ; \
fi
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/pci \
$(PCI_MAKE_OPTS)
endef
define PCI_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/pci \
$(PCI_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) \
install
endef
+173
View File
@@ -0,0 +1,173 @@
################################################################################
#
# perf
#
################################################################################
LINUX_TOOLS += perf
PERF_DEPENDENCIES = host-flex host-bison
ifeq ($(KERNEL_ARCH),x86_64)
PERF_ARCH=x86
else
PERF_ARCH=$(KERNEL_ARCH)
endif
PERF_MAKE_FLAGS = \
$(LINUX_MAKE_FLAGS) \
JOBS=$(PARALLEL_JOBS) \
ARCH=$(PERF_ARCH) \
DESTDIR=$(TARGET_DIR) \
prefix=/usr \
WERROR=0 \
NO_GTK2=1 \
NO_LIBPERL=1 \
NO_LIBPYTHON=1 \
NO_LIBBIONIC=1
# We need to pass an argument to ld for setting the emulation when
# building for MIPS architecture, otherwise the default one will always
# be used and the compilation for most variants will fail.
ifeq ($(BR2_mips),y)
PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf32btsmip"
else ifeq ($(BR2_mipsel),y)
PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf32ltsmip"
else ifeq ($(BR2_mips64),y)
ifeq ($(BR2_MIPS_NABI32),y)
PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf32btsmipn32"
else
PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf64btsmip"
endif
else ifeq ($(BR2_mips64el),y)
ifeq ($(BR2_MIPS_NABI32),y)
PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf32ltsmipn32"
else
PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf64ltsmip"
endif
endif
# The call to backtrace() function fails for ARC, because for some
# reason the unwinder from libgcc returns early. Thus the usage of
# backtrace() should be disabled in perf explicitly: at build time
# backtrace() appears to be available, but it fails at runtime: the
# backtrace will contain only several functions from the top of stack,
# instead of the complete backtrace.
ifeq ($(BR2_arc),y)
PERF_MAKE_FLAGS += NO_BACKTRACE=1
endif
ifeq ($(BR2_PACKAGE_LINUX_TOOLS_PERF_TUI),y)
PERF_DEPENDENCIES += slang
else
PERF_MAKE_FLAGS += NO_NEWT=1 NO_SLANG=1
endif
ifeq ($(BR2_PACKAGE_AUDIT),y)
PERF_DEPENDENCIES += audit
else
PERF_MAKE_FLAGS += NO_LIBAUDIT=1
endif
ifeq ($(BR2_PACKAGE_ZSTD),y)
PERF_DEPENDENCIES += zstd
endif
ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
PERF_DEPENDENCIES += libunwind
else
PERF_MAKE_FLAGS += NO_LIBUNWIND=1
endif
ifeq ($(BR2_PACKAGE_NUMACTL),y)
PERF_DEPENDENCIES += numactl
else
PERF_MAKE_FLAGS += NO_LIBNUMA=1
endif
ifeq ($(BR2_PACKAGE_ELFUTILS),y)
PERF_DEPENDENCIES += elfutils
else
PERF_MAKE_FLAGS += NO_LIBELF=1 NO_DWARF=1
endif
ifeq ($(BR2_PACKAGE_BINUTILS),y)
PERF_DEPENDENCIES += binutils
else
PERF_MAKE_FLAGS += NO_DEMANGLE=1
endif
ifeq ($(BR2_PACKAGE_OPENSSL),y)
PERF_DEPENDENCIES += openssl
else
PERF_MAKE_FLAGS += NO_LIBCRYPTO=1
endif
ifeq ($(BR2_PACKAGE_ZLIB),y)
PERF_DEPENDENCIES += zlib
else
PERF_MAKE_FLAGS += NO_ZLIB=1
endif
# lzma is provided by xz
ifeq ($(BR2_PACKAGE_XZ),y)
PERF_DEPENDENCIES += xz
else
PERF_MAKE_FLAGS += NO_LZMA=1
endif
# We really do not want to build the perf documentation, because it
# has stringent requirement on the documentation generation tools,
# like xmlto and asciidoc), which may be lagging behind on some
# distributions.
# We name it 'GNUmakefile' so that GNU make will use it instead of
# the existing 'Makefile'.
define PERF_DISABLE_DOCUMENTATION
if [ -f $(LINUX_DIR)/tools/perf/Documentation/Makefile ]; then \
printf "%%:\n\t@:\n" >$(LINUX_DIR)/tools/perf/Documentation/GNUmakefile; \
fi
endef
LINUX_POST_PATCH_HOOKS += PERF_DISABLE_DOCUMENTATION
# O must be redefined here to overwrite the one used by Buildroot for
# out of tree build. We build perf in $(LINUX_DIR)/tools/perf/ and not just
# $(LINUX_DIR) so that it isn't built in the root directory of the kernel
# sources.
define PERF_BUILD_CMDS
$(Q)if test ! -f $(LINUX_DIR)/tools/perf/Makefile ; then \
echo "Your kernel version is too old and does not have the perf tool." ; \
echo "At least kernel 2.6.31 must be used." ; \
exit 1 ; \
fi
$(Q)if test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \
if ! grep -q NO_LIBELF $(LINUX_DIR)/tools/perf/Makefile* ; then \
if ! test -r $(LINUX_DIR)/tools/perf/config/Makefile ; then \
echo "The perf tool in your kernel cannot be built without libelf." ; \
echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \
exit 1 ; \
fi \
fi \
fi
$(Q)if test "$(BR2_PACKAGE_LINUX_TOOLS_PERF_TUI)" = "y" ; then \
if ! grep -q NO_SLANG $(LINUX_DIR)/tools/perf/Makefile* ; then \
echo "The perf tool in your kernel cannot be build with the TUI." ; \
echo "Either upgrade your kernel to >= 3.10, or disable the TUI." ; \
exit 1 ; \
fi \
fi
$(TARGET_MAKE_ENV) $(MAKE1) $(PERF_MAKE_FLAGS) \
-C $(LINUX_DIR)/tools/perf O=$(LINUX_DIR)/tools/perf/
endef
# After installation, we remove the Perl and Python scripts from the
# target.
define PERF_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE1) $(PERF_MAKE_FLAGS) \
-C $(LINUX_DIR)/tools/perf O=$(LINUX_DIR)/tools/perf/ install
$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/
$(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/tests/
endef
define PERF_LINUX_CONFIG_FIXUPS
$(call KCONFIG_ENABLE_OPT,CONFIG_PERF_EVENTS)
endef
@@ -0,0 +1,46 @@
################################################################################
#
# selftests
#
################################################################################
LINUX_TOOLS += selftests
ifeq ($(KERNEL_ARCH),x86_64)
SELFTESTS_ARCH=x86
else
ifeq ($(KERNEL_ARCH),i386)
SELFTESTS_ARCH=x86
else
SELFTESTS_ARCH=$(KERNEL_ARCH)
endif
endif
SELFTESTS_DEPENDENCIES = libcap-ng popt
SELFTESTS_MAKE_FLAGS = \
$(LINUX_MAKE_FLAGS) \
ARCH=$(SELFTESTS_ARCH)
# O must be redefined here to overwrite the one used by Buildroot for
# out of tree build. We build the selftests in $(LINUX_DIR)/tools/selftests and
# not just $(LINUX_DIR) so that it isn't built in the root directory of the kernel
# sources.
#
# The headers_install step here is important as some kernel selftests use a
# hardcoded CFLAGS to find kernel headers e.g:
# CFLAGS += -I../../../../usr/include/
# The headers_install target will install the kernel headers locally inside
# the Linux build dir
define SELFTESTS_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR) $(SELFTESTS_MAKE_FLAGS) \
headers_install
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/testing/selftests \
$(SELFTESTS_MAKE_FLAGS) O=$(LINUX_DIR)/tools/testing/selftests
endef
define SELFTESTS_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/testing/selftests \
$(SELFTESTS_MAKE_FLAGS) O=$(LINUX_DIR)/tools/testing/selftests \
INSTALL_PATH=$(TARGET_DIR)/usr/lib/kselftests install
endef
+37
View File
@@ -0,0 +1,37 @@
################################################################################
#
# tmon
#
################################################################################
LINUX_TOOLS += tmon
TMON_DEPENDENCIES = host-pkgconf ncurses
TMON_MAKE_OPTS = $(LINUX_MAKE_FLAGS) \
CC=$(TARGET_CC) \
PKG_CONFIG_PATH=$(STAGING_DIR)/usr/lib/pkgconfig
ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
define TMON_DISABLE_STACK_PROTECTOR
$(SED) 's%-fstack-protector%%' $(LINUX_DIR)/tools/thermal/tmon/Makefile
endef
endif
define TMON_BUILD_CMDS
$(Q)if ! grep install $(LINUX_DIR)/tools/thermal/tmon/Makefile >/dev/null 2>&1 ; then \
echo "Your kernel version is too old and does not have the tmon tool." ; \
echo "At least kernel 3.13 must be used." ; \
exit 1 ; \
fi
$(TMON_DISABLE_STACK_PROTECTOR)
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
$(TMON_MAKE_OPTS) \
tmon
endef
define TMON_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools \
$(TMON_MAKE_OPTS) \
INSTALL_ROOT=$(TARGET_DIR) \
tmon_install
endef
+74
View File
@@ -0,0 +1,74 @@
################################################################################
#
# linux-tools
#
################################################################################
# Vampirising sources from the kernel tree, so no source nor site specified.
# Instead, we directly build in the sources of the linux package. We can do
# that, because we're not building in the same location and the same files.
#
# So, all tools refer to $(LINUX_DIR) instead of $(@D).
# Note: we need individual tools makefiles to be included *before* we build
# the list of build and install hooks below to guarantee that each tool has
# a chance to register itself once, and only once. Therefore, the makefiles
# are named linux-tool-*.mk.in, so they won't be picked up by the top-level
# Makefile, but can be included here, guaranteeing the single inclusion and
# the proper ordering.
include $(sort $(wildcard package/linux-tools/*.mk.in))
# We only need the kernel to be extracted, not actually built
LINUX_TOOLS_PATCH_DEPENDENCIES = linux
# Install Linux kernel tools in the staging directory since some tools
# may install shared libraries and headers (e.g. cpupower).
LINUX_TOOLS_INSTALL_STAGING = YES
LINUX_TOOLS_DEPENDENCIES += $(foreach tool,$(LINUX_TOOLS),\
$(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
$($(call UPPERCASE,$(tool))_DEPENDENCIES)))
LINUX_TOOLS_POST_BUILD_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
$(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
$(call UPPERCASE,$(tool))_BUILD_CMDS))
LINUX_TOOLS_POST_INSTALL_STAGING_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
$(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
$(call UPPERCASE,$(tool))_INSTALL_STAGING_CMDS))
LINUX_TOOLS_POST_INSTALL_TARGET_HOOKS += $(foreach tool,$(LINUX_TOOLS),\
$(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
$(call UPPERCASE,$(tool))_INSTALL_TARGET_CMDS))
define LINUX_TOOLS_LINUX_CONFIG_FIXUPS
$(foreach tool,$(LINUX_TOOLS),\
$(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
$($(call UPPERCASE,$(tool))_LINUX_CONFIG_FIXUPS))
)
endef
define LINUX_TOOLS_INSTALL_INIT_SYSTEMD
$(foreach tool,$(LINUX_TOOLS),\
$(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
$($(call UPPERCASE,$(tool))_INSTALL_INIT_SYSTEMD))
)
endef
define LINUX_TOOLS_INSTALL_INIT_SYSV
$(foreach tool,$(LINUX_TOOLS),\
$(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
$($(call UPPERCASE,$(tool))_INSTALL_INIT_SYSV))
)
endef
define LINUX_TOOLS_INSTALL_INIT_OPENRC
$(foreach tool,$(LINUX_TOOLS),\
$(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\
$(or $($(call UPPERCASE,$(tool))_INSTALL_INIT_OPENRC),\
$($(call UPPERCASE,$(tool))_INSTALL_INIT_SYSV)))
)
endef
$(eval $(generic-package))