diff options
author | Enrico Scholz <enrico.scholz@sigma-chemnitz.de> | 2015-01-22 17:13:01 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-29 15:36:48 +0000 |
commit | 43dc6b5974eb32c45dd35281ecc8ef8de14d52b5 (patch) | |
tree | bab31bd5fc8a5db1b56c65764648f1ff46fe4156 /meta/classes | |
parent | e598bd52eff8bf85cfe3b0d719c97c5ed25f8ebb (diff) | |
download | poky-43dc6b5974eb32c45dd35281ecc8ef8de14d52b5.tar.gz |
image_types.bbclass: manage 'cpio_append' directory
For cpio images, do_rootfs() can operate on a dirty '${WORKDIR}/cpio_append'
directory which contains e.g. files from previous builds. This can cause
unwanted files in the image or can break the build.
E.g. when there is a cpio_append/init -> /sbin/init symlink symlink, the
'ln -sf' can fail due to SELinux restrictions:
| $ ls -la cpio_append/init
| lrwxrwxrwx. 1 ensc ensc 10 22. Jan 16:26 cpio_append/init -> /sbin/init
|
| $ strace ln -sf /sbin/init cpio_append/init
| ...
| stat("cpio_append/init", 0x7fffbb9ca310) = -1 EACCES (Permission denied)
| exit_group(1) = ?
Patch cleans up 'cpio_append' before executing the 'do_rootfs' task by
adding it to 'cleandirs'. An alternative implementation (which avoids
creation of this empty dir for non-cpio images) might remove it within
IMAGE_CMD_cpio, but this might break builds where people rely on the
existence of this directory (e.g. to add local files).
(From OE-Core rev: 4db3cc2360289c062fa0df4678f2f2ef990f0c1a)
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/image_types.bbclass | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass index 80a67bae47..0c27f298fc 100644 --- a/meta/classes/image_types.bbclass +++ b/meta/classes/image_types.bbclass | |||
@@ -68,10 +68,10 @@ IMAGE_CMD_squashfs-xz = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_ | |||
68 | IMAGE_CMD_squashfs-lzo = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs-lzo ${EXTRA_IMAGECMD} -noappend -comp lzo" | 68 | IMAGE_CMD_squashfs-lzo = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs-lzo ${EXTRA_IMAGECMD} -noappend -comp lzo" |
69 | IMAGE_CMD_tar = "tar -cvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar -C ${IMAGE_ROOTFS} ." | 69 | IMAGE_CMD_tar = "tar -cvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar -C ${IMAGE_ROOTFS} ." |
70 | 70 | ||
71 | do_rootfs[cleandirs] += "${WORKDIR}/cpio_append" | ||
71 | IMAGE_CMD_cpio () { | 72 | IMAGE_CMD_cpio () { |
72 | (cd ${IMAGE_ROOTFS} && find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio) | 73 | (cd ${IMAGE_ROOTFS} && find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio) |
73 | if [ ! -L ${IMAGE_ROOTFS}/init -a ! -e ${IMAGE_ROOTFS}/init ]; then | 74 | if [ ! -L ${IMAGE_ROOTFS}/init -a ! -e ${IMAGE_ROOTFS}/init ]; then |
74 | mkdir -p ${WORKDIR}/cpio_append | ||
75 | if [ -L ${IMAGE_ROOTFS}/sbin/init -o -e ${IMAGE_ROOTFS}/sbin/init ]; then | 75 | if [ -L ${IMAGE_ROOTFS}/sbin/init -o -e ${IMAGE_ROOTFS}/sbin/init ]; then |
76 | ln -sf /sbin/init ${WORKDIR}/cpio_append/init | 76 | ln -sf /sbin/init ${WORKDIR}/cpio_append/init |
77 | else | 77 | else |