[elbe-devel] [PATCH v3 50/52] Fix style in rfs.py

dion at linutronix.de dion at linutronix.de
Thu Jun 27 14:45:04 CEST 2019


From: Olivier Dion <dion at linutronix.de>

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 elbepack/rfs.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index 3d35e29c..85084de5 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -268,9 +268,9 @@ class BuildEnv (object):
         preseed_txt = preseed_to_text(preseed)
         self.rfs.write_file("var/cache/elbe/preseed.txt", 0o644, preseed_txt)
         with self.rfs:
-            chroot(
-                self.rfs.path, 'debconf-set-selections < %s' %
-                self.rfs.fname("var/cache/elbe/preseed.txt"))
+            cmd = ('debconf-set-selections < %s' %
+                   self.rfs.fname("var/cache/elbe/preseed.txt"))
+            chroot(self.rfs.path, cmd)
 
     def create_apt_prefs(self):
 
@@ -311,9 +311,8 @@ class BuildEnv (object):
 
     def seed_etc(self):
         passwd = self.xml.text("target/passwd")
-        chroot(
-            self.rfs.path, """/bin/sh -c 'echo "%s\\n%s\\n" | passwd'""" %
-            (passwd, passwd))
+        stdin = "%s\n%s\n" % (passwd, passwd)
+        chroot(self.rfs.path, "passwd", stdin=stdin)
 
         hostname = self.xml.text("target/hostname")
         fqdn = hostname
-- 
2.11.0




More information about the elbe-devel mailing list