aboutsummaryrefslogtreecommitdiffstats
path: root/main/alpine-conf/0004-update-kernel-new-options-hostkeys-and-repositories-.patch
blob: 581c57d5a2fce72b6d912c5bd42a5444f1248795 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
From 7ac843e901888dfc3d971815c13c9fbc12ef6405 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Thu, 14 Jul 2016 06:42:13 +0000
Subject: [PATCH 4/6] update-kernel: new options --hostkeys and
 --repositories-file

to simplify creation of bootable images from external repositries
and with developer signing keys.
---
 update-kernel.in | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/update-kernel.in b/update-kernel.in
index 57f51de..06b7eac 100644
--- a/update-kernel.in
+++ b/update-kernel.in
@@ -20,6 +20,8 @@ BUILDDIR=
 FLAVOR=
 MNTDIR=
 PACKAGES=
+MKINITFS_ARGS=
+REPOSITORIES_FILE=/etc/apk/repositories
 SIGNALS="HUP INT TERM"
 TMPDIR=
 features=
@@ -44,14 +46,16 @@ Options: -a|--arch <arch>        Install kernel for specified architecture
          -F|--feature <feature>  Enable initfs feature
          -p|--package <package>  Additional module or firmware package
          -v|--verbose            Verbose output
+         -K|--hostkeys           Include host keys in initramfs
+         --repositories-file <f> apk repositories file
 
 EOF
     exit $1
 }
 
 QUIET_OPT="--quiet"
-OPTS=$(getopt -l arch:,build-dir:,flavor:,feature:,help,package:,verbose \
-	      -n $SCRIPT -o a:b:f:F:hp:v -- "$@") || usage 1
+OPTS=$(getopt -l arch:,build-dir:,flavor:,feature:,help,package:,verbose,hostkeys,repositories-file: \
+	      -n $SCRIPT -o a:b:f:F:hp:vK -- "$@") || usage 1
 eval set -- "$OPTS"
 while :; do
     case "$1" in
@@ -82,6 +86,13 @@ while :; do
 	-v|--verbose)
 	    QUIET_OPT=
 	    ;;
+	-K|--hostkeys)
+	    MKINITFS_ARGS="$MKINITFS_ARGS -K"
+	    ;;
+        --repositories-file)
+	    shift
+	    REPOSITORIES_FILE=$1
+	    ;;
 	--)
 	    break
 	    ;;
@@ -180,7 +191,7 @@ _apk() {
 
     $wrapper apk $cmd $QUIET_OPT -p $ROOT --arch "$ARCH" \
 	--keys-dir /etc/apk/keys \
-	--repositories-file /etc/apk/repositories $*
+	--repositories-file "$REPOSITORIES_FILE" $*
 }
 
 extra_pkgs() {
@@ -237,7 +248,7 @@ find $ROOT/lib/modules -type f -name "*.ko" | xargs modinfo -F firmware | sort -
 done
 _exec mksquashfs $MODLOOP "$STAGING/$MODIMG" -comp xz
 
-_exec mkinitfs -q -b $ROOT -F "$features base squashfs" \
+_exec mkinitfs $MKINITFS_ARGS -q -b $ROOT -F "$features base squashfs" \
     -o "$STAGING/initramfs-$FLAVOR" "$KVER"
 
 for file in System.map config vmlinuz; do
-- 
2.9.3