From: Ioan-Adrian Ratiu Date: Fri, 1 Apr 2016 14:31:20 +0000 (+0300) Subject: wic/isoimage-isohybrid.py: change cpio generated uid&gid to root X-Git-Tag: 2016-4~172 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=28910ee2eacc15cf42b5e58bd43b3bd15c34eb97;p=openembedded-core.git wic/isoimage-isohybrid.py: change cpio generated uid&gid to root By default cpio preserves the uid&guid's of the original user which leads to host contamination and boot failures because commands like mount from initramfs expect to be run by root and the original host user might not even exist on the target. Signed-off-by: Ioan-Adrian Ratiu Signed-off-by: Richard Purdie --- diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py index de99ad8495..bc9928314c 100644 --- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py +++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py @@ -174,8 +174,8 @@ class IsoImagePlugin(SourcePlugin): else: msger.error("Couldn't find or build initrd, exiting.\n") - exec_cmd("find %s | cpio -o -H newc >%s/initrd.cpio " \ - % (initrd_dir, cr_workdir), as_shell=True) + exec_cmd("cd %s && find . | cpio -o -H newc -R +0:+0 >./initrd.cpio " \ + % initrd_dir, as_shell=True) exec_cmd("gzip -f -9 -c %s/initrd.cpio > %s" \ % (cr_workdir, initrd), as_shell=True) shutil.rmtree(initrd_dir)