dw-0 / kiauh

Klipper Installation And Update Helper
GNU General Public License v3.0
3.4k stars 491 forks source link

feat: add free disk space startup check #351

Closed cravl-dev closed 2 months ago

cravl-dev commented 1 year ago

Closes #331 by adding a startup check for at least 5GB of free space in ${HOME}.

dw-0 commented 1 year ago

I like the idea and it seems like a rather easy approach and solution to the issue. Though im not sure if we should do this check everytime after starting KIAUH. Imagine user has everthing installed and just want to update a component. He would then be shown the message and the script exits, leaving the user unable to do anything. Even uninstalling something to free space up would be impossible.

I think the check should be done somewhere later. Maybe in the install and update menu itself? we could check if any component is already installed, and if its a completely clean system that has no klipper, moonraker etc installed, we could assume the dependencies are also missing and show the warning in red. i would still allow the user to proceed i think. he has been warned, right? a second case would be to check if anything is installed at all, and if it is but the available disk space is below 5gb, we could print the message in yellow for signaling something like "hey you're likely running out of disk space soon". but let the user proceed here as well. last but not least: is $HOME really the correct directory to check? don't system packages go onto another partition usually? i don't know that from the top of my head right now.

cravl-dev commented 1 year ago

I'm converting this to a draft while I mess with it some more, I have a couple test cases that still aren't working right and I want to refactor a bit to simplify things.

dw-0 commented 2 months ago

I close this PR as this is not planned to be integrated in KIAUH v5 anymore. Further development of new features should target KIAUH v6, which requires a feature to be implemented in Python.