WPJ428 kernel too big since 5.15 (ipq40xx)

Hi :slight_smile:

I've noticed that I'm no longer able to build images for the Compex WPJ428 since the switch to kernel version 5.15.
There are also no official trunk images anymore.

I would like to give reducing the size a go but, tbh, I don't really know how to go about it.

Ā£ size */built-in.a | sort -n -k 4 | less | tail 
  46508    7836    1567   55911    da67 kernel/cgroup/cgroup.o (ex kernel/built-in.a)
  54323     610    1184   56117    db35 net/ipv6/addrconf.o (ex net/built-in.a)
  76369      39       4   76412   12a7c fs/io_uring.o (ex fs/built-in.a)
  86014    1948      36   87998   157be net/core/dev.o (ex net/built-in.a)
  90219    1165      96   91480   16558 net/core/filter.o (ex net/built-in.a)
  91969     254      16   92239   1684f net/core/devlink.o (ex net/built-in.a)
 112114      41      12  112167   1b627 kernel/bpf/verifier.o (ex kernel/built-in.a)
 121671       0       0  121671   1db47 lib/zstd/compress.o (ex lib/built-in.a)
  21472  410912  140731  573115   8bebb kernel/printk/printk.o (ex kernel/built-in.a)
18697732              0       0 18697732        11d4e04 usr/initramfs_data.o (ex usr/built-in.a)

Is there a good way to shrink initramfs_data?

Remove as many packages as you can live with, then the image will be smaller.

Removing packages has no impact at all on the kernel size, which is a single static binary executable.

Total image size (which is the only thing you could influence by removing packages) seems to be limited to IMAGE_SIZE := 31232k, which is plenty.

Kernel size appears to be limited to KERNEL_SIZE := 4096k, which should be sufficient at this point (kernel size in master is just above 3 MB), so I don't really think why the kernel size would be a reason (but it defaults to not being built nevertheless).

1 Like

Good point, I should have said reduce built in kernel modules.

@jdwl1o1 @slh
thanks!

i really should've put more thought and details into the original post.

here's what i'm doing atm to get the kernel size down and the warning disappear:

3080c3080
< CONFIG_PACKAGE_kmod-lib-crc16=m
---
> CONFIG_PACKAGE_kmod-lib-crc16=y
3291c3291
< CONFIG_PACKAGE_kmod-batman-adv=m
---
> CONFIG_PACKAGE_kmod-batman-adv=y

but it doesn't like those modules are included at all anymore.

ls: /lib/modules/*/bat*: No such file or directory

also, i can't find a way to depend on them as modules that aren't built-in.

if de-selecting packages is the way to, i guess, i'll have to live without some

When you remove modules from the kernel you would need to reinstall the kmod packages after the system is up and running - then they will be in the overlay rather than the kernel.

I was hoping to get the module to land in the compressed ROM under /lib/modules/ because installing packages after a sysupgrade is hard to automate.
opkg isn't even present in my current image.

Indeed, all my selected modules lie in /lib/modules/ already?!
How comes the ITB is smaller after de-selecting batman if the modules lie in the ROM-portion of the image?

Well, disabling batman-adv works for now but I'll likely come back to this.

I dont see why images for this device are not uploaded as they built and kernel is not out of the size limits.

Ok, its set to DEFAULT :n, that's why.

What message do you get if trying to build?

I was getting the error from Build/check-size (include/image-commands.mk).
The itb was just slightly too large (4354088 bytes).

Funnily enough, it doesn't happen now :thinking:
I'm still on the same commit and I have a backup of .config that I was comparing my attempts against.

The default image should not have kernel over 4MB

@robimarko you're right!

i'm selecting a few kernel modules like veth, tun, batman-adv, l2tp, and usb-serial.

i wasn't aware that make kernel_menuconfig saved my changes.
the reason it works now is that i disabled a few modules around ubifs there.
ubifs depends on zstd and that is huuuge. everything appears to work without ubifs.

here's the diff:

diff --git a/target/linux/ipq40xx/config-5.15 b/target/linux/ipq40xx/config-5.15
index 22b2d03d80..3ec361b678 100644
--- a/target/linux/ipq40xx/config-5.15
+++ b/target/linux/ipq40xx/config-5.15
@@ -96,6 +96,7 @@ CONFIG_CRC32_SLICEBY8=y
 CONFIG_CRC8=y
 CONFIG_CRYPTO_AES_ARM=y
 CONFIG_CRYPTO_AES_ARM_BS=y
+CONFIG_CRYPTO_ARCH_HAVE_LIB_BLAKE2S=y
 CONFIG_CRYPTO_BLAKE2S_ARM=y
 CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_CRYPTD=y
@@ -113,11 +114,9 @@ CONFIG_CRYPTO_DRBG=y
 CONFIG_CRYPTO_DRBG_HMAC=y
 CONFIG_CRYPTO_DRBG_MENU=y
 CONFIG_CRYPTO_ECB=y
-CONFIG_CRYPTO_HASH_INFO=y
 CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_HW=y
 CONFIG_CRYPTO_JITTERENTROPY=y
-CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
 CONFIG_CRYPTO_LIB_DES=y
 CONFIG_CRYPTO_LIB_SHA256=y
 CONFIG_CRYPTO_LZO=y
@@ -131,7 +130,6 @@ CONFIG_CRYPTO_SHA256_ARM=y
 CONFIG_CRYPTO_SHA512=y
 CONFIG_CRYPTO_SIMD=y
 CONFIG_CRYPTO_XTS=y
-CONFIG_CRYPTO_ZSTD=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
 CONFIG_DEBUG_MISC=y
@@ -486,7 +484,7 @@ CONFIG_TIMER_OF=y
 CONFIG_TIMER_PROBE=y
 CONFIG_TREE_RCU=y
 CONFIG_TREE_SRCU=y
-CONFIG_UBIFS_FS=y
+# CONFIG_UBIFS_FS is not set
 CONFIG_UEVENT_HELPER_PATH=""
 CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
 CONFIG_UNWINDER_ARM=y
@@ -498,12 +496,9 @@ CONFIG_VFP=y
 CONFIG_VFPv3=y
 CONFIG_WATCHDOG_CORE=y
 CONFIG_XPS=y
-CONFIG_XXHASH=y
 CONFIG_XZ_DEC_ARM=y
 CONFIG_XZ_DEC_BCJ=y
 CONFIG_ZBOOT_ROM_BSS=0
 CONFIG_ZBOOT_ROM_TEXT=0
 CONFIG_ZLIB_DEFLATE=y
 CONFIG_ZLIB_INFLATE=y
-CONFIG_ZSTD_COMPRESS=y
-CONFIG_ZSTD_DECOMPRESS=y

for me, the 'fix'- if you will, was disabling ubifs/zstd.
i've noticed no problems with the image so i'm accepting my previous post.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.