- mkdir -p $$(1)/lib/modules/$(LINUX_VERSION)
- $(CP) -L $$(FILES) $$(1)/lib/modules/$(LINUX_VERSION)/
+ @for mod in $$(FILES); do \
+ if [ -e $$$$$$$$mod ]; then \
+ mkdir -p $$(1)/$(MODULES_SUBDIR) ; \
+ $(CP) -L $$$$$$$$mod $$(1)/$(MODULES_SUBDIR)/ ; \
+ elif [ -e "$(LINUX_DIR)/modules.builtin" ]; then \
+ if grep -q "$$$$$$$${mod##$(LINUX_DIR)/}" "$(LINUX_DIR)/modules.builtin"; then \
+ echo "NOTICE: module '$$$$$$$$mod' is built-in."; \
+ else \
+ echo "ERROR: module '$$$$$$$$mod' is missing."; \
+ exit 1; \
+ fi; \
+ else \
+ echo "WARNING: module '$$$$$$$$mod' missing and modules.builtin not available, assuming built-in."; \
+ fi; \
+ done;