inherit terminal DEVSHELL = "${SHELL}" python do_devshell () { if d.getVarFlag("do_devshell", "manualfakeroot"): d.prependVar("DEVSHELL", "pseudo ") fakeenv = d.getVar("FAKEROOTENV", True).split() for f in fakeenv: k = f.split("=") d.setVar(k[0], k[1]) d.appendVar("OE_TERMINAL_EXPORTS", " " + k[0]) d.delVarFlag("do_devshell", "fakeroot") oe_terminal(d.getVar('DEVSHELL', True), 'OpenEmbedded Developer Shell', d) } addtask devshell after do_patch # The directory that the terminal starts in DEVSHELL_STARTDIR ?= "${S}" do_devshell[dirs] = "${DEVSHELL_STARTDIR}" do_devshell[nostamp] = "1" # devshell and fakeroot/pseudo need careful handling since only the final # command should run under fakeroot emulation, any X connection should # be done as the normal user. We therfore carefully construct the envionment # manually python () { if d.getVarFlag("do_devshell", "fakeroot"): # We need to signal our code that we want fakeroot however we # can't manipulate the environment and variables here yet (see YOCTO #4795) d.setVarFlag("do_devshell", "manualfakeroot", "1") d.delVarFlag("do_devshell", "fakeroot") } def devpyshell(d): import code import select import signal import termios m, s = os.openpty() sname = os.ttyname(s) def noechoicanon(fd): old = termios.tcgetattr(fd) old[3] = old[3] &~ termios.ECHO &~ termios.ICANON # &~ termios.ISIG termios.tcsetattr(fd, termios.TCSADRAIN, old) # No echo or buffering over the pty noechoicanon(s) pid = os.fork() if pid: os.close(m) oe_terminal("oepydevshell-internal.py %s %d" % (sname, pid), 'OpenEmbedded Developer PyShell', d) os._exit(0) else: os.close(s) os.dup2(m, sys.stdin.fileno()) os.dup2(m, sys.stdout.fileno()) os.dup2(m, sys.stderr.fileno()) sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) sys.stdin = os.fdopen(sys.stdin.fileno(), 'r', 0) bb.utils.nonblockingfd(sys.stdout) bb.utils.nonblockingfd(sys.stderr) bb.utils.nonblockingfd(sys.stdin) _context = { "os": os, "bb": bb, "time": time, "d": d, } ps1 = "pydevshell> " ps2 = "... " buf = [] more = False i = code.InteractiveInterpreter(locals=_context) print("OE PyShell (PN = %s)\n" % d.getVar("PN", True)) def prompt(more): if more: prompt = ps2 else: prompt = ps1 sys.stdout.write(prompt) # Restore Ctrl+C since bitbake masks this def signal_handler(signal, frame): raise KeyboardInterrupt signal.signal(signal.SIGINT, signal_handler) child = None prompt(more) while True: try: try: (r, _, _) = select.select([sys.stdin], [], [], 1) if not r: continue line = sys.stdin.readline().strip() if not line: prompt(more) continue except EOFError as e: sys.stdout.write("\n") except (OSError, IOError) as e: if e.errno == 11: continue if e.errno == 5: return raise else: if not child: child = int(line) continue buf.append(line) source = "\n".join(buf) more = i.runsource(source, "") if not more: buf = [] prompt(more) except KeyboardInterrupt: i.write("\nKeyboardInterrupt\n") buf = [] more = False prompt(more) except SystemExit: # Easiest way to ensure everything exits os.kill(child, signal.SIGTERM) break python do_devpyshell() { import signal try: devpyshell(d) except SystemExit: # Stop the SIGTERM above causing an error exit code return finally: return } addtask devpyshell after do_patch do_devpyshell[nostamp] = "1" d>Florian Boor3 2007-08-02tslib: bump version to 1.0 (from poky)Koen Kooi2 2007-06-12remove a bunch of empty directoriesRolf Leggewie1 2007-05-18tslib: fix RRECOMMENDSKoen Kooi1 2007-05-18tslib: ship pointercal files for angstromKoen Kooi1 2007-04-18tslib: Add dummy script for HTC Tornado without touchscreen. Disables pointer...Florian Boor2 2007-03-08tslib: disable grab-events thingy by default, turn it on for fic-gta01Koen Kooi4 2007-03-04tslib: dev package fix, install all .la files.Philipp Zabel1 2007-02-27tslib: Bump PRFlorian Boor1 2007-02-27tslib: Remove wrong tslib.sh for A780.Florian Boor1 2007-02-18tslib: merge patch from openmoko:Koen Kooi4 2007-01-09tslib: remove magician specific configuration again, it works withoutPhilipp Zabel2 2007-01-09tslib: add magician configurationPhilipp Zabel2 2006-12-31tslib: Have a sane default tslib.sh file to match what nearly all 2.6 udev de...Richard Purdie45 2006-12-31remove extra whitespace at end-of-line in about 900 bb files.Rolf Leggewie1 2006-12-29tslib: Add htcblueangel config, just standard kernel 2.6 one.Paul Sokolovsky2 2006-12-29tslib 1.0: No supported HH.org machine needs 2.4 stuff or detect-stylus.Paul Sokolovsky1 2006-12-29tslib: tslib.sh for h2200, h5000, h6300, htcuniversal is the standard kernel ...Paul Sokolovsky4 2006-12-29tslib: ipaq-pxa270 - no such machine (was removed some time ago), remove over...Paul Sokolovsky2 2006-12-29tslib: htcuniversal's ts.conf is equal in semantics to the default one (of Paul Sokolovsky1 2006-12-29tslib: h3600, h3900: Use standard kernel 2.6 tslib.sh.Paul Sokolovsky2 2006-12-29tslib: tslib.sh for h4000 is standard-minimal one.Paul Sokolovsky1 2006-12-04tslib: remove h1940 machine dependency on detect-stylus and switch to using t...Arjan Schrijver2 2006-12-04tslib: fix HOMEPAGEKoen Kooi1 2006-12-04tslib: remove some more detect-stylus depends for devices that can use a rece...Koen Kooi1 2006-11-29tslib/tslib/smdk2440/tslib.sh : remove 2.4 stuff that gives away where IGraeme Gregory1 2006-11-29tslib/tslib/smdk2440 : add configuration for smdk2440 machineGraeme Gregory2 2006-11-23packages/tslib/tslib/jornada7xx/ts.conf : Proper ts.confKristoffer Ericson1 2006-11-23packages/tslib/tslib/jornada7xx/tslib.sh : Set proper TS deviceKristoffer Ericson1 2006-11-21tslib-maemo: remove it, since tslib has nokia 770 support and later maemo ver...Koen Kooi4 2006-11-21tslib: Add nokia770 support (from poky)Richard Purdie2 2006-11-20h5xxx: Rename machine to h5000.Paul Sokolovsky3 2006-11-09tslib: drop old patchRichard Purdie1 2006-11-07tslib: touchscreen, not touchsreenKoen Kooi2 2006-11-05tslib: General cleanup - Turn ts-2.6.conf into the standard ts.conf, remove T...Richard Purdie32 2006-11-05tslib: don't use detect-stylus for h2200, hx4700 and h5xxx. Feel free to remo...Koen Kooi1 2006-10-20tslib 1.0 add configuration file for qemuarm machine - taken from Poky.Michael Lauer3 2006-10-10hx4700, hx2000: start adding support for hx4700 and hx200 ipaqs to solve over...Koen Kooi