From 7df7428acfba3c524526d7b23ff9c86c113fc7e2 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Thu, 25 Oct 2018 22:17:39 +0200 Subject: [PATCH] Build lxc pacakges to /srv/build/lxc --- zz-build/build-all.sh | 5 +++-- zz-build/usr/bin/lxc-pack | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/zz-build/build-all.sh b/zz-build/build-all.sh index 9abe042..8d8cb49 100755 --- a/zz-build/build-all.sh +++ b/zz-build/build-all.sh @@ -7,15 +7,16 @@ cd $(realpath $(dirname "${0}")) apk update apk add alpine-sdk -# Copy build toolchain +# Prepare build toolchain adduser root abuild cp etc/abuild.conf /etc/abuild.conf cp usr/bin/abuild /usr/bin/abuild cp usr/bin/fix-apk /usr/bin/fix-apk cp usr/bin/lxc-build /usr/bin/lxc-build cp usr/bin/lxc-pack /usr/bin/lxc-pack -mkdir /srv/build +mkdir -p /srv/build/lxc # Supply /srv/build/repokey.rsa +# Supply /srv/build/packages.key # Build native apps cd ../app-acme-sh diff --git a/zz-build/usr/bin/lxc-pack b/zz-build/usr/bin/lxc-pack index 7f1a24b..ac788cc 100755 --- a/zz-build/usr/bin/lxc-pack +++ b/zz-build/usr/bin/lxc-pack @@ -11,7 +11,8 @@ from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives.serialization import load_pem_private_key -BUILD_ROOT = '/root/buildroot' +BUILD_ROOT = '/srv/build/lxc' +PRIVATE_KEY = '/srv/build/packages.key' LXC_ROOT = '/var/lib/lxc' def pack(pkg_file): @@ -61,7 +62,7 @@ def pack(pkg_file): # Sign packages print('Signing packages') - with open(os.path.join(BUILD_ROOT, 'packages.key'), 'rb') as f: + with open(PRIVATE_KEY, 'rb') as f: priv_key = load_pem_private_key(f.read(), None, default_backend()) with open(os.path.join(BUILD_ROOT, 'packages'), 'rb') as f: data = f.read()