2008-05-23 09:09:16 +00:00
|
|
|
#
|
2010-04-12 23:15:56 +00:00
|
|
|
# Copyright (C) 2007-2010 OpenWrt.org
|
2007-06-08 10:44:01 +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
|
|
|
|
|
2013-09-25 19:32:34 +00:00
|
|
|
KDIR_TMP:=$(KDIR)/tmp
|
|
|
|
|
2008-08-05 01:01:27 +00:00
|
|
|
ifneq ($(CONFIG_AVR32_UBOOT),)
|
|
|
|
define Build/Clean
|
2008-04-28 14:10:09 +00:00
|
|
|
$(MAKE) -C u-boot clean
|
2008-08-05 01:01:27 +00:00
|
|
|
endef
|
2008-04-28 14:10:09 +00:00
|
|
|
|
2008-08-05 01:01:27 +00:00
|
|
|
define Build/Compile
|
2008-04-28 14:10:09 +00:00
|
|
|
$(MAKE) -C u-boot compile
|
2008-08-05 01:01:27 +00:00
|
|
|
endef
|
|
|
|
endif
|
2008-04-28 14:10:09 +00:00
|
|
|
|
2007-06-08 10:44:01 +00:00
|
|
|
define Image/BuildKernel
|
2013-09-25 19:32:34 +00:00
|
|
|
-mkdir -p $(KDIR_TMP)
|
2010-04-12 23:15:56 +00:00
|
|
|
cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
|
2008-05-23 09:09:16 +00:00
|
|
|
|
2008-11-25 18:33:33 +00:00
|
|
|
$(STAGING_DIR_HOST)/bin/lzma e $(LINUX_DIR)/arch/avr32/boot/images/vmlinux.bin $(KDIR)/vmlinux.lzma
|
2008-05-23 09:09:16 +00:00
|
|
|
mkimage -A avr32 -O linux -T kernel -a 0x10000000 -C lzma \
|
|
|
|
-e 0x90000000 \
|
|
|
|
-n 'OpenWrt Linux-$(LINUX_VERSION)' \
|
|
|
|
-d $(KDIR)/vmlinux.lzma $(KDIR)/uImage-lzma
|
|
|
|
|
2010-04-12 23:15:56 +00:00
|
|
|
cp $(KDIR)/uImage-lzma $(BIN_DIR)/$(IMG_PREFIX)-uImage-lzma
|
2007-06-08 10:44:01 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build
|
|
|
|
$(call Image/Build/$(1),$(1))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build/squashfs
|
|
|
|
( \
|
2013-09-25 19:32:34 +00:00
|
|
|
cat $(KDIR)/uImage-lzma; \
|
|
|
|
cat $(KDIR)/root.squashfs; \
|
|
|
|
) > $(KDIR_TMP)/avr32-squahsfs.img
|
|
|
|
padjffs2 $(KDIR_TMP)/avr32-squahsfs.img 64
|
|
|
|
dd if=$(KDIR_TMP)/avr32-squahsfs.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img bs=64k conv=sync
|
2007-06-08 10:44:01 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build/jffs2-64k
|
|
|
|
( \
|
2013-09-25 19:32:34 +00:00
|
|
|
dd if=$(KDIR)/uImage-lzma bs=64k conv=sync; \
|
2007-06-08 10:44:01 +00:00
|
|
|
dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
|
2010-04-12 23:15:56 +00:00
|
|
|
) > $(BIN_DIR)/$(IMG_PREFIX)-$(1).img
|
2007-06-08 10:44:01 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|