]> code.ossystems Code Review - openembedded-core.git/commit
image/image_types.bbclass: fix fatal error during cpio debugfs creation
authorAndré Draszik <adraszik@tycoint.com>
Fri, 10 Jun 2016 15:11:38 +0000 (16:11 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 12 Jun 2016 22:46:45 +0000 (23:46 +0100)
commit659ae1d7df28115429f6f31450fad6d1f86e3031
tree037946a48e32d6cecb51fb44311b931060ace738
parent46708da7a69ce4d4b0709abe6b694d7f0bd4deb5
image/image_types.bbclass: fix fatal error during cpio debugfs creation

If /init is just a symlink to /sbin/init, debugfs creation
fails with the following error:

ERROR: Error: The image creation script '<...>/debugfs.create_image.cpio' returned 1:
touch: cannot touch '<...>/cpio_append/init': Permission denied
WARNING: exit code 1 from a shell command.

ERROR: Function failed: do_rootfs

The reason is that IMAGE_CMD_cpio() is run twice on the same
WORKDIR. The first run creates a symlink in WORKDIR/cpio_append/init
to point to /sbin/init, while the 2nd run then tries to 'touch'
that link, which will fail, of course since /sbin/init is not
usually writable by non-root users.

Fix this by providing knowledge to the IMAGE_CMD_xxx() scripts
with regards to the fact that they are being executed in the
context of debugfs creation. The IMAGE_CMD_cpio() can now be
intelligent in the sense that it can avoid all additional symlink
handling during the debugfs run. The symlinks do not need to
be part of the debugfs, so we can skip that part altogether
in that case.

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/image.bbclass
meta/classes/image_types.bbclass