-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Sat, Jun 20, 2020 at 04:47:49PM +0000, WillyPillow wrote:
> On Wednesday, June 17, 2020 11:55 PM, Marek Marczykowski-Górecki <
marm...@invisiblethingslab.com> wrote:
> > I'm not yet sure about interactions with qubes.SyncAppmenus call (used
> > to extract actually available applications). This is normally done when
> > the template is initially started during installation (and also later
> > after installing updates). Before starting the template (specifically
> > before making qubes.PostInstall call to it), you don't have desktop
> > files templates, so menu entries cannot be created yet. This probably
> > means various menu related calls will need to be after qubes.PostInstall
> > call.
>
> As far as I can tell from reading the source code, the main things that
> `qvm-appmenus` do are i) update the whitelists (which is the part that needs to
> be replaced in `qvm-template-postprocess`) and ii) update the appmenus
> according to the whitelist and desktop file templates. The latter is
> (indirectly) invoked by qubes.SyncAppmenus after updating the desktop file
> templates. As such, the new qrexec call, to my understanding, only has to
> implement the former functionality.
>
> However, as qubes.SyncAppmenus updates the appmenus, my understanding is that
> the orders in which they are called do not matter?
>
> By the way, upon inspecting the code more closely, `qvm-appmenus` merely writes
> the whitelist to a file and reads from it later. As we are storing the list in
> qvm-features anyway, is it still necessary to have the qrexec call?
If we rely on the side effect of qubes.SyncAppmenus to not only extract
available desktop files, but also (re)generate actual menu, then indeed
for template installation no extra qrexec services are necessary.
But in general, qrexec services for manipulating menu will be needed for
all kind of other cases, like creating/removing VMs, updating menu after
setting what applications are included, after changing template, after
changing guivm etc. Sounds like a task unrelated to template manager.
> > > > > Anyhow, if the package format has been established to a certain extent, maybe I
> > > > > can start building a PoC that, say, imports a image from an existing RPM?
> > >
>
> > > > Yes :)
> > >
>
> > > A PoC using the original file format can be found at
> > >
https://gist.github.com/WillyPillow/61ee5f48b7c5b7cc90c9fd2ec5c1b20d.
> > > The script is tested with `qubes-template-fedora-31-minimal` from the official repos.
> >
>
> > extract_rpm is not called from anywhere?
>
> That's... very embarrassing :(
>
> I may have accidentally removed it when cleaning up the comments.
>
> > Be careful about TemporaryDirectory - by default it puts it in /tmp,
> > which is RAM-based tmpfs - may be too small for the whole template.
> > /var/tmp should be better (AFAIR dir= argument).
>
> I see. Did not realize that /tmp is a tmpfs.
>
> An updated version with the issues above fixed (and some other slight changes)
> has been posted.
If the intention of nogpgcheck is similar to dnf --nogpgcheck option,
then it would be simpler to skip the check completely instead of
handling various error conditions.
Actually, why both --nogpgcheck and --allow-unsigned? If you don't care
if the signature is there, one of those options is enough. And skipping
the check will be simpler.
As for the comment about setting installed_by_rpm - yes, better drop
setting it in qvm-template-postprocess.
> > Also, look specifically for a requested template name, not just anything
> > you find in the package. Currently "for name in os.listdir(target +
> > PATH_PREFIX)" will happily accept whatever template is there (possibly
> > also multiple templates in a single rpm).
>
> The reason I did it this way was because i) there doesn't seem to be a clean
> way of extracting the template name from the package, and ii) it might
> conceivably be a feature useful in cases like installing whonix-gw and
> whonix-ws at the same time.
>
> That being said, the idea of looking for a requested template name makes a lot
> of sense as a way of dealing with the first problem. I am unsure what the user
> interface should look like when installing downloaded RPMs though.
I would go with the package name (in rpm header). And if it doesn't
conform to "qubes-template-(template name)" pattern, then require
explicit option from the user, or even reject as an invalid package.
And when the user request to download the template, you already have
expected name.
> (Thinking about it, being able to install multiple templates this way would
> probably create issues when implementing force-reinstall operations later on,
> so sticking to one template in one RPM is probably a better idea after all.)
Yes, one template - one rpm. Otherwise there will be a lot of complexity
in various corner cases.
- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAl7wL24ACgkQ24/THMrX
1yyyTQgAhIR22DsnTtE+xToZ4KEH1Y/zMUQm1WVcbBUqk3/QtVVUbr+54Ruhq8Ni
yMgp3Iqwy2PgrcsCh2cVDgB/MvctKx1J91/Gn4tuFBEQe7w8uWCg5VLRgLWhIwrt
pv/UC11swf4oCto26KugInqMhVDHKgogKGELCH+X8DADTFaDZISIPTMSwmKxajBV
p1JjnGwVqg70QUpvtf3lkLTcO9KvdiNHa/vx8MEkW1s2lgjeeVWPqJZIWdgy2x7C
AF7XDFsP3inDPuz2+nGx4VF3kK7Ne7IFx2g4W7x/K2+1eli+F8iXWN4bzgeR4lm0
mIB7RBrbxC6ggMQSnuYSQb8vKtdEPA==
=OYDe
-----END PGP SIGNATURE-----