opendreambox 2.0
[opendreambox.git] / meta-opendreambox / classes / image_types_nfi.bbclass
1 inherit image_types
2
3 IMAGE_CMD_jffs2.nfi = " \
4         mkfs.jffs2 \
5                 --root=${IMAGE_ROOTFS}/boot \
6                 --faketime \
7                 --disable-compressor=lzo \
8                 --compression-mode=size \
9                 --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \
10                 ${EXTRA_IMAGECMD}; \
11         rm -rf ${IMAGE_ROOTFS}/boot/*; \
12         printf '/dev/mtdblock2\t/boot\t\tjffs2\tro\t\t\t\t0 0\n' >> ${IMAGE_ROOTFS}/etc/fstab; \
13         mkfs.jffs2 \
14                 --root=${IMAGE_ROOTFS} \
15                 --faketime \
16                 --disable-compressor=lzo \
17                 --compression-mode=size \
18                 --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
19                 ${EXTRA_IMAGECMD}; \
20         ${DREAMBOX_BUILDIMAGE} \
21                 --boot-partition ${DREAMBOX_PART0_SIZE}:${STAGING_DATADIR}/dreambox-secondstage/secondstage-${MACHINE}.bin \
22                 --data-partition ${DREAMBOX_PART1_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \
23                 --data-partition ${DREAMBOX_PART2_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
24                 > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.nfi; \
25 "
26
27 IMAGE_CMD_sum.jffs2.nfi = " \
28         mkfs.jffs2 \
29                 --root=${IMAGE_ROOTFS}/boot \
30                 --faketime \
31                 --disable-compressor=lzo \
32                 --compression-mode=size \
33                 --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \
34                 ${EXTRA_IMAGECMD}; \
35         sumtool \
36                 -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \
37                 -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.sum.jffs2 \
38                 ${EXTRA_IMAGECMD}; \
39         rm -rf ${IMAGE_ROOTFS}/boot/*; \
40         printf '/dev/mtdblock2\t/boot\t\tjffs2\tro\t\t\t\t0 0\n' >> ${IMAGE_ROOTFS}/etc/fstab; \
41         mkfs.jffs2 \
42                 --root=${IMAGE_ROOTFS} \
43                 --faketime \
44                 --disable-compressor=lzo \
45                 --compression-mode=size \
46                 --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
47                 ${EXTRA_IMAGECMD}; \
48         sumtool \
49                 -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
50                 -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.sum.jffs2 \
51                 ${EXTRA_IMAGECMD}; \
52         ${DREAMBOX_BUILDIMAGE} \
53                 --boot-partition ${DREAMBOX_PART0_SIZE}:${STAGING_DATADIR}/dreambox-secondstage/secondstage-${MACHINE}.bin \
54                 --data-partition ${DREAMBOX_PART1_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.sum.jffs2 \
55                 --data-partition ${DREAMBOX_PART2_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.sum.jffs2 \
56                 > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.nfi; \
57 "
58
59 EXTRA_IMAGECMD_jffs2.nfi ?= "-e ${DREAMBOX_ERASE_BLOCK_SIZE} -n -l"
60 EXTRA_IMAGECMD_sum.jffs2.nfi ?= "-e ${DREAMBOX_ERASE_BLOCK_SIZE} -n -l"
61
62 IMAGE_DEPENDS_jffs2.nfi = "${IMAGE_DEPENDS_jffs2} dreambox-buildimage-native"
63 IMAGE_DEPENDS_sum.jffs2.nfi = "${IMAGE_DEPENDS_sum.jffs2} dreambox-buildimage-native"
64
65 IMAGE_TYPES += "jffs2.nfi sum.jffs2.nfi"