From 0701c27addcbdb9c692baa9ed018847d0e1a1e49 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt <stefan.schmidt@huawei.com> Date: Mon, 12 Jul 2021 11:02:56 +0200 Subject: [PATCH] jool: Add initial recipes for jool NAT64 user-space tools and kernel modules The jool project contains three different types of outputs. User-space tools, iptables plugins and kernel modules. The first two are handled by the main jool recipe while the later one is handled by jool-kmod. The git tag for version 4.1.5 is used. Signed-off-by: Stefan Schmidt <stefan.schmidt@huawei.com> --- .../jool/jool-kmod_git.bb | 36 +++++++++++++++++++ .../recipes-connectivity/jool/jool.inc | 10 ++++++ ...hanges-to-be-handled-by-yocto-recipe.patch | 22 ++++++++++++ .../recipes-connectivity/jool/jool_git.bb | 33 +++++++++++++++++ 4 files changed, 101 insertions(+) create mode 100644 meta-ohos-staging/recipes-connectivity/jool/jool-kmod_git.bb create mode 100644 meta-ohos-staging/recipes-connectivity/jool/jool.inc create mode 100644 meta-ohos-staging/recipes-connectivity/jool/jool/0001-Build-system-changes-to-be-handled-by-yocto-recipe.patch create mode 100644 meta-ohos-staging/recipes-connectivity/jool/jool_git.bb diff --git a/meta-ohos-staging/recipes-connectivity/jool/jool-kmod_git.bb b/meta-ohos-staging/recipes-connectivity/jool/jool-kmod_git.bb new file mode 100644 index 00000000..32eb3ae1 --- /dev/null +++ b/meta-ohos-staging/recipes-connectivity/jool/jool-kmod_git.bb @@ -0,0 +1,36 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +include jool.inc + +DESCRIPTION = "Jool SIIT and NAT64 kernel modules for Linux." + +LIC_FILES_CHKSUM = "file://../../COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +S = "${WORKDIR}/git/src/mod/" + +DEPENDS = "virtual/kernel" + +inherit module + +EXTRA_OEMAKE += "KERNEL_DIR=${STAGING_KERNEL_DIR} \ + KERNEL_PATH=${STAGING_KERNEL_DIR} \ + KERNEL_VERSION=${KERNEL_VERSION} \ + CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ + AR="${KERNEL_AR}" \ + O=${STAGING_KERNEL_BUILDDIR} \ + KBUILD_EXTRA_SYMBOLS="${B}/common/Module.symvers" \ + " + +MODULES_MODULE_SYMVERS_LOCATION="common/Module.symvers" + +module_do_compile () { + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS + # There is a race exposed in parallel build if the common module is not + # build first. It provides the Module.symvers file which the siit and + # nat64 modules depend on. Which means we run this first to build the + # dependency and the rest with the second command. + oe_runmake -C common + oe_runmake ${MAKE_TARGETS} +} diff --git a/meta-ohos-staging/recipes-connectivity/jool/jool.inc b/meta-ohos-staging/recipes-connectivity/jool/jool.inc new file mode 100644 index 00000000..5c4786a7 --- /dev/null +++ b/meta-ohos-staging/recipes-connectivity/jool/jool.inc @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +SECTION = "networking" +LICENSE = "GPLv2" + +# This SRCREV is the 4.1.5 git tag revision +SRCREV = "34ffbf56a0c8bd53c4cb554e102a9084b301170e" +SRC_URI = "git://github.com/NICMx/Jool.git" diff --git a/meta-ohos-staging/recipes-connectivity/jool/jool/0001-Build-system-changes-to-be-handled-by-yocto-recipe.patch b/meta-ohos-staging/recipes-connectivity/jool/jool/0001-Build-system-changes-to-be-handled-by-yocto-recipe.patch new file mode 100644 index 00000000..fa96f1b7 --- /dev/null +++ b/meta-ohos-staging/recipes-connectivity/jool/jool/0001-Build-system-changes-to-be-handled-by-yocto-recipe.patch @@ -0,0 +1,22 @@ +From 0667a0934bafb626d3abd7c5eebdc93b287e47bc Mon Sep 17 00:00:00 2001 +From: Stefan Schmidt <stefan.schmidt@huawei.com> +Date: Thu, 8 Jul 2021 15:24:02 +0200 +Subject: [PATCH] Build system changes to be handled by yocto recipe + +Leave iptables subdir out do be handled manually as it is not integrated +in autotools. + +Upstream-Status: Inappropriate [other] + +Signed-off-by: Stefan Schmidt <stefan.schmidt@huawei.com> +--- + src/usr/Makefile.am | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/src/usr/Makefile.am b/src/usr/Makefile.am +index 7f4758ce..f6b1cdf0 100644 +--- a/src/usr/Makefile.am ++++ b/src/usr/Makefile.am +@@ -1 +1,1 @@ +-SUBDIRS = util nl argp siit nat64 iptables joold ++SUBDIRS = util nl argp siit nat64 joold diff --git a/meta-ohos-staging/recipes-connectivity/jool/jool_git.bb b/meta-ohos-staging/recipes-connectivity/jool/jool_git.bb new file mode 100644 index 00000000..7a241c03 --- /dev/null +++ b/meta-ohos-staging/recipes-connectivity/jool/jool_git.bb @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +include jool.inc + +DESCRIPTION = "Jool is an Open Source SIIT and NAT64 for Linux." + +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +SRC_URI += "file://0001-Build-system-changes-to-be-handled-by-yocto-recipe.patch" + +S = "${WORKDIR}/git" + +DEPENDS = "libnl iptables" +DEPENDS_append_libc-musl = " argp-standalone" + +inherit pkgconfig autotools + +CFLAGS += "-I${STAGING_INCDIR}" +LDFLAGS += "-L${STAGING_LIBDIR}" + +do_compile_append () { + oe_runmake -C ${S}/src/usr/iptables/ +} + +do_install_append () { + install -d ${D}/${libdir}/xtables + install ${S}/src/usr/iptables/*.so ${D}/${libdir}/xtables +} + +FILES_${PN} += "${datadir}/bash-completion" +FILES_${PN} += "${libdir}/xtables/*.so" -- GitLab