lorax: Save information about rootfs filesystem size and usage

Run df on the filesystem image after it has been created.
Output will be in program.log, eg:

Running... df /var/tmp/lorax.imgutils.wm04pg_v
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/loop0       1998672 1619508    362780  82% /var/tmp/lorax.imgutils.wm04pg_v
Return code: 0
This commit is contained in:
Brian C. Lane 2018-12-14 09:15:31 -08:00
parent 1607e33227
commit 251306e1ab

View File

@ -465,6 +465,9 @@ def mkfsimage(fstype, rootdir, outfile, size=None, mkfsargs=None, mountargs="",
copytree(rootdir, mnt, preserve)
do_grafts(graft, mnt, preserve)
# Save information about filesystem usage
execWithRedirect("df", [mnt])
# Make absolutely sure that the data has been written
runcmd(["sync"])