diff options
author | Andrea Adami <andrea.adami@gmail.com> | 2012-01-26 08:09:50 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-01 15:07:41 +0000 |
commit | 84e24f0f005aab7ba23bfa002a7a52785137f947 (patch) | |
tree | d4900282a9d098ab02f062978cc90d19387aa305 /meta/classes | |
parent | 636d7e308fefe7cca67166d564c3a8f877f2ca86 (diff) | |
download | poky-84e24f0f005aab7ba23bfa002a7a52785137f947.tar.gz |
image_types.bbclass: refactor cpio images generation.
* Add common check for the presence of an /init
* symlink, being 'touch' would fail with it
* and 'touch -h' is not yet generally supported
* (depends on distro on build host).
(From OE-Core rev: ab282056148f3152f96b6990e09270ae5405da9d)
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/image_types.bbclass | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass index 4908ed99bf..eef554d04c 100644 --- a/meta/classes/image_types.bbclass +++ b/meta/classes/image_types.bbclass | |||
@@ -115,16 +115,29 @@ IMAGE_CMD_tar = "cd ${IMAGE_ROOTFS} && tar -cvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME | |||
115 | IMAGE_CMD_tar.gz = "cd ${IMAGE_ROOTFS} && tar -zcvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar.gz ." | 115 | IMAGE_CMD_tar.gz = "cd ${IMAGE_ROOTFS} && tar -zcvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar.gz ." |
116 | IMAGE_CMD_tar.bz2 = "cd ${IMAGE_ROOTFS} && tar -jcvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar.bz2 ." | 116 | IMAGE_CMD_tar.bz2 = "cd ${IMAGE_ROOTFS} && tar -jcvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar.bz2 ." |
117 | IMAGE_CMD_tar.xz = "cd ${IMAGE_ROOTFS} && tar --xz -cvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar.xz ." | 117 | IMAGE_CMD_tar.xz = "cd ${IMAGE_ROOTFS} && tar --xz -cvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar.xz ." |
118 | IMAGE_CMD_cpio () { | 118 | |
119 | CPIO_TOUCH_INIT () { | ||
120 | if [ ! -L ${IMAGE_ROOTFS}/init ] | ||
121 | then | ||
119 | touch ${IMAGE_ROOTFS}/init | 122 | touch ${IMAGE_ROOTFS}/init |
123 | fi | ||
124 | } | ||
125 | IMAGE_CMD_cpio () { | ||
126 | ${CPIO_TOUCH_INIT} | ||
120 | cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio) | 127 | cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio) |
121 | } | 128 | } |
122 | IMAGE_CMD_cpio.gz () { | 129 | IMAGE_CMD_cpio.gz () { |
123 | touch ${IMAGE_ROOTFS}/init | 130 | ${CPIO_TOUCH_INIT} |
124 | cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc | gzip -c -9 >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.gz) | 131 | cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc | gzip -c -9 >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.gz) |
125 | } | 132 | } |
126 | IMAGE_CMD_cpio.xz = "type cpio >/dev/null; cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc | xz -c ${XZ_COMPRESSION_LEVEL} --check=${XZ_INTEGRITY_CHECK} > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.xz) ${EXTRA_IMAGECMD}" | 133 | IMAGE_CMD_cpio.xz () { |
127 | IMAGE_CMD_cpio.lzma = "type cpio >/dev/null; cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc | xz --format=lzma -c ${XZ_COMPRESSION_LEVEL} --check=${XZ_INTEGRITY_CHECK} >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.lzma) ${EXTRA_IMAGECMD}" | 134 | ${CPIO_TOUCH_INIT} |
135 | cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc | xz -c ${XZ_COMPRESSION_LEVEL} --check=${XZ_INTEGRITY_CHECK} > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.xz) ${EXTRA_IMAGECMD} | ||
136 | } | ||
137 | IMAGE_CMD_cpio.lzma () { | ||
138 | ${CPIO_TOUCH_INIT} | ||
139 | cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc | xz --format=lzma -c ${XZ_COMPRESSION_LEVEL} --check=${XZ_INTEGRITY_CHECK} >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.lzma) ${EXTRA_IMAGECMD} | ||
140 | } | ||
128 | 141 | ||
129 | UBI_VOLNAME ?= "${MACHINE}-rootfs" | 142 | UBI_VOLNAME ?= "${MACHINE}-rootfs" |
130 | 143 | ||