Fedora-OSTree-Setup-dev / Fedora-OSTree-Setup

Glorified scipt that automates the setup of Fedora Silverblue/Kinoite based on given config file.
GNU General Public License v3.0
7 stars 3 forks source link

handling of commands that needs sudo permission #46

Open iaacornus opened 1 year ago

iaacornus commented 1 year ago

there are alot of commands that the program needs to execute needing sudo permission, this includes system wide modifications in flatpak overrides, config modifications in /etc, addition of repo with sudo ostree, or removing and adding systemd services and autostart programs.

handling sudo by including it in the CMD_ argument to subprocess.Popen or subprocess.call does not seem to be a good idea. The polkit cannot be configured either since it is in /usr

boredsquirrel commented 1 year ago

Additional: how to deal with pure shell commands?

I am honest, you have to start build the core script, I can add the parts probably, as I know something about the bash commands that work, but the python commands are completely different.

I think the main components (in bash) are ready, and would only use Python for the interface, writing the scripts and executing them in the end.

Maybe thats not how these programs are constructed, and a real python script with progress bars, direct output e.g. is better, but then you would need python equivalents for all these bash commands, making them pretty much useless.

What stays in bash:

  1. the final rpm-ostree script, installing and removing all packages at once
  2. the autostart reboot script, setting some configs for rpm-ostree layered packages and then deleting itself