2009-05-02 20:48:42 +08:00
|
|
|
#
|
2010-04-13 07:15:56 +08:00
|
|
|
# Copyright (C) 2009-2010 OpenWrt.org
|
2009-05-02 20:48:42 +08:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2013-06-06 04:58:53 +08:00
|
|
|
NAND_BLOCKSIZE := 2048:128k
|
2010-08-23 01:03:25 +08:00
|
|
|
|
2009-05-02 20:48:42 +08:00
|
|
|
define Image/BuildKernel
|
|
|
|
# do mach-id fixup here, if needed
|
2010-04-13 07:15:56 +08:00
|
|
|
cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
|
2009-05-02 20:48:42 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build
|
2010-08-29 06:01:21 +08:00
|
|
|
$(if $(Image/Build/$(1)), \
|
|
|
|
$(call Image/Build/$(1),$(1)), \
|
2013-10-02 08:33:48 +08:00
|
|
|
$(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).img \
|
2010-08-29 06:01:21 +08:00
|
|
|
)
|
2009-06-01 20:52:30 +08:00
|
|
|
endef
|
|
|
|
|
2013-06-06 04:58:53 +08:00
|
|
|
define Image/Build/jffs2-nand-2048-128k
|
2013-10-02 08:33:48 +08:00
|
|
|
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img \
|
2010-08-30 05:08:55 +08:00
|
|
|
bs=2048 conv=sync
|
|
|
|
endef
|
|
|
|
|
2009-05-02 20:48:42 +08:00
|
|
|
define Image/Build/squashfs
|
|
|
|
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
|
|
|
|
( \
|
2009-06-01 20:52:30 +08:00
|
|
|
dd if=$(KDIR)/uImage bs=4096k conv=sync; \
|
2009-05-02 20:48:42 +08:00
|
|
|
dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \
|
2013-10-02 08:33:48 +08:00
|
|
|
) > $(BIN_DIR)/$(IMG_PREFIX)-$(1).img
|
2009-05-02 20:48:42 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|