qubes-installer-qubes-os/lorax/0005-Drop-inner-rootfs.img-layer.patch
Marek Marczykowski-Górecki 332be8e1e3 anaconda, lorax: drop rootfs.img inside squashfs
Package root filesystem directly as squashfs image. The most important
gain is getting rid of greatly unreproducible ext4 image creation. But
also it makes the output image slightly smaller, and the build faster.
Also, dmsquash-live dracut module is not needed anymore, which reduce
initramfs size.
2018-10-04 21:46:15 +02:00

49 lines
1.9 KiB
Diff

From cfc809df64e2778e51d47dc8b4466cf98efe8a2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
Date: Wed, 3 Oct 2018 20:00:19 +0200
Subject: [PATCH] Drop inner rootfs.img layer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Make runtime directly into squashfs image. This reduces largely
unreproducible ext4 layer, but requires dracut module modification to
properly mount the image.
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
src/pylorax/treebuilder.py | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py
index 5d4f8b7..b804c2f 100644
--- a/src/pylorax/treebuilder.py
+++ b/src/pylorax/treebuilder.py
@@ -212,17 +212,11 @@ class RuntimeBuilder(object):
generate_module_info(moddir+kver, outfile=moddir+"module-info")
def create_runtime(self, outfile="/var/tmp/squashfs.img", compression="xz", compressargs=None, size=2):
- # make live rootfs image - must be named "LiveOS/rootfs.img" for dracut
compressargs = compressargs or []
- workdir = joinpaths(os.path.dirname(outfile), "runtime-workdir")
- os.makedirs(joinpaths(workdir, "LiveOS"))
+ os.makedirs(os.path.dirname(outfile))
- imgutils.mkrootfsimg(self.vars.root, joinpaths(workdir, "LiveOS/rootfs.img"),
- "Anaconda", size=size)
-
- # squash the live rootfs and clean up workdir
- imgutils.mksquashfs(workdir, outfile, compression, compressargs)
- remove(workdir)
+ # squash the rootfs
+ imgutils.mksquashfs(self.vars.root, outfile, compression, compressargs)
def finished(self):
""" Done using RuntimeBuilder
--
2.17.1