2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
10 LOADADDR = 0x81000000 # RAM start + 16M
11 KERNEL_ENTRY = 0x80041000
12 RAMSIZE = 0x00100000 # 1MB
17 LOADADDR=$(LOADADDR) \
18 KERNEL_ENTRY=$(KERNEL_ENTRY) \
20 IMAGE_COPY=$(IMAGE_COPY)
23 $(MAKE) -C $(GENERIC_PLATFORM_DIR)/image/lzma-loader $(LOADER_MAKEOPTS) clean
27 cp $(KDIR)/vmlinux.elf $(BIN_DIR)/openwrt-$(BOARD)-vmlinux.elf
28 gzip -9 -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
29 $(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/vmlinux $(KDIR)/vmlinux.bin.l7
30 dd if=$(KDIR)/vmlinux.bin.l7 of=$(BIN_DIR)/openwrt-$(BOARD)-vmlinux.lzma bs=65536 conv=sync
31 dd if=$(KDIR)/vmlinux.bin.gz of=$(BIN_DIR)/openwrt-$(BOARD)-vmlinux.gz bs=65536 conv=sync
32 cat $(KDIR)/vmlinux | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
33 $(MAKE) -C $(GENERIC_PLATFORM_DIR)/image/lzma-loader $(LOADER_MAKEOPTS) clean compile
36 define Image/BuildKernel
37 $(CP) $(KDIR)/loader.bin $(BIN_DIR)/openwrt-$(BOARD)-vmlinux
40 define Image/Build/squashfs
41 $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
45 $(call Image/Build/$(1))
46 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-root.$(1) bs=128k conv=sync
49 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
51 cat $(KDIR)/vmlinux | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
52 $(MAKE) -C $(GENERIC_PLATFORM_DIR)/image/lzma-loader $(LOADER_MAKEOPTS) clean compile
54 define Image/BuildKernel
55 $(CP) $(KDIR)/loader.bin $(BIN_DIR)/openwrt-$(BOARD)-vmlinux
59 $(eval $(call BuildImage))