Bug 4473 - kernel-tools-native's merge_config.sh isn't sh-compliant
Summary: kernel-tools-native's merge_config.sh isn't sh-compliant
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: kernel (show other bugs)
Version: 1.4
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.4.1
Assignee: Bruce Ashfield
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-05-09 12:37 UTC by Ross Burton
Modified: 2013-05-25 04:25 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2013-05-09 12:37:05 UTC
The merge_config.sh in kernel-tools-native uses "trap" syntax that isn't POSIX compliant, so when running under dash this produces an error, which means busybox won't configure.

In tracing this I discovered that copy of this tool in the kernel was fix in late 2012 by a certain Darren Hart.  The changes in the kernel should probably be backported to the yocto-kernel-tools repository as we've had two reports of Ubuntu users with sh->dash failing to build busybox.
Comment 1 Bruce Ashfield 2013-05-09 12:39:05 UTC
I'll take this. I maintain the kern-tools, and already started fixing this yesterday.
Comment 2 Otavio Salvador 2013-05-09 12:57:59 UTC
Thanks, please backport the patch to 1.4 (and maybe 1.3) so people using Ubuntu 10.04 can use it without problems. I had some customers complaining about it.
Comment 3 Bruce Ashfield 2013-05-09 13:04:07 UTC
I'll send the changes to the stable branches for testing. There are a few
patches we carry for extra functionality used by the kernel fragment processing
(which I'll send upstream for the next kernel cycle), so it's not a completely 
straight backport.

Do we have any issues reported on 1.3 ? We only started using merge_config.sh
for busybox in 1.4:

> git tag --contains 56dc1720caa48344238d352c7b6e9b0f0d41aa54
1.4_M4.final
1.4_M4.rc1
1.4_M5.final
1.4_M5.rc1
1.4_M5.rc2
1.4_M5.rc3
1.4_M6.rc1
dylan-9.0.0

So I'll start with 1.4 and see if we get a tangible issue reported in 1.3. Merging it back
further increases the risk, and testing .. so I'll take the cautious route and wait on it.
Comment 4 Ross Burton 2013-05-09 13:05:43 UTC
Agreed, every report of this I've seen was against master or 1.4 - 1.3 is safe from the busybox aspect at least.
Comment 5 Otavio Salvador 2013-05-09 13:56:18 UTC
But it is a risk as it is used by linux-yocto recipe in 1.3 so if it has same issue there it'd be better to port the fix for it as well.
Comment 6 Darren Hart 2013-05-09 14:51:27 UTC
Remember merge_config.sh is in the mainline kernel, let's do this properly and fix upstream first. I actually tested this on bash and dash when I wrote it.... hrm, not sure where the gap was here.
Comment 7 Darren Hart 2013-05-09 14:52:48 UTC
Upstream commit shows this is indeed tested on dash. How is this failing for people? Is it just that we haven't pulled in the upstream signal name fix?

$ git show 041b78c
commit 041b78c89b1fe68f44c45e8b6cc6c9f8ea8f0e4c
Author: Darren Hart <dvhart@linux.intel.com>
Date:   Tue Jan 10 15:41:10 2012 -0800

    merge_config.sh: use signal names compatible with dash and bash
    
    The SIGHUP SIGINT and SIGTERM names caused failures when running
    merge_config.sh with the dash shell.  Dropping the "SIG" component makes
    the script work in both bash and dash.
    
    Signed-off-by: Darren Hart <dvhart@linux.intel.com>
    Acked-by: John Stultz <john.stultz@linaro.org>
    Cc: Michal Marek <mmarek@suse.cz>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Michal Marek <mmarek@suse.cz>

diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index 890276b..b91015d 100644
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -24,7 +24,7 @@ clean_up() {
        rm -f $TMP_FILE
        exit
 }
-trap clean_up SIGHUP SIGINT SIGTERM
+trap clean_up HUP INT TERM
 
 usage() {
        echo "Usage: $0 [OPTIONS] [CONFIG [...]]"
Comment 8 Bruce Ashfield 2013-05-09 15:02:40 UTC
Darren: that's what I meant, I'll just pick up the mainline fixes, there's nothing I need to fix,
just backports.

My changes will go upstream as well, but they aren't the problem.

I need to have it out of tree for now,  for two reasons: busybox can't depend on the kernel,
and we don't want duplicate code. I'll just make sure that I'm always trolling for the few
fixes and get them into kern-tools. Our packaging is like the kconfig-frontends, where it
is pulled out and packaged for other needs.
Comment 9 Bruce Ashfield 2013-05-09 19:33:11 UTC
changes have been ported and local changes rebased. testing busy box and kernel for use case regressions.
Comment 10 Bruce Ashfield 2013-05-10 04:33:17 UTC
Changes are done and pushed to the kern-tools repo. busybox and 3.8/3.4 kernel tested against master and 1.4.

Changes will be sent tomorrow, with 1.3 changes to follow.
Comment 11 Paul Eggleton 2013-05-22 16:24:49 UTC
Fix has been merged into master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f259554b4e91eecbb009622a64e43c5619aedb92

and also dylan (for 1.4.1):

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=dylan&id=3faa5039c8147d0bf9e352dc5ad1e9e12cf2086a

For danny the merge is still pending AFAICT.