diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2011-11-14 10:34:04 +0100 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2011-11-14 10:34:04 +0100 |
commit | eceb8e05b9e984e8221fb9a3754c2253d8c980f8 (patch) | |
tree | 6945b92f18d3d70c7086ab999f7ee2574c8bde35 /classes | |
parent | 4ec169d7d08218e3b1dad570ba34ed67a8897119 (diff) | |
download | meta-ti-eceb8e05b9e984e8221fb9a3754c2253d8c980f8.tar.gz |
sdcard_image bbclass: run genex2fs directly on the loop device
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'classes')
-rw-r--r-- | classes/sdcard_image.bbclass | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/classes/sdcard_image.bbclass b/classes/sdcard_image.bbclass index 531b4192..7d1f061d 100644 --- a/classes/sdcard_image.bbclass +++ b/classes/sdcard_image.bbclass | |||
@@ -130,20 +130,16 @@ IMAGE_CMD_sdimg () { | |||
130 | echo "Creating rootfs loopback" | 130 | echo "Creating rootfs loopback" |
131 | ${LOSETUP} ${LOOPDEV_FS} ${SDIMG} -o ${FS_OFFSET} | 131 | ${LOSETUP} ${LOOPDEV_FS} ${SDIMG} -o ${FS_OFFSET} |
132 | 132 | ||
133 | # should use fdisk info | ||
134 | echo "Creating rootfs image" | ||
135 | touch ${WORKDIR}/${IMAGE_NAME}.rootfs.img | ||
136 | |||
137 | FS_NUM_INODES=$(echo $FS_SIZE_BLOCKS / 4 | bc) | 133 | FS_NUM_INODES=$(echo $FS_SIZE_BLOCKS / 4 | bc) |
138 | 134 | ||
139 | case "${ROOTFSTYPE}" in | 135 | case "${ROOTFSTYPE}" in |
140 | ext3) | 136 | ext3) |
141 | genext2fs -z -N $FS_NUM_INODES -b $FS_SIZE_BLOCKS -d ${IMAGE_ROOTFS} ${WORKDIR}/${IMAGE_NAME}.rootfs.img | 137 | genext2fs -z -N $FS_NUM_INODES -b $FS_SIZE_BLOCKS -d ${IMAGE_ROOTFS} ${LOOPDEV_FS} |
142 | tune2fs -L ${IMAGE_NAME} -j ${WORKDIR}/${IMAGE_NAME}.rootfs.img | 138 | tune2fs -L ${IMAGE_NAME} -j ${LOOPDEV_FS} |
143 | ;; | 139 | ;; |
144 | ext4) | 140 | ext4) |
145 | genext2fs -z -N $FS_NUM_INODES -b $FS_SIZE_BLOCKS -d ${IMAGE_ROOTFS} ${WORKDIR}/${IMAGE_NAME}.rootfs.img | 141 | genext2fs -z -N $FS_NUM_INODES -b $FS_SIZE_BLOCKS -d ${IMAGE_ROOTFS} ${LOOPDEV_FS} |
146 | tune2fs -L ${IMAGE_NAME} -j -O extents,uninit_bg,dir_index ${WORKDIR}/${IMAGE_NAME}.rootfs.img | 142 | tune2fs -L ${IMAGE_NAME} -j -O extents,uninit_bg,dir_index ${LOOPDEV_FS} |
147 | ;; | 143 | ;; |
148 | *) | 144 | *) |
149 | echo "Please set ROOTFSTYPE to something supported" | 145 | echo "Please set ROOTFSTYPE to something supported" |
@@ -151,8 +147,6 @@ IMAGE_CMD_sdimg () { | |||
151 | ;; | 147 | ;; |
152 | esac | 148 | esac |
153 | 149 | ||
154 | dd if=${WORKDIR}/${IMAGE_NAME}.rootfs.img of=${LOOPDEV_FS} | ||
155 | |||
156 | ${LOSETUP} -d ${LOOPDEV_FS} || true | 150 | ${LOSETUP} -d ${LOOPDEV_FS} || true |
157 | 151 | ||
158 | gzip -c ${WORKDIR}/sd.img > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-${IMAGEDATESTAMP}.img.gz | 152 | gzip -c ${WORKDIR}/sd.img > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-${IMAGEDATESTAMP}.img.gz |