-
Notifications
You must be signed in to change notification settings - Fork 110
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
Have partition be sized to minimum to fit specified files #46
Comments
Hmmm, we would could do that in the mountpoint handling. We would have to move that before calling |
I'm a "Google for a Solution" kind of guy, and here's what I found for "size of a folder in C": https://stackoverflow.com/questions/21569578/how-to-get-total-size-of-a-folder-in-c-with-recursivity A side issue is how precise you need to be; it's easy to think of ways of estimating the final size that end up with a too-small partition. Suggestion: a configuration setting for how much extra space gets added to the estimation. |
The problem is getting the corner cases right. From a quick lock, I'm pretty sure that this will skip directories named About the size: some unknown additional space is always needed for meta data. In PTXdist for example I start with the size of the uncompressed tar and use 125% of that by default. |
Oy: if someone wants to name a directory You could solve this with documentation, saying that file trees containing unusually named files won't be able to use this feature. |
No, if we do this, then we do it right. Documentation like that is just shifting blame, it doesn't solve any problems when they occur. And I certainly don't know the file names of all the files in the images I create. And if I need to create a fallback elsewhere in case genimage get's it wrong, then It's not worth the effort implementing this in genimage at all. |
Sounds right to me. Let me know if you want more feedback/suggestions/opinions. |
Hi!
I have the following error: Is there a workaround to have this partition automatically sized to its minimum? |
100% cannot work. None of the tools used here, allow specifying this. So we calculate the space used by the content. However, there is always some overhead that depends on both the filesystem and the structure of the content (how many files, filenames, directory hierarchy, etc.). Genimage cannot calculate this overhead. So for the size calculation we only use the file content. So 100% will never work. If you want to get as close as possible, then you need to experiment here. I use 120% most of the time. It's close enough for me and has not failed for me yet. If you go too low, then it may work once, but fail later when the content changes. |
Thanks for your answer, but on my use case I have the "mkdosfs: Attempting to create a too small or too large filesystem." whatever the percent value I use, even 200%. |
That sounds like a bug. Please open an new issue and add the output of genimage with --loglevel=3 |
I created #227. |
As I expect a number of
buildroot
users are these days, we usegenimage
to generate the output file image. Problem: we must explicitly set asize
value large enough to fit the built system. Too large, and we're making unwieldy images; too small and the build fails. Even worse, we'll have to tune this again and again as we add features to our product, increasing the size of the contained files.Would it be possible for
genimage
to measure the size of the files that will go into the partition (specified using therootpath
property) and then make a partition that can contain those files with little waste?The text was updated successfully, but these errors were encountered: