FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important
information on the platform change.
08-10-2023 10:24 AM
Hello Community,
I have created a snap and it contains configuration files, which are saved under $SNAP_DATA. During the runtime, I want to edit the configuration files in order to integrate other components.
By referring few documentation and example codes, I was able to create an empty folder inside the active configuration. But, I do not know how to map the files under $SNAP_DATA to this folder.
First, is it possible to map the files in this way? If yes, please let me know the steps to perform.
Thank you
Solved! Go to Solution.
08-10-2023 10:41 AM
CodeShepherd describes in this thread how to copy files to the active configuration using a hook. See script "connect-plug-active-solution".
08-17-2023 04:17 PM
Hello,
Thank you for the response. Actually, what I want to achieve is something different.
I am following this source https://github.com/giaever-online-iot/home-assistant-snap/blob/master/snap/snapcraft.yaml to generate a snap for home assistant.
Under apps, the command bin/hass --config $SNAP_DATA starts the application and generates few configuration files and folders, which will get stored at $SNAP_DATA. The command takes a path as arguement, where there files and folders need to be stored.
I have modified the command to bin/hass --config /var/snap/rexroth-solutions/common/solutions/activeConfiguration/home-assistant/config
At the moment, I am facing the following issue: Fatal Error: Unable to create library directory /var/snap/rexroth-solutions/common/solutions/activeConfiguration/home-assistant/config/deps: [Errno 13] Permission denied: '/var/snap/rexroth-solutions/common/solutions/activeConfiguration/home-assistant/config/deps'
Steps I have followed so far:
1. Added a shell script, which will create a folder named home-assistant and sub folder named config inside activeConfiguration directory.
2. Added configs folder with package-assets file
3. Added active-solution plugs to snapcraft.yaml
4. Added parts to dump shell script and package-assets
5. Added hooks connect-plug-active-solution
I have attached the complete project as Zip. Please, let me know where I am making mistakes. Any help would be highly appreciable.
Thanks & Regards
08-21-2023 09:41 AM
Hello,
Try to follow this how to step by step:
08-23-2023 10:29 AM
Hi Riboni,
The post really helped me.
I made a mistake of not naming the package manifest file same as snapcraft project name. Renaming it, fixed the issue and directory now got the permission to map files.
Thanks & Regards