diff options
author | André Draszik <adraszik@tycoint.com> | 2016-06-10 16:11:38 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-12 23:47:18 +0100 |
commit | 9ac4c8b11cd28cc1d343f9b2a91a6666febe246d (patch) | |
tree | 065fa0868722b904071d86a875c220c3e0998d0d /meta/classes/image.bbclass | |
parent | 3332061f69ea03e1165f3c8b64197d3f35ffb95e (diff) | |
download | poky-9ac4c8b11cd28cc1d343f9b2a91a6666febe246d.tar.gz |
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.
(From OE-Core rev: 659ae1d7df28115429f6f31450fad6d1f86e3031)
Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r-- | meta/classes/image.bbclass | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 9f4c83ffc6..65ce6bb524 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -287,6 +287,7 @@ def setup_debugfs_variables(d): | |||
287 | d.appendVar('IMAGE_ROOTFS', '-dbg') | 287 | d.appendVar('IMAGE_ROOTFS', '-dbg') |
288 | d.appendVar('IMAGE_LINK_NAME', '-dbg') | 288 | d.appendVar('IMAGE_LINK_NAME', '-dbg') |
289 | d.appendVar('IMAGE_NAME','-dbg') | 289 | d.appendVar('IMAGE_NAME','-dbg') |
290 | d.setVar('IMAGE_BUILDING_DEBUGFS', 'true') | ||
290 | debugfs_image_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS', True) | 291 | debugfs_image_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS', True) |
291 | if debugfs_image_fstypes: | 292 | if debugfs_image_fstypes: |
292 | d.setVar('IMAGE_FSTYPES', debugfs_image_fstypes) | 293 | d.setVar('IMAGE_FSTYPES', debugfs_image_fstypes) |