From 6f141658d49affdb3f5b95cba3b66b52ec13dd4b Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Fri, 14 Dec 2018 09:15:31 -0800 Subject: [PATCH] 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 --- src/pylorax/imgutils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pylorax/imgutils.py b/src/pylorax/imgutils.py index 1f1985b5..865e8ab4 100644 --- a/src/pylorax/imgutils.py +++ b/src/pylorax/imgutils.py @@ -477,6 +477,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"])