calamares / calamares-extensions

Examples of Calamares branding
35 stars 18 forks source link

Flatpak fetch metadata module #27

Open nintyfan opened 10 months ago

nintyfan commented 10 months ago

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: https://github.com/calamares/calamares/pull/2176

dalto8 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

I thought netinstall is a gui for package selection. Did you write about packages module. I maybe misunderstood.

pon., 28 sie 2023, 21:20 użytkownik Adriaan de Groot < @.***> napisał:

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.

— Reply to this email directly, view it on GitHub https://github.com/calamares/calamares-extensions/issues/27#issuecomment-1696242635, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGXA6QZA6LRRWWNB2GZZCXLXXTVOJANCNFSM6AAAAAA4BVB7AU . You are receiving this because you authored the thread.Message ID: @.***>

nintyfan commented 10 months ago

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 commented 10 months ago

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