From 6171fc7e4fb14a70edfd86a794a844c3f07823b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Mon, 26 Oct 2015 19:51:08 +0200 Subject: update-kernel: include only needed firmwares in modloop new modloop (44.9M) 117.9M 4.1.10-0-grsec 39.3M firmware 157.1M total old modloop (80.8M) 117.9M 4.1.10-0-grsec 112.1M firmware 230.0M total --- update-kernel.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/update-kernel.in b/update-kernel.in index f4d2e8c..1327047 100644 --- a/update-kernel.in +++ b/update-kernel.in @@ -140,7 +140,7 @@ trap clean_up EXIT $SIGNALS if [ "$SUPERUSER" ]; then - apk add $QUIET_OPT --update-cache -t $VIRTUAL mkinitfs squashfs-tools + apk add $QUIET_OPT --update-cache -t $VIRTUAL mkinitfs squashfs-tools kmod fi if [ -z "$features" ]; then @@ -221,7 +221,10 @@ DTB_STAGING=$TMPDIR/dtbs mkdir $DTB_STAGING $MODLOOP $STAGING cp -a $ROOT/lib/modules $MODLOOP -cp -a $ROOT/lib/firmware $MODLOOP/modules +mkdir -p $MODLOOP/modules/firmware +find $ROOT/lib/modules -type f -name "*.ko" | xargs modinfo -F firmware | sort -u | while read FW; do + [ -e "$ROOT/lib/firmware/$FW" ] && install -pD $ROOT/lib/firmware/$FW $MODLOOP/modules/firmware/$FW +done _exec mksquashfs $MODLOOP "$STAGING/$MODIMG" -comp xz _exec mkinitfs -q -b $ROOT -F "$features base squashfs" \ -- cgit v1.2.3