@ -9,12 +9,16 @@ include $(INCLUDE_DIR)/image.mk
NAND_BLOCKSIZE := 2048:128k
d e f i n e s a n i t i z e _ p r o f i l e _ n a m e
$(shell echo $(PROFILE) | tr '[ : upper :]' '[:lower :]')
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 / T e m p l a t e
$( CP) $( KDIR) /zImage $( BIN_DIR) /$( IMG_PREFIX) -zImage
echo -ne '\x00\x00\x00\x00' >> $( BIN_DIR) /$( IMG_PREFIX) -zImage
$( call Image/BuildKernel/MkuImage, \
none, 0x0000 8000, 0x0000 8000, \
none, 0x8000, 0x8000, \
$( BIN_DIR) /$( IMG_PREFIX) -zImage, \
$( BIN_DIR) /$( IMG_PREFIX) -uImage \
)
@ -23,7 +27,7 @@ define Image/BuildKernel/Template
$( CP) $( KDIR) /zImage-initramfs $( BIN_DIR) /$( IMG_PREFIX) -zImage-initramfs
echo -ne '\x00\x00\x00\x00' >> $( BIN_DIR) /$( IMG_PREFIX) -zImage-initramfs
$( call Image/BuildKernel/MkuImage, \
none, 0x0000 8000, 0x0000 8000, \
none, 0x8000, 0x8000, \
$( BIN_DIR) /$( IMG_PREFIX) -zImage-initramfs, \
$( BIN_DIR) /$( IMG_PREFIX) -uImage-initramfs \
)
@ -32,21 +36,21 @@ define Image/BuildKernel/Template
ifneq ( $( 1) ,)
$( CP) $( LINUX_DIR) /arch/arm/boot/dts/kirkwood-$( 1) .dtb $( BIN_DIR) /$( IMG_PREFIX) -$( 1) .dtb
$( CP) $( KDIR) /zImage $( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE ) -zImage
cat $( BIN_DIR) /$( IMG_PREFIX) -$( 1) .dtb >> $( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE ) -zImage
$( CP) $( KDIR) /zImage $( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name ) -zImage
cat $( BIN_DIR) /$( IMG_PREFIX) -$( 1) .dtb >> $( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name ) -zImage
$( call Image/BuildKernel/MkuImage, \
none, 0x0000 8000, 0x0000 8000, \
$( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE ) -zImage, \
$( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE ) -uImage \
none, 0x8000, 0x8000, \
$( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name ) -zImage, \
$( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name ) -uImage \
)
ifneq ( $( CONFIG_TARGET_ROOTFS_INITRAMFS) ,)
$( CP) $( KDIR) /zImage-initramfs $( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE ) -zImage-initramfs
cat $( BIN_DIR) /$( IMG_PREFIX) -$( 1) .dtb >> $( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE ) -zImage-initramfs
$( CP) $( KDIR) /zImage-initramfs $( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name ) -zImage-initramfs
cat $( BIN_DIR) /$( IMG_PREFIX) -$( 1) .dtb >> $( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name ) -zImage-initramfs
$( call Image/BuildKernel/MkuImage, \
none, 0x0000 8000, 0x0000 8000,
$( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE ) -zImage-initramfs, \
$( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE ) -uImage-initramfs \
none, 0x8000, 0x8000, \
$( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name ) -zImage-initramfs, \
$( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name ) -uImage-initramfs \
)
endif
endif
@ -56,19 +60,27 @@ define Image/InstallKernel/Template
ifneq ( $( CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL) ,)
$( INSTALL_DIR) $( TARGET_DIR) /boot
ifneq ( $( CONFIG_TARGET_ROOTFS_INCLUDE_UIMAGE) ,)
$( CP) $( BIN_DIR) /$( IMG_PREFIX) -uImage $( TARGET_DIR) /boot/
ln -sf $( IMG_PREFIX) -uImage $( TARGET_DIR) /boot/uImage
endif
ifneq ( $( CONFIG_TARGET_ROOTFS_INCLUDE_ZIMAGE) ,)
$( CP) $( BIN_DIR) /$( IMG_PREFIX) -zImage $( TARGET_DIR) /boot/
ln -sf $( IMG_PREFIX) -zImage $( TARGET_DIR) /boot/zImage
endif
endif
ifneq ( $( CONFIG_TARGET_ROOTFS_INCLUDE_DTB) ,)
$( INSTALL_DIR) $( TARGET_DIR) /boot
ifneq ( $( 1) ,)
$( CP) $( BIN_DIR) /$( IMG_PREFIX) -$( 1) .dtb $( TARGET_DIR) /boot/
ln -sf $( IMG_PREFIX) -$( 1) .dtb $( TARGET_DIR) /boot/$( 1) .dtb
endif
endif
e n d e f
d e f i n e I m a g e / B u i l d / j f f s 2 - n a n d - 2 0 4 8 - 1 2 8 k
dd if = $( KDIR) /root.$( 1) of = $( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE ) -$( 1) .img \
dd if = $( KDIR) /root.$( 1) of = $( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name ) -$( 1) .img \
bs = 2048 conv = sync
e n d e f
@ -77,20 +89,25 @@ define Image/Build/squashfs
( \
dd if = $( KDIR) /zImage bs = 4096k conv = sync; \
dd if = $( KDIR) /root.$( 1) bs = 128k conv = sync; \
) > $( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE) -$( 1) .img
) > $( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name) -$( 1) .img
e n d e f
d e f i n e I m a g e / m k f s / t a r g z
$( TAR) -czpf $( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name) -rootfs.tar.gz --numeric-owner --owner= 0 --group= 0 -C $( TARGET_DIR) / .
e n d e f
d e f i n e I m a g e / B u i l d / u b i f s
ifneq ( $( $( PROFILE) _UBIFS_OPTS) ,)
$( CP) $( KDIR) /root.ubifs $( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE) -ubifs.img
$( CP) $( KDIR) /root.ubifs $( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name) -rootfs.ubifs
endif
e n d e f
d e f i n e I m a g e / B u i l d / u b i
ifneq ( $( $( PROFILE) _UBI_OPTS) ,)
$( CP) $( KDIR) /root.ubi $( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE) -ubi.img
$( CP) $( KDIR) /root.ubi $( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name) -rootfs.ubi
endif
e n d e f
@ -111,7 +128,7 @@ endef
d e f i n e I m a g e / B u i l d
$( if $( Image/Build/$( 1) ) , \
$( call Image/Build/$( 1) ,$( 1) ) , \
$( CP) $( KDIR) /root.$( 1) $( BIN_DIR) /$( IMG_PREFIX) -$( PROFILE ) -$( 1) .img \
$( CP) $( KDIR) /root.$( 1) $( BIN_DIR) /$( IMG_PREFIX) -$( call sanitize_profile_name ) -$( 1) .img \
)
e n d e f