Define target specific ramdisk images for testing (Gabor Juhos)

SVN-Revision: 7395
owl
Florian Fainelli 2007-05-30 10:30:36 +00:00
parent 22a6072cd4
commit 1822d0b004
2 changed files with 69 additions and 28 deletions

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2006 OpenWrt.org # Copyright (C) 2006,2007 OpenWrt.org
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -7,28 +7,33 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk include $(INCLUDE_DIR)/image.mk
define Build/Compile LOADER_MAKE = $(MAKE) -C lzma-loader KDIR=$(KDIR)
rm -f $(KDIR)/loader.gz $(KDIR)/loader-edimax.gz
$(MAKE) -C lzma-loader \ define PrepareLoader
BUILD_DIR="$(KDIR)" \ $(LOADER_MAKE) LOADER=$(1) LOADER_DATA="" \
TARGET="$(KDIR)" \ LZMA_TEXT_START=$(2) LZMA_STARTUP_ORG=$(3) \
install compile
echo -ne "\\x00" >> $(KDIR)/loader.gz
$(MAKE) -C lzma-loader \ endef
BUILD_DIR="$(KDIR)" \ define PrepareLZMAKernel
TARGET="$(KDIR)" \ $(LOADER_MAKE) LOADER=vmlinux-lzma-$(1) LOADER_DATA=$(KDIR)/vmlinux.lzma \
LOADER=loader-edimax \ LZMA_TEXT_START=$(2) LZMA_STARTUP_ORG=$(3) \
BZ_STARTUP_ORG=0x6D8 \ compile
install
echo -ne "\\x00" >> $(KDIR)/loader-edimax.gz
endef endef
define Build/Clean define Build/Clean
$(MAKE) -C lzma-loader clean $(LOADER_MAKE) clean
endef endef
define Image/Prepare define Image/Prepare
cat $(KDIR)/vmlinux | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma cat $(KDIR)/vmlinux | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
$(call PrepareLoader,generic,0x80500000,0)
$(call PrepareLoader,admboot,0x80500000,0x6D8)
else
$(call PrepareLZMAKernel,generic,0x80500000,0)
$(call PrepareLZMAKernel,admboot,0x80500000,0x6D8)
endif
endef endef
define trxalign/jffs2-128k define trxalign/jffs2-128k
@ -47,7 +52,7 @@ endef
define Image/Build/Edimax define Image/Build/Edimax
$(STAGING_DIR)/bin/mkcsysimg -B $(4) -d -w \ $(STAGING_DIR)/bin/mkcsysimg -B $(4) -d -w \
-r $(KDIR)/loader-edimax.gz \ -r $(KDIR)/loader-admboot.gz \
-x $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1)-noloader.trx \ -x $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1)-noloader.trx \
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(3)-$(2).bin $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(3)-$(2).bin
endef endef
@ -57,7 +62,7 @@ define Image/Build/MyLoader
$(STAGING_DIR)/bin/mkmylofw -B $(4) \ $(STAGING_DIR)/bin/mkmylofw -B $(4) \
-p0x20000:0x10000:ahp:0x80001000 \ -p0x20000:0x10000:ahp:0x80001000 \
-p0x30000:0 \ -p0x30000:0 \
-b0x20000:0x10000:h:$(KDIR)/loader.gz \ -b0x20000:0x10000:h:$(KDIR)/loader-generic.gz \
-b0x30000:0::$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(3)-$(2).trx \ -b0x30000:0::$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(3)-$(2).trx \
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(3)-$(2).bin $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(3)-$(2).bin
endef endef
@ -67,7 +72,7 @@ define Image/Build/RouterBoard
endef endef
define Image/Build define Image/Build
$(STAGING_DIR)/bin/trx -o $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).trx -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma $(call trxalign/$(1)) -f $(KDIR)/root.$(1) $(STAGING_DIR)/bin/trx -o $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).trx -f $(KDIR)/loader-generic.gz -f $(KDIR)/vmlinux.lzma $(call trxalign/$(1)) -f $(KDIR)/root.$(1)
$(STAGING_DIR)/bin/trx -o $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1)-noloader.trx -f $(KDIR)/vmlinux.lzma $(call trxalign/$(1)) -f $(KDIR)/root.$(1) $(STAGING_DIR)/bin/trx -o $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1)-noloader.trx -f $(KDIR)/vmlinux.lzma $(call trxalign/$(1)) -f $(KDIR)/root.$(1)
ifneq ($(1),jffs2-128K) ifneq ($(1),jffs2-128K)
$(call Image/Build/Compex,$(1),wp54g-wrt,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/Compex,$(1),wp54g-wrt,$(patsubst jffs2-%,jffs2,$(1)))
@ -97,4 +102,19 @@ ifeq ($(1),tgz)
endif endif
endef endef
define Image/Build/LZMAKernel
$(CP) $(KDIR)/loader-vmlinux-lzma-$(2).$(3) \
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinux-lzma-$(1).$(3)
endef
define Image/Build/Initramfs
$(call Image/Build/LZMAKernel,generic,generic,elf)
$(call Image/Build/LZMAKernel,rb-100,generic,elf)
$(call Image/Build/LZMAKernel,np27g,generic,bin)
$(call Image/Build/LZMAKernel,wp54g,generic,bin)
$(call Image/Build/LZMAKernel,br-6104k,admboot,gz)
$(call Image/Build/LZMAKernel,cas-771,admboot,gz)
endef
$(eval $(call BuildImage)) $(eval $(call BuildImage))

View File

@ -7,21 +7,31 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk include $(INCLUDE_DIR)/image.mk
define Build/Compile LOADER_MAKE = $(MAKE) -C lzma-loader KDIR=$(KDIR)
rm -f $(KDIR)/loader-zynos.gz $(KDIR)/loader-zynos.bin
$(MAKE) -C lzma-loader \ define CompileLoader
BUILD_DIR="$(KDIR)" \ $(LOADER_MAKE) LOADER=$(1) LOADER_DATA="" \
TARGET="$(KDIR)" \ LZMA_TEXT_START=$(2) LZMA_STARTUP_ORG=$(3) \
LOADER=loader-zynos \ compile
install endef
define CompileLZMAKernel
$(LOADER_MAKE) LOADER=vmlinux-lzma-$(1) LOADER_DATA=$(KDIR)/vmlinux.lzma \
LZMA_TEXT_START=$(2) LZMA_STARTUP_ORG=$(3) \
compile
endef endef
define Build/Clean define Build/Clean
$(MAKE) -C lzma-loader clean $(LOADER_MAKE) clean
endef endef
define Image/Prepare define Image/Prepare
cat $(KDIR)/vmlinux | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma cat $(KDIR)/vmlinux | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
$(call CompileLoader,zyxel,0x80500000,0)
else
$(call CompileLZMAKernel,zyxel,0x80500000,0)
endif
endef endef
define trxalign/jffs2-128k define trxalign/jffs2-128k
@ -41,8 +51,19 @@ endef
define Image/Build define Image/Build
$(STAGING_DIR)/bin/trx -o $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1)-noloader.trx -f $(KDIR)/vmlinux.lzma $(call trxalign/$(1)) -f $(KDIR)/root.$(1) $(STAGING_DIR)/bin/trx -o $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1)-noloader.trx -f $(KDIR)/vmlinux.lzma $(call trxalign/$(1)) -f $(KDIR)/root.$(1)
ifneq ($(1),jffs2-128K) ifneq ($(1),jffs2-128K)
#FIXME: no supported boards yet #FIXME: firware images yet
endif endif
endef endef
define Image/Build/LZMAKernel
$(CP) $(KDIR)/loader-vmlinux-lzma-$(2).$(3) \
$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinux-lzma-$(1).$(3)
endef
define Image/Build/Initramfs
$(call Image/Build/LZMAKernel,p-334wt,zyxel,bin)
$(call Image/Build/LZMAKernel,p-335wt,zyxel,bin)
endef
$(eval $(call BuildImage)) $(eval $(call BuildImage))