1 DEPENDS += "u-boot-mkimage-native"
3 magicbox_gen_images() {
5 KERNEL=`ls -tr ${DEPLOY_DIR_IMAGE}/uImage* | tail -n 1`
6 if [ -z "$KERNEL" ]; then
7 oefatal "No kernel found in ${DEPLOY_DIR_IMAGE}. Exiting !"
12 #We need to prep the image so that u-boot recognizes it
13 mv ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.squashfs.bin
14 ${STAGING_BINDIR_NATIVE}/uboot-mkimage -A ppc -O linux -T ramdisk -C none -n "OPLinux-uclibc-squashfs" \
15 -d ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.squashfs.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs
16 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.squashfs.bin
21 mv ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs-lzma ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.squashfs-lzma.bin
22 ${STAGING_BINDIR_NATIVE}/uboot-mkimage -A ppc -O linux -T ramdisk -C none -n "OPLinux-uclibc-squashfs-lzma" \
23 -d ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.squashfs-lzma.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs-lzma
24 rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.squashfs-lzma.bin
26 #kernel+jffs2 in a single image
27 #Add jffs2 marker at the end of the rootfs file
28 echo -ne '\xde\xad\xc0\xde' >> ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2
31 ( dd if=$KERNEL bs=65536 conv=sync; \
32 dd if=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 bs=65536 conv=sync; \
33 ) > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.jffs2.flash.bin
39 IMAGE_POSTPROCESS_COMMAND += "magicbox_gen_images; "