#
# Copyright (C) 2010-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
i n c l u d e $( TOPDIR ) / r u l e s . m k
i n c l u d e $( INCLUDE_DIR ) / i m a g e . m k
d e f i n e I m a g e / P r e p a r e
mkimage -A arm -O linux -T kernel -C none -a 0x20008000 -e 0x20008000 -n '$(VERSION_DIST) Linux-$(LINUX_VERSION)' -d $( KDIR) /zImage $( KDIR) /uImage
e n d e f
LEGACY_NOR_KERNEL_SIZE = 2048k
LEGACY_SPI_KERNEL_SIZE = 1536k
# Build sysupgrade image
d e f i n e B u i l d F i r m w a r e / L e g a c y
dd if = $( BIN_DIR) /$( IMG_PREFIX) -$( 1) -sysupgrade.bin \
of = $( KDIR) /uImage.pad bs = $( 3) count = 1
dd if = $( BIN_DIR) /$( IMG_PREFIX) -$( 1) -sysupgrade.bin \
of = $( KDIR) /root.$( 1) .pad bs = $( 3) skip = 1
sh $( TOPDIR) /scripts/combined-image.sh \
$( KDIR) /uImage.pad \
$( KDIR) /root.$( 1) .pad \
$( BIN_DIR) /$( IMG_PREFIX) -$( 1) -$( 2) -legacy-sysupgrade.bin
e n d e f
d e f i n e I m a g e / B u i l d K e r n e l / I n i t r a m f s
mkimage -A arm -O linux -T kernel -C none -a 0x20008000 -e 0x20008000 -n '$(VERSION_DIST) Linux-$(LINUX_VERSION)' -d $( KDIR) /zImage-initramfs $( BIN_DIR) /$( IMG_PREFIX) -initramfs-uImage
e n d e f
d e f i n e I m a g e / B u i l d
cat $( KDIR) /uImage $( KDIR) /root.$( 1) > $( BIN_DIR) /$( IMG_PREFIX) -$( 1) -sysupgrade.bin
$( call Image/Build/$( 1) ,$( 1) )
$( call BuildFirmware/Legacy,$( 1) ,laguna_spi,$( LEGACY_SPI_KERNEL_SIZE) )
$( call BuildFirmware/Legacy,$( 1) ,laguna_nor,$( LEGACY_NOR_KERNEL_SIZE) )
e n d e f
d e f i n e I m a g e / B u i l d / s q u a s h f s
$( call prepare_generic_squashfs,$( BIN_DIR) /$( IMG_PREFIX) -$( 1) -sysupgrade.bin)
e n d e f
$( eval $ ( call BuildImage ) )