build scripts: fix 'make defconfig' damage
[openwrt/openwrt.git] / include / kernel.mk
index 8df70ba5f683795016e154dfca281bfc9e507ea2..5442c9153f2aeb415fd146bc33e48a95a576ac48 100644 (file)
@@ -105,7 +105,7 @@ define ModuleAutoLoad
                echo "#!/bin/sh" > $(2)/CONTROL/postinst; \
                echo "[ -z \"\$$$$$$$$IPKG_INSTROOT\" ] || exit 0" >> $(2)/CONTROL/postinst; \
                echo ". /lib/functions.sh" >> $(2)/CONTROL/postinst; \
-               echo "load_modules $$$$$$$$modules" >> $(2)/CONTROL/postinst; \
+               echo "insert_modules $$$$$$$$modules" >> $(2)/CONTROL/postinst; \
                chmod 0755 $(2)/CONTROL/postinst; \
        fi
 endef
@@ -163,11 +163,11 @@ $(call KernelPackage/$(1)/config)
                                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."; \
+                                       echo "ERROR: module '$$$$$$$$mod' is missing." >&2; \
                                        exit 1; \
                                fi; \
                        else \
-                               echo "WARNING: module '$$$$$$$$mod' missing and modules.builtin not available, assuming built-in."; \
+                               echo "WARNING: module '$$$$$$$$mod' missing and modules.builtin not available, assuming built-in." >&2; \
                        fi; \
                  done;
                  $(call ModuleAutoLoad,$(1),$$(1),$(AUTOLOAD))
@@ -176,9 +176,13 @@ $(call KernelPackage/$(1)/config)
     endif
   $(if $(CONFIG_PACKAGE_kmod-$(1)),
     else
-      compile: kmod-$(1)-unavailable
-      kmod-$(1)-unavailable:
-               @echo "WARNING: kmod-$(1) is not available in the kernel config"
+      compile: $(1)-disabled
+      $(1)-disabled:
+               @echo "WARNING: kmod-$(1) is not available in the kernel config - generating empty package" >&2
+
+      define Package/kmod-$(1)/install
+               true
+      endef
   )
   endif
   $$(eval $$(call BuildPackage,kmod-$(1)))