mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-26 21:11:54 +01:00
fix(build_toolchains): Remove hard-coded portage profile
This commit is contained in:
parent
8ee5f00137
commit
31d5ced3df
@ -25,10 +25,12 @@ get_dependency_list() {
|
||||
|
||||
configure_portage() {
|
||||
local pkg_path="$1"
|
||||
local profile="$2"
|
||||
|
||||
mkdir -p "${ROOT}/etc/portage"
|
||||
rm -f "${ROOT}/etc/make.profile" "${ROOT}/etc/portage/make.profile"
|
||||
# eselect will report "!!! Warning: Strange path." but that's OK
|
||||
eselect profile set --force coreos:coreos/amd64/generic
|
||||
echo "eselect will report '!!! Warning: Strange path.' but that's OK"
|
||||
eselect profile set --force "$profile"
|
||||
|
||||
cat >"${ROOT}/etc/portage/make.conf" <<EOF
|
||||
CHOST=${CHOST}
|
||||
CBUILD=$(portageq envvar CBUILD)
|
||||
@ -79,7 +81,8 @@ configure_cross_root() {
|
||||
local ROOT="/usr/${cross_chost}"
|
||||
|
||||
CHOST="${cross_chost}" ROOT="$ROOT" SYSROOT="$ROOT" \
|
||||
configure_portage "cross/${cross_chost}"
|
||||
configure_portage "cross/${cross_chost}" \
|
||||
"${CROSS_PROFILE[${cross_chost}]}"
|
||||
|
||||
# In order to get a dependency list we must calculate it before
|
||||
# updating package.provided. Otherwise portage will no-op.
|
||||
@ -110,7 +113,8 @@ configure_target_root() {
|
||||
local cross_chost=$(get_board_chost "$1")
|
||||
|
||||
CHOST="${cross_chost}" ROOT="/build/${board}" \
|
||||
SYSROOT="/usr/${cross_chost}" configure_portage "target/${board}"
|
||||
SYSROOT="/usr/${cross_chost}" configure_portage \
|
||||
"target/${board}" "$(get_board_profile "${board}")"
|
||||
}
|
||||
|
||||
build_target_toolchain() {
|
||||
|
||||
@ -10,6 +10,14 @@ TOOLCHAIN_PKGS=(
|
||||
sys-libs/glibc
|
||||
)
|
||||
|
||||
# Portage arguments to enforce the toolchain to only use binpkgs.
|
||||
TOOLCHAIN_BINONLY=( "${TOOLCHAIN_PKGS[@]/#/--useoldpkg-atoms=}" )
|
||||
|
||||
# Portage profile to use for building out the cross compiler's SYSROOT.
|
||||
# This is only used as an intermediate step to be able to use the cross
|
||||
# compiler to build a full native toolchain. Packages are not uploaded.
|
||||
CROSS_PROFILE["x86_64-cros-linux-gnu"]="coreos:coreos/amd64/generic"
|
||||
|
||||
# Map board names to CHOSTs and portage profiles. This is the
|
||||
# definitive list, there is assorted code new and old that either
|
||||
# guesses or hard-code these. All that should migrate to this list.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user