diff options
Diffstat (limited to 'resources/tools/disk-image-builder/nested')
11 files changed, 362 insertions, 99 deletions
diff --git a/resources/tools/disk-image-builder/nested/CHANGELOG b/resources/tools/disk-image-builder/nested/CHANGELOG index 9a0518811d..74dc2201e3 100644 --- a/resources/tools/disk-image-builder/nested/CHANGELOG +++ b/resources/tools/disk-image-builder/nested/CHANGELOG @@ -1,3 +1,15 @@ +## [1.3] - 2016-06-12 + +### Changes +- Use Glibc instead of uClibc. Required for DPDK. +- Include buildroot patch for DPDK. Update build.sh + script to include that patch. +- Update Linux kernel config to include UIO support + +### Added +- Python, DPDK to image + + ## [1.2] - 2016-05-25 ### Changes diff --git a/resources/tools/disk-image-builder/nested/build.sh b/resources/tools/disk-image-builder/nested/build.sh index 88b444b67d..9b02cfda87 100755 --- a/resources/tools/disk-image-builder/nested/build.sh +++ b/resources/tools/disk-image-builder/nested/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -e # Copyright (c) 2016 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); @@ -67,6 +67,9 @@ set -e wget -P ${BUILD_DIR} -N $BUILDROOT_URL tar -C ${BUILD_DIR} -xzf ${BUILD_DIR}/$BUILDROOT_TARBALL +# Apply DPDK patch to buildroot. Do not fail if this patch has already been applied. +patch -N -d ${BUILDROOT_DIR} -p1 < buildroot-patches/dpdk.patch || /bin/true + cp -p buildroot-config $BUILDROOT_DIR/.config cp -p kernel-defconfig $BUILDROOT_DIR/kernel-defconfig make -C $BUILDROOT_DIR @@ -124,7 +127,7 @@ sudo tar -C ${MOUNT_TMPDIR} -xf ${BUILDROOT_OUTPUT} echo "Applying patches/modifications" mydir=$(pwd) cd ${MOUNT_TMPDIR} -sudo run-parts -v ${mydir}/patches +sudo run-parts -v ${mydir}/image-patches cd ${mydir} # Copy version and changelog diff --git a/resources/tools/disk-image-builder/nested/buildroot-config b/resources/tools/disk-image-builder/nested/buildroot-config index b909a39270..9151475dc5 100644 --- a/resources/tools/disk-image-builder/nested/buildroot-config +++ b/resources/tools/disk-image-builder/nested/buildroot-config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Buildroot 2016.02 Configuration +# Buildroot 2016.02-ga74531b-dirty Configuration # BR2_HAVE_DOT_CONFIG=y BR2_HOST_GCC_AT_LEAST_4_7=y @@ -105,10 +105,10 @@ BR2_STRIP_EXCLUDE_DIRS="" # BR2_OPTIMIZE_2 is not set # BR2_OPTIMIZE_3 is not set BR2_OPTIMIZE_S=y - -# -# Stack Smashing Protection needs a toolchain w/ SSP -# +BR2_SSP_NONE=y +# BR2_SSP_REGULAR is not set +# BR2_SSP_STRONG is not set +# BR2_SSP_ALL is not set # BR2_STATIC_LIBS is not set BR2_SHARED_LIBS=y # BR2_SHARED_STATIC_LIBS is not set @@ -124,7 +124,7 @@ BR2_GLOBAL_PATCH_DIR="" # Toolchain # BR2_TOOLCHAIN=y -BR2_TOOLCHAIN_USES_UCLIBC=y +BR2_TOOLCHAIN_USES_GLIBC=y BR2_TOOLCHAIN_BUILDROOT=y # BR2_TOOLCHAIN_EXTERNAL is not set BR2_TOOLCHAIN_BUILDROOT_VENDOR="buildroot" @@ -144,28 +144,15 @@ BR2_TOOLCHAIN_BUILDROOT_VENDOR="buildroot" BR2_KERNEL_HEADERS_4_4=y # BR2_KERNEL_HEADERS_VERSION is not set BR2_DEFAULT_KERNEL_HEADERS="4.4.3" -BR2_TOOLCHAIN_BUILDROOT_UCLIBC=y -# BR2_TOOLCHAIN_BUILDROOT_GLIBC is not set +# BR2_TOOLCHAIN_BUILDROOT_UCLIBC is not set +BR2_TOOLCHAIN_BUILDROOT_GLIBC=y # BR2_TOOLCHAIN_BUILDROOT_MUSL is not set -BR2_TOOLCHAIN_BUILDROOT_LIBC="uclibc" +BR2_TOOLCHAIN_BUILDROOT_LIBC="glibc" BR2_PACKAGE_LINUX_HEADERS=y -BR2_PACKAGE_UCLIBC=y - -# -# uClibc Options -# -BR2_UCLIBC_CONFIG="package/uclibc/uClibc-ng.config" -BR2_UCLIBC_CONFIG_FRAGMENT_FILES="" -# BR2_TOOLCHAIN_BUILDROOT_INET_RPC is not set -BR2_TOOLCHAIN_BUILDROOT_WCHAR=y -# BR2_TOOLCHAIN_BUILDROOT_LOCALE is not set -# BR2_PTHREADS_NONE is not set -BR2_PTHREADS_NATIVE=y -# BR2_PTHREAD_DEBUG is not set -# BR2_TOOLCHAIN_BUILDROOT_USE_SSP is not set -BR2_UCLIBC_INSTALL_UTILS=y -# BR2_UCLIBC_INSTALL_TEST_SUITE is not set -BR2_UCLIBC_TARGET_ARCH="x86_64" +BR2_PACKAGE_GLIBC=y +BR2_GLIBC_VERSION_2_21=y +# BR2_GLIBC_VERSION_2_22 is not set +BR2_GLIBC_VERSION_STRING="2.21" # # Binutils Options @@ -195,12 +182,17 @@ BR2_GCC_ENABLE_TLS=y # BR2_GCC_ENABLE_OPENMP is not set # BR2_GCC_ENABLE_GRAPHITE is not set # BR2_PACKAGE_HOST_GDB is not set +BR2_TOOLCHAIN_HAS_NATIVE_RPC=y BR2_USE_WCHAR=y +BR2_ENABLE_LOCALE=y BR2_TOOLCHAIN_HAS_THREADS=y +BR2_TOOLCHAIN_HAS_THREADS_DEBUG=y BR2_TOOLCHAIN_HAS_THREADS_NPTL=y BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS=y +BR2_TOOLCHAIN_HAS_SSP=y # BR2_ENABLE_LOCALE_PURGE is not set -BR2_NEEDS_GETTEXT=y +BR2_GENERATE_LOCALE="" +# BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY is not set BR2_USE_MMU=y BR2_TARGET_OPTIMIZATION="" BR2_TARGET_LDFLAGS="" @@ -256,10 +248,7 @@ BR2_TARGET_GENERIC_PASSWD_MD5=y BR2_TARGET_GENERIC_PASSWD_METHOD="md5" BR2_INIT_BUSYBOX=y # BR2_INIT_SYSV is not set - -# -# systemd needs (e)glibc toolchain, headers >= 3.10 -# +# BR2_INIT_SYSTEMD is not set # BR2_INIT_NONE is not set # BR2_ROOTFS_DEVICE_CREATION_STATIC is not set BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS=y @@ -461,10 +450,7 @@ BR2_PACKAGE_MPLAYER_ARCH_SUPPORTS=y # # Debugging, profiling and benchmark # - -# -# blktrace needs a (e)glibc or musl toolchain -# +# BR2_PACKAGE_BLKTRACE is not set # # bonnie++ needs a toolchain w/ C++ @@ -479,10 +465,7 @@ BR2_PACKAGE_MPLAYER_ARCH_SUPPORTS=y # duma needs a toolchain w/ C++, threads, dynamic library # # BR2_PACKAGE_FIO is not set - -# -# gdb/gdbserver needs a toolchain w/ threads, threads debug -# +# BR2_PACKAGE_GDB is not set BR2_PACKAGE_GOOGLE_BREAKPAD_ARCH_SUPPORTS=y # @@ -501,10 +484,7 @@ BR2_PACKAGE_GOOGLE_BREAKPAD_ARCH_SUPPORTS=y # BR2_PACKAGE_MCELOG is not set # BR2_PACKAGE_MEMSTAT is not set # BR2_PACKAGE_NETPERF is not set - -# -# netsniff-ng needs an (e)glibc toolchain w/ threads, headers >= 3.0 -# +# BR2_PACKAGE_NETSNIFF_NG is not set # # oprofile needs a toolchain w/ C++, wchar @@ -521,10 +501,7 @@ BR2_PACKAGE_GOOGLE_BREAKPAD_ARCH_SUPPORTS=y # BR2_PACKAGE_SPIDEV_TEST is not set # BR2_PACKAGE_STRACE is not set # BR2_PACKAGE_STRESS is not set - -# -# stress-ng needs a glibc toolchain w/ dynamic library, headers >= 3.3 -# +# BR2_PACKAGE_STRESS_NG is not set # # sysdig needs a toolchain w/ C++, gcc >= 4.7, dynamic library and a Linux kernel to be built @@ -575,10 +552,7 @@ BR2_PACKAGE_GETTEXT=y # # Filesystem and flash utilities # - -# -# autofs needs a toolchain w/ threads, RPC, dynamic library -# +# BR2_PACKAGE_AUTOFS is not set # BR2_PACKAGE_BTRFS_PROGS is not set # BR2_PACKAGE_CIFS_UTILS is not set # BR2_PACKAGE_CPIO is not set @@ -847,10 +821,7 @@ BR2_PACKAGE_QT5_JSCORE_AVAILABLE=y # BR2_PACKAGE_MINICOM is not set # BR2_PACKAGE_NANOCOM is not set # BR2_PACKAGE_NEARD is not set - -# -# nvidia-driver needs an (e)glibc toolchain -# +# BR2_PACKAGE_NVIDIA_DRIVER is not set # BR2_PACKAGE_OFONO is not set # @@ -945,6 +916,11 @@ BR2_PACKAGE_MONO_ARCH_SUPPORTS=y # BR2_PACKAGE_PERL is not set # BR2_PACKAGE_PHP is not set # BR2_PACKAGE_PYTHON is not set +# BR2_PACKAGE_PYTHON_PY_ONLY is not set +# BR2_PACKAGE_PYTHON_PYC_ONLY is not set +# BR2_PACKAGE_PYTHON_PY_PYC is not set +# BR2_PACKAGE_PYTHON_UCS2 is not set +# BR2_PACKAGE_PYTHON_UCS4 is not set # BR2_PACKAGE_PYTHON3 is not set # BR2_PACKAGE_RUBY is not set # BR2_PACKAGE_TCL is not set @@ -1501,6 +1477,10 @@ BR2_PACKAGE_CANFESTIVAL_ARCH_SUPPORTS=y # # czmq needs a toolchain w/ C++, wchar, threads # +BR2_PACKAGE_DPDK=y +BR2_PACKAGE_DPDK_CONFIG="x86_64-native-linuxapp-gcc" +# BR2_PACKAGE_DPDK_TEST is not set +BR2_PACKAGE_DPDK_EXAMPLES=y # # filemq needs a toolchain w/ C++, wchar, threads @@ -1581,10 +1561,7 @@ BR2_PACKAGE_CANFESTIVAL_ARCH_SUPPORTS=y # BR2_PACKAGE_LIBWEBSOCKETS is not set # BR2_PACKAGE_MONGOOSE is not set # BR2_PACKAGE_NEON is not set - -# -# nss-pam-ldapd needs an (e)glibc toolchain -# +# BR2_PACKAGE_NSS_PAM_LDAPD is not set # # omniORB needs a toolchain w/ C++, threads @@ -1629,7 +1606,6 @@ BR2_PACKAGE_CANFESTIVAL_ARCH_SUPPORTS=y # # BR2_PACKAGE_APR is not set # BR2_PACKAGE_APR_UTIL is not set -# BR2_PACKAGE_ARGP_STANDALONE is not set # # armadillo needs a toolchain w/ C++ @@ -1690,10 +1666,7 @@ BR2_PACKAGE_BOOST_ARCH_SUPPORTS=y BR2_PACKAGE_LIBATOMIC_OPS_ARCH_SUPPORTS=y # BR2_PACKAGE_LIBATOMIC_OPS is not set BR2_PACKAGE_LIBBSD_ARCH_SUPPORTS=y - -# -# libbsd needs an (e)glibc toolchain w/ threads -# +# BR2_PACKAGE_LIBBSD is not set # BR2_PACKAGE_LIBCAP is not set # BR2_PACKAGE_LIBCAP_NG is not set @@ -1745,14 +1718,8 @@ BR2_PACKAGE_LIBURCU_ARCH_SUPPORTS=y # BR2_PACKAGE_LIBURCU is not set # BR2_PACKAGE_LIBUV is not set # BR2_PACKAGE_LIGHTNING is not set - -# -# linux-pam needs a uClibc or (e)glibc toolchain w/ wchar, locale, dynamic library -# - -# -# liquid-dsp requires a (e)glibc/musl toolchain w/ dynamic library -# +# BR2_PACKAGE_LINUX_PAM is not set +# BR2_PACKAGE_LIQUID_DSP is not set # BR2_PACKAGE_LTTNG_LIBUST is not set # BR2_PACKAGE_MPC is not set # BR2_PACKAGE_MPDECIMAL is not set @@ -1806,7 +1773,6 @@ BR2_PACKAGE_PROTOBUF_ARCH_SUPPORTS=y # BR2_PACKAGE_LIBENCA is not set # BR2_PACKAGE_LIBESTR is not set # BR2_PACKAGE_LIBFRIBIDI is not set -BR2_PACKAGE_LIBICONV=y # BR2_PACKAGE_LIBUNISTRING is not set # BR2_PACKAGE_LINENOISE is not set # BR2_PACKAGE_NCURSES is not set @@ -1894,10 +1860,7 @@ BR2_PACKAGE_QEMU_HAS_EMULS=y # # BR2_PACKAGE_BIND is not set # BR2_PACKAGE_BLUEZ_UTILS is not set - -# -# bluez5-utils needs a glibc or musl toolchain w/ wchar, threads, headers >= 3.4, dynamic library -# +# BR2_PACKAGE_BLUEZ5_UTILS is not set # BR2_PACKAGE_BMON is not set # BR2_PACKAGE_BOA is not set BR2_PACKAGE_BRIDGE_UTILS=y @@ -2046,10 +2009,7 @@ BR2_PACKAGE_OPENSSH=y # BR2_PACKAGE_OPENVPN is not set # BR2_PACKAGE_P910ND is not set # BR2_PACKAGE_PHIDGETWEBSERVICE is not set - -# -# portmap needs a toolchain w/ RPC -# +# BR2_PACKAGE_PORTMAP is not set # BR2_PACKAGE_PPPD is not set # BR2_PACKAGE_PPTP_LINUX is not set # BR2_PACKAGE_PROFTPD is not set @@ -2067,10 +2027,7 @@ BR2_PACKAGE_OPENSSH=y # rtorrent needs a toolchain w/ C++, threads, wchar # # BR2_PACKAGE_RTPTOOLS is not set - -# -# samba4 needs a toolchain w/ RPC, wchar, dynamic library, threads -# +# BR2_PACKAGE_SAMBA4 is not set # # sconeserver needs a toolchain w/ C++, NPTL @@ -2243,10 +2200,7 @@ BR2_PACKAGE_INITSCRIPTS=y # BR2_PACKAGE_IRQBALANCE is not set # BR2_PACKAGE_KEYUTILS is not set # BR2_PACKAGE_KMOD is not set - -# -# kvmtool needs a (e)glibc or musl toolchain -# +# BR2_PACKAGE_KVMTOOL is not set # BR2_PACKAGE_LXC is not set # BR2_PACKAGE_MONIT is not set # BR2_PACKAGE_NCDU is not set @@ -2255,10 +2209,7 @@ BR2_PACKAGE_INITSCRIPTS=y # # nut needs a toolchain w/ C++ # - -# -# openvmtools needs an (e)glibc or musl toolchain w/ wchar, threads, RPC, locale -# +# BR2_PACKAGE_OPENVMTOOLS is not set # BR2_PACKAGE_POLKIT is not set # BR2_PACKAGE_PWGEN is not set # BR2_PACKAGE_QUOTA is not set @@ -2271,10 +2222,7 @@ BR2_PACKAGE_INITSCRIPTS=y # BR2_PACKAGE_SWUPDATE is not set BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS=y # BR2_PACKAGE_TPM_TOOLS is not set - -# -# unscd needs an (e)glibc toolchain -# +# BR2_PACKAGE_UNSCD is not set # BR2_PACKAGE_UTIL_LINUX is not set # diff --git a/resources/tools/disk-image-builder/nested/buildroot-patches/dpdk.patch b/resources/tools/disk-image-builder/nested/buildroot-patches/dpdk.patch new file mode 100644 index 0000000000..29b8bb8de5 --- /dev/null +++ b/resources/tools/disk-image-builder/nested/buildroot-patches/dpdk.patch @@ -0,0 +1,214 @@ +diff --git a/package/Config.in b/package/Config.in +index 6fc0466..ab38a76 100644 +--- a/package/Config.in ++++ b/package/Config.in +@@ -1095,6 +1095,7 @@ menu "Networking" + source "package/cgic/Config.in" + source "package/cppzmq/Config.in" + source "package/czmq/Config.in" ++ source "package/dpdk/Config.in" + source "package/filemq/Config.in" + source "package/flickcurl/Config.in" + source "package/fmlib/Config.in" +diff --git a/package/dpdk/Config.in b/package/dpdk/Config.in +new file mode 100644 +index 0000000..a42271e +--- /dev/null ++++ b/package/dpdk/Config.in +@@ -0,0 +1,54 @@ ++config BR2_PACKAGE_DPDK ++ bool "dpdk" ++ depends on (BR2_i386 && !BR2_x86_i386 && !BR2_x86_i486 \ ++ && !BR2_x86_i586 && !BR2_x86_x1000) \ ++ || BR2_x86_64 || BR2_ARM_CPU_ARMV7A || BR2_aarch64 \ ++ || BR2_aarch64_be ++ depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_UCLIBC ++ depends on BR2_TOOLCHAIN_HAS_SYNC_1 ++ depends on BR2_TOOLCHAIN_HAS_SYNC_2 ++ depends on BR2_TOOLCHAIN_HAS_SYNC_4 ++ depends on BR2_TOOLCHAIN_HAS_SYNC_8 ++ help ++ DPDK is a set of libraries and drivers for fast packet processing. It ++ was designed to run on any processors, however, Intel x86 has been the ++ first CPU to be supported. Ports for other CPUs like IBM Power 8 and ++ ARM are under progress. It runs mostly in Linux userland. A FreeBSD ++ port is now available for a subset of DPDK features. ++ ++ Notes: ++ * To build the included Linux Kernel drivers, it is necessary to ++ enable CONFIG_PCI_MSI, CONFIG_UIO. ++ * To build the PCAP PMD properly, you need to enable the libpcap ++ manually. ++ * You may need to install the python2 interpreter if you want to use ++ scripts dpdk_nic_bind.py and cpu_layout.py ++ ++ http://www.dpdk.org/ ++ ++if BR2_PACKAGE_DPDK ++ ++config BR2_PACKAGE_DPDK_CONFIG ++ string "Configuration" ++ default "i686-native-linuxapp-gcc" \ ++ if BR2_x86_i686 ++ default "x86_64-native-linuxapp-gcc" \ ++ if BR2_x86_64 ++ default "arm-armv7a-linuxapp-gcc" \ ++ if BR2_ARM_CPU_ARMV7A ++ default "arm64-armv8a-linuxapp-gcc" \ ++ if BR2_aarch64 || BR2_aarch64_be ++ ++config BR2_PACKAGE_DPDK_TEST ++ bool "Install tests suite" ++ select BR2_PACKAGE_PYTHON_PEXPECT if BR2_PACKAGE_PYTHON ++ help ++ Install all DPDK tests. If you want to run the tests by the included ++ autotest.py script you need to enable python manually. ++ ++config BR2_PACKAGE_DPDK_EXAMPLES ++ bool "Build & install examples" ++ help ++ Build and install all examples selected by the current configuration. ++ ++endif +diff --git a/package/dpdk/dpdk.hash b/package/dpdk/dpdk.hash +new file mode 100644 +index 0000000..1c47f19 +--- /dev/null ++++ b/package/dpdk/dpdk.hash +@@ -0,0 +1,2 @@ ++# Locally calculated ++sha256 d631495bc6e8d4c4aec72999ac03c3ce213bb996cb88f3bf14bb980dad1d3f7b dpdk-16.04.tar.gz +diff --git a/package/dpdk/dpdk.mk b/package/dpdk/dpdk.mk +new file mode 100644 +index 0000000..02860fd +--- /dev/null ++++ b/package/dpdk/dpdk.mk +@@ -0,0 +1,128 @@ ++################################################################################ ++# ++# dpdk ++# ++################################################################################ ++ ++DPDK_VERSION = 16.04 ++DPDK_SITE = http://dpdk.org/browse/dpdk/snapshot ++DPDK_SOURCE = dpdk-$(DPDK_VERSION).tar.gz ++ ++DPDK_LICENSE = BSD (core), GPLv2+ (Linux drivers) ++DPDK_LICENSE_FILES = GNUmakefile LICENSE.GPL ++DPDK_INSTALL_STAGING = YES ++ ++DPDK_DEPENDENCIES += linux ++ ++ifeq ($(BR2_PACKAGE_LIBPCAP),y) ++DPDK_DEPENDENCIES += libpcap ++endif ++ ++ifeq ($(BR2_SHARED_LIBS),y) ++define DPDK_ENABLE_SHARED_LIBS ++ $(call KCONFIG_ENABLE_OPT,CONFIG_RTE_BUILD_SHARED_LIB,\ ++ $(@D)/build/.config) ++endef ++ ++DPDK_POST_CONFIGURE_HOOKS += DPDK_ENABLE_SHARED_LIBS ++endif ++ ++# We're building a kernel module without using the kernel-module infra, ++# so we need to tell we want module support in the kernel ++ifeq ($(BR2_PACKAGE_DPDK),y) ++LINUX_NEEDS_MODULES = y ++endif ++ ++DPDK_CONFIG = $(call qstrip,$(BR2_PACKAGE_DPDK_CONFIG)) ++ ++ifeq ($(BR2_PACKAGE_DPDK_EXAMPLES),y) ++# Build of DPDK examples is not very straight-forward. It requires to have ++# the SDK and runtime installed on same place to reference it by RTE_SDK. ++# We place it locally in the build directory. ++# In additition, some examples seem to have a dependency on the ethtool ++# example that may not be met when building in parallel for the first ++# time. As a (dirty) workaround, we build twice. ++define DPDK_BUILD_EXAMPLES ++ $(MAKE) -C $(@D) DESTDIR=$(@D)/examples-sdk \ ++ CROSS=$(TARGET_CROSS) install-sdk install-runtime ++ $(MAKE) -C $(@D) RTE_KERNELDIR=$(LINUX_DIR) CROSS=$(TARGET_CROSS) \ ++ RTE_SDK=$(@D)/examples-sdk/usr/local/share/dpdk \ ++ T=$(DPDK_CONFIG) examples || echo "Failed, building again" ++ $(MAKE) -C $(@D) RTE_KERNELDIR=$(LINUX_DIR) CROSS=$(TARGET_CROSS) \ ++ RTE_SDK=$(@D)/examples-sdk/usr/local/share/dpdk \ ++ T=$(DPDK_CONFIG) examples ++endef ++ ++DPDK_EXAMPLES_PATH = $(@D)/examples-sdk/usr/local/share/dpdk/examples ++ ++# Installation of examples is not supported in DPDK so we do it explicitly ++# here. As the binaries and libraries do not have a single or regular location ++# where to find them after build, we search for them by find. ++define DPDK_INSTALL_EXAMPLES ++ $(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/local/bin ++ $(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/local/lib ++ for f in `find $(DPDK_EXAMPLES_PATH) -executable -type f \ ++ -name '[a-z]*.so*' | grep '\/lib\/.*'`; do \ ++ $(INSTALL) -m 0755 -D $$f \ ++ $(TARGET_DIR)/usr/local/lib/`basename $$f`;\ ++ done ++ for f in `find $(DPDK_EXAMPLES_PATH) -executable -type f \ ++ ! -name '*.so*' | grep '\/app\/.*'`; do \ ++ $(INSTALL) -m 0755 -D $$f \ ++ $(TARGET_DIR)/usr/local/bin/`basename $$f`;\ ++ done ++endef ++ ++define DPDK_INSTALL_KMOD ++ $(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/local/kmod ++ for f in `find $(@D)/build/kmod -name '*.ko'` ; do \ ++ $(INSTALL) -m 0755 -D $$f \ ++ $(TARGET_DIR)/usr/local/kmod/`basename $$f`; \ ++ done ++endef ++ ++# Build of the power example is broken (at least for 16.04). ++define DPDK_DISABLE_POWER ++ $(call KCONFIG_DISABLE_OPT,CONFIG_RTE_LIBRTE_POWER,\ ++ $(@D)/build/.config) ++endef ++ ++DPDK_POST_CONFIGURE_HOOKS += DPDK_DISABLE_POWER ++endif ++ ++define DPDK_CONFIGURE_CMDS ++ $(MAKE) -C $(@D) T=$(DPDK_CONFIG) RTE_KERNELDIR=$(LINUX_DIR) \ ++ CROSS=$(TARGET_CROSS) config ++endef ++ ++define DPDK_BUILD_CMDS ++ $(TARGET_MAKE_ENV) LDFLAGS="$(TARGET_LDFLAGS)" $(MAKE) \ ++ DBM_INCLUDE="$(STAGING_DIR)/usr/include" \ ++ CCOPTS="$(TARGET_CFLAGS) -D_GNU_SOURCE" \ ++ SHARED_LIBS="$(if $(BR2_STATIC_LIBS),n,y)" -C $(@D) \ ++ RTE_KERNELDIR=$(LINUX_DIR) CROSS=$(TARGET_CROSS) ++ $(DPDK_BUILD_EXAMPLES) ++endef ++ ++define DPDK_INSTALL_STAGING_CMDS ++ $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) prefix=/usr \ ++ CROSS=$(TARGET_CROSS) install-sdk ++endef ++ ++ifeq ($(BR2_PACKAGE_DPDK_TEST),y) ++define DPDK_INSTALL_TARGET_TEST ++ $(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/dpdk ++ $(INSTALL) -m 0755 -D $(@D)/build/app/test $(TARGET_DIR)/usr/dpdk ++ $(INSTALL) -m 0755 -D $(@D)/app/test/*.py $(TARGET_DIR)/usr/dpdk ++endef ++endif ++ ++define DPDK_INSTALL_TARGET_CMDS ++ $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) prefix=/usr \ ++ CROSS=$(TARGET_CROSS) install-runtime ++ $(DPDK_INSTALL_KMOD) ++ $(DPDK_INSTALL_TARGET_TEST) ++ $(DPDK_INSTALL_EXAMPLES) ++endef ++ ++$(eval $(generic-package)) diff --git a/resources/tools/disk-image-builder/nested/patches/01-serial-console b/resources/tools/disk-image-builder/nested/image-patches/01-serial-console index 99b6f7f3c8..99b6f7f3c8 100755 --- a/resources/tools/disk-image-builder/nested/patches/01-serial-console +++ b/resources/tools/disk-image-builder/nested/image-patches/01-serial-console diff --git a/resources/tools/disk-image-builder/nested/patches/02-users b/resources/tools/disk-image-builder/nested/image-patches/02-users index 9b7db0969a..9b7db0969a 100755 --- a/resources/tools/disk-image-builder/nested/patches/02-users +++ b/resources/tools/disk-image-builder/nested/image-patches/02-users diff --git a/resources/tools/disk-image-builder/nested/patches/03-network b/resources/tools/disk-image-builder/nested/image-patches/03-network index ca5c4f952d..ca5c4f952d 100755 --- a/resources/tools/disk-image-builder/nested/patches/03-network +++ b/resources/tools/disk-image-builder/nested/image-patches/03-network diff --git a/resources/tools/disk-image-builder/nested/patches/04-qemu-ga b/resources/tools/disk-image-builder/nested/image-patches/04-qemu-ga index 2897260d10..2897260d10 100755 --- a/resources/tools/disk-image-builder/nested/patches/04-qemu-ga +++ b/resources/tools/disk-image-builder/nested/image-patches/04-qemu-ga diff --git a/resources/tools/disk-image-builder/nested/patches/05-ssh-hostkeys b/resources/tools/disk-image-builder/nested/image-patches/05-ssh-hostkeys index de8be15798..de8be15798 100755 --- a/resources/tools/disk-image-builder/nested/patches/05-ssh-hostkeys +++ b/resources/tools/disk-image-builder/nested/image-patches/05-ssh-hostkeys diff --git a/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support b/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support new file mode 100755 index 0000000000..99ac0e14e3 --- /dev/null +++ b/resources/tools/disk-image-builder/nested/image-patches/06-dpdk-support @@ -0,0 +1,78 @@ +#!/bin/sh + +### This may be a temporary file. Once DPDK is working stable in the nested +### VM, and if and when ### we decide we want to do all testing with DPDK, +### the steps executed here may become default configuration for the image. +### +### For now, to give us the flexibility to work with and without DPDK, keep +### this as a separate script. + +DPDK_START_FILE="start-testpmd.sh" +DPDK_STOP_FILE="stop-testpmd.sh" + +cat - > ${DPDK_START_FILE} <<"_EOF" +#!/bin/sh + +TARGET_DRIVER="igb_uio" +PATH_TO_IGB_UIO_MODULE="/usr/local/kmod/igb_uio.ko" +NUM_HUGEPAGES=512 +TESTPMD_LOG=/tmp/testpmd.log +TESTPMD_PID=/tmp/testpmd.pid + +if [ -f ${TESTPMD_PID} ] +then + echo Testpmd is already running. Please stop running instance first. + echo Delete PID file ${TESTPMD_PID} if you are sure this is a stale PID file. + exit 1 +fi + +# Load igb_uio module if this is the driver we want to use +if [ "${TARGET_DRIVER}" = "igb_uio" ] +then + insmod ${PATH_TO_IGB_UIO_MODULE} +fi + +# Set up hugepages +echo "vm.nr_hugepages = ${NUM_HUGEPAGES}" > /etc/sysctl.conf +sysctl -p +mkdir -p /mnt/huge +grep -q hugetlbfs /etc/fstab || echo "hugetlbfs /mnt/huge hugetlbfs mode=1770,gid=2021 0 0" >> /etc/fstab +mount -a + +# +echo 1af4 1000 > /sys/bus/pci/drivers/${TARGET_DRIVER}/new_id +# +for dev in $(find /sys/bus/pci/drivers/virtio-pci -type l -name '*:*:*.*' | sed -e 's/.*\///') +do + echo Unbinding $dev from virtio-pci + echo $dev > /sys/bus/pci/drivers/virtio-pci/unbind + echo Binding $dev to ${TARGET_DRIVER} + echo $dev > /sys/bus/pci/drivers/${TARGET_DRIVER}/bind +done + +# Start testpmd in the background. This looks a bit convoluted; we need to redirect stdin +# (and keep stdin active) or else testpmd will quit. +tail -f /dev/null | nohup testpmd $@ > ${TESTPMD_LOG} 2>&1 & +echo $! > ${TESTPMD_PID} +_EOF + +cat - > ${DPDK_STOP_FILE} <<"_EOF" +#!/bin/sh + +TESTPMD_LOG=/tmp/testpmd.log +TESTPMD_PID=/tmp/testpmd.pid + +if [ ! -f ${TESTPMD_PID} ] +then + echo Testpmd is not running. + exit 1 +fi + +kill $(cat ${TESTPMD_PID}) +rm -f ${TESTPMD_PID} + +cat ${TESTPMD_LOG} +_EOF + +chmod 755 ${DPDK_START_FILE} +chmod 755 ${DPDK_STOP_FILE} diff --git a/resources/tools/disk-image-builder/nested/kernel-defconfig b/resources/tools/disk-image-builder/nested/kernel-defconfig index 7fd03d3e45..85beb9f56f 100644 --- a/resources/tools/disk-image-builder/nested/kernel-defconfig +++ b/resources/tools/disk-image-builder/nested/kernel-defconfig @@ -307,6 +307,9 @@ CONFIG_SECURITY_SELINUX=y CONFIG_SECURITY_SELINUX_BOOTPARAM=y CONFIG_SECURITY_SELINUX_DISABLE=y # CONFIG_CRYPTO_ANSI_CPRNG is not set +## +## Our modifications +## CONFIG_VIRTIO_PCI=y CONFIG_VIRTIO_BALLOON=y CONFIG_VIRTIO_BLK=y @@ -315,3 +318,8 @@ CONFIG_VIRTIO=y CONFIG_VIRTIO_RING=y CONFIG_BRIDGE=y CONFIG_IP_FORWARD=y +CONFIG_PCI_MSI=y +CONFIG_UIO=y +CONFIG_UIO_PCI_GENERIC=y +# CONFIG_VFIO is not set +# CONFIG_VFIO_PCI is not set |