Bug 487

Summary: [bash] job control doesn't work: e.g., fg/bg of bash not available
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Qing He <qing.he>
Component: meta-yoctoAssignee: Dexuan Cui <dexuan.cui>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: High CC: dexuan.cui, jessica.zhang, ke.yu, kevin.tian, poky.bs.watcher, poky.watcher, richard.purdie, sgw
Version: 0.9   
Target Milestone: 1.2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Qing He 2010-10-19 01:51:57 UTC
The fb/bg subcommand cannot run in bash, this also fails bash testsuite

reproduce step:
  $ bash
  $ fg
  bash: fg: command not found


expected result: "no current job"
Comment 1 Qing He 2010-10-20 01:52:11 UTC
job control can't be detected when cross-compiling, can be enabled explicitly by "--enable-job-control"
Comment 3 Dexuan Cui 2011-10-31 23:09:50 UTC
(In reply to comment #1)
> job control can't be detected when cross-compiling, can be enabled explicitly
> by "--enable-job-control"

Actually this doesn't work.  --enable-job-control is only a hint of wanting job control to work -- it can't 100% make sure the feature is properly enabled.

The config script actually reports:

configure:29262: checking for presence of necessary job control definitions
configure:29268: WARNING: cannot check job control if cross-compiling -- defaulting to missing
configure:29362: result: missing


According to the discussions at 
http://www.mail-archive.com/bug-bash@gnu.org/msg03107.html,
looks "export bash_cv_job_control_missing=present" would work.
Comment 4 Dexuan Cui 2011-10-31 23:13:32 UTC
(In reply to comment #3)
> (In reply to comment #1)
> > job control can't be detected when cross-compiling, can be enabled explicitly
> > by "--enable-job-control"
> 
> Actually this doesn't work.  --enable-job-control is only a hint of wanting job
> control to work -- it can't 100% make sure the feature is properly enabled.
BTW, busybox's sh does support job control properly.
In core-image-minimal, busybox's sh is used by default, so people might think the bug has been fixed...
In core-image-sato, the bash from the recipe bash is used and we can reproduce this bug.
Comment 5 Dexuan Cui 2011-11-01 01:09:42 UTC
(In reply to comment #3)
> (In reply to comment #1)
> > job control can't be detected when cross-compiling, can be enabled explicitly
> > by "--enable-job-control"
> 
> Actually this doesn't work.  --enable-job-control is only a hint of wanting job
> control to work -- it can't 100% make sure the feature is properly enabled.
> 
> The config script actually reports:
> 
> configure:29262: checking for presence of necessary job control definitions
> configure:29268: WARNING: cannot check job control if cross-compiling --
> defaulting to missing
> configure:29362: result: missing
> 
> 
> According to the discussions at 
> http://www.mail-archive.com/bug-bash@gnu.org/msg03107.html,
> looks "export bash_cv_job_control_missing=present" would work.


BTW, I worked out a fix and sent to oe-core ML:
http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=dcui/bug487&id=ac7b821f266e932e267a4d62af83586ba3261a98.