summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-09-29 14:56:09 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-14 11:24:57 +0100
commit266379f0beef2749660376c255bcbe1931ef4b08 (patch)
tree22eeab7754575895ebbcd93713e9cd6e6cf83436 /bitbake/lib
parenta66c929a6a88f7e5799ed82774b5ee62148c1864 (diff)
downloadpoky-266379f0beef2749660376c255bcbe1931ef4b08.tar.gz
bitbake: bitbake-setup: add 'install-buildtools' command
This basically calls install-buildtools from oe-core/poky, but it ensures via command line parameters that the installation location is stable and the downloads are preserved for reproducibility: $ bin/bitbake-setup install-buildtools Loading settings from /home/alex/bitbake-builds/bitbake-setup.conf ====== Buildtools archive is downloaded into /home/alex/bitbake-builds/yocto-master-testing/buildtools-downloads/20250319141333 and its content installed into /home/alex/bitbake-builds/yocto-master-testing/buildtools ... (output from install-buildtools script) ====== It also detects when buildtools are already installed, and will direct users what to do: ====== alex@Zen2:/srv/work/alex/bitbake$ bin/bitbake-setup install-buildtools Loading settings from /home/alex/bitbake-builds/bitbake-setup.conf Buildtools are already installed in /home/alex/bitbake-builds/yocto-master-testing/buildtools. If you wish to use them, you need to source the the environment setup script e.g. $ . /home/alex/bitbake-builds/yocto-master-testing/buildtools/environment-setup-x86_64-pokysdk-linux You can also re-run bitbake-setup install-buildtools with --force option to force a reinstallation ====== This commits includes fixes by Gyorgy Sarvari <skandigraun@gmail.com> https://github.com/kanavin/bitbake/pull/2 (Bitbake rev: 3fe3096847046110c72b23fce37fb4a459b1d748) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/tests/setup.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/setup.py b/bitbake/lib/bb/tests/setup.py
index ab4dbf7621..fb2c15f545 100644
--- a/bitbake/lib/bb/tests/setup.py
+++ b/bitbake/lib/bb/tests/setup.py
@@ -49,6 +49,21 @@ with open(os.path.join(builddir, 'init-build-env'), 'w') as f:
49""" 49"""
50 self.add_file_to_testrepo('scripts/oe-setup-build', oesetupbuild, script=True) 50 self.add_file_to_testrepo('scripts/oe-setup-build', oesetupbuild, script=True)
51 51
52 installbuildtools = """#!/usr/bin/env python3
53import getopt
54import sys
55import os
56
57opts, args = getopt.getopt(sys.argv[1:], "d:", ["downloads-directory="])
58for option, value in opts:
59 if option == '-d':
60 installdir = value
61
62print("Buildtools installed into {}".format(installdir))
63os.makedirs(installdir)
64"""
65 self.add_file_to_testrepo('scripts/install-buildtools', installbuildtools, script=True)
66
52 bitbakeconfigbuild = """#!/usr/bin/env python3 67 bitbakeconfigbuild = """#!/usr/bin/env python3
53import os 68import os
54import sys 69import sys
@@ -224,6 +239,11 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
224 out = self.runbbsetup("update") 239 out = self.runbbsetup("update")
225 self.assertIn("Configuration in {} has not changed".format(buildpath), out[0]) 240 self.assertIn("Configuration in {} has not changed".format(buildpath), out[0])
226 241
242 # install buildtools
243 out = self.runbbsetup("install-buildtools")
244 self.assertIn("Buildtools installed into", out[0])
245 self.assertTrue(os.path.exists(os.path.join(buildpath, 'buildtools')))
246
227 # change a file in the test layer repo, make a new commit and 247 # change a file in the test layer repo, make a new commit and
228 # test that status/update correctly report the change and update the config 248 # test that status/update correctly report the change and update the config
229 prev_test_file_content = test_file_content 249 prev_test_file_content = test_file_content