Pantavisor 019 Features: Groups

Modifying the Groups of a Container

As in the restart policy and status goal posts, we are going to modify the group of an existing container by manually editing the src.json file in our previously cloned device:

cd home_rpi64_latest
ls

In here, among others, we have the pvr-sdk container, which is linked to the legacy platform group. Inside that directory, we will find the src.json and the run.json files. The first one will be used by pvr, while the second one will be parsed by Pantavisor itself. Let us first take a look at the configured group in the run.json:

$ jq .group pvr-sdk/run.json 
"platform"

As we can see, the pvr-sdk is still part of the platform group, but we want to modify this, as the new device.json does not have such group. If we want to change that without having to reinstall the container, we have to do it in the src.json, as run.json is not meant to be directly edited:

$ jq .args.PV_GROUP pvr-sdk/src.json 
"platform"

And manually edit it to look like this:

$ jq .args.PV_GROUP pvr-sdk/src.json 
"devtools"

Now, if we use the pvr app install command:

pvr app install homeassistant

The pvr tool will take the value from the src.json file and apply it at the run.json:

$ jq .group pvr-sdk/run.json 
"devtools"

After we have repeated this operation with all existing containers and make sure they are all pointing to the new groups, you can commit and post the changes to make them effective in your device:

pvr add .
pvr commit
pvr post -m "change legacy groups to new ones"