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

Flatpak fetch metadata module #27

Open
nintyfan opened this issue Aug 28, 2023 · 5 comments
Open

Flatpak fetch metadata module #27

nintyfan opened this issue Aug 28, 2023 · 5 comments

Comments

@nintyfan
Copy link
Contributor

nintyfan commented Aug 28, 2023

Two weeks ago, dalto8 have merged my work to add flatpak as calamares package manager. But, there is need to download package list from flatphub, I think.

Module should work in this way: download package list by flapak (flatpak list) and them save it into yml file (not config file of netinstall module, but to file contains list of packages; file format is supported by netinstall to represent file was downloadable set of package names).

If distro vendor configure everything correctly, then:

  1. Calamares should start my fetch module
  2. My fetch module save package names and (possible?) other data in file pointed by configuration of fetch module
  3. Calamares starts netinstall module
  4. netinstall will read from local file, which was saved by fetch module
  5. User selects packages to install
  6. Calamares starts packages module and it uses flatpak to install packages

Any suggestions?
Saving list of packages on filesystem is simplest approach. I thought about making netinstall be able to read packages list from local storage of calamares, but it will be too hard.

Previous work: calamares/calamares#2176

@dalto8
Copy link
Collaborator

dalto8 commented Aug 28, 2023

The netinstall module doesn't read from a file at that stage. It reads from global storage. So you would probably want to write the data to global storage instead of a file.

If you need an example of that, you can look at the packagechooser module.

@adriaandegroot
Copy link
Contributor

Calamares modules read their configuration files at startup, so that's too late. Offering an entirely arbitrary package list at install time is tough -- every other module either has the full configuration on disk, or, like netinstall, has a mechanism for fetching the full configuration at runtime, but it's still the same kind of configuration.

@nintyfan
Copy link
Contributor Author

nintyfan commented Aug 30, 2023 via email

@nintyfan
Copy link
Contributor Author

Calamares modules read their configuration files at startup, so that's too late. Offering an entirely arbitrary package list at install time is tough -- every other module either has the full configuration on disk, or, like netinstall, has a mechanism for fetching the full configuration at runtime, but it's still the same kind of configuration.

Ok. I uses google's translator. :-D How runtime configuration for netinstall works? Should I emit some signal to force reload configuration or call routine with String or c-string contains new configuration?

@dalto8
Copy link
Collaborator

dalto8 commented Aug 31, 2023

Ok. I uses google's translator. :-D How runtime configuration for netinstall works? Should I emit some signal to force reload configuration or call routine with String or c-string contains new configuration?

Netinstall reads from global storage when the module is executed. All you need to do is add your data to global storage in the correct key prior to the module executing.

If you need an example of how to do it, the packagechooser module has code that writes data for the netinstall module. Specifically, that code is here:
https://github.com/calamares/calamares/blob/calamares/src/modules/packagechooser/Config.cpp#L149

@nintyfan nintyfan mentioned this issue Sep 5, 2023
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