From 46c0852b6f3737027ad75d3c6a7754607d8d9cb3 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 15 Jul 2021 12:38:50 -0400 Subject: [PATCH] Add more non-json data to image format --- imgutil/imgutil | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/imgutil/imgutil b/imgutil/imgutil index 60d013c1..8903a5f6 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -130,6 +130,12 @@ def capture_system_back(args): outimg.write(struct.pack('!I', jsize)) with open(fname + '.json','rb') as fsinfoin: outimg.write(fsinfoin.read()) + outimg.write(struct.pack('!Q', fs['minsize'])) + outimg.write(struct.pack('!Q', fs['initsize'])) + outimg.write(struct.pack('!H', len(fs['filesystem'].encode('utf8')))) + outimg.write(fs['filesystem'].encode('utf8')) + outimg.write(struct.pack('!H', len(fs['device'].encode('utf8')))) + outimg.write(fs['device'].encode('utf8')) # want to pad to 4096, the pad size (2 bytes) and image size # (8 bytes) will contribute to padding (or drive need for more) # padding