aboutsummaryrefslogtreecommitdiffstats
path: root/main/alpine-conf/0001-update-kernel-use-nopad-Xbcj-for-modloop.patch
blob: e04dc66aa42ceb5eb800971d7e81b73eac1d9b58 (plain) (blame)
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
From 30e6933e71fc18ff5bcb5a7d9dad105e464272bf Mon Sep 17 00:00:00 2001
From: "Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
Date: Mon, 6 Jul 2020 10:50:55 -0400
Subject: [PATCH] update-kernel: use -nopad -Xbcj for modloop

reduces x86 modloop size by about 38k. -all-time 0 reduces by 300 bytes
more, but probably more confusing than it's worth
---
 update-kernel.in | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/update-kernel.in b/update-kernel.in
index 67eb94b..d0b67e8 100644
--- a/update-kernel.in
+++ b/update-kernel.in
@@ -317,7 +317,13 @@ if [ -e "$ROOT"/lib/modules/*/kernel/drivers/bluetooth/btbcm.ko ]; then
 	done
 fi
 
-mksquashfs $MODLOOP "$STAGING/$MODIMG" -comp xz -exit-on-error
+case $ARCH in
+	armhf) mksfs="-Xbcj arm" ;;
+	armv7|aarch64) mksfs="-Xbcj arm,armthumb" ;;
+	x86|x86_64) mksfs="-Xbcj x86" ;;
+	*) mksfs=
+esac
+mksquashfs $MODLOOP "$STAGING/$MODIMG" -comp xz -exit-on-error -nopad $mksfs
 
 if [ -n "$MODLOOPSIGN" ]; then
 	sign_modloop "$STAGING/$MODIMG"
-- 
2.30.0