add possibility to set manual PV
[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                 --disable-compressor=lzo \
7                 --compression-mode=size \
8                 --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \
9                 ${EXTRA_IMAGECMD}; \
10         rm -rf ${IMAGE_ROOTFS}/boot/*; \
11         printf '/dev/mtdblock2\t/boot\t\tjffs2\tro\t\t\t\t0 0\n' >> ${IMAGE_ROOTFS}/etc/fstab; \
12         mkfs.jffs2 \
13                 --root=${IMAGE_ROOTFS} \
14                 --disable-compressor=lzo \
15                 --compression-mode=size \
16                 --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
17                 ${EXTRA_IMAGECMD}; \
18         ${DREAMBOX_BUILDIMAGE} \
19                 --boot-partition ${DREAMBOX_PART0_SIZE}:${STAGING_DATADIR}/dreambox-secondstage/secondstage-${MACHINE}.bin \
20                 --data-partition ${DREAMBOX_PART1_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \
21                 --data-partition ${DREAMBOX_PART2_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
22                 > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.nfi; \
23 "
24
25 IMAGE_CMD_sum.jffs2.nfi = " \
26         mkfs.jffs2 \
27                 --root=${IMAGE_ROOTFS}/boot \
28                 --disable-compressor=lzo \
29                 --compression-mode=size \
30                 --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \
31                 ${EXTRA_IMAGECMD}; \
32         sumtool \
33                 -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \
34                 -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.sum.jffs2 \
35                 ${EXTRA_IMAGECMD}; \
36         rm -rf ${IMAGE_ROOTFS}/boot/*; \
37         printf '/dev/mtdblock2\t/boot\t\tjffs2\tro\t\t\t\t0 0\n' >> ${IMAGE_ROOTFS}/etc/fstab; \
38         mkfs.jffs2 \
39                 --root=${IMAGE_ROOTFS} \
40                 --disable-compressor=lzo \
41                 --compression-mode=size \
42                 --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
43                 ${EXTRA_IMAGECMD}; \
44         sumtool \
45                 -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
46                 -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.sum.jffs2 \
47                 ${EXTRA_IMAGECMD}; \
48         ${DREAMBOX_BUILDIMAGE} \
49                 --boot-partition ${DREAMBOX_PART0_SIZE}:${STAGING_DATADIR}/dreambox-secondstage/secondstage-${MACHINE}.bin \
50                 --data-partition ${DREAMBOX_PART1_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.sum.jffs2 \
51                 --data-partition ${DREAMBOX_PART2_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.sum.jffs2 \
52                 > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.nfi; \
53 "
54
55 EXTRA_IMAGECMD_jffs2.nfi ?= "-e ${DREAMBOX_ERASE_BLOCK_SIZE} -n -l"
56 EXTRA_IMAGECMD_sum.jffs2.nfi ?= "-e ${DREAMBOX_ERASE_BLOCK_SIZE} -n -l"
57
58 IMAGE_DEPENDS_jffs2.nfi = "${IMAGE_DEPENDS_jffs2} dreambox-buildimage-native"
59 IMAGE_DEPENDS_sum.jffs2.nfi = "${IMAGE_DEPENDS_sum.jffs2} dreambox-buildimage-native"
60
61 IMAGE_TYPES += "jffs2.nfi sum.jffs2.nfi"