From 1c846b9437d1653230c66794ce89a5a79c410b40 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 9 Nov 2016 20:56:30 +0000 Subject: update-kernel: add support for -k/--apk-pubkey This is a way to inject the users pubkey to initramfs --- update-kernel.in | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/update-kernel.in b/update-kernel.in index 981156c..eccb7b5 100644 --- a/update-kernel.in +++ b/update-kernel.in @@ -56,8 +56,8 @@ usage() { } QUIET_OPT="--quiet" -OPTS=$(getopt -l arch:,build-dir:,flavor:,feature:,help,package:,verbose,hostkeys,media,repositories-file: \ - -n $SCRIPT -o a:b:f:F:hp:vKM -- "$@") || usage 1 +OPTS=$(getopt -l arch:,build-dir:,flavor:,feature:,help,package:,verbose,apk-pubkey:,hostkeys,media,repositories-file: \ + -n $SCRIPT -o a:b:f:F:hp:vk:KM -- "$@") || usage 1 eval set -- "$OPTS" while :; do @@ -89,6 +89,10 @@ while :; do -v|--verbose) QUIET_OPT= ;; + -k|--apk-pubkey) + shift + APK_PUBKEY="$1" + ;; -K|--hostkeys) MKINITFS_ARGS="$MKINITFS_ARGS -K" ;; @@ -230,6 +234,10 @@ else fi _apk add --no-scripts alpine-base $PACKAGES +if [ -n "$APK_PUBKEY" ]; then + mkdir -p "$ROOT"/etc/apk/keys + cp "$APK_PUBKEY" "$ROOT"/etc/apk/keys/ +fi KVER_FLAVOR= [ "$FLAVOR" = vanilla ] || KVER_FLAVOR=-$FLAVOR -- cgit v1.2.3