aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-07-13 14:49:28 +0000
committerTimo Teräs <timo.teras@iki.fi>2016-07-13 14:54:07 +0000
commit3e2519f2930a318ef06ffb8bac01bae6fc1ee218 (patch)
tree238c3190af11ea6600ae4cdf6ee79af3bc2a6185
parent2b7fe8ade7cc5dfefcdaebb3ba2425936b2b3540 (diff)
downloadmkinitfs-3e2519f2930a318ef06ffb8bac01bae6fc1ee218.tar.bz2
mkinitfs-3e2519f2930a318ef06ffb8bac01bae6fc1ee218.tar.xz
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.
-rwxr-xr-xmkinitfs.in7
1 files changed, 5 insertions, 2 deletions
diff --git a/mkinitfs.in b/mkinitfs.in
index 555bea8..d69ccc5 100755
--- a/mkinitfs.in
+++ b/mkinitfs.in
@@ -133,6 +133,7 @@ initfs_firmware() {
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 @@ initfs_cpio() {
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 @@ options:
-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 @@ EOF
# 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 @@ while getopts "b:c:f:F:hi:kLlo:qt:" opt; do
h) usage;;
i) init=$OPTARG;;
k) keeptmp=1;;
+ K) hostkeys=1;;
L) list_features=1;;
l) list_sources=1;;
o) outfile="$OPTARG";;