home: hub: mkinitfs

Download patch

ref: 3e2519f2930a318ef06ffb8bac01bae6fc1ee218
parent: 2b7fe8ade7cc5dfefcdaebb3ba2425936b2b3540
author: Timo Teräs <timo.teras@iki.fi>
date: Wed Jul 13 09:49:28 CDT 2016

mkinitfs: add -K flag to copy host keys to new initramfs

this is mainly to copy the developer keys present on build system
to the target initramfs. simplifies creating your own initramfs
and when your key is not packaged.

--- a/mkinitfs.in
+++ b/mkinitfs.in
@@ -133,6 +133,7 @@
 
 initfs_apk_keys() {
 	mkdir -p "$tmpdir"/etc/apk/keys
+	[ "$hostkeys" ] && cp "/etc/apk/keys/"* "$tmpdir"/etc/apk/keys/
 	cp "${basedir}etc/apk/keys/"* "$tmpdir"/etc/apk/keys/
 }
 
@@ -148,7 +149,7 @@
 
 usage() {
 	cat <<EOF
-usage: mkinitfs [-hkLl] [-b basedir] [-c configfile] [-F features] [-f fstab]
+usage: mkinitfs [-hkKLl] [-b basedir] [-c configfile] [-F features] [-f fstab]
 		[-i initfile ] [-o outfile] [-t tempdir] [kernelversion]"
 options:
 	-b  prefix files and kernel modules with basedir
@@ -158,6 +159,7 @@
 	-h  print this help
 	-i  use initfile as init instead of $init
 	-k  keep tempdir
+	-K  copy also host keys to initramfs
 	-l  only list files that would have been used
 	-L  list available features
 	-o  set another outfile
@@ -171,7 +173,7 @@
 # main
 
 
-while getopts "b:c:f:F:hi:kLlo:qt:" opt; do
+while getopts "b:c:f:F:hi:kKLlo:qt:" opt; do
 	case "$opt" in
 		b) basedir="$OPTARG";;
 		c) config="$OPTARG";;
@@ -180,6 +182,7 @@
 		h) usage;;
 		i) init=$OPTARG;;
 		k) keeptmp=1;;
+		K) hostkeys=1;;
 		L) list_features=1;;
 		l) list_sources=1;;
 		o) outfile="$OPTARG";;