summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorAndrea Adami <andrea.adami@gmail.com>2012-01-26 08:09:50 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-01 14:58:45 +0000
commitab282056148f3152f96b6990e09270ae5405da9d (patch)
tree323a8930f2ab6cee4853adbc81c3b6221fde35ee /meta
parent6d3eac57bdba8e2582c210a2f82a3a4546f68581 (diff)
downloadopenembedded-core-ab282056148f3152f96b6990e09270ae5405da9d.tar.gz
openembedded-core-ab282056148f3152f96b6990e09270ae5405da9d.tar.bz2
openembedded-core-ab282056148f3152f96b6990e09270ae5405da9d.zip
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). Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/image_types.bbclass21
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
IMAGE_CMD_tar.gz = "cd ${IMAGE_ROOTFS} && tar -zcvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar.gz ."
IMAGE_CMD_tar.bz2 = "cd ${IMAGE_ROOTFS} && tar -jcvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar.bz2 ."
IMAGE_CMD_tar.xz = "cd ${IMAGE_ROOTFS} && tar --xz -cvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar.xz ."
-IMAGE_CMD_cpio () {
+
+CPIO_TOUCH_INIT () {
+ if [ ! -L ${IMAGE_ROOTFS}/init ]
+ then
touch ${IMAGE_ROOTFS}/init
+ fi
+}
+IMAGE_CMD_cpio () {
+ ${CPIO_TOUCH_INIT}
cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio)
}
IMAGE_CMD_cpio.gz () {
- touch ${IMAGE_ROOTFS}/init
+ ${CPIO_TOUCH_INIT}
cd ${IMAGE_ROOTFS} && (find . | cpio -o -H newc | gzip -c -9 >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.gz)
}
-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}"
-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}"
+IMAGE_CMD_cpio.xz () {
+ ${CPIO_TOUCH_INIT}
+ 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}
+}
+IMAGE_CMD_cpio.lzma () {
+ ${CPIO_TOUCH_INIT}
+ 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}
+}
UBI_VOLNAME ?= "${MACHINE}-rootfs"