2008-11-22 21:45:14 +02:00
|
|
|
#
|
2010-04-27 22:28:40 +03:00
|
|
|
# Copyright (C) 2006-2010 OpenWrt.org
|
2006-12-25 10:05:48 +02: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 17:52:29 +02:00
|
|
|
define Image/BuildKernel
|
2010-04-27 22:28:40 +03:00
|
|
|
cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
|
2006-12-25 10:05:48 +02:00
|
|
|
gzip -9 -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
|
2007-08-07 03:04:25 +03:00
|
|
|
$(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/vmlinux $(KDIR)/vmlinux.bin.l7
|
2010-04-27 22:28:40 +03: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 10:05:48 +02:00
|
|
|
endef
|
|
|
|
|
2007-03-02 03:38:07 +02:00
|
|
|
define Image/Build/squashfs
|
|
|
|
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
|
|
|
|
endef
|
|
|
|
|
2006-12-25 10:05:48 +02:00
|
|
|
define Image/Build
|
2007-03-02 03:38:07 +02:00
|
|
|
$(call Image/Build/$(1))
|
2010-04-27 22:28:40 +03:00
|
|
|
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
|
2008-07-25 06:55:21 +03:00
|
|
|
|
2008-12-18 15:31:59 +02:00
|
|
|
-$(STAGING_DIR_HOST)/bin/mkfwimage \
|
2009-02-20 12:19:24 +02:00
|
|
|
-B XS2 -v XS2.ar2316.OpenWrt.$(REVISION) \
|
2010-04-27 22:28:40 +03: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 15:31:59 +02:00
|
|
|
|
|
|
|
-$(STAGING_DIR_HOST)/bin/mkfwimage \
|
2009-02-20 12:19:24 +02:00
|
|
|
-B XS5 -v XS5.ar2313.OpenWrt.$(REVISION) \
|
2010-04-27 22:28:40 +03: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 21:45:14 +02:00
|
|
|
|
2009-04-21 04:16:34 +03:00
|
|
|
-$(STAGING_DIR_HOST)/bin/mkfwimage \
|
|
|
|
-B XS2-8 -v XS2.ar2316.OpenWrt.$(REVISION) \
|
2010-04-27 22:28:40 +03: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 04:16:34 +03:00
|
|
|
|
2008-11-22 21:45:14 +02:00
|
|
|
-$(STAGING_DIR_HOST)/bin/mkmylofw -B np25g \
|
|
|
|
-p0x020000:0x130000:ah:0x80041000:linux:$(KDIR)/vmlinux.bin.gz \
|
2010-04-27 22:28:40 +03:00
|
|
|
-p0x150000:0x2a0000:::rootfs:$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
|
|
|
|
$(BIN_DIR)/$(IMG_PREFIX)-np25g-$(1).bin
|
2008-12-18 15:31:59 +02:00
|
|
|
|
2008-11-22 21:45:14 +02:00
|
|
|
-$(STAGING_DIR_HOST)/bin/mkmylofw -B wpe53g \
|
|
|
|
-p0x020000:0x130000:ah:0x80041000:linux:$(KDIR)/vmlinux.bin.gz \
|
2010-04-27 22:28:40 +03:00
|
|
|
-p0x150000:0x2a0000:::rootfs:$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
|
|
|
|
$(BIN_DIR)/$(IMG_PREFIX)-wpe53g-$(1).bin
|
2008-11-22 21:45:14 +02:00
|
|
|
|
2009-09-22 04:09:04 +03:00
|
|
|
ifeq ($(BOARD),atheros)
|
|
|
|
-sh $(TOPDIR)/scripts/combined-image.sh \
|
2010-04-27 22:28:40 +03:00
|
|
|
"$(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma" \
|
|
|
|
"$(BIN_DIR)/$(IMG_PREFIX)-root.$(1)" \
|
|
|
|
"$(BIN_DIR)/$(IMG_PREFIX)-combined.$(1).img"
|
2009-09-22 04:09:04 +03:00
|
|
|
endif
|
2006-12-25 10:05:48 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|