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

Assume raw format for image #7

Conversation

mrtwnklr
Copy link
Contributor

@mrtwnklr mrtwnklr commented Mar 7, 2020

This change fixes the following warning when starting a container:

WARNING: Image format was not specified for '/sdcard/filesystem.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.

@lukechilds lukechilds force-pushed the master branch 3 times, most recently from 8fc0f42 to 4523499 Compare March 9, 2020 06:39
@lukechilds
Copy link
Owner

Is it a good idea to hardcode to the raw format over letting QEMU do probing?

If someone has an image in a different format then it won't be able to boot if we hardcode to raw.

Or is raw pretty much ubiquitous for Pi images?

// CC @JamesReynolds

@JamesReynolds
Copy link
Contributor

@lukechilds I have never seen a qcow2 or vmdk image of a raspberry pi disk, I'm sure that raw is ubiquitous. However, adding ".img" is fairly ubiquitous too, so making ".img" default to raw could be a reasonable compromise?

@lukechilds
Copy link
Owner

That's a good idea.

@mrtwnklr are you able to check for the .img extension first? If there is an .img extension specify the raw format, if no .img extension just let QEMU do it's probing.

@mrtwnklr
Copy link
Contributor Author

Yes, that's a good idea.
But checking for the real extension (container-outside) of the volume mounted path is not possible. One could define an additional env var IS_RAW_IMAGE and use this in entrypoint.sh to prevent the warning.

@lukechilds
Copy link
Owner

lukechilds commented Mar 11, 2020

Oh of course, .img is hardcoded in the entrypoint. In that case I don't think the check is necessary. By requiring a .img file I guess we are implicitly saying we expect the raw format.

@lukechilds
Copy link
Owner

@mrtwnklr are you able to just rebase this on top of the latest changes and then this is good to be merged. Thanks!

@mrtwnklr mrtwnklr force-pushed the bugfix/fix_image_format_not_specified_warning branch 2 times, most recently from abab529 to 7d0e25b Compare March 12, 2020 17:54
@mrtwnklr mrtwnklr force-pushed the bugfix/fix_image_format_not_specified_warning branch from 7d0e25b to e0ea1b6 Compare March 12, 2020 17:57
@mrtwnklr
Copy link
Contributor Author

Ok, that's it.

@lukechilds lukechilds changed the title fix qemu warning 'Image format was not specified ...' Assume raw format for image Mar 16, 2020
@lukechilds lukechilds merged commit 35b55bc into lukechilds:master Mar 16, 2020
@lukechilds
Copy link
Owner

Thanks @mrtwnklr!

@mrtwnklr mrtwnklr deleted the bugfix/fix_image_format_not_specified_warning branch March 16, 2020 06:02
sthagen added a commit to sthagen/lukechilds-dockerpi that referenced this pull request Mar 19, 2020
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

Successfully merging this pull request may close these issues.

3 participants