Add kernel size analysis command
The size of the kernel can be viewed per-component by checking the size of built-in.o
files in the build result.
$ size */built-in.o | sort -n -r -k 4
731596 53144 33588 818328 c7c98 drivers/built-in.o
687960 24972 2648 715580 aeb3c fs/built-in.o
547844 19508 28052 595404 915cc net/built-in.o
184072 6256 32440 222768 36630 kernel/built-in.o
141956 3300 2852 148108 2428c mm/built-in.o
68048 1804 1096 70948 11524 block/built-in.o
26216 768 0 26984 6968 crypto/built-in.o
17744 2412 2124 22280 5708 init/built-in.o
20780 292 124 21196 52cc ipc/built-in.o
18768 68 0 18836 4994 lib/built-in.o
2116 0 0 2116 844 security/built-in.o
134 0 0 134 86 usr/built-in.o
text data bss dec hex filename
(found on https://elinux.org/Kernel_Size_Tuning_Guide)
Maybe there's a way to integrate this into pmos to easily find where some size can be shaved off when a kernel doesn't fit in the boot partition.