2006-06-27 00:35:46 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2006-06-21 03:13:25 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
2006-06-21 02:32:39 +00:00
|
|
|
include $(INCLUDE_DIR)/image.mk
|
2006-10-26 01:08:41 +00:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
2006-06-15 21:43:59 +00:00
|
|
|
|
|
|
|
LOADADDR = 0x81000000 # RAM start + 16M
|
|
|
|
KERNEL_ENTRY = 0x80101000
|
|
|
|
RAMSIZE = 0x00100000 # 1MB
|
|
|
|
IMAGE_COPY = 1
|
|
|
|
|
|
|
|
LOADER_MAKEOPTS= \
|
|
|
|
KDIR=$(KDIR) \
|
|
|
|
LOADADDR=$(LOADADDR) \
|
|
|
|
KERNEL_ENTRY=$(KERNEL_ENTRY) \
|
|
|
|
RAMSIZE=$(RAMSIZE) \
|
|
|
|
IMAGE_COPY=$(IMAGE_COPY)
|
|
|
|
|
2006-12-06 18:31:28 +00:00
|
|
|
define Build/Compile
|
|
|
|
$(CC) -o $(STAGING_DIR)/bin/patch-cmdline $(PLATFORM_DIR)/src/patch-cmdline.c
|
|
|
|
endef
|
|
|
|
|
2006-06-15 21:43:59 +00:00
|
|
|
define Build/Clean
|
2006-12-18 18:30:29 +00:00
|
|
|
$(MAKE) -C $(GENERIC_PLATFORM_DIR)/image/lzma-loader $(LOADER_MAKEOPTS) clean
|
2006-06-15 21:43:59 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Prepare
|
2006-10-26 01:08:41 +00:00
|
|
|
$(KERNEL_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $(LINUX_DIR)/vmlinux $(LINUX_KERNEL)
|
2007-01-10 21:52:28 +00:00
|
|
|
cat $(KDIR)/vmlinux | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
|
|
|
|
$(MAKE) -C $(GENERIC_PLATFORM_DIR)/image/lzma-loader $(LOADER_MAKEOPTS) clean compile
|
|
|
|
cp $(LINUX_DIR)/vmlinux $(KDIR)/vmlinux.elf
|
2006-06-15 21:43:59 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/BuildKernel
|
|
|
|
$(CP) $(KDIR)/loader.elf $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinux
|
|
|
|
endef
|
|
|
|
|
2006-10-26 01:08:41 +00:00
|
|
|
define Image/cmdline/jffs2-64k
|
|
|
|
block2mtd.block2mtd=/dev/cfa2,65536 root=/dev/mtdblock0 rootfstype=jffs2
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/cmdline/jffs2-128k
|
|
|
|
block2mtd.block2mtd=/dev/cfa2,131072 root=/dev/mtdblock0 rootfstype=jffs2
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/cmdline/ext2
|
|
|
|
root=/dev/cfa2 rootfstype=ext2
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build
|
2007-01-10 21:52:28 +00:00
|
|
|
$(STAGING_DIR)/bin/patch-cmdline $(KDIR)/vmlinux.elf '$(strip $(call Image/cmdline/$(1))) '
|
2006-12-07 00:26:26 +00:00
|
|
|
./gen_image.sh $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).bin 4 $(LINUX_DIR)/vmlinux 16 $(KDIR)/root.$(1)
|
2006-06-15 21:43:59 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|