]> 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)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 1 Aug 2021 12:47:32 +0000 (13:47 +0100)
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>
meta/classes/populate_sdk_base.bbclass
meta/conf/bitbake.conf
meta/files/toolchain-shar-extract.sh
meta/files/toolchain-shar-relocate.sh

index 3c1eb454b3ea6fcc9edb045f1c72a8cbe6828e58..ccfe223289502e99ad300cbe77d2170d4e5cb6b3 100644 (file)
@@ -280,6 +280,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 f2ceb26c04212ec725d9dee780227bf7912624bc..1d5f5b7fcd73708b35f9b721f28d8a6f57141ce5 100644 (file)
@@ -422,8 +422,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 54337412966c81f20fd8a7926f698bc923bb570a..8ea6194eca5a9ac89e9d81098f8dd522fdffc4f6 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"