]> code.ossystems Code Review - openembedded-core.git/commitdiff
sanity.bbclass: Only verify /bin/sh link if it's a link
authorOlof Johansson <olof.johansson@axis.com>
Wed, 10 Aug 2016 07:38:48 +0000 (09:38 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 17 Aug 2016 09:31:10 +0000 (10:31 +0100)
If /bin/sh is a regular file (and not a symlink), we assume it's a
reasonable shell and allow it.

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/sanity.bbclass

index 088dd2ac2381c3e378efd0f1557b30d3f86f82bf..98345ce103893199f4795ec7836cf06c9ebfaa5a 100644 (file)
@@ -932,10 +932,11 @@ def check_sanity_everybuild(status, d):
         with open(checkfile, "w") as f:
             f.write(tmpdir)
 
-    # Check /bin/sh links to dash or bash
-    real_sh = os.path.realpath('/bin/sh')
-    if not real_sh.endswith('/dash') and not real_sh.endswith('/bash'):
-        status.addresult("Error, /bin/sh links to %s, must be dash or bash\n" % real_sh)
+    # If /bin/sh is a symlink, check that it points to dash or bash
+    if os.path.islink('/bin/sh'):
+        real_sh = os.path.realpath('/bin/sh')
+        if not real_sh.endswith('/dash') and not real_sh.endswith('/bash'):
+            status.addresult("Error, /bin/sh links to %s, must be dash or bash\n" % real_sh)
 
 def check_sanity(sanity_data):
     class SanityStatus(object):