aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-kernel
diff options
context:
space:
mode:
authorJackie Huang <jackie.huang@windriver.com>2015-11-18 18:02:21 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2015-11-30 13:11:17 -0500
commit636af36e70f2041b38080c3d6a9907bfa076cb35 (patch)
tree5b956a4bd01514dff6020d01717abdafe4347048 /meta-networking/recipes-kernel
parent352755e2b7d512f043df798d986f4ad46bd87e0e (diff)
downloadmeta-openembedded-contrib-636af36e70f2041b38080c3d6a9907bfa076cb35.tar.gz
netmap-modules: make deterministic builds for drivers
The driver builds are optional, but for deterministic builds, we should should be able to explicitly enable/disable the builds for them in a proper place (maybe in BSP). But we can't use PACKAGECONFIG since there is no option for each driver, and the options are: --no-drivers do not compile any driver --no-drivers= do not compile the given drivers (comma sep.) --drivers= only compile the given drivers (comma sep.) So use NETMAP_DRIVERS to list the needed drivers and add proper configs to EXTRA_OECONF, the default is no drivers, and all supported drivers are listed in NETMAP_ALL_DRIVERS. Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-kernel')
-rw-r--r--meta-networking/recipes-kernel/netmap/netmap-modules_git.bb26
1 files changed, 25 insertions, 1 deletions
diff --git a/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb b/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb
index 6365fee920..23f3094afa 100644
--- a/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb
+++ b/meta-networking/recipes-kernel/netmap/netmap-modules_git.bb
@@ -15,7 +15,31 @@ EXTRA_OECONF = "--kernel-dir=${STAGING_KERNEL_BUILDDIR} \
--driver-suffix="-netmap" \
"
-EXTRA_OECONF += "--no-drivers=ixgbe --no-drivers=virtio_net.c"
+# The driver builds are optional, but for deterministic builds,
+# we should be able to explicitly enable/disable the builds
+# for them in a proper place (maybe in BSP).
+# But we can't use PACKAGECONFIG since there is no option for
+# each driver, and the options are:
+# --no-drivers do not compile any driver
+# --no-drivers= do not compile the given drivers (comma sep.)
+# --drivers= only compile the given drivers (comma sep.)
+#
+# So use NETMAP_DRIVERS and the following python code to add proper
+# configs to EXTRA_OECONF.
+#
+# The default is no-drivers, and all supported drivers are listed
+# in NETMAP_ALL_DRIVERS.
+NETMAP_DRIVERS ??= ""
+NETMAP_ALL_DRIVERS = "ixgbe igb e1000e e1000 veth.c forcedeth.c virtio_net.c r8169.c"
+
+python __anonymous () {
+ drivers_list = d.getVar("NETMAP_DRIVERS", True).split()
+ all_drivers_list = d.getVar("NETMAP_ALL_DRIVERS", True).split()
+ config_drivers = "--drivers=" + ",".join(drivers_list)
+
+ extra_oeconf_drivers = bb.utils.contains_any('NETMAP_DRIVERS', all_drivers_list, config_drivers, '--no-drivers', d)
+ d.appendVar("EXTRA_OECONF", extra_oeconf_drivers)
+}
LDFLAGS := "${@'${LDFLAGS}'.replace('-Wl,-O1', '')}"
LDFLAGS := "${@'${LDFLAGS}'.replace('-Wl,--as-needed', '')}"