]> code.ossystems Code Review - openembedded-core.git/commitdiff
sdk: Decouple default install path from built in path
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Jul 2021 15:44:56 +0000 (16:44 +0100)
committerSteve Sakoman <steve@sakoman.com>
Thu, 2 Sep 2021 14:19:06 +0000 (04:19 -1000)
Add SDKPATHINSTALL which is used as the default install location of the SDK
instead of SDKPATH. This means the default install path isn't encoded into
every SDK binary, meaning if a date is used there the entire SDK doesn't
have to rebuild. Most distros can switch to only customise SDKPATHINSTALL
meaning more sstate reuse too.

[YOCTO #14100]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit bc4ee5453560dcefc4a4ecc5657df5cc1666e153)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes/populate_sdk_base.bbclass
meta/conf/bitbake.conf
meta/files/toolchain-shar-extract.sh
meta/files/toolchain-shar-relocate.sh

index b46f1aed270f3595128aaaae6d205aabb713afda..396792f0f77824e182f5c4d24c28bdadd649c7e0 100644 (file)
@@ -275,6 +275,7 @@ EOF
        # substitute variables
        sed -i -e 's#@SDK_ARCH@#${SDK_ARCH}#g' \
                -e 's#@SDKPATH@#${SDKPATH}#g' \
+               -e 's#@SDKPATHINSTALL@#${SDKPATHINSTALL}#g' \
                -e 's#@SDKEXTPATH@#${SDKEXTPATH}#g' \
                -e 's#@OLDEST_KERNEL@#${SDK_OLDEST_KERNEL}#g' \
                -e 's#@REAL_MULTIMACH_TARGET_SYS@#${REAL_MULTIMACH_TARGET_SYS}#g' \
index 0141919021beb99531056da1a82ad86edc2a8549..f442a6593aa2fbd5ba940ba9ddaf384affd44775 100644 (file)
@@ -421,8 +421,10 @@ PKGDATA_DIR = "${TMPDIR}/pkgdata/${MACHINE}"
 
 SDK_NAME_PREFIX ?= "oecore"
 SDK_NAME = "${SDK_NAME_PREFIX}-${SDK_ARCH}-${TUNE_PKGARCH}"
-SDKPATH = "/usr/local/${SDK_NAME_PREFIX}-${SDK_ARCH}"
+SDKPATH = "/usr/local/oe-sdk-hardcoded-buildpath"
 SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
+# The path to default to installing the SDK to
+SDKPATHINSTALL = "/usr/local/${SDK_NAME_PREFIX}-${SDK_ARCH}"
 
 ##################################################################
 # Kernel info.
index dd9342758b48ff6bc0a329180f8dd7f54cb64f52..4386b985bb068cefff8cbe0963df05408451fe8d 100644 (file)
@@ -56,7 +56,8 @@ if ! xz -V > /dev/null 2>&1; then
        exit 1
 fi
 
-DEFAULT_INSTALL_DIR="@SDKPATH@"
+SDK_BUILD_PATH="@SDKPATH@"
+DEFAULT_INSTALL_DIR="@SDKPATHINSTALL@"
 SUDO_EXEC=""
 EXTRA_TAR_OPTIONS=""
 target_sdk_dir=""
index ba873373e29e81862646d587a65c188b52df8035..3ece04db0a4a3c2426354c31a7deb55fc453935b 100644 (file)
@@ -61,7 +61,7 @@ done | xargs -n100 file | grep ":.*\(ASCII\|script\|source\).*text" | \
              -e "$target_sdk_dir/post-relocate-setup" \
              -e "$target_sdk_dir/${0##*/}" | \
     xargs -n100 $SUDO_EXEC sed -i \
-        -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" \
+        -e "s:$SDK_BUILD_PATH:$target_sdk_dir:g" \
         -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" \
         -e "s: /usr/bin/perl: /usr/bin/env perl:g"