]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel.bbclass: fix the bug of checking the existing sections in do_strip()
authorKevin Hao <kexin.hao@windriver.com>
Wed, 30 Sep 2015 02:29:33 +0000 (10:29 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 1 Oct 2015 06:40:37 +0000 (07:40 +0100)
Ross reported the following waring when building edgerouter BSP:
    WARNING: Section not found: .comment

The reason is that the testing of the existing sections in do_strip()
returned the wrong value. Please see the following code in do_strip():
                for str in ${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}; do {
                        if [ "$headers" != *"$str"* ]; then
                                bbwarn "Section not found: $str";
                        fi

                        "$CROSS_COMPILE"strip -s -R $str ${KERNEL_OUTPUT}
                }; done

The "*" doesn't have special meaning in the if string test, so it will
return true even the $str is a substring of $headers. Fix this issue
by replacing it with "! (echo "$headers" | grep -q "^$str$")".

Reported-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/kernel.bbclass

index dfbdfd24ffdb6af19c684a2d441b67ce2805832d..5e8b6cf343181a022b2bbd29766800e6d1061e5c 100644 (file)
@@ -413,7 +413,7 @@ do_strip() {
                          gawk '{print $1}'`
 
                for str in ${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}; do {
-                       if [ "$headers" != *"$str"* ]; then
+                       if ! (echo "$headers" | grep -q "^$str$"); then
                                bbwarn "Section not found: $str";
                        fi