Bug 12518 - Ctrl+C doesn't close menuconfig terminal
Summary: Ctrl+C doesn't close menuconfig terminal
Status: RESOLVED WONTFIX
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: kernel (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.5 M3
Assignee: Yi Zhao
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-01-30 04:17 UTC by Anuj Mittal
Modified: 2018-04-11 00:23 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anuj Mittal 2018-01-30 04:17:21 UTC
It looks like bitbake has stopped configuring kernel when ctrl+c is pressed twice but terminal with menuconfig keeps running and isn't closed.

bitbake -c menuconfig virtual/kernel
Comment 1 Randy MacLeod 2018-02-01 19:40:38 UTC
It's a medium priority since one can just exit from the menuconfig session first. Robert please see if we can correct the behaviour to have bitbake kill the terminal session on the second control-c.
Comment 2 Anuj Mittal 2018-02-02 07:25:23 UTC
Was the milestone value changed by mistake?
Comment 3 Randy MacLeod 2018-02-02 14:53:09 UTC
> Was the milestone value changed by mistake?
Yes. Fixed.
Comment 4 Yi Zhao 2018-03-08 18:45:12 UTC
This issue only happens with gnome-terminal which introduced by commit: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=c706bfbabbf9f7caf2cf509eb91381fb49aa44cb

For more details, please see:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=7254

As workaround, you could set OE_TERMINAL = "xterm" or OE_TERMINAL = "rxvt" in conf/local.conf.
Comment 5 Yi Zhao 2018-03-11 23:00:41 UTC
For more details, please see bug 7254 Comment 11 . The root cause is when the gnome-terminal gets spawned, it becomes a child process for gnome-terminal-sever. Once bitbake process gets the SIGTERM, it can not kill the gnome-terminal as it is not the child process for bitbake.

It seems the Ubuntu (16.04) keeps the --disable-factory option for gnome-terminal. If you are using gnome-terminal on Ubuntu, you could apply the following patch as a workaround:

diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 94afe39..908a95d 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -52,7 +52,7 @@ class XTerminal(Terminal):
             raise UnsupportedTerminal(self.name)
 
 class Gnome(XTerminal):
-    command = 'gnome-terminal -t "{title}" -x {command}'
+    command = 'gnome-terminal --disable-factory -t "{title}" -x {command}'
     priority = 2
 
     def __init__(self, sh_cmd, title=None, env=None, d=None):
Comment 6 Yi Zhao 2018-04-11 00:23:48 UTC
As comment in bug 7254 Comment 11 . The root cause is when the gnome-terminal gets spawned, it becomes a child process for gnome-terminal-sever. Once bitbake process gets the SIGTERM, it can not kill the gnome-terminal as it is not the child process for bitbake.

As workaround, you could set OE_TERMINAL = "xterm" or OE_TERMINAL = "rxvt" in conf/local.conf.