[elbe-devel] [PATCH 5/5] rfs: also fix the "not is_cross()" codepath keyring code

Torben Hohn torben.hohn at linutronix.de
Thu Dec 17 14:32:16 CET 2020


there is a separate codepath for the native case. (iE amd64)
adjust it to the new code.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/rfs.py | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index cf8ec6046..4bc58707b 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -200,19 +200,25 @@ class BuildEnv:
         strapcmd += ' --include="%s"' % includepkgs
 
         if not self.xml.is_cross(host_arch):
-            # ignore gpg verification if install from cdrom, cause debootstrap
-            # seems to ignore /etc/apt/trusted.gpg.d/elbe-keyring.gpg
-            # 01/2017 manut
-            if self.xml.has(
-                    "project/noauth") or self.xml.has("project/mirror/cdrom"):
+            if self.xml.has("project/noauth"):
                 cmd = '%s --no-check-gpg --arch=%s "%s" "%s" "%s"' % (
                     strapcmd, arch, suite, self.rfs.path, primary_mirror)
             else:
-                cmd = '%s --arch=%s "%s" "%s" "%s"' % (
-                    strapcmd, arch, suite, self.rfs.path, primary_mirror)
+                if self.xml.has("project/mirror/cdrom"):
+                    keyring = ' --keyring="%s"' % (
+                        self.rfs.fname('/elbe.keyring'))
+                else:
+                    keyring = ''
+
+                cmd = '%s --arch=%s %s "%s" "%s" "%s"' % (
+                    strapcmd, arch, keyring, suite, self.rfs.path, primary_mirror)
 
             try:
                 self.cdrom_mount()
+                if keyring:
+                    do('apt-key --keyring "%s" add "%s/targetrepo/repo.pub"' % (
+                        self.rfs.fname('/elbe.keyring'),
+                        self.rfs.fname("cdrom")))
                 do(cmd)
             except CommandError:
                 cleanup = True
-- 
2.20.1



More information about the elbe-devel mailing list