]> code.ossystems Code Review - openembedded-core.git/commit
image_types.bbclass: fixed 'init' creation for cpio images
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>
Thu, 22 Jan 2015 16:13:00 +0000 (17:13 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 28 Jan 2015 21:22:22 +0000 (21:22 +0000)
commit2aa5d2880ee3578f4965f245addd365fb7b1c1ca
treec2b05f653874c61f8bbbfd4d2b48e7132e732ac6
parent907514c1b2d07231eb6ec63d21ad5dc25e731b29
image_types.bbclass: fixed 'init' creation for cpio images

When /init is a dangling symlink or a symlink to a file which can not be
stated on the build system (e.g. due to SELinux restrictions), the '[ !
-e .../init ]' test will succeed which causes the manual creation of
/init.

E.g. here:

| $ ls -la cpio_append/init
| lrwxrwxrwx. 1 ensc ensc 10 22. Jan 16:26 cpio_append/init -> /sbin/init
|
| $ strace /bin/test -e  cpio_append/init
| stat("cpio_append/init", 0x7fff374a9db0) = -1 EACCES (Permission denied)
| exit_group(1)                           = ?

To test for the existence of a file, both '-L' and '-e' checks must be
executed and to prevent SELinux noise, the '-L' should happen before
'-e'.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/image_types.bbclass