summaryrefslogtreecommitdiffstats
path: root/meta/classes/devshell.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* devshell: Do not add scripts/git-intercept to PATHPeter Kjellerstedt2023-03-141-2/+0
| | | | | | | | | | | | | | | The use of scripts/git-intercept was introduced in commit 3266c327df (install/devshell: Introduce git intercept script due to fakeroot issues) and later reverted in commit af27c81eaf (scripts: Make git intercept global). (From OE-Core rev: 51424b9955374196307aaf73cf4b6c184ce4fb6d) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> (cherry picked from commit f6c260c8e2a33e282a35afc99de4ef8cc1791b08) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* install/devshell: Introduce git intercept script due to fakeroot issuesPaul Gortmaker2022-05-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a devshell, recent versions of git will complain if the repo is owned by someone other than the current UID - consider this example: ------ bitbake -c devshell linux-yocto [...] kernel-source#git branch fatal: unsafe repository ('/home/paul/poky/build-qemuarm64/tmp/work-shared/qemuarm64/kernel-source' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /home/paul/poky/build-qemuarm64/tmp/work-shared/qemuarm64/kernel-source kernel-source# ------ Of course the devshell has UID zero and the "real" UID is for "paul" in this case. And so recent git versions complain. As the whole purpose of the devshell is to invoke a shell where development can take place, having a non-functional git is clearly unacceptable. Richard suggested we could use PSEUDO_UNLOAD=1 to evade this issue, and I suggested we probably will see other similar instances like this and should make use of PATH to intercept via devshell wrappers - conveniently we already have examples of this. Here, we copy the existing "ar" example and tune it to the needs of git to combine Richard's suggestion and mine. As such we now also can store commit logs and use send-email with our user specific settings, instead of "root", so in additon to fixing basic commands like "git branch" it should also increase general usefulness. RP: Tweaked the patch so the PATH change only applies to the devshell task and is a generic git intercept rather than devshell specific. RP: Also apply the PATH change to do_install tasks since that also runs under fakeroot and several software projects inject "git describe" output into their binaries (systemd, iputils, llvm, ipt-gpu-tools at least) causing reproducibility issues from systems with different git versions. (From OE-Core rev: 0ff2cff2c1eac3fe6304644db0fc27ba3130c237) Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3266c327dfa186791e0f1e2ad63c6f5d39714814) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devshell.bbclass: Exceptions displayed within devpyshellDorinda Bassey2021-03-281-0/+1
| | | | | | | | | | | | | | | | If you type something into devpyshell, an exception should be triggered, but that exception isn't printed out because it is not being flushed out of the buffer. This patch fixes that issue. [YOCTO #12156] (From OE-Core rev: 92b2da5824c11063d0bb8e39bc221530137e29b4) Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9f95e82a3b27bfd5177a855326dcad8a5bdf5b2d) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devshell.bbclass: clean up trailing whitespacesChang Rebecca Swee Fun2017-06-061-3/+3
| | | | | | | (From OE-Core rev: fac6c0fcb30d7cb49036cb32247569d65d1c5e7f) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devshell.bbclass: ensure toolchains available for do_devshellChang Rebecca Swee Fun2017-06-061-1/+1
| | | | | | | | | | | | Toolchains are required to be prepopulated in sysroot before entering devshell. [YOCTO #11464] (From OE-Core rev: eb8a1cdf5106d119f77db76f9a690826af9fcda3) Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVarFlag callsJoshua Lock2016-12-161-2/+2
| | | | | | | | | | | | | | | getVarFlag() now defaults to expanding by default, thus remove the True option from getVarFlag() calls with a regex search and replace. Search made with the following regex: getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\) (From OE-Core rev: 2dea9e490a98377010b3d4118d054814c317a735) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVar callsJoshua Lock2016-12-161-3/+3
| | | | | | | | | | | | | getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devpyshell: python3: flush stdout explicitlyEd Bartosh2016-07-081-2/+2
| | | | | | | | | | | | | | Opening text stream in unbuffered mode raises the following exception In Python 3: ValueError: can't have unbuffered text I/O Fixed by leaving std* streams in text mode and flushing stdout explicitly. (From OE-Core rev: 732001cb268683f5b56e251e2964ec5b694a2147) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devshell.bbclass: fix double unbufferingEd Bartosh2016-07-081-1/+0
| | | | | | | | | | | | | | stdout is already unbuffered in bitbake code. Attempt to do it again in devshell.bbclass causes this crash when running devpyshell: File "scripts/oepydevshell-internal.py", line 29, in <module> pty = open(sys.argv[1], "w+b", 0) IOError: [Errno 13] Permission denied: '/dev/pts/6' (From OE-Core rev: 875910451e1ce97d0c42b41b1140c8160ed1f40a) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/lib: Add expand parameter to getVarFlagRichard Purdie2016-02-041-2/+2
| | | | | | | | | | | | | | | | This sets the scene for removing the default False for expansion from getVarFlag. This would later allow True to become the default. On the most part this is an automatic translation with: sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, True):g' -i `grep -ril getVar *` In this case, the default was False, but True was used since in most cases here expansion would be expected. (From OE-Core rev: 42a10788e89b07b14a150ced07113566cf99fcdd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devshell: allow the starting directory to be overriddenRoss Burton2015-03-161-1/+3
| | | | | | | | | | Some people like to have the devshell start in ${B} instead of ${S}, so allow this to be overridden. (From OE-Core rev: 217af639d13258429949b14c67110650288cba7a) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devshell: Add interactive python shellRichard Purdie2014-05-281-0/+121
| | | | | | | | | | | | | | | Being able to interact with the python context in the Bitbake task execution environment has long been desireable. This patch introduces such a mechanism. Executing "bitbake X -c devpyshell" will open a terminal connected to a python interactive interpretor in the task context so for example you can run commands like "d.getVar('WORKDIR')" This version now includes readline support for command history and various other bug fixes such as exiting cleanly compared to previous versions. (From OE-Core rev: 36734f34fe6e4b91e293234687e63c02f5b3117e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devshell: Don't corrupt the fakeroot variablesRichard Purdie2013-09-061-6/+12
| | | | | | | | | | | | | | | | | The devshell anonymous python fragment overwrites variables in the datastore with their expanded versions. If this runs before the code in allarch.bbclass which changes TARGET_OS, we can end up with different directories in the fakeroot environment variables, some expanded with the original TARGET_OS value. The devshell code only needs to run before the task itself so we change to trigger it to run at task execution time only using a flag. [YOCTO #4795] (From OE-Core rev: 56baf177cdf074929a090cc66a8b89d346a5d79c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devshell.bbclass: Allow running devshell and fakeroot togetherRichard Purdie2013-02-191-1/+18
| | | | | | | | | | | | | | | | | | | Currently its hard to run a devshell complete with fakeroot context. This patch allows the fakeroot flag on the task to do this, as with any other task. Since we may need to start X terminal applications, we need to only start the fakeroot session on the final command, hence the hoops this code jumps through. As always with fakeroot, you can break out and run a command without the fake permissions with syntax like "PSEUDO_UNLOAD=1 <command>" [YOCTO #3374] (From OE-Core rev: 0a2662a48eaf0487db043c348e2834bb9cdd0466) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Rework how the devshell functionsChris Larson2011-08-101-18/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | In the new implementation, each known terminal is defined as a class in oe.terminal, as a subclass of bb.process.Popen. terminal.bbclass wraps this functionality, providing the metadata pieces. It obeys the OE_TERMINAL variable, which is a 'choice' typed variable. This variable may be 'auto', 'none', or any of the names of the defined terminals. When using 'auto', or requesting an unsupported terminal, we attempt to spawn them in priority order until we get one that's available on this system (and in the case of the X terminals, has DISPLAY defined). The 'none' value is used when we're doing things like automated builds, and want to ensure that no terminal is *ever* spawned, under any circumstances. Current available terminals: gnome konsole xterm rxvt screen (From OE-Core rev: 69f77f80965fa06a057837f8f49eda06855c4086) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Ensure Bash is used when spawning terminalsJoshua Lock2011-02-241-2/+2
| | | | | | | | | We rely on Bashisms when spawning a terminal so ensure that bash is used when using devshell and menuconfig. Fixes [BUGID #119] Signed-off-by: Joshua Lock <josh@linux.intel.com>
* devshell: Clean up devshell code so this task doesn't polute the global ↵Richard Purdie2010-12-091-6/+5
| | | | | | namespace Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* devshell.bbclass: export the FAKEROOTENV so it can be accessed within the ↵Richard Purdie2010-08-231-0/+1
| | | | | | devshell task Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* devshell.bbclass: Merge tweaks from OE.devRichard Purdie2009-12-181-1/+2
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* devshell.bbclass: Export needed variablesRichard Purdie2008-05-211-0/+3
| | | | git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4526 311d38ba-8fff-0310-9ca6-ca027cbcb966
* devshell.bbclass: Sync with OE since this no longer works at properly ↵Richard Purdie2007-09-171-2/+7
| | | | | | without this change git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2738 311d38ba-8fff-0310-9ca6-ca027cbcb966
* classes: Sync with OE - mainly quoting fixes or other minor updatesRichard Purdie2006-11-201-3/+3
| | | | git-svn-id: https://svn.o-hand.com/repos/poky/trunk@885 311d38ba-8fff-0310-9ca6-ca027cbcb966
* devshell.bbclass: Run after do_patchRichard Purdie2006-08-311-1/+1
| | | | git-svn-id: https://svn.o-hand.com/repos/poky/trunk@684 311d38ba-8fff-0310-9ca6-ca027cbcb966
* devshell: Convert to its own class and add to poky.conf by default. Export ↵Richard Purdie2006-08-301-0/+13
EXTRA_OEMAKE to devshell. git-svn-id: https://svn.o-hand.com/repos/poky/trunk@683 311d38ba-8fff-0310-9ca6-ca027cbcb966