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 0000000000000000000000000000000000000000..32eb3ae146acbcff43564b75908d55f5e39109f7 --- /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 0000000000000000000000000000000000000000..5c4786a7f41221fc02bde1d18661bdb0ca02d105 --- /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 0000000000000000000000000000000000000000..fa96f1b7669c8971dc5f418f0615ebce7ef9fae8 --- /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 0000000000000000000000000000000000000000..7a241c03292709f2e7ae598730ec310ae379c0c8 --- /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"