linuxhyperlinksdkyoctoportability

Yocto SDK portable with relative links


We have a Yocto project (mickledore) to create a custom Linux for an ARM A7 system. To be able to write code for this target, we also created the SDK. Inside local.conf we have:

SDKMACHINE = "i686"
SDK_ARCHIVE_TYPE = "tar.xz"

We execute:

bitbake core-image-minimal -c populate_sdk -f

Everything looks good and works so far. But. In the SDK there are a lot of symbolic links:

/home/foobar/buildtools/sdk/sysroots/i686-pokysdk-linux/usr/bin$ ls -l
xz -> /home/foobar/poky/build/tmp/deploy/sdk/i686/sysroots/i686-pokysdk-linux/usr/bin/xz.xz

We need to give the SDK to every member of the team so it would be nice to have a portable SDK without links or with relative links, but we could not find any options to make yocto create such a thing.

It seems to us as if the only option is, to write a script that converts all links from absolute to relative. Is it really that complicated or does anybody have a different idea on how to make the SDK portable?


Solution

  • What you're looking at is the unpacked SDK. There you have many links specific to the system where it was unpacked on. You cannot even move that folder without breaking things.

    What you want instead is the .sh file (it's actually a self extracting zip archive) inside the build folder. For me it's named like this:

    tmp/deploy/sdk/poky-glibc-x86_64-my-image..aarch64..toolchain-4.2.0.sh
    

    Then each member simply gets the file and runs it. The shell script will automatically add the right paths in the appropriate places. Should look something like this:

    sh poky-glibc-x86_64-my-image..aarch64..toolchain-4.2.0.sh
    Poky SDK installer version 4.2.0
    =====================================================================
    Enter target directory for SDK (default: /opt/poky/4.2.0): 
    You are about to install the SDK to "/opt/poky/4.2.0". Proceed [Y/n]? n
    ...
    

    From what you said in the comment about needing to have 32-bit hosts for building: I'd simply cross compile, if you're not relying on some assembler optimizations or other unusual things. In fact, the .sh file has all the info in it's name according to the docs on the SDK:

    poky-glibc-host_system-image_type-arch-toolchain-release_version.sh
    

    Where:

    host_system is a string representing your development system:

               i686 or x86_64.
    

    image_type is the image for which the SDK was built:

               core-image-minimal or core-image-sato.
    

    is a string representing the tuned target architecture:

               aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon.
    

    release_version is a string representing the release number of the Yocto Project:

               5.2.999, 5.2.999+snapshot 
    

    For example, the following SDK installer is for a 64-bit development host system and a i586-tuned target architecture based off the SDK for core-image-sato and using the current DISTRO snapshot:

    poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh