|
| 1 | +From 31faba33b71feb160f436aaf4c9ac9932cb68830 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Dusty Mabe < [email protected]> |
| 3 | +Date: Fri, 14 Feb 2025 12:23:48 -0500 |
| 4 | +Subject: [PATCH] stages/coreos.live-artifacts: use /var/tmp for mkfs.erofs |
| 5 | + |
| 6 | +This helps reduce the memory requirements of mkfs.erofs since |
| 7 | +it won't be writing to tmpfs (memory backed) storage, which is |
| 8 | +what is mounted on /tmp/. |
| 9 | +--- |
| 10 | + stages/org.osbuild.coreos.live-artifacts.mono | 6 +++++- |
| 11 | + 1 file changed, 5 insertions(+), 1 deletion(-) |
| 12 | + |
| 13 | +diff --git a/stages/org.osbuild.coreos.live-artifacts.mono b/stages/org.osbuild.coreos.live-artifacts.mono |
| 14 | +index 302b24d3..a5837deb 100755 |
| 15 | +--- a/stages/org.osbuild.coreos.live-artifacts.mono |
| 16 | ++++ b/stages/org.osbuild.coreos.live-artifacts.mono |
| 17 | +@@ -606,10 +606,14 @@ def mkrootfs_metal(paths, workdir, img_metal, fstype, fsoptions, loop_client): |
| 18 | + # Note the filename must be exactly "root.[squash|ero]fs" |
| 19 | + # because the 35coreos-live dracut module requires it. |
| 20 | + if fstype == "erofs": |
| 21 | ++ # Set TMPDIR='/var/tmp' to write temporary files into non-tmpfs |
| 22 | ++ # (memory backed) storage. This helps reduce memory requirements. |
| 23 | ++ # https://github.com/erofs/erofs-utils/issues/13 |
| 24 | + subprocess.check_call(['mkfs.erofs', |
| 25 | + *fsoptions.split(' '), |
| 26 | + paths["initrd-rootfs/root.erofs"], |
| 27 | +- tmp_rootfs_dir]) |
| 28 | ++ tmp_rootfs_dir], |
| 29 | ++ env=dict(os.environ, TMPDIR='/var/tmp')) |
| 30 | + else: |
| 31 | + subprocess.check_call(['mksquashfs', tmp_rootfs_dir, |
| 32 | + paths["initrd-rootfs/root.squashfs"], |
| 33 | +-- |
| 34 | +2.48.1 |
| 35 | + |
0 commit comments