/projects/RPi2/filesystem/storage is not copied to device

  • Hello,


    I would like to have some files already integrated into an image or release. In particular a connman config to have wifi without entering a long passphrase on tv remote.


    Steps done:

    • Copied files to
      /projects/RPi2/filesystem/storage/.cache/
      /projects/RPi2/filesystem/storage/.config/
      /projects/RPi2/filesystem/storage/.kodi/
    • PROJECT=RPi2 ARCH=arm make release OR
      PROJECT=RPi2 ARCH=arm make image


    All the files appear in /build.LibreELEC-RPi2.arm-8.0-devel/image/system/storage but after installing the image to sd card or updating the system with the release the files are not copied to the device.


    I am pleased for any advice
    vop43


    LibreELEC version master adec105

  • What lrusak is saying is that the LE build doesn't support what you are trying to achieve. You'll need to patch the various systemd scripts for kodi, connmand etc. to deploy your files to /storage from within your image. You don't want to copy a folder called "/storage" to your image as that will be very confusing (as LE already mounts a /storage partition), but you could put your own files in a folder called /usr/storage which should then be copied to your image, and then deploy your files from /usr/storage.


    However, it's probably a solution that will break at some point when other updates are applied to master, and it might be easier to deploy your static files from a tar file. Presumably you're creating a custom image for more than just these WiFi credentials, as that's a lot of work for something that's fairly trivial.

  • To make storage partition ready I made one service which copies files from somewhere under /usr to /storage. When image is build extra files are copied to /usr. It was working fine when I was needing this.


    Support my work with small (or big) Paypal donation


    Amlogic devices works better with CoreELEC

    Blu-ray Disc Java menus support - forum thread, Github

    my lamp addon (unofficial/community with limited support)
    my touchscreen support and instructions by Grruhn (now touchscreen addon exists in repository)


  • Thanks for the feedback so far.
    Everything I want to have integrated is in the folders which are also backed up by the LibreELEC plugin:
    /storage/.cache
    /storage/.config
    /storage/.kodi
    And yes, it's more than wifi credentials, but not that much:
    - connman config
    - LCDd config for patched lcdproc
    - scripts for RemotePi Board
    - modified addon script.xbmc.lcdproc and config
    - kodi config


    What I tried is patching
    LibreELEC.tv/userconfig.service at ce890b1f04c0932f3d9912eaaf5fab237f6fd38f · LibreELEC/LibreELEC.tv · GitHub
    to copy files not only to .config but to all the folders mentioned above. I think this is was vpeter mentioned.
    It seems not to be a really clean solution for me, but it works.


    Another option would be using the already integrated backup functionality in an automated way.
    LibreELEC.tv/init at 79dc62da2c3aaa260b9c3b02782d6901ee1d2ba4 · LibreELEC/LibreELEC.tv · GitHub
    But the init script searches in /storage/.restore (which is not easily accessible besides during operation).
    Of course going to the LibreELEC GUI and restoring a backup is not a big deal, but why doing things manually in such an environment.
    I will have a look at this soon.