On 09/18/2015 11:33 PM, Mario Carrillo wrote: > Add hierarchy-file support to the DPDK modules for linux, > when invoking "make install H=1" (hierarchy-file) > > This hierarchy is based on: > http://www.freedesktop.org/software/systemd/man/file-hierarchy.html > > headers will be installed in: $(DESTDIR)/lib/modules > > Signed-off-by: Mario Carrillo <mario.alfredo.c.arevalo at intel.com> > --- > mk/rte.module.mk | 8 ++++++++ > mk/rte.sdkinstall.mk | 4 ++++ > 2 files changed, 12 insertions(+) > > diff --git a/mk/rte.module.mk b/mk/rte.module.mk > index 7bf77c1..4fc43ba 100644 > --- a/mk/rte.module.mk > +++ b/mk/rte.module.mk > @@ -59,6 +59,14 @@ compare = $(strip $(subst $(1),,$(2)) $(subst $(2),,$(1))) > > .PHONY: all > all: install > +# > +# if H (hierarchy-file) varible is equal "1" > +# install modules in /lib/modules/$(KERNEL_DIR). > +# > +ifeq ($(H),1) > + @[ -d $(MOD_DIR)/$(KERNEL_DIR) ] || mkdir -p $(MOD_DIR)/$(KERNEL_DIR) > + $(Q)cp -f $(MODULE).ko $(MOD_DIR)/$(KERNEL_DIR) > +endif > > .PHONY: install > install: build _postinstall > diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk > index b506959..5ddc3f7 100644 > --- a/mk/rte.sdkinstall.mk > +++ b/mk/rte.sdkinstall.mk > @@ -59,6 +59,8 @@ DATA_DIR := $(DESTDIR)/usr/share > INCLUDE_DIR := $(DESTDIR)/usr/include > SBIN_DIR := $(DESTDIR)/usr/sbin > BIN_DIR := $(DESTDIR)/usr/bin > +MOD_DIR := $(DESTDIR)/lib/modules > +KERNEL_DIR := $(shell uname -r)/extra
Please don't assume one is always building for the running kernel. Defaulting around uname -r is perfectly reasonable, but there needs to be a way to override it from the cli. For example rte.vars.mk has this: # can be overriden by make command line or exported environment variable RTE_KERNELDIR ?= /lib/modules/$(shell uname -r)/build - Panu -