meta-bsp: remove jffs rootfs image types and related code
[opendreambox.git] / meta-dreambox / classes / image_types_nfi.bbclass
1 inherit image_types
2
3 IMAGE_CMD_ubi.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         echo \[root\] > ubinize.cfg; \
13         echo mode=ubi >> ubinize.cfg; \
14         echo image=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs >> ubinize.cfg; \
15         echo vol_id=0 >> ubinize.cfg; \
16         echo vol_name=${UBI_VOLNAME} >> ubinize.cfg; \
17         echo vol_type=dynamic >> ubinize.cfg; \
18         if [ ${UBINIZE_VOLSIZE} = "0" ]; then \
19                 echo vol_flags=autoresize >> ubinize.cfg; \
20         else \
21                 echo vol_size=${UBINIZE_VOLSIZE} >> ubinize.cfg; \
22                 if [ ${UBINIZE_DATAVOLSIZE} != "0" ]; then \
23                         echo \[data\] >> ubinize.cfg; \
24                         echo mode=ubi >> ubinize.cfg; \
25                         echo vol_id=1 >> ubinize.cfg; \
26                         echo vol_type=dynamic >> ubinize.cfg; \
27                         echo vol_name=data >> ubinize.cfg; \
28                         echo vol_size=${UBINIZE_DATAVOLSIZE} >> ubinize.cfg; \
29                         echo vol_flags=autoresize >> ubinize.cfg; \
30                         printf '/dev/ubi0_1\t/data\t\tubifs\trw,nofail\t\t\t\t0 0\n' >> ${IMAGE_ROOTFS}/etc/fstab; \
31                         install -d ${IMAGE_ROOTFS}/data; \
32                 fi; \
33         fi; \
34         mkfs.ubifs \
35                 -r ${IMAGE_ROOTFS} \
36                 -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs \
37                 ${MKUBIFS_ARGS}; \
38         ubinize -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${UBINIZE_ARGS} ubinize.cfg; \
39         ${DREAMBOX_BUILDIMAGE} \
40                 --boot-partition ${DREAMBOX_PART0_SIZE}:${STAGING_DATADIR}/dreambox-secondstage/secondstage.bin \
41                 --data-partition ${DREAMBOX_PART1_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \
42                 --data-partition ${DREAMBOX_PART2_SIZE}:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi \
43                 > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.nfi; \
44 "
45
46 EXTRA_IMAGECMD_ubi.nfi ?= "-e ${DREAMBOX_ERASE_BLOCK_SIZE} -n -l"
47
48 IMAGE_DEPENDS_ubi.nfi = "${IMAGE_DEPENDS_ubi} ${IMAGE_DEPENDS_ubifs} dreambox-buildimage-native"
49
50 IMAGE_TYPES += "ubi.nfi"
51
52 runimagecmd_append() {
53     if [ -n "${IMAGE_LINK_NAME}" ]; then
54         if [ -e ${IMAGE_NAME}.nfi ]; then
55             ln -s ${IMAGE_NAME}.nfi ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.nfi
56         fi
57     fi
58 }