Build lxc pacakges to /srv/build/lxc

This commit is contained in:
Disassembler 2018-10-25 22:17:39 +02:00
parent 204318ef44
commit 7df7428acf
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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()