In order to install Ubuntu, we've been relying on cpio
directly. However, it needs root access for its operations.

So, in order to avoid failures when running as nonroot,
use fakeroot instead. This introduces a new dependency,
but hopefully it is not a huge one. And moreover, this
should only affect people looking to install Ubuntu or
Debian.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 tests/unattended_install.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/unattended_install.py b/tests/unattended_install.py
index cdfe58f..c125dfc 100644
--- a/tests/unattended_install.py
+++ b/tests/unattended_install.py
@@ -394,16 +394,16 @@ class UnattendedInstallConfig(object):
 
         base_initrd = os.path.basename(self.initrd)
         os.chdir(remaster_path)
-        utils.run("gzip -d < ../%s | cpio --extract --make-directories "
+        utils.run("gzip -d < ../%s | fakeroot cpio --extract 
--make-directories "
                   "--no-absolute-filenames" % base_initrd, verbose=DEBUG)
         utils.run("cp %s %s" % (self.unattended_file, dest_fname),
                   verbose=DEBUG)
 
         if self.params.get("vm_type") == "libvirt":
-            utils.run("find . | cpio -H newc --create > ../%s.img" %
+            utils.run("find . | fakeroot cpio -H newc --create > ../%s.img" %
                       base_initrd.rstrip(".gz"), verbose=DEBUG)
         else:
-            utils.run("find . | cpio -H newc --create | gzip -9 > ../%s" %
+            utils.run("find . | fakeroot cpio -H newc --create | gzip -9 > 
../%s" %
                       base_initrd, verbose=DEBUG)
 
         os.chdir(self.image_path)
-- 
1.8.1.4

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to