This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM57X: Adding Package to rootfs Image

Expert 2430 points
Part Number: PROCESSOR-SDK-AM57X

Hopefully, this will be a Yocto 101 type question that can be (relatively) easily answered.

For reference, I'm building the SDK following your instructions:  Building the SDK

So presume my development environment is in a state where I can build (via Yocto) both default Linux file systems, namely, arago-core-tisdk-bundle (Full SDK) and arago-base-tisdk-image (Minimal Target Filesystem).

I want to add 'rsync' and 'zip' (and 'apt-get' for that matter) to the image as part of the build, i.e., I want it to be automatically included as part of the final tarball that I flash onto my SD card.  Step-by-step, how would I go about doing that?

(I really do need rsync and zip pre-installed, but this even applies to my proprietary application that I am developing for our H/W:  How do I modify my custom bitbake layer to include various third-party applications to be pre-installed in the 'rootfs' image?)

  • I guess to answer my own question, I somewhat figured it out.

    Luckily, "rsync" and "zip" already have recipes defined as I found by searching layers.openembedded.org.  Given this, the brute force approach (meaning to add them EVERY distro you build), simply add the following to your conf/local.conf file at the end:

    IMAGE_INSTALL_append += " rsync zip"

    So this was great since they were already supported, but what process is necessary to auto-install my own application?  So say have MyAppExecutable.  On my ***HOST*** system, I need to generate the final rootfs tarball with this application already installed under /usr/bin (or wherever).  Is there some guide out there that will show me the steps necessary to do this?  (Maybe I'm using the wrong keywords, but Goggle isn't helping me here.)

  • Hi Alex,

    The IMAGE_INSTALL_append method described above definitely works and you can extend the same to bring in your "own applications" too.

    So, here are the steps that I would outline:

    1. MyAppExecutable needs a Yocto recipe - this will take care of installing it in /usr/bin or wherever you require the files to go to along with the dependencies that it may need.
    2. Next, will need to include this recipe into a layer - you may add this to an existing layer or create your own layer.
    3. Build the recipe independently (bitbake)
    4. Repeat the same IMAGE_INSTALL_append method to include this recipe as part of the build.

    With this, the MyAppExecutable will get included in the target filesystem.

    There is an FAQ on how to customize (reduce the size of the filesystem) and lists the many different ways in which recipes get included in the filesystem, you can use that as a reference (and do the opposite) to explore alternatives to IMAGE_INSTALL_append: https://e2e.ti.com/support/processors/f/791/t/915887

    Regards

    Karthik

  • Thanks.  And thanks for linking me to your other post, too.  That will prove very helpful down the line when I'm needing to reduce the footprint for production.

    I have a follow-up question.  Regardless of the size of the 'rootfs' partition on my SD Card (can be 7.5 GB, 16 GB, or even the full 32 GB), after I do the 'sudo tar -Jvxf <image-name>.tar.xz -C /media/alex/rootfs && sync' step to flash the image, the partition always gets (somehow) marked as full with 0 bytes available after tar command completes (completes without error, mind you).  Why is this so, and is there something I can do to prevent that?  (And it's not a transient thing because after I boot with SD card, on the target, 'df' shows / having 0 bytes available, too.)

    This is an issue because DURING DEVELOPMENT, I need the ability to transfer files and whatnot to the target system, but I can't because there is supposedly no space available.

     

    Edit:  I just had the notion to resize the partition manually, and it worked, and now I have some space available.  But my question still stands.  How is it that 'tar' is marking the entire partition full once it's done extracting the files, and how do I stop it from doing that?

  • Hi Alex,

    Glad that helped.

    I don't think I have seen that behavior on my side, the occupied size clearly reflects the size of the extracted rootfs.

    This is probably something that you will to dig deeper at your end or perhaps help me recreate it and we can take a look. Please create a new thread for that when you are ready.

    For now, I will mark this one as closed.

    Regards

    Karthik