diff options
author | Andrei Gherzan <andrei@gherzan.ro> | 2012-09-10 19:26:27 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-14 09:50:26 +0100 |
commit | 30db39829b64d675e8114f0441bb7b71b3161f10 (patch) | |
tree | f4803fdcd3aaa612bae30715a4aab5e0462227ff | |
parent | e5561887e761bf98f07c7a0995cd28f5a936f289 (diff) | |
download | poky-30db39829b64d675e8114f0441bb7b71b3161f10.tar.gz |
image_types.bbclass: Round up ROOTFS_SIZE after base_size check
If we round up ROOTFS_SIZE to IMAGE_ROOTFS_ALIGNMENT before checking if
base_size is greater then IMAGE_ROOTFS_SIZE, we can end up adding an
unaligned value to IMAGE_ROOTFS_SIZE. Obviously, if
IMAGE_ROOTFS_EXTRA_SPACE was overwritten with an unaligned value. So
let's add the round up code after the base_size calculus and it's
comparison.
(From OE-Core rev: 726c1617077da6b49606ac1a2cae64d2d02e6214)
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/image_types.bbclass | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass index 6f8514ff5b..8d76cc907e 100644 --- a/meta/classes/image_types.bbclass +++ b/meta/classes/image_types.bbclass | |||
@@ -82,9 +82,9 @@ runimagecmd () { | |||
82 | # The base_size gets calculated: | 82 | # The base_size gets calculated: |
83 | # - initial size determined by `du -ks` of the IMAGE_ROOTFS | 83 | # - initial size determined by `du -ks` of the IMAGE_ROOTFS |
84 | # - then multiplied by the IMAGE_OVERHEAD_FACTOR | 84 | # - then multiplied by the IMAGE_OVERHEAD_FACTOR |
85 | # - then rounded up to IMAGE_ROOTFS_ALIGNMENT | 85 | # - tested against IMAGE_ROOTFS_SIZE |
86 | # - finally tested against IMAGE_ROOTFS_SIZE | 86 | # - round up ROOTFS_SIZE to IMAGE_ROOTFS_ALIGNMENT |
87 | ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS}|awk '{base_size = $1 * ${IMAGE_OVERHEAD_FACTOR} + ${IMAGE_ROOTFS_ALIGNMENT} - 1; base_size -= base_size % ${IMAGE_ROOTFS_ALIGNMENT}; print ((base_size > ${IMAGE_ROOTFS_SIZE} ? base_size : ${IMAGE_ROOTFS_SIZE}) + ${IMAGE_ROOTFS_EXTRA_SPACE}) }'` | 87 | ROOTFS_SIZE=`du -ks ${IMAGE_ROOTFS} | awk '{base_size = $1 * ${IMAGE_OVERHEAD_FACTOR}; base_size = ((base_size > ${IMAGE_ROOTFS_SIZE} ? base_size : ${IMAGE_ROOTFS_SIZE}) + ${IMAGE_ROOTFS_EXTRA_SPACE}); if (base_size != int(base_size)) base_size = int(base_size + 1); base_size = base_size + ${IMAGE_ROOTFS_ALIGNMENT} - 1; base_size -= base_size % ${IMAGE_ROOTFS_ALIGNMENT}; print base_size }'` |
88 | ${cmd} | 88 | ${cmd} |
89 | # Now create the needed compressed versions | 89 | # Now create the needed compressed versions |
90 | cd ${DEPLOY_DIR_IMAGE}/ | 90 | cd ${DEPLOY_DIR_IMAGE}/ |