Bug 598

Summary: [poky] kernel interactive build does not work via ssh
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Jiajun Xu <jiajun.xu>
Component: meta-yoctoAssignee: Bruce Ashfield <bruce.ashfield>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: bruce.ashfield, ke.yu, kevin.tian, kunwei.tian, poky.bs.watcher, poky.watcher, richard.purdie, sgw
Version: 1.0   
Target Milestone: 1.0 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Jiajun Xu 2010-12-15 06:42:24 UTC
Testing Env:    
Poky gitinfo: 3a78838d4f1db75d06b5d3df042638f34cf328f5

This is an enhancement request. Poky supports kernel interactive build such as, "bitbake linux-yocto -c menuconfig". But currently such command only works on local X desktop. It cannot work via ssh, which is a common usage model for developer.

Reproduce steps:
1. Download latest poky source
2. Run "bitbake linux-yocto -c menuconfig" in a ssh session
Comment 1 Jiajun Xu 2010-12-15 06:43:25 UTC
(In reply to comment #0)
> Testing Env:    
> Poky gitinfo: 3a78838d4f1db75d06b5d3df042638f34cf328f5
> This is an enhancement request. Poky supports kernel interactive build such as,
> "bitbake linux-yocto -c menuconfig". But currently such command only works on
> local X desktop. It cannot work via ssh, which is a common usage model for
> developer.
> Reproduce steps:
> 1. Download latest poky source
> 2. Run "bitbake linux-yocto -c menuconfig" in a ssh session

The error we got when running in a ssh session:

###########
NOTE: package linux-yocto-2.6.37+git0+ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9_0+87aacc373557f8849dde8618fbe1f7f8f2af6038-r14: task do_menuconfig: Started
ERROR: Task failed: ('function do_menuconfig failed', '/home/jxu49/osel/poky-m2/build/tmp/work/qemux86-poky-linux/linux-yocto-2.6.37+git0+ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9_0+87aacc373557f8849dde8618fbe1f7f8f2af6038-r14/temp/log.do_menuconfig.28018')
ERROR: Logfile of failure stored in: /home/jxu49/osel/poky-m2/build/tmp/work/qemux86-poky-linux/linux-yocto-2.6.37+git0+ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9_0+87aacc373557f8849dde8618fbe1f7f8f2af6038-r14/temp/log.do_menuconfig.28018
Log data follows:
| Failed to parse arguments: Cannot open display:
| ERROR: Task failed: ('function do_menuconfig failed', '/home/jxu49/osel/poky-m2/build/tmp/work/qemux86-poky-linux/linux-yocto-2.6.37+git0+ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9_0+87aacc373557f8849dde8618fbe1f7f8f2af6038-r14/temp/log.do_menuconfig.28018')
NOTE: package linux-yocto-2.6.37+git0+ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9_0+87aacc373557f8849dde8618fbe1f7f8f2af6038-r14: task do_menuconfig: Failed
ERROR: Task 6 (/home/jxu49/osel/poky-m2/meta/recipes-kernel/linux/linux-yocto_git.bb, do_menuconfig) failed with 1
ERROR: '/home/jxu49/osel/poky-m2/meta/recipes-kernel/linux/linux-yocto_git.bb' failed
###########
Comment 2 Saul Wold 2010-12-15 11:22:41 UTC
Can you try setting TERMCMD and TERMCMDRUN to the screen settings and see if that works?

Place the following in your local.conf

TERMCMD = "${SCREEN_TERMCMD}"
TERMCMDRUN = "${SCREEN_TERMCMDRUN}"
Comment 3 Bruce Ashfield 2010-12-15 13:09:46 UTC
No change here:


yow-bashfiel-d2 [/home/bruc...poky/build]> cat conf/local.conf | grep SCREE
TERMCMD = "${SCREEN_TERMCMD}"
TERMCMDRUN = "${SCREEN_TERMCMDRUN}"


bitbake -f linux-yocto -c menuconfig
NOTE: Handling BitBake files: - (0773/0773) [100 %]
Parsing of 773 .bb files complete (726 cached, 47 parsed). 932 targets, 34 skipped, 0 masked, 0 errors.

OE Build Configuration:
BB_VERSION        = "1.11.0"
METADATA_BRANCH   = "master"
METADATA_REVISION = "774de9680f32009be3af41155c9750769a611a47"
TARGET_ARCH       = "x86_64"
TARGET_OS         = "linux"
MACHINE           = "qemux86-64"
DISTRO            = "poky"
DISTRO_VERSION    = "0.9+snapshot-20101215"
TARGET_FPU        = ""

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing setscene Tasks
NOTE: We can skip tasks set([])
NOTE: Executing runqueue
NOTE: Full skip list set([])
NOTE: Running task 151 of 151 (ID: 6, /home/bruce/poky/meta/recipes-kernel/linux/linux-yocto_git.bb, do_menuconfig)
NOTE: package linux-yocto-2.6.37+git0+ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9_0+87aacc373557f8849dde8618fbe1f7f8f2af6038-r14: task do_menuconfig: Started
NOTE: package linux-yocto-2.6.37+git0+ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9_0+87aacc373557f8849dde8618fbe1f7f8f2af6038-r14: task do_menuconfig: Succeeded
NOTE: Tasks Summary: Attempted 151 tasks of which 150 didn't need to be rerun and 0 failed.

No menuconfig was seen :)

---------------

I previously had:


yow-bashfiel-d2 [/home/bruc...poky/build]> cat conf/local.conf | grep screen
TERMCMD = "screen"
TERMCMDRUN = "screen"

Which results in:


yow-bashfiel-d2 [/home/bruc...poky/build]> !bit
bitbake -f linux-yocto -c menuconfig
NOTE: Out of date cache found, rebuilding...
NOTE: Handling BitBake files: - (0773/0773) [100 %]
Parsing of 773 .bb files complete (0 cached, 773 parsed). 932 targets, 34 skipped, 0 masked, 0 errors.

OE Build Configuration:
BB_VERSION        = "1.11.0"
METADATA_BRANCH   = "master"
METADATA_REVISION = "774de9680f32009be3af41155c9750769a611a47"
TARGET_ARCH       = "x86_64"
TARGET_OS         = "linux"
MACHINE           = "qemux86-64"
DISTRO            = "poky"
DISTRO_VERSION    = "0.9+snapshot-20101215"
TARGET_FPU        = ""

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing setscene Tasks
NOTE: We can skip tasks set([])
NOTE: Executing runqueue
NOTE: Full skip list set([])
NOTE: Running task 151 of 151 (ID: 6, /home/bruce/poky/meta/recipes-kernel/linux/linux-yocto_git.bb, do_menuconfig)
NOTE: package linux-yocto-2.6.37+git0+ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9_0+87aacc373557f8849dde8618fbe1f7f8f2af6038-r14: task do_menuconfig: Started
ERROR: Task failed: ('function do_menuconfig failed', '/home/bruce/poky/build/tmp/work/qemux86-64-poky-linux/linux-yocto-2.6.37+git0+ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9_0+87aacc373557f8849dde8618fbe1f7f8f2af6038-r14/temp/log.do_menuconfig.30706')
ERROR: Logfile of failure stored in: /home/bruce/poky/build/tmp/work/qemux86-64-poky-linux/linux-yocto-2.6.37+git0+ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9_0+87aacc373557f8849dde8618fbe1f7f8f2af6038-r14/temp/log.do_menuconfig.30706
Log data follows:
| Must be connected to a terminal.
| ERROR: Task failed: ('function do_menuconfig failed', '/home/bruce/poky/build/tmp/work/qemux86-64-poky-linux/linux-yocto-2.6.37+git0+ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9_0+87aacc373557f8849dde8618fbe1f7f8f2af6038-r14/temp/log.do_menuconfig.30706')
NOTE: package linux-yocto-2.6.37+git0+ee0a10ab687b29c4d22d47e5b28bc8b3ebb7a8d9_0+87aacc373557f8849dde8618fbe1f7f8f2af6038-r14: task do_menuconfig: Failed
ERROR: Task 6 (/home/bruce/poky/meta/recipes-kernel/linux/linux-yocto_git.bb, do_menuconfig) failed with 1
ERROR: '/home/bruce/poky/meta/recipes-kernel/linux/linux-yocto_git.bb' failed

------------------------------

All tests done via ssh -Y
Comment 4 Richard Purdie 2010-12-21 06:33:58 UTC
Can people retest this with the latest master please? I tested with ssh -Y and gnome-terminal and it seemed to work fine both locally and over ssh. I'm not sure about screen, I think that may have some kind of problem as it appears to hang here. I don't use screen much though so it could be my usage...
Comment 5 Richard Purdie 2010-12-21 06:36:16 UTC
Just to confirm that if in another terminal I attach with screen -r, it connects to the menuconfig task. It won't reuse an existing screen session with a new window by the looks of it.
Comment 6 Bruce Ashfield 2010-12-21 09:58:34 UTC
works on master for me now. screen was used, and I can see 
the menuconfig.
Comment 7 Jiajun Xu 2010-12-22 06:33:22 UTC
When I set following configure in local.conf, I will get error in log.do_menuconfig.
########
TERMCMD = "${SCREEN_TERMCMD}"
TERMCMDRUN = "${SCREEN_TERMCMDRUN}"
########

Error log in log.do_menuconfig:
########
ERROR: ld.so: object 'libpseudo.so' from LD_PRELOAD cannot be preloaded: ignored.
########
Comment 8 Bruce Ashfield 2011-02-23 12:47:11 UTC
This works fine. I just retested. When you attach to the appropriate screen
session the menuconfig is quite healthy and running.
Comment 9 Jiajun Xu 2011-03-01 06:14:09 UTC
(In reply to comment #8)
> This works fine. I just retested. When you attach to the appropriate screen
> session the menuconfig is quite healthy and running.

Hi Bruce,
Is is possible for you to send me a BKM on how to enable interactive build with latest poky?
It never works on my machine, maybe it is caused by my machine configuration.

Now the only workable terminal on my machine is XTERM. But it still needs following change to work correctly. Without the change, seems ${TERMCMDRUN} in function do_menuconfig run under ${TOPDIR}, instead of ${S}.

########
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 5d9b86a..e2c7562 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -202,7 +202,7 @@ do_menuconfig() {
         export DBUS_SESSION_BUS_ADDRESS='${DBUS_SESSION_BUS_ADDRESS}'
         export XAUTHORITY='${XAUTHORITY}'
        export TERMWINDOWTITLE="${PN} Kernel Configuration"
-       export SHELLCMDS="bash make menuconfig"
+       export SHELLCMDS="cd ${S} && make menuconfig"
        ${TERMCMDRUN}
        if [ $? -ne 0 ]; then
                echo "Fatal: '${TERMCMD}' not found. Check TERMCMD variable."
########
Comment 10 Bruce Ashfield 2011-03-01 12:35:44 UTC
You definitely shouldn't need the "cd {S}", this is already being
run in the context of the source directory of the build. That's what
I'm seeing.

But I AM seeing the pseudo preload issue jump up and abort
the menuconfig. Investigating more.
Comment 12 Jiajun Xu 2011-03-10 17:41:53 UTC
Verify the bug in RC2 testing, and it's fixed now.