From d530acf6cc85bd4ae25af6a43375c875ba369927 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 16:54:09 +0000 Subject: [PATCH 1/7] Initial plan From 40f01b15eade00a52944875c9fb382bef5792118 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 17:02:56 +0000 Subject: [PATCH 2/7] Add yoctoproject.org-bitbake devcontainer feature Agent-Logs-Url: https://github.com/devcontainer-community/devcontainer-features/sessions/322a93a4-a882-4582-89f6-7a414507043c Co-authored-by: sebst <592313+sebst@users.noreply.github.com> --- README.md | 1 + src/yoctoproject.org-bitbake/NOTES.md | 17 +++ .../devcontainer-feature.json | 17 +++ src/yoctoproject.org-bitbake/install.sh | 108 ++++++++++++++++++ test/yoctoproject.org-bitbake/test.sh | 14 +++ 5 files changed, 157 insertions(+) create mode 100644 src/yoctoproject.org-bitbake/NOTES.md create mode 100644 src/yoctoproject.org-bitbake/devcontainer-feature.json create mode 100755 src/yoctoproject.org-bitbake/install.sh create mode 100755 test/yoctoproject.org-bitbake/test.sh diff --git a/README.md b/README.md index 6a3914f..c0997f2 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ | [turso.tech](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/turso.tech) | `tursodb` — in-process SQL database compatible with SQLite | gh release | 1.0.0 | | [webinstall.dev](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/webinstall.dev) | `webi` — install packages without sudo | curl | 1.0.1 | | [yakitrak/notesmd-cli](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/yakitrak-notesmd-cli) | `notesmd-cli` — manage Obsidian vaults from the terminal | gh release | 1.0.0 | +| [yoctoproject.org/bitbake](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/yoctoproject.org-bitbake) | `bitbake` — build tool for the Yocto Project | curl | 1.0.0 | | [yq](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/yq) | `yq` — command-line YAML/JSON/XML processor | gh release | 1.0.1 | | [zellij.dev](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/zellij.dev) | `zellij` — terminal workspace with multiplexer and layouts | gh release | 1.0.2 | | [zyedidia/eget](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/zyedidia-eget) | `eget` — easily install prebuilt binaries from GitHub releases | gh release | 1.0.2 | diff --git a/src/yoctoproject.org-bitbake/NOTES.md b/src/yoctoproject.org-bitbake/NOTES.md new file mode 100644 index 0000000..6a7a4be --- /dev/null +++ b/src/yoctoproject.org-bitbake/NOTES.md @@ -0,0 +1,17 @@ +# yoctoproject.org/bitbake + +## Project + +- [BitBake](https://downloads.yoctoproject.org/releases/bitbake/) + +## Description + +BitBake is a generic task execution engine for the Yocto Project and OpenEmbedded that allows shell and Python tasks to be run efficiently and in parallel while working within complex inter-task dependency constraints. It is the build tool at the core of the Yocto Project's embedded Linux build system. + +## Installation Method + +Downloaded as a source tarball from [downloads.yoctoproject.org](https://downloads.yoctoproject.org/releases/bitbake/) and extracted to `/opt/bitbake`, with symlinks placed in `/usr/local/bin`. + +## Other Notes + +_No additional notes._ diff --git a/src/yoctoproject.org-bitbake/devcontainer-feature.json b/src/yoctoproject.org-bitbake/devcontainer-feature.json new file mode 100644 index 0000000..866b1c7 --- /dev/null +++ b/src/yoctoproject.org-bitbake/devcontainer-feature.json @@ -0,0 +1,17 @@ +{ + "name": "yoctoproject.org/bitbake", + "id": "yoctoproject.org-bitbake", + "version": "1.0.0", + "description": "Install \"bitbake\" build tool for the Yocto Project", + "documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/yoctoproject.org-bitbake", + "options": { + "version": { + "type": "string", + "default": "latest", + "proposals": [ + "latest" + ], + "description": "Version of \"bitbake\" to install." + } + } +} diff --git a/src/yoctoproject.org-bitbake/install.sh b/src/yoctoproject.org-bitbake/install.sh new file mode 100755 index 0000000..9bac460 --- /dev/null +++ b/src/yoctoproject.org-bitbake/install.sh @@ -0,0 +1,108 @@ +#!/bin/bash +set -o errexit +set -o pipefail +set -o noclobber +set -o nounset +set -o allexport +readonly name="bitbake" +readonly installDir='/opt/bitbake' +readonly binaryTargetFolder='/usr/local/bin' +readonly downloadsBaseUrl='https://downloads.yoctoproject.org/releases/bitbake' +apt_get_update() { + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update -y + fi +} +apt_get_checkinstall() { + if ! dpkg -s "$@" >/dev/null 2>&1; then + apt_get_update + DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends --no-install-suggests --option 'Debug::pkgProblemResolver=true' --option 'Debug::pkgAcquire::Worker=1' "$@" + fi +} +apt_get_cleanup() { + apt-get clean + rm -rf /var/lib/apt/lists/* +} +check_curl_tar_installed() { + declare -a requiredAptPackagesMissing=() + if ! [ -r '/etc/ssl/certs/ca-certificates.crt' ]; then + requiredAptPackagesMissing+=('ca-certificates') + fi + if ! command -v curl >/dev/null 2>&1; then + requiredAptPackagesMissing+=('curl') + fi + if ! command -v tar >/dev/null 2>&1; then + requiredAptPackagesMissing+=('tar') + fi + declare -i requiredAptPackagesMissingCount=${#requiredAptPackagesMissing[@]} + if [ $requiredAptPackagesMissingCount -gt 0 ]; then + apt_get_update + apt_get_checkinstall "${requiredAptPackagesMissing[@]}" + apt_get_cleanup + fi +} +curl_check_url() { + local url=$1 + local status_code + status_code=$(curl -s -o /dev/null -w '%{http_code}' "$url") + if [ "$status_code" -ne 200 ] && [ "$status_code" -ne 302 ]; then + echo "Failed to download '$url'. Status code: $status_code." + return 1 + fi +} +curl_download_stdout() { + local url=$1 + curl \ + --silent \ + --location \ + --output '-' \ + --connect-timeout 5 \ + "$url" +} +echo_banner() { + local text="$1" + echo -e "\e[1m\e[97m\e[41m$text\e[0m" +} +utils_check_version() { + local version=$1 + if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then + printf >&2 '=== [ERROR] Option "version" (value: "%s") is not "latest" or valid semantic version format "X.Y.Z" !\n' \ + "$version" + exit 1 + fi +} +yocto_get_latest_bitbake_version() { + curl -s "${downloadsBaseUrl}/" \ + | grep -oP 'bitbake-\K[0-9]+\.[0-9]+\.[0-9]+(?=\.tar\.gz)' \ + | sort -V \ + | tail -1 +} +install() { + utils_check_version "$VERSION" + check_curl_tar_installed + apt_get_checkinstall python3 + if [ "$VERSION" == 'latest' ] || [ -z "$VERSION" ]; then + VERSION="$(yocto_get_latest_bitbake_version)" + fi + readonly version="${VERSION:?}" + readonly downloadUrl="${downloadsBaseUrl}/bitbake-${version}.tar.gz" + curl_check_url "$downloadUrl" + mkdir -p "$installDir" + curl_download_stdout "$downloadUrl" | tar \ + -xz \ + -f '-' \ + --strip-components=1 \ + -C "$installDir" + local bin_name + for bin_file in "${installDir}/bin"/*; do + bin_name="$(basename "$bin_file")" + ln -sf "$bin_file" "${binaryTargetFolder}/${bin_name}" + chmod 755 "${binaryTargetFolder}/${bin_name}" + done + apt_get_cleanup +} +echo_banner "devcontainer.community" +echo "Installing $name..." +install "$@" +echo "(*) Done!" diff --git a/test/yoctoproject.org-bitbake/test.sh b/test/yoctoproject.org-bitbake/test.sh new file mode 100755 index 0000000..7a49876 --- /dev/null +++ b/test/yoctoproject.org-bitbake/test.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +# Optional: Import test library bundled with the devcontainer CLI +# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib +# Provides the 'check' and 'reportResults' commands. +source dev-container-features-test-lib + +# Feature-specific tests +check "execute command" bash -c "bitbake --version | grep 'BitBake'" + +# Report results +reportResults From 50657c6d0c2ce552fc2a8bdcb0bfdf4e76a75fa3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 17:08:11 +0000 Subject: [PATCH 3/7] fix: create python->python3 symlink for older bitbake shebangs Agent-Logs-Url: https://github.com/devcontainer-community/devcontainer-features/sessions/efe0abbe-1351-4f36-be5b-e99f312f247e Co-authored-by: sebst <592313+sebst@users.noreply.github.com> --- src/yoctoproject.org-bitbake/install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/yoctoproject.org-bitbake/install.sh b/src/yoctoproject.org-bitbake/install.sh index 9bac460..7547805 100755 --- a/src/yoctoproject.org-bitbake/install.sh +++ b/src/yoctoproject.org-bitbake/install.sh @@ -100,6 +100,9 @@ install() { ln -sf "$bin_file" "${binaryTargetFolder}/${bin_name}" chmod 755 "${binaryTargetFolder}/${bin_name}" done + if ! command -v python >/dev/null 2>&1; then + ln -sf "$(command -v python3)" /usr/local/bin/python + fi apt_get_cleanup } echo_banner "devcontainer.community" From 85d2bc57fd4b328506173ebc13959a2ac0f9b016 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 17:12:36 +0000 Subject: [PATCH 4/7] fix: use wrapper scripts instead of symlinks so bitbake finds its lib dir Agent-Logs-Url: https://github.com/devcontainer-community/devcontainer-features/sessions/a93fd625-7344-48cf-a556-fdc0caea6a10 Co-authored-by: sebst <592313+sebst@users.noreply.github.com> --- src/yoctoproject.org-bitbake/install.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/yoctoproject.org-bitbake/install.sh b/src/yoctoproject.org-bitbake/install.sh index 7547805..0f72dc6 100755 --- a/src/yoctoproject.org-bitbake/install.sh +++ b/src/yoctoproject.org-bitbake/install.sh @@ -97,12 +97,9 @@ install() { local bin_name for bin_file in "${installDir}/bin"/*; do bin_name="$(basename "$bin_file")" - ln -sf "$bin_file" "${binaryTargetFolder}/${bin_name}" + printf '#!/bin/sh\nexec "%s" "$@"\n' "$bin_file" > "${binaryTargetFolder}/${bin_name}" chmod 755 "${binaryTargetFolder}/${bin_name}" done - if ! command -v python >/dev/null 2>&1; then - ln -sf "$(command -v python3)" /usr/local/bin/python - fi apt_get_cleanup } echo_banner "devcontainer.community" From 3a666f7e6feb19e1f45b394f3020097b9151311d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 17:21:14 +0000 Subject: [PATCH 5/7] fix: restore python->python3 symlink alongside wrapper script approach Agent-Logs-Url: https://github.com/devcontainer-community/devcontainer-features/sessions/9c88bf18-0372-45df-954d-2d0a7805fb8c Co-authored-by: sebst <592313+sebst@users.noreply.github.com> --- src/yoctoproject.org-bitbake/install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/yoctoproject.org-bitbake/install.sh b/src/yoctoproject.org-bitbake/install.sh index 0f72dc6..16fb779 100755 --- a/src/yoctoproject.org-bitbake/install.sh +++ b/src/yoctoproject.org-bitbake/install.sh @@ -100,6 +100,9 @@ install() { printf '#!/bin/sh\nexec "%s" "$@"\n' "$bin_file" > "${binaryTargetFolder}/${bin_name}" chmod 755 "${binaryTargetFolder}/${bin_name}" done + if ! command -v python >/dev/null 2>&1; then + ln -sf "$(command -v python3)" /usr/local/bin/python + fi apt_get_cleanup } echo_banner "devcontainer.community" From c7fe7cb6bc0ddd38a56e47cf15c50a3bfab5bbb9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 17:32:00 +0000 Subject: [PATCH 6/7] fix: switch BitBake source from Yocto downloads page to GitHub openembedded/bitbake Agent-Logs-Url: https://github.com/devcontainer-community/devcontainer-features/sessions/3e1e1633-a348-4b4e-80a2-7f980f10d843 Co-authored-by: sebst <592313+sebst@users.noreply.github.com> --- src/yoctoproject.org-bitbake/NOTES.md | 4 ++-- src/yoctoproject.org-bitbake/install.sh | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/yoctoproject.org-bitbake/NOTES.md b/src/yoctoproject.org-bitbake/NOTES.md index 6a7a4be..8d4e0f9 100644 --- a/src/yoctoproject.org-bitbake/NOTES.md +++ b/src/yoctoproject.org-bitbake/NOTES.md @@ -2,7 +2,7 @@ ## Project -- [BitBake](https://downloads.yoctoproject.org/releases/bitbake/) +- [BitBake](https://github.com/openembedded/bitbake) ## Description @@ -10,7 +10,7 @@ BitBake is a generic task execution engine for the Yocto Project and OpenEmbedde ## Installation Method -Downloaded as a source tarball from [downloads.yoctoproject.org](https://downloads.yoctoproject.org/releases/bitbake/) and extracted to `/opt/bitbake`, with symlinks placed in `/usr/local/bin`. +Downloaded as a source tarball from [github.com/openembedded/bitbake](https://github.com/openembedded/bitbake) (tags in the form `yocto-X.Y.Z`) and extracted to `/opt/bitbake`, with wrapper scripts placed in `/usr/local/bin`. ## Other Notes diff --git a/src/yoctoproject.org-bitbake/install.sh b/src/yoctoproject.org-bitbake/install.sh index 16fb779..237f412 100755 --- a/src/yoctoproject.org-bitbake/install.sh +++ b/src/yoctoproject.org-bitbake/install.sh @@ -5,9 +5,9 @@ set -o noclobber set -o nounset set -o allexport readonly name="bitbake" +readonly githubRepository='openembedded/bitbake' readonly installDir='/opt/bitbake' readonly binaryTargetFolder='/usr/local/bin' -readonly downloadsBaseUrl='https://downloads.yoctoproject.org/releases/bitbake' apt_get_update() { if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then echo "Running apt-get update..." @@ -66,15 +66,15 @@ echo_banner() { } utils_check_version() { local version=$1 - if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then - printf >&2 '=== [ERROR] Option "version" (value: "%s") is not "latest" or valid semantic version format "X.Y.Z" !\n' \ + if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+(\.[0-9]+)?)$ ]]; then + printf >&2 '=== [ERROR] Option "version" (value: "%s") is not "latest" or valid version format "X.Y" or "X.Y.Z" !\n' \ "$version" exit 1 fi } -yocto_get_latest_bitbake_version() { - curl -s "${downloadsBaseUrl}/" \ - | grep -oP 'bitbake-\K[0-9]+\.[0-9]+\.[0-9]+(?=\.tar\.gz)' \ +github_get_latest_bitbake_version() { + curl -s "https://api.github.com/repos/${githubRepository}/tags?per_page=100" \ + | grep -oP '"name":\s*"yocto-\K[0-9]+\.[0-9]+\.[0-9]+(?=")' \ | sort -V \ | tail -1 } @@ -83,10 +83,10 @@ install() { check_curl_tar_installed apt_get_checkinstall python3 if [ "$VERSION" == 'latest' ] || [ -z "$VERSION" ]; then - VERSION="$(yocto_get_latest_bitbake_version)" + VERSION="$(github_get_latest_bitbake_version)" fi readonly version="${VERSION:?}" - readonly downloadUrl="${downloadsBaseUrl}/bitbake-${version}.tar.gz" + readonly downloadUrl="https://github.com/${githubRepository}/archive/refs/tags/yocto-${version}.tar.gz" curl_check_url "$downloadUrl" mkdir -p "$installDir" curl_download_stdout "$downloadUrl" | tar \ From e42fc78e82d3b233629c565d11ac75f20327cde8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 17:42:17 +0000 Subject: [PATCH 7/7] fix: install locales package and generate en_US.UTF-8 for bitbake Agent-Logs-Url: https://github.com/devcontainer-community/devcontainer-features/sessions/5f4ae525-116e-44ba-b353-6a98c1e42ec7 Co-authored-by: sebst <592313+sebst@users.noreply.github.com> --- src/yoctoproject.org-bitbake/install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/yoctoproject.org-bitbake/install.sh b/src/yoctoproject.org-bitbake/install.sh index 237f412..dfa6722 100755 --- a/src/yoctoproject.org-bitbake/install.sh +++ b/src/yoctoproject.org-bitbake/install.sh @@ -81,7 +81,9 @@ github_get_latest_bitbake_version() { install() { utils_check_version "$VERSION" check_curl_tar_installed - apt_get_checkinstall python3 + apt_get_checkinstall python3 locales + echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen + locale-gen if [ "$VERSION" == 'latest' ] || [ -z "$VERSION" ]; then VERSION="$(github_get_latest_bitbake_version)" fi