Skip to main content
Visitor II
September 8, 2022
Solved

receipt.bb can't install into /usr/local in latest V4.0.x OpenSTLinux

  • September 8, 2022
  • 5 replies
  • 1345 views

Hi,

I have a problem with installing any directory or any files into /usr/local folder.

Here my_receipt.bb

DESCRIPTION = "My receipt"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9"
 
SRC_URI = "file://reset_led.sh "
 
S = "${WORKDIR}"
 
do_configure[noexec] = "1"
do_compile[noexec] = "1"
 
do_install() {
 install -d ${D}${prefix}/local/reset-led
 install -m 0755 ${WORKDIR}/reset_led.sh ${D}${prefix}/local/reset-led/
}
 
FILES:${PN} += "${prefix}/local/reset-led/"

In OpenSTLinx, those folders and files go to st-image-userfs...tar.xz.

In /usr/local I can see only demos etc. folders and directories.

The compilation is going well without any errors or warnings. What was missed, and where is the problem?

    This topic has been closed for replies.
    Best answer by Erwan SZYMANSKI

    Hi @Michał Wołowik​ ,

    Yes understood, indeed this is a userfs mounting point issue.

    What is happening here is that you tell the weston image to install your package in /usr/local.

    However, we also have a userfs image that aims to install everything in this folder, so a complete clean is made before.

    What you have to do is to tell this userfs image to install your package.

    It is done in the following file: layers/meta-st/meta-st-stm32mp/recipes-st/images/st-image-userfs.bb

    Then, modify the file to add your "my-receipt" package.

    SUMMARY = "STM32MP userfs Image"
    LICENSE = "MIT"
     
    include recipes-st/images/st-image-partitions.inc
     
    # Define to null ROOTFS_MAXSIZE
    IMAGE_ROOTFS_MAXSIZE = ""
     
    # Add specific package for our image:
    PACKAGE_INSTALL += " \
     ${@bb.utils.contains('MACHINE_FEATURES', 'm4copro', 'm4projects-stm32mp1-userfs', '', d)} \
     linux-examples-stm32mp1-userfs \
     my_receipt \
     "
     
    # Add demo application described on specific packagegroup
    PACKAGE_INSTALL += " \
     packagegroup-st-demo \
     "

    Hope that it will help you.

    Kind regards,

    Erwan.

    5 replies

    Technical Moderator
    September 9, 2022

    Hello @Michał Wołowik​ ,

    Did you already compare with the /layers/meta-st/meta-st-stm32mp/recipes-extended/linux-examples/linux-examples-stm32mp1 bitbake file ?

    Let me know if you understand your issue with the upper file that do the same thing as what you are looking for.

    For now I am building a yocto image with your example to try to reproduce.

    Kind regards,

    Erwan.

    MWoło.2Author
    Visitor II
    September 9, 2022

    Hi Erwan,

    yes, I based on linux-examples-stm32mp1. The problem is that no folder reset-led is created into /usr/local. I also try to add a folder in for instance into /etc/systemd/system and working as it should. The problem is only with /usr/local. I predict a problem with userfs partition due it is the mounting point for /usr/local.

    Thanks for the help.

    BR Michal

    Technical Moderator
    September 9, 2022

    Hi @Michał Wołowik​ ,

    Yes understood, indeed this is a userfs mounting point issue.

    What is happening here is that you tell the weston image to install your package in /usr/local.

    However, we also have a userfs image that aims to install everything in this folder, so a complete clean is made before.

    What you have to do is to tell this userfs image to install your package.

    It is done in the following file: layers/meta-st/meta-st-stm32mp/recipes-st/images/st-image-userfs.bb

    Then, modify the file to add your "my-receipt" package.

    SUMMARY = "STM32MP userfs Image"
    LICENSE = "MIT"
     
    include recipes-st/images/st-image-partitions.inc
     
    # Define to null ROOTFS_MAXSIZE
    IMAGE_ROOTFS_MAXSIZE = ""
     
    # Add specific package for our image:
    PACKAGE_INSTALL += " \
     ${@bb.utils.contains('MACHINE_FEATURES', 'm4copro', 'm4projects-stm32mp1-userfs', '', d)} \
     linux-examples-stm32mp1-userfs \
     my_receipt \
     "
     
    # Add demo application described on specific packagegroup
    PACKAGE_INSTALL += " \
     packagegroup-st-demo \
     "

    Hope that it will help you.

    Kind regards,

    Erwan.

    MWoło.2Author
    Visitor II
    September 9, 2022

    Hi Erwan,

    I will try.

    Thanks

    BR Michal

    MWoło.2Author
    Visitor II
    September 9, 2022

    Perfect answer. It is always good to ask, I spend almost half a day. Of course works. Many thanks

    BR Michal

    Technical Moderator
    September 9, 2022

    @Michał Wołowik​ ,

    Glad to see that it solves your issue.

    Have a nice day,

    Erwan.