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

minimize.sh fails with no swap partition #420

Closed
beddari opened this issue Aug 14, 2015 · 3 comments
Closed

minimize.sh fails with no swap partition #420

beddari opened this issue Aug 14, 2015 · 3 comments
Labels
Type: Bug Does not work as expected.

Comments

@beddari
Copy link

beddari commented Aug 14, 2015

With set -e this line will exit minimize.sh if we got no swap partition, seems like that wasn't the intention ...

https://github.com/chef/bento/blob/master/scripts/common/minimize.sh#L3

@fnichol fnichol added the Bug label Aug 19, 2015
@fnichol
Copy link
Contributor

fnichol commented Aug 19, 2015

@beddari Oh yes, a great point. I was trying to skirt around the platforms that didn't have swap (or even the /sbin/blkid command) to preserve the previous behavior. While I don't normally like doing this, do you think a swapuuid="/sbin/blkid -o value -l -s UUID -t TYPE=swap" || true; would be an okay-ish fix?

@beddari
Copy link
Author

beddari commented Aug 28, 2015

Yes,

swapuuid="`/sbin/blkid -o value -l -s UUID -t TYPE=swap || true`";

... the closest well-tested portable shell code to grab from is probably https://github.com/chef/opscode-omnitruck/blob/master/views/install.sh.erb ;-)

@sheldonh
Copy link
Contributor

#479 applies a more conservative approach than a blanket ignore. It's not as nice to read, but it does deal with just the special case of swapless builders.

@tas50 tas50 added Type: Bug Does not work as expected. and removed Bug labels Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

4 participants