Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: support a feature to read external file for templating #1363

Closed
tagoh opened this issue Jan 16, 2024 · 7 comments
Closed

RFE: support a feature to read external file for templating #1363

tagoh opened this issue Jan 16, 2024 · 7 comments

Comments

@tagoh
Copy link
Contributor

tagoh commented Jan 16, 2024

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
Copy link
Contributor

bcl commented Jan 16, 2024

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.

@tagoh
Copy link
Contributor Author

tagoh commented Jan 17, 2024

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
Copy link
Contributor

bcl commented Jan 17, 2024

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.

@tagoh
Copy link
Contributor Author

tagoh commented Jan 18, 2024

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
Copy link

juhp commented Jan 18, 2024

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
Copy link

juhp commented Jan 18, 2024

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
Copy link
Contributor

bcl commented Mar 15, 2024

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

@bcl bcl closed this as completed Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants