add failsafe support for x86-2.6 and fix mdev support for platforms using /etc/preinit
[openwrt/openwrt.git] / package / base-files / Makefile
index 5cbef91e3c97909e04cf331795f6238c64d4cc27..30e90453eeed1d9250dcf25ec61edb2024d11f48 100644 (file)
@@ -19,7 +19,6 @@ REV:=$(shell LANG=C svn info | awk '/^Revision:/ { print$$2 }' )
 ifeq ($(REV),)
   REV:=0
 endif
-
 include $(INCLUDE_DIR)/package.mk
 
 ifneq ($(DUMP),1)
@@ -101,8 +100,13 @@ endef
 
 define Package/base-files$(TARGET)/install
        $(CP) ./files/* $(1)/
-       if [ -d $(PLATFORM_DIR)/base-files/. ]; then \
-               $(CP) $(PLATFORM_DIR)/base-files/* $(1)/; \
+       if [ -d $(PLATFORM_DIR)/base-files/default/. ]; then \
+               $(CP) $(PLATFORM_DIR)/base-files/default/* $(1)/; \
+       fi
+       if [ "$(PROFILE)" != "Default" ]; then \
+               if [ -d $(PLATFORM_DIR)/base-files/profile-$(PROFILE)/. ]; then \
+                       $(CP) $(PLATFORM_DIR)/base-files/profile-$(PROFILE)/* $(1)/; \
+               fi; \
        fi
        $(SED) 's,$$$$R,r$(REV),g' $(1)/etc/banner
        $(SED) 's,$$$$S,$(BOARD)-$(KERNEL),g' $(1)/etc/ipkg.conf