[oe-commits] [openembedded-core] 03/07: isoimage-isohybrid: don't include cpio in cpio image

git at git.openembedded.org git at git.openembedded.org
Wed Sep 19 13:48:06 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 7a7b29f5f1392f4f87af4f20cda99c66b4789fde
Author: Ioan-Adrian Ratiu <adrian.ratiu at ni.com>
AuthorDate: Tue Sep 18 19:17:52 2018 +0300

    isoimage-isohybrid: don't include cpio in cpio image
    
    Because the find | cpio processes execute in parallel connected via
    the pipe, and the cpio outputs in the same dir find searches for
    source files, the cpio will be included in itself partially, depending
    on how fast the build machine creates the cpio file before cpio
    gobbles it up.
    
    This bloats the ISO image, though compression reduces the .iso file size,
    once the kernel decompresses the cpio image and boots it live, it uses
    up to double the RAM memory.
    
    Fix this by creating the initrd.cpio file directly inside cr_workdir.
    
    Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu at ni.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index 25a695d..170077c 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -191,10 +191,9 @@ class IsoImagePlugin(SourcePlugin):
             else:
                 raise WicError("Couldn't find or build initrd, exiting.")
 
-            exec_cmd("cd %s && find . | cpio -o -H newc -R root:root >./initrd.cpio " \
-                    % initrd_dir, as_shell=True)
-            exec_cmd("gzip -f -9 -c %s/initrd.cpio > %s" \
-                    % (initrd_dir, initrd), as_shell=True)
+            exec_cmd("cd %s && find . | cpio -o -H newc -R root:root >%s/initrd.cpio " \
+                     % (initrd_dir, cr_workdir), as_shell=True)
+            exec_cmd("gzip -f -9 %s/initrd.cpio" % cr_workdir, as_shell=True)
             shutil.rmtree(initrd_dir)
 
         return initrd

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list