-$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches
- [ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches
- @$(CP) config $(LINUX_DIR)/.config
- touch $@
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
+ define Kernel/SetInitramfs
+ rm -f $(BUILD_DIR)/root/sbin/init
+ ln -s /etc/preinit $(BUILD_DIR)/root/sbin/init
+ $(CP) $(PLATFORM_DIR)/image/preinit.arch $(BUILD_DIR)/root/etc/
+ endef
+endif
+
+# include the profiles
+-include profiles/*.mk
+
+$(eval $(call BuildKernel))