Sorry to bump an old thread, I have got bind dirs to work with simple applications. However, I am confused about how to handle applications with lots of dependencies.
Right now I have a f35-kleopatra template for my offline gpg qube which is just normal f35 with kleopatra installed. I would love to make this a bind-dir instead of a whole new template but i don’t know, with the current system of how bind-dirs works it doesn’t seem worth the effort.
For example look at how many things kleopatra installed when put in my template.
So I basically need to add all the files installed by 64 packages to the bind-dirs file.
I guess it could be done with a script that follows this logic:
For dep in dependencies:
for each line in $(dnf repoquery -l dep)
$BindsFile >> "binds+=( ‘$line’ ) # add each file installed by dep to config file.
sudo mkdir -p “/rw/bind-dirs/$LineUpToFinalSlashAkaFolder” #create folders in /rw/bind-dirs
sudo cp $line "/rw/bind-dirs/$line #copy actual file installed by dep to /rw/bind-dirs/$line
I mean this script is obviously just a pseudo code example and wouldn’t be hard to right? Has anyone by chance already made a script like this which would make the current bind dirs system actually usable?
I don’t know it seems like more effort than it’s worth that’s why I just made a new template. However, I do think not having an easy system to install one extra application to the main template and nothing else should be easier than it is or maybe even considered to be redesigned completly.
qvm-freeze-template #save current fedora35 as in a current state/base layer.
dnf install kleopatra
qvm-create-layer (new template name)
Then on update of the new update instead of treating it as a seperate template and upgrade f35 multipe times, update f35 once, copy base to layered template, then upgrade all packages installed between qvm-free-template and create layer.
So on update of f35-kleopatra:
cp fedora35 to f35-kleopatra:
dnf install/upgrade kleoatra (in f35-kleopatra)
So basically we only update f35 once instead of many times over, /just remember this is also the base for the layered template instead of upgrading f35 a 2nd time. Then in the layered template just install/upgrade any packages that were installed in the “top layer” (kleopatra). This could be done with lvm snapshots.
The goal of this would be to save space, by simply remembering that fedora35 is also the base for the other template. So size of kleopatra template would be just the size of kleopatra instead of 5GB etc.
On boot of f35-kleopatra, set root file system to default fedora-35 base. Put snapshot CoW changes from when kleopatra was installed on top of this. Done. This could be accomplished easily with either lvm snapshots or btrfs snapshots. Considering 4.1 is already taking lvm backup snapshots of vms, that would be the easiest root. Then we could create layered templates based of CoW changes and only update f35 once instead of updating the same packages over and over for each vm, Then the size of additional layer based templates would just be the size of the application not of all of f35 as well (5gb).
Am I crazy or does this idea at least make sense? I’m not expecting this to be added any time soon or anything, but this at least makes sense right? Or is there a problem with this idea I am missing?
Seems like this would be a much more user friendly system than the way bind-dirs work currently. Just because as a user I feel it’s not even worth the effort to use bind-dirs even for a simple app like kleopatra even though I would like to.