Open dmuhamedagic opened 5 years ago
debootstick shell scripts are called with set -e
flag, so except for a few specific cases, failing commands should always interrupt the program. Thus, I tend to think that the command that prints those errors returns zero (erroneously).
About the free space check, since debootstick may have to install missing packages (linux kernel, lvm, etc.), or not (if they are already installed), I believe it is not possible to get an accurate value of the free space size needed.
But we can still make en estimate and check it.
Here is what I propose:
And we have three cases:
What do you think?
That's great! Very thorough! Yes, programs exiting with inappropriate exit code is not so seldom.
While we're at surprising behaviour, I noticed that the "out of space" condition on a loop device results in I/O errors. That happens as a program wants to write beyond the end. I couldn't find any information about that.
OK. I hope I will have a little time tomorrow to work on these issues.
This seems to be a different problem. Looks like some interaction with the device mapper and the VG which debootstick creates. It seems like it happens after debootstick interrupted and the VG remains around.
I'm not sure how to reproduce this, perhaps I pressed ctrl-C twice, before debootstick had a chance to clean up the device mapper/lvm stuff. Perhaps to ignore the signals during the cleanup?
If the image generated cannot fit on the target directory debootstick fails with read (perhaps also write) errors:
I'm not sure why is there a read error, but apparently the program doesn't check the exit code there.
It would also be good to check the amount of free space on the disk and just don't run if there's not enough of it.