core-agent-linux/init
AJ Jordan 593724c05b
Use dumpe2fs for filesystem size calculations
The previous approach used `df` to get usable space and then added a
fixed size to that number in order to account for filesystem
overhead. However, at some point that stopped working for me. It
appears that ext4 filesystem overhead can vary over time or because of
other factors. (Certainly now that I think about it the old code would
only work well for people with the exact same filesystem size as me.)

So the new approach is to just completely ignore what `df` tells us
and instead go directly to the source: the filesystem's internal
notion of exactly how much space it takes up. We use `dumpe2fs` to
retrieve this information and calculate the on-disk size dynamically
from that. Then we add the space that boot data takes up (unchanged),
and we add 5MB padding because when I tested this it didn't quite add
up otherwise. https://unix.stackexchange.com/a/13551/29146 suggests
that this unaccounted-for data may be e.g. additional copies of the
superblock.
2019-02-07 16:04:11 -05:00
..
control-printer-icon.sh Hint shellcheck where to look for sourced files, if in repository 2017-09-30 05:05:34 +02:00
functions is_protected_file: if no config dir is present, assume the file is _not_ protected 2018-12-06 14:44:42 +01:00
resize-rootfs-if-needed.sh Use dumpe2fs for filesystem size calculations 2019-02-07 16:04:11 -05:00
setup-rw.sh Update spelling in setup-rw.sh 2018-12-14 17:07:28 +01:00
setup-rwdev.sh setup-rwdev.sh: Only check first 1 GiB for zeros 2018-07-03 20:07:12 +00:00