add new dfboot loader - a complete revison of romboot code.
[openwrt/svn-archive/archive.git] / target / linux / at91-2.6 / 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 define Build/Clean
12 # $(MAKE) -C romboot clean
13 $(MAKE) -C dfboot clean
14 $(MAKE) -C u-boot clean
15 endef
16
17 define Build/Compile
18 # $(MAKE) -C romboot compile
19 $(MAKE) -C dfboot compile
20 $(MAKE) -C u-boot compile
21 $(KDIR)/u-boot-1.1.4/tools/ubparams
22 cp params $(KDIR)
23 endef
24
25 define Image/Prepare
26 cp $(LINUX_DIR)/arch/arm/boot/uImage $(KDIR)/uImage
27 cp $(KDIR)/dfboot/dfboot.bin $(KDIR)/dfboot.bin
28 cp $(KDIR)/dfboot/dfbptest.bin $(KDIR)/dfbptest.bin
29 cp $(KDIR)/u-boot-1.1.4/u-boot.bin $(KDIR)/u-boot.bin
30 dd if=$(KDIR)/u-boot.bin of=$(KDIR)/u-boot.block bs=100k count=1 conv=sync
31 cat $(KDIR)/u-boot.block $(KDIR)/params > $(KDIR)/u-boot.full
32 endef
33
34 define Image/BuildKernel
35 cp $(KDIR)/uImage $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-uImage
36 endef
37
38 define Image/Build
39 dd if=$(KDIR)/uImage of=$(KDIR)/uImage.block bs=8448 conv=sync
40 dd if=$(KDIR)/root.squashfs of=$(KDIR)/root.block bs=8448 conv=sync
41 cat $(KDIR)/uImage.block $(KDIR)/root.block > $(KDIR)/knlroot.bin
42 $(STAGING_DIR)/bin/trx -o $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL).trx -f $(KDIR)/dfboot.bin -f$(KDIR)/u-boot.full -f$(KDIR)/knlroot.bin
43 cp $(KDIR)/dfbptest.bin $(BIN_DIR)
44 $(call Image/Build/$(1),$(1))
45 endef
46
47 $(eval $(call BuildImage))