Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 6 additions & 19 deletions build_library/build_image_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ zip_update_tools() {
--arch "$(get_sdk_arch)" --output-dir "${BUILD_DIR}" --zip-name "${update_zip}"
}

run_ldconfig() {
# This wrapper is created by setup_board.
sudo "ldconfig-${BOARD}" -r "$1"
}

run_localedef() {
local root_fs_dir="$1"
info "Generating C.UTF-8 locale..."
Expand Down Expand Up @@ -140,17 +135,6 @@ emerge_to_image() {
--jobs="${NUM_JOBS}" \
--verbose \
"$@"

# Shortcut if this was just baselayout
[[ "$*" == *sys-apps/baselayout ]] && return

# Make sure profile.env has been generated
sudo -E ROOT="${root_fs_dir}" env-update --no-ldconfig

# TODO(marineam): just call ${BUILD_LIBRARY_DIR}/check_root directly once
# all tests are fatal, for now let the old function skip soname errors.
ROOT="${root_fs_dir}" PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \
test_image_content "${root_fs_dir}"
}

# Switch to the dev or prod sub-profile
Expand Down Expand Up @@ -497,6 +481,7 @@ start_image() {
local disk_layout="$2"
local root_fs_dir="$3"
local update_group="$4"
local profile="$5"

local disk_img="${BUILD_DIR}/${image_name}"

Expand All @@ -507,6 +492,8 @@ start_image() {
"${BOARD_ROOT}"/etc/portage/repos.conf \
"${BUILD_DIR}"/configroot/etc/portage/

set_image_profile "${profile}"

info "Using image type ${disk_layout}"
"${BUILD_LIBRARY_DIR}/disk_util" --disk_layout="${disk_layout}" \
format "${disk_img}"
Expand All @@ -520,9 +507,9 @@ start_image() {
# First thing first, install baselayout to create a working filesystem.
emerge_to_image "${root_fs_dir}" --nodeps --oneshot sys-apps/baselayout

# FIXME(marineam): Work around glibc setting EROOT=$ROOT
# https://bugs.gentoo.org/show_bug.cgi?id=473728#c12
sudo mkdir -p "${root_fs_dir}/etc/ld.so.conf.d"
# We need the libc ASAP to execute binaries from the ROOT at install time, but
# the dependency is implicit, so explicitly install.
emerge_to_image "${root_fs_dir}" --oneshot virtual/libc

# Set /etc/lsb-release on the image.
"${BUILD_LIBRARY_DIR}/set_lsb_release" \
Expand Down
10 changes: 7 additions & 3 deletions build_library/dev_container_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,16 @@ create_dev_container() {
local image_packages="${image_name%.bin}_packages.txt"
local image_licenses="${image_name%.bin}_licenses.json"

start_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}"
start_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}" dev

set_image_profile dev
emerge_to_image "${root_fs_dir}" @system ${base_pkg}
run_ldconfig "${root_fs_dir}"
run_localedef "${root_fs_dir}"

# TODO(marineam): just call ${BUILD_LIBRARY_DIR}/check_root directly once
# all tests are fatal, for now let the old function skip soname errors.
ROOT="${root_fs_dir}" PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \
test_image_content "${root_fs_dir}"

write_packages "${root_fs_dir}" "${BUILD_DIR}/${image_packages}"
write_licenses "${root_fs_dir}" "${BUILD_DIR}/${image_licenses}"
insert_licenses "${BUILD_DIR}/${image_licenses}" "${root_fs_dir}"
Expand Down
9 changes: 6 additions & 3 deletions build_library/prod_image_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,18 @@ create_prod_image() {
local image_realinitrd_contents_wtd="${image_name%.bin}_realinitrd_contents_wtd.txt"
local image_sysext_base="${image_name%.bin}_sysext.squashfs"

start_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}"
start_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}" prod

# Install minimal GCC (libs only) and then everything else
set_image_profile prod
extract_prod_gcc "${root_fs_dir}"
emerge_to_image "${root_fs_dir}" "${base_pkg}"
run_ldconfig "${root_fs_dir}"
run_localedef "${root_fs_dir}"

# TODO(marineam): just call ${BUILD_LIBRARY_DIR}/check_root directly once
# all tests are fatal, for now let the old function skip soname errors.
ROOT="${root_fs_dir}" PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \
test_image_content "${root_fs_dir}"

local root_with_everything="${root_fs_dir}"

# Call helper script for adding sysexts to the base OS.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From b1a85fb629593de585e63271cfd20cc93319dd01 Mon Sep 17 00:00:00 2001
From: James Le Cuirot <chewi@gentoo.org>
Date: Mon, 9 Nov 2026 15:13:23 +0000
Subject: [PATCH] depgraph: Make buildpkg-proactive aware of
--binpkg-respect-user-patches

This now triggers a rebuild when --binpkg-respect-user-patches would
mask a binary package.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -8344,6 +8344,10 @@ class depgraph:
binpkg_changed_deps
and self._changed_deps(binpkg)
)
+ and not (
+ binpkg_respect_user_patches
+ and binpkg.user_patches != pkgsettings.userPatchDigest(binpkg)
+ )
):
break
else:
--
2.56.0

2 changes: 1 addition & 1 deletion sdk_container/src/third_party/gentoo
Submodule gentoo updated 3043 files
7 changes: 2 additions & 5 deletions setup_board
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,13 @@ EOF
# ldconfig cannot generate caches for non-native arches. Use QEMU and the
# native ldconfig to work around that. Don't use the bwrap wrapper above
# because it's unnecessarily complex for this use case.
wrapper="/usr/local/sbin/ldconfig-${BOARD_VARIANT}"
wrapper="/usr/local/sbin/${BOARD_CHOST}-ldconfig"
sudo_clobber "${wrapper}" <<EOF
#!/bin/sh
exec ${qemu-} "${BOARD_ROOT}"/sbin/ldconfig -r "${BOARD_ROOT}" "\$@"
exec ${qemu-} "/usr/${BOARD_CHOST}/sbin/ldconfig" "\$@"
EOF
wrappers+=( "${wrapper}" )

# Create a CHOST-based ldconfig symlink for Portage to call.
sudo ln -sfT "ldconfig-${BOARD_VARIANT}" "/usr/local/sbin/${BOARD_CHOST}-ldconfig"

cmds+=(
"chmod a+rx ${wrappers[*]}"
"chown root:root ${wrappers[*]}"
Expand Down