fix bug in imagebuilder init.d scripts
[openwrt/svn-archive/archive.git] / target / imagebuilder / files / Makefile
index 7b35e545dddcc30dca4a5a11d0ce1cc114a29718..7dfc06c4c55d9f9356238376258c85a224f17470 100644 (file)
@@ -20,6 +20,7 @@ ifeq ($(KBUILD_VERBOSE),99)
   MAKE:=3>/dev/null $(MAKE)
 endif
 export IS_TTY=$(shell tty -s && echo 1 || echo 0)
+export IMAGEBUILDER=1
 
 # override variables from rules.mk
 PACKAGE_DIR:=$(TOPDIR)/packages
@@ -34,10 +35,11 @@ IPKG:= \
 define Profile/Default
   ID:=
   NAME:=
+  KCONFIG:=
   PACKAGES:=
 endef
 
-define Profile
+define AddProfile
   $(eval $(call Profile/Default))
   $(eval $(call Profile/$(1)))
   ifneq ($(ID),)
@@ -46,8 +48,10 @@ define Profile
     endif
        $(ID)_NAME:=$(NAME)
        $(ID)_PACKAGES:=$(PACKAGES)
-    PROFILE_LIST += \
+    ifneq ($(KCONFIG),)
+      PROFILE_LIST += \
                echo '$(ID):'; [ -z '$(NAME)' ] || echo '       $(NAME)'; echo '        Packages: $(PACKAGES)';
+    endif
   endif
 endef
 
@@ -88,7 +92,7 @@ $(TOPDIR)/tmp/ipkg.conf: FORCE
 BUILD_PACKAGES:=$(sort $(DEFAULT_PACKAGES) $(PACKAGES) $($(PROFILE)_PACKAGES) kernel)
 BUILD_PACKAGES:=$(patsubst base-files,base-files-$(BOARD)-$(KERNEL),$(BUILD_PACKAGES))
 # "-pkgname" in the package list means remove "pkgname" from the package list
-BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES)
+BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES))
 
 image:
        if [ -z "$($(PROFILE)_NAME)" ]; then \
@@ -133,7 +137,7 @@ package_postinst: FORCE
                for script in ./etc/init.d/*; do \
                        grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
                        IPKG_INSTROOT=$(BUILD_DIR)/root $(which bash) ./etc/rc.common $$script enable; \
-               done; \
+               done || true; \
        )
 
 build_image: FORCE