From cf789724141b2a16387328ff336fe9b4aee93485 Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Fri, 1 Feb 2019 16:31:14 +0000 Subject: update-kernel: add modloopfw option modloopfw will add additional firmware to the modloop image to work around not beeing detected by modinfo. --- update-kernel.in | 44 +++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) (limited to 'update-kernel.in') diff --git a/update-kernel.in b/update-kernel.in index ef38793..94458e1 100644 --- a/update-kernel.in +++ b/update-kernel.in @@ -8,6 +8,8 @@ # Copyright (c) 2014 Timo Teräs # Copyright (c) 2014-2015 Kaarle Ritvanen +PREFIX= +. $PREFIX/lib/libalpine.sh SCRIPT=update-kernel VIRTUAL=.tmp-$SCRIPT @@ -29,6 +31,7 @@ REPOSITORIES_FILE=/etc/apk/repositories SIGNALS="HUP INT TERM" TMPDIR= features= +modloopfw= error() { echo "$SCRIPT: $1" >&2 @@ -44,25 +47,26 @@ usage() { $SCRIPT -f $opts $dest_args $SCRIPT -b $opts [$dest_args] - Options: -a|--arch Install kernel for specified architecture - -b|--build Install custom-built kernel - -f|--flavor Install kernel of specified flavor - -F|--feature Enable initfs feature - -p|--package Additional module or firmware package - -s|--modloopsign Sign modloop with abuild key - -v|--verbose Verbose output - -k|--apk-pubkey Include given key in initramfs - -K|--hostkeys Include host keys in initramfs - -C|--compression Initramfs compression (see mkinitfs for options) - -M|--media Boot media directory layout - --repositories-file apk repositories file + Options: -a|--arch Install kernel for specified architecture + -b|--build Install custom-built kernel + -e|--modloopfw Install extra firmware in modloop + -f|--flavor Install kernel of specified flavor + -F|--feature Enable initfs feature + -p|--package Additional module or firmware package + -s|--modloopsign Sign modloop with abuild key + -v|--verbose Verbose output + -k|--apk-pubkey Include given key in initramfs + -K|--hostkeys Include host keys in initramfs + -C|--compression Initramfs compression (see mkinitfs for options) + -M|--media Boot media directory layout + --repositories-file apk repositories file __EOF__ exit $1 } QUIET_OPT="--quiet" -OPTS=$(getopt -l arch:,build-dir:,flavor:,feature:,help,package:,modloopsign,verbose,apk-pubkey:,hostkeys,compression:,media,repositories-file: \ +OPTS=$(getopt -l arch:,build-dir:,flavor:,feature:,modloopfw:,help,package:,modloopsign,verbose,apk-pubkey:,hostkeys,compression:,media,repositories-file: \ -n $SCRIPT -o a:b:f:F:hp:svk:KC:M -- "$@") || usage 1 eval set -- "$OPTS" @@ -84,6 +88,10 @@ while :; do shift features="$features $1" ;; + -e|--modloopfw) + shift + modloopfw="$modloopfw $1" + ;; -h|--help) echo "$SCRIPT @VERSION@" >&2 usage 0 @@ -277,6 +285,16 @@ find $ROOT/lib/modules -type f -name "*.ko" | xargs modinfo -F firmware | sort - fi done +# install extra firmware files in modloop (i.e. not detected by modinfo) +for _xfw in "$modloopfw"; do + if [ -f "$ROOT/lib/firmware/$_xfw" ]; then + install -pD "$ROOT/lib/firmware/$_xfw" \ + "$MODLOOP"/modules/firmware/"$_xfw" + else + echo "Warning: extra firmware \"$_xfw\" not found!" + fi +done + # include bluetooth firmware in modloop if [ -d "$MODLOOP/modules/firmware/brcm" ]; then for _btfw in "$ROOT"/lib/firmware/brcm/*.hcd; do -- cgit v1.2.3