mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-17 04:51:31 +03:00
f777cbdadb
The algorithms inside `make_ext4fs` can be followed, but it ends up being a bit complex. I did not figure out all variables, but the amount of them made me reluctant to implement it as a complte formula. Instead, I looked at the actual usable space using `df` and mapped it in a spreadsheet. With the knowledge from actively looking at the source code, and other data, it is known that the lookup table will work, while not be ideal. The fudge factor starting at 256MiB is about stable, but there is a slight downward deviation at 512MiB, which is why 512MiB was used. The downward deviation was not observed in other values. Here's the table as computed. ``` MIB Fudge 5 0.84609375 8 0.5419921875 16 0.288818359375 32 0.1622314453125 64 0.09893798828125 128 0.067291259765625 256 0.0518646240234375 512 0.05208587646484375 1024 0.048187255859375 2048 0.04060554504394531 4096 0.03718090057373047 ``` The difference from .52% to .37% is negligible for 0.5 vs. 4 GiB is annoying me. The lookup table could be changed to include all known values instead, I guess. |
||
---|---|---|
.. | ||
lib | ||
tests | ||
default.nix | ||
makeExt4.nix | ||
makeFAT32.nix | ||
makeFilesystem.nix | ||
makeMBR.nix | ||
test.rb |