diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-09-29 09:57:13 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-09-29 14:40:49 +0200 |
commit | 1264144c999ae5cd1bda04376d6d59c25bff9dc1 (patch) | |
tree | fd3ed2f65731d80ed3b9ca7e631085054b75580d | |
parent | d1ebc04774747fb242ae02bcfa51dcfaf5bffd18 (diff) |
utilize RTE_EAL_PMD_PATH
This sets RTE_EAL_PMD_PATH to /usr/lib/$(shell dpkg-architecture
-qDEB_HOST_MULTIARCH)/dpdk-pmds.
On creating the pmd library packages those get a symlink from that dir.
This allows DPDK applications to autoload pmd drivers and only rely on
the EAL -d option for those provided in other places (e.g. custom
drivers).
By that one can use testpmd/l2fwd/openvswitch-dpdk and others without
passing -d <full-path-to-pmd.so> to EAL.
Each lib gets an extra relative symlink from the RTE_EAL_PMD_PATH dir to
the lib itself e.g. for librte_vhost:
./usr/lib/x86_64-linux-gnu/dpdk-pmds/
./usr/lib/x86_64-linux-gnu/dpdk-pmds/librte_vhost.so.3 -> ../librte_vhost.so.3
Change-Id: Idf997e58cfa5060961239b3ee0c22de89e0ed1a3
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
-rwxr-xr-x | debian/rules | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/debian/rules b/debian/rules index 064ffc3b..e4684928 100755 --- a/debian/rules +++ b/debian/rules @@ -129,6 +129,7 @@ ifeq (,$(filter dpdk_config=%,$(DEB_BUILD_OPTIONS))) -e 's,(CONFIG_RTE_KNI_KMOD=).*,\1$(DPDK_CONFIG_BUILD_KMOD),' \ -e 's,(LIBRTE_PMD_PCAP=).*,\1y,' \ -e 's,(LIBRTE_PMD_XENVIRT=).*,\1y,' \ + -e 's,(CONFIG_RTE_EAL_PMD_PATH=).*,\1"/usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/dpdk-pmds/",' \ $(DPDK_STATIC_DIR)/.config # xen not available on ppc64el ifneq (,$(filter $(DEB_HOST_ARCH), ppc64el)) @@ -206,9 +207,16 @@ override_dh_auto_install-arch: else \ PKG=$${LN}$${VER}; \ fi; \ + LIBF="$$(basename $${lib})"; \ + LIBD="debian/$${PKG}/$(LIBDIR)"; \ echo "moving $${lib} for library $${PKG}"; \ - mkdir -p debian/$${PKG}/$(LIBDIR); \ - mv $${lib} debian/$${PKG}/$(LIBDIR); \ + mkdir -p $${LIBD}; \ + mv $${lib} $${LIBD}; \ + if [ "$${LIBF#librte_pmd_}x" != "$${LIBF}x" ]; then \ + mkdir -p $${LIBD}/dpdk-pmds; \ + echo "PMD: linking $${LIBF} into RTE_EAL_PMD_PATH at $${LIBD}/dpdk-pmds/"; \ + ln -s --relative --target-directory=$${LIBD}/dpdk-pmds/ $${LIBD}/$${LIBF}; \ + fi; \ done # pkg-config mkdir -p debian/libdpdk-dev/$(LIBDIR)/pkgconfig |