bf871fb2aed4fe23aca80cc720e6edd3d420882f
[openwrt/staging/dedeckeh.git] / target / linux / goldfish / image / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/image.mk
10
11 JFFS2_BLOCKSIZE=124k
12 JFFS2OPTS += -n -s 2048
13
14 _PREFIX=openwrt-goldfish-
15
16 define Image/BuildKernel
17 $(TARGET_CROSS)objcopy -O binary -R .note -R .comment -S \
18 $(LINUX_DIR)/arch/arm/boot/compressed/vmlinux $(BIN_DIR)/$(_PREFIX)kernel.bin
19 $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS), \
20 $(CP) $(LINUX_DIR)/usr/initramfs_data.cpio.gz, \
21 gzip -c < $(LINUX_DIR)/usr/initramfs_data.cpio > \
22 ) $(BIN_DIR)/$(_PREFIX)ramdisk.bin
23 $(CP) ./run-emulator.sh $(BIN_DIR)/
24 endef
25
26 define Image/Build/jffs2-124k
27 $(CP) ./ubinize.cfg $(KDIR)/
28 (cd $(KDIR); \
29 ubinize \
30 -o $(BIN_DIR)/$(_PREFIX)$(1).img \
31 -p 128KiB -m 2KiB -s 2KiB ubinize.cfg; \
32 )
33 nand_ecc \
34 $(BIN_DIR)/$(_PREFIX)$(1).img \
35 $(BIN_DIR)/$(_PREFIX)system.bin
36 endef
37
38 define Image/Build
39 $(call Image/Build/$(1),$(1))
40 endef
41
42
43 $(eval $(call BuildImage))