Commit 7ac843e9 authored by Timo Teräs's avatar Timo Teräs

update-kernel: new options --hostkeys and --repositories-file

to simplify creation of bootable images from external repositries
and with developer signing keys.
parent 824237dd
...@@ -20,6 +20,8 @@ BUILDDIR= ...@@ -20,6 +20,8 @@ BUILDDIR=
FLAVOR= FLAVOR=
MNTDIR= MNTDIR=
PACKAGES= PACKAGES=
MKINITFS_ARGS=
REPOSITORIES_FILE=/etc/apk/repositories
SIGNALS="HUP INT TERM" SIGNALS="HUP INT TERM"
TMPDIR= TMPDIR=
features= features=
...@@ -44,14 +46,16 @@ Options: -a|--arch <arch> Install kernel for specified architecture ...@@ -44,14 +46,16 @@ Options: -a|--arch <arch> Install kernel for specified architecture
-F|--feature <feature> Enable initfs feature -F|--feature <feature> Enable initfs feature
-p|--package <package> Additional module or firmware package -p|--package <package> Additional module or firmware package
-v|--verbose Verbose output -v|--verbose Verbose output
-K|--hostkeys Include host keys in initramfs
--repositories-file <f> apk repositories file
EOF EOF
exit $1 exit $1
} }
QUIET_OPT="--quiet" QUIET_OPT="--quiet"
OPTS=$(getopt -l arch:,build-dir:,flavor:,feature:,help,package:,verbose \ OPTS=$(getopt -l arch:,build-dir:,flavor:,feature:,help,package:,verbose,hostkeys,repositories-file: \
-n $SCRIPT -o a:b:f:F:hp:v -- "$@") || usage 1 -n $SCRIPT -o a:b:f:F:hp:vK -- "$@") || usage 1
eval set -- "$OPTS" eval set -- "$OPTS"
while :; do while :; do
case "$1" in case "$1" in
...@@ -82,6 +86,13 @@ while :; do ...@@ -82,6 +86,13 @@ while :; do
-v|--verbose) -v|--verbose)
QUIET_OPT= QUIET_OPT=
;; ;;
-K|--hostkeys)
MKINITFS_ARGS="$MKINITFS_ARGS -K"
;;
--repositories-file)
shift
REPOSITORIES_FILE=$1
;;
--) --)
break break
;; ;;
...@@ -180,7 +191,7 @@ _apk() { ...@@ -180,7 +191,7 @@ _apk() {
$wrapper apk $cmd $QUIET_OPT -p $ROOT --arch "$ARCH" \ $wrapper apk $cmd $QUIET_OPT -p $ROOT --arch "$ARCH" \
--keys-dir /etc/apk/keys \ --keys-dir /etc/apk/keys \
--repositories-file /etc/apk/repositories $* --repositories-file "$REPOSITORIES_FILE" $*
} }
extra_pkgs() { extra_pkgs() {
...@@ -237,7 +248,7 @@ find $ROOT/lib/modules -type f -name "*.ko" | xargs modinfo -F firmware | sort - ...@@ -237,7 +248,7 @@ find $ROOT/lib/modules -type f -name "*.ko" | xargs modinfo -F firmware | sort -
done done
_exec mksquashfs $MODLOOP "$STAGING/$MODIMG" -comp xz _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" -o "$STAGING/initramfs-$FLAVOR" "$KVER"
for file in System.map config vmlinuz; do for file in System.map config vmlinuz; do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment