2008-11-22 19:45:14 +00:00
|
|
|
#
|
2010-04-12 23:15:56 +00:00
|
|
|
# Copyright (C) 2006-2010 OpenWrt.org
|
2006-12-25 08:05:48 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2008-03-27 15:52:29 +00:00
|
|
|
define Image/BuildKernel
|
2010-04-12 23:15:56 +00:00
|
|
|
cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
|
2006-12-25 08:05:48 +00:00
|
|
|
gzip -9 -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
|
2007-08-07 00:04:25 +00:00
|
|
|
$(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/vmlinux $(KDIR)/vmlinux.bin.l7
|
2010-04-12 23:15:56 +00:00
|
|
|
dd if=$(KDIR)/vmlinux.bin.l7 of=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma bs=65536 conv=sync
|
|
|
|
dd if=$(KDIR)/vmlinux.bin.gz of=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux.gz bs=65536 conv=sync
|
2006-12-25 08:05:48 +00:00
|
|
|
endef
|
|
|
|
|
2007-03-02 01:38:07 +00:00
|
|
|
define Image/Build/squashfs
|
|
|
|
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
|
|
|
|
endef
|
|
|
|
|
2006-12-25 08:05:48 +00:00
|
|
|
define Image/Build
|
2007-03-02 01:38:07 +00:00
|
|
|
$(call Image/Build/$(1))
|
2010-04-12 23:15:56 +00:00
|
|
|
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
|
2008-07-25 03:55:21 +00:00
|
|
|
|
2008-12-18 13:31:59 +00:00
|
|
|
-$(STAGING_DIR_HOST)/bin/mkfwimage \
|
2009-02-20 10:19:24 +00:00
|
|
|
-B XS2 -v XS2.ar2316.OpenWrt.$(REVISION) \
|
2010-04-12 23:15:56 +00:00
|
|
|
-k $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma \
|
|
|
|
-r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
|
|
|
|
-o $(BIN_DIR)/$(IMG_PREFIX)-ubnt2-$(1).bin
|
2008-12-18 13:31:59 +00:00
|
|
|
|
|
|
|
-$(STAGING_DIR_HOST)/bin/mkfwimage \
|
2009-02-20 10:19:24 +00:00
|
|
|
-B XS5 -v XS5.ar2313.OpenWrt.$(REVISION) \
|
2010-04-12 23:15:56 +00:00
|
|
|
-k $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma \
|
|
|
|
-r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
|
|
|
|
-o $(BIN_DIR)/$(IMG_PREFIX)-ubnt5-$(1).bin
|
2008-11-22 19:45:14 +00:00
|
|
|
|
2009-04-21 01:16:34 +00:00
|
|
|
-$(STAGING_DIR_HOST)/bin/mkfwimage \
|
|
|
|
-B XS2-8 -v XS2.ar2316.OpenWrt.$(REVISION) \
|
2010-04-12 23:15:56 +00:00
|
|
|
-k $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma \
|
|
|
|
-r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
|
|
|
|
-o $(BIN_DIR)/$(IMG_PREFIX)-ubnt2-pico2-$(1).bin
|
2009-04-21 01:16:34 +00:00
|
|
|
|
2008-11-22 19:45:14 +00:00
|
|
|
-$(STAGING_DIR_HOST)/bin/mkmylofw -B np25g \
|
|
|
|
-p0x020000:0x130000:ah:0x80041000:linux:$(KDIR)/vmlinux.bin.gz \
|
2010-04-12 23:15:56 +00:00
|
|
|
-p0x150000:0x2a0000:::rootfs:$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
|
|
|
|
$(BIN_DIR)/$(IMG_PREFIX)-np25g-$(1).bin
|
2008-12-18 13:31:59 +00:00
|
|
|
|
2008-11-22 19:45:14 +00:00
|
|
|
-$(STAGING_DIR_HOST)/bin/mkmylofw -B wpe53g \
|
|
|
|
-p0x020000:0x130000:ah:0x80041000:linux:$(KDIR)/vmlinux.bin.gz \
|
2010-04-12 23:15:56 +00:00
|
|
|
-p0x150000:0x2a0000:::rootfs:$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
|
|
|
|
$(BIN_DIR)/$(IMG_PREFIX)-wpe53g-$(1).bin
|
2008-11-22 19:45:14 +00:00
|
|
|
|
2009-09-22 01:09:04 +00:00
|
|
|
ifeq ($(BOARD),atheros)
|
|
|
|
-sh $(TOPDIR)/scripts/combined-image.sh \
|
2010-04-12 23:15:56 +00:00
|
|
|
"$(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma" \
|
|
|
|
"$(BIN_DIR)/$(IMG_PREFIX)-root.$(1)" \
|
|
|
|
"$(BIN_DIR)/$(IMG_PREFIX)-combined.$(1).img"
|
2009-09-22 01:09:04 +00:00
|
|
|
endif
|
2006-12-25 08:05:48 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|