project/Generic/filesystem, placing files into /storage/* locations

  • Hello all,

    Been fighting with this for a while, never quite managing to figure out how. Any help appreciated.

    Folder projects/Generic have two subfolders:
    - etc

    - usr

    I've found that content in usr/config end up in /storage/.config

    What is the mapping here? Need files into:
    - /storage
    - /storage/.kodi/userdata

    /stridex

  • If you want to place something in /storage you first need to create a package (or ammend an existing one) to embed the file(s) somewhere in the SYSTEM file and then embed and execute a script (or systemd service which executes a script) at boot time that checks if the file(s) exist on /storage and if not, copies them there. You cannot create files directly on /storage via the buildsystem because that path doesn't (and should not) exist in the SYSTEM or KERNEL files.

    NB: There is no direct mapping from /storage/.config to /etc .. we typically configure a package to run from /var/run/something which is symlinked to a location in /etc and then systemd services (which run scripts) copy the content from /storage/.config/something to /var/run/something at boot time to make things appear as if they are mapped. There's lots of prior art for this in the systemd package.