Skip to contentSkip to conversation

relaxed testing for shell

PATCH In review Juro Bystricky 2 participants 3 messages Mar 15, 2017

lore
Share & tools
lore
#0 lore raw

cover relaxed testing for shell

Due to the recently implemented update-alternatives for bash binary, sanity checker may end up with a (false-positive) error such as:

Error, /bin/sh links to /bin/bash.bash, must be dash or bash

This patch is also desired for "morty", even if it may not support update-alternatives for bash, otherwise, for example builds using "master" toaster will fail when using "morty" release.

Juro Bystricky (1):
sanity.bbclass: modify check for shell

 meta/classes/sanity.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 sanity.bbclass: modify check for shell

Due to the recently implemented update-alternatives for bash binary, sanity checker may end up with a (false-positive) error such as:

Error, /bin/sh links to /bin/bash.bash, must be dash or bash

This patch modifies the test: presence of "/bash" or "/dash" in shell binary name results in pass.

[YOCTO#11108]

---
 meta/classes/sanity.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/sanity.bbclass +3 -1
index 7682ffb..a11b581 100644
@@ -929,7 +929,9 @@ def check_sanity_everybuild(status, d):
     # 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'):
+        # Due to update-alternatives, the shell name may take various
+        # forms, such as /bin/dash, bin/bash, /bin/bash.bash ...
+        if '/dash' not in real_sh and '/bash' not in real_sh:
             status.addresult("Error, /bin/sh links to %s, must be dash or bash\n" % real_sh)
 
 def check_sanity(sanity_data):
Signature · 1 line
2.7.4
#2 lore raw

Re: [morty][PATCH 1/1] sanity.bbclass: modify check for shell

Quoted 7 lines · Juro Bystricky

Due to the recently implemented update-alternatives for bash binary, sanity checker may end up with a (false-positive) error such as:

Error, /bin/sh links to /bin/bash.bash, must be dash or bash

This patch modifies the test: presence of "/bash" or "/dash" in shell binary name results in pass.

ok. got it in my pre-stagging.
thanks
- armin

Quoted 23 lines

[YOCTO#11108]

---
  meta/classes/sanity.bbclass | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/sanity.bbclass +3 -1
index 7682ffb..a11b581 100644
@@ -929,7 +929,9 @@ def check_sanity_everybuild(status, d):
      # 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'):
+        # Due to update-alternatives, the shell name may take various
+        # forms, such as /bin/dash, bin/bash, /bin/bash.bash ...
+        if '/dash' not in real_sh and '/bash' not in real_sh:
              status.addresult("Error, /bin/sh links to %s, must be dash or bash\n" % real_sh)
 
  def check_sanity(sanity_data):