From: Ferry Toth <fntoth@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>,
Xavier Berger <xavier.berger@bio-logic.net>,
Alexander Kanavin <alex@linutronix.de>,
Ferry Toth <ftoth@exalondelft.nl>
Subject: [PATCH v2 2/3] package_manager: sign DEB package feeds
Date: Sun, 3 Apr 2022 21:50:45 +0200 [thread overview]
Message-ID: <20220403195046.7060-4-fntoth@gmail.com> (raw)
In-Reply-To: <20220403195046.7060-1-fntoth@gmail.com>
From: Ferry Toth <ftoth@exalondelft.nl>
Implement debian package repository signature.
For each Release file created in repository subdirectory, a signature
Release.gpg is created.
Signature is performed using gpg backend when the following variables
are set in local.conf:
PACKAGE_CLASSES += "sign_package_feed"
PACKAGE_FEED_GPG_NAME = "<Id of GPG key>"
PACKAGE_FEED_GPG_PASSPHRASE_FILE="<path to password file>"
Signed-off-by: Xavier Berger <xavier.berger@bio-logic.net>
Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
---
meta/lib/oe/package_manager/deb/__init__.py | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/meta/lib/oe/package_manager/deb/__init__.py b/meta/lib/oe/package_manager/deb/__init__.py
index 9f112ae25b..86ddb130ad 100644
--- a/meta/lib/oe/package_manager/deb/__init__.py
+++ b/meta/lib/oe/package_manager/deb/__init__.py
@@ -53,6 +53,7 @@ class DpkgIndexer(Indexer):
index_cmds = []
deb_dirs_found = False
+ index_sign_files = set()
for arch in arch_list:
arch_dir = os.path.join(self.deploy_dir, arch)
if not os.path.isdir(arch_dir):
@@ -62,7 +63,10 @@ class DpkgIndexer(Indexer):
cmd += "%s -fcn Packages > Packages.gz;" % gzip
- with open(os.path.join(arch_dir, "Release"), "w+") as release:
+ release_file = os.path.join(arch_dir, "Release")
+ index_sign_files.add(release_file)
+
+ with open(release_file, "w+") as release:
release.write("Label: %s\n" % arch)
cmd += "PSEUDO_UNLOAD=1 %s release . >> Release" % apt_ftparchive
@@ -76,8 +80,17 @@ class DpkgIndexer(Indexer):
return
oe.utils.multiprocess_launch(create_index, index_cmds, self.d)
- if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
- raise NotImplementedError('Package feed signing not implementd for dpkg')
+ if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1':
+ signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND', True))
+ else:
+ signer = None
+ if signer:
+ for f in index_sign_files:
+ signer.detach_sign(f,
+ self.d.getVar('PACKAGE_FEED_GPG_NAME', True),
+ self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True),
+ output_suffix="gpg",
+ use_sha256=True)
class PMPkgsList(PkgsList):
--
2.32.0
next prev parent reply other threads:[~2022-04-04 18:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-03 19:50 package_manager: support for signed DEB package feeds Ferry Toth
2022-04-03 19:50 ` [PATCH v2 0/3] *** SUBJECT HERE *** Ferry Toth
2022-04-03 19:50 ` [PATCH v2 1/3] gpg-sign: Add parameters to gpg signature function Ferry Toth
2022-04-03 19:50 ` Ferry Toth [this message]
2022-04-03 19:50 ` [PATCH v2 3/3] apt: add apt selftest to test signed package feeds Ferry Toth
2022-04-04 13:58 ` Richard Purdie
2022-04-04 17:35 ` Ferry Toth
2022-04-04 20:39 ` Richard Purdie
2022-04-05 15:23 ` Ferry Toth
2022-04-06 11:40 ` Richard Purdie
2022-04-06 14:43 ` Ferry Toth
2022-04-06 15:23 ` Richard Purdie
2022-04-06 19:44 ` Ferry Toth
2022-04-06 21:05 ` Richard Purdie
2022-04-07 9:59 ` Ferry Toth
2022-04-06 10:10 ` [OE-core] " Alexandre Belloni
2022-04-06 15:16 ` Ferry Toth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220403195046.7060-4-fntoth@gmail.com \
--to=fntoth@gmail.com \
--cc=alex@linutronix.de \
--cc=ftoth@exalondelft.nl \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.org \
--cc=xavier.berger@bio-logic.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.