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

Exit codes when "Image cannot be shrunk any further" #192

Closed
justin-robinson opened this issue Mar 6, 2024 · 3 comments
Closed

Exit codes when "Image cannot be shrunk any further" #192

justin-robinson opened this issue Mar 6, 2024 · 3 comments

Comments

@justin-robinson
Copy link

If you attempt to shrink an image that can't be shrunk anymore, the command exits with status 1. This was unexpected and requires us to suppress that error code so it doesn't kill our script. I'd argue this isn't an error since the result is what the user wanted, an image that's shrunk as much as possible. What are you thoughts?

# sudo sdm --shrink my.img
* Start shrink on IMG 'my.img'
> Check the file system
rootfs: 52111/215568 files (0.2% non-contiguous), 571790/861981 blocks
resize2fs 1.46.5 (30-Dec-2021)
% Image cannot be shrunk any further

# echo $?
1

We have to do this as a workaroung

# shrink it (always return exit code 0 since sdm sets it to 1 if the image already is the minimum size)
sudo sdm --shrink $1 || true
@gitbls
Copy link
Owner

gitbls commented Mar 6, 2024

Ugh. That one is easy. Please continue posting busted exit statusi, will fix them in the next release.

@gitbls
Copy link
Owner

gitbls commented Mar 22, 2024

Fixed in V11.6. Please test/verify. Thx

@gitbls
Copy link
Owner

gitbls commented Apr 22, 2024

Closing due to no activity. Please re-open or create a new issue if necessary.

@gitbls gitbls closed this as completed Apr 22, 2024
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

2 participants