weldr/lorax

RFE: support a feature to read external file for templating

Closed this issue · 7 comments

In Fedora 39, We have implemented default-fonts meta packages to simplify the package installation for default fonts. We don't need to update lorax template files anymore when changing our default fonts. However, lorax still have a hardcoded packages/files to clean up unnecessary files. This doesn't effectively work on meta packages because there are no way to know the real package name from them.

To improve this, I want to propose a feature in lorax to read a sort of manifest file in the package to describe what files are needed (or to drop; dunno which one is better yet from POV of the security risks) and then process instead of the hardcoded files in a template.

For font package side, I'm not supposed to create that file by hand (for font packages at least). We basically rely on fonts-rpm-macros to generate most of things in a spec file. So it could be done by rebuilding fonts packages once the necessary changes is landed in fonts-rpm-macros.

Also, I want to bring this to coming Fedora Changes proposal when it is ready.

How does it sound?

bcl commented

I'd rather not have it depend on a file in the rpm packages. The cleanup stage is pretty unique, AFAIK nothing other than lorax does this, so it doesn't make sense to have packages carry around that information. It would also mean that minimization efforts would need a rebuild of the packages in question instead of just lorax. OTOH the lack of file info in meta packages is a good point. There may be something that can be done about that, I'll have to dig into how much info I can extract from dnf though.

Thank you for the comment! The goal is to drop such hardcoded information in the template to maximize the efforts of "default-fonts" mechanism. So I'd like to keep the discussion.

If we focus on to the font stuff only, I suppose it can be automated to minimize the image in programatical way because the boot image apparently use Regular style font only. We don't need to rebuild packages that way.

bcl commented

The current fedora runtime-cleanup.tmpl has this in it:

removefrom google-noto-sans-cjk-fonts /usr/share/fonts/google-noto-sans-cjk-fonts/NotoSansCJK-{Black,Bold,*Light,Medium,Thin}.ttc
removefrom google-noto-sans-vf-fonts /usr/share/fonts/google-noto-vf/NotoSans-Italic-VF.ttf

So it doesn't make sense to me to add a mechanism to automate that unless it is going to change more often or grow much larger.

We can't promise anything about it. It may happens or may not. I didn't check but there may be more files we can drop. dunno.

juhp commented

removefrom google-noto-sans-cjk-fonts /usr/share/fonts/google-noto-sans-cjk-fonts/NotoSansCJK-{Black,Bold,*Light,Medium,Thin}.ttc

If we switch lorax to use the noto vf cjk fonts - this should no longer be needed

juhp commented

I think we can switch lorax to the default-fonts metapackages first in line with the rest of the Fedora
and see if there are any more extra fonts appearing. If it is just NotoSans-Italic-VF.ttf left, it might be overkill to do more,
though I also like the idea of having a such a non-minimal manifest file in the fonts packages,
of course that would also have to be kept up to date too...

bcl commented

Switched to default fonts packages in lorax v40.5, closing this.