Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 46 additions & 15 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ build_linux() {
cd linux-${LINUX_VERSION}

# Apply linux-tiny patches for reduced memory footprint and LTO support
for p in ../patches/0002-*.patch ../patches/0003-*.patch ../patches/0004-*.patch ../patches/0005-*.patch ../patches/0006-*.patch ../patches/0010-*.patch ../patches/0011-*.patch ../patches/0012-*.patch ../patches/0013-*.patch; do
for p in ../patches/0002-*.patch ../patches/0003-*.patch ../patches/0004-*.patch ../patches/0005-*.patch ../patches/0006-*.patch ../patches/0010-*.patch ../patches/0011-*.patch ../patches/0012-*.patch ../patches/0013-*.patch ../patches/0014-*.patch; do
[ -f "${p}" ] || continue
apply_patch_once "${p}"
done
Expand Down Expand Up @@ -854,13 +854,20 @@ build_linux() {
# defaults to y under EXPERT and pulls a full decompressor library into
# the image -- olddefconfig silently restores them after defconfig.
# Sub-bucket rollup measured RD_ZSTD = 36,942 bytes (lib/zstd),
# RD_LZ4 = 10,972 bytes (lib/lz4), RD_XZ = 6,598 bytes (lib/xz) of
# dead .text in the production vmlinux. RD_ZSTD also pulls
# lib/xxhash.c (~3KB). Keep RD_GZIP=y as the boot-path requirement;
# explicitly disable the rest.
# RD_LZ4 = 10,972 bytes (lib/lz4), RD_XZ = 6,598 bytes (lib/xz),
# RD_LZO = 728 bytes (lib/lzo) of dead .text in the production vmlinux;
# RD_LZMA / RD_BZIP2 do not currently land any .text but their default-y
# status lets olddefconfig drift them back on the next time a fs/ or
# net/ symbol gets enabled. RD_ZSTD also pulls lib/xxhash.c (~3KB).
# Keep RD_GZIP=y as the boot-path requirement; explicitly disable the
# rest, including the residuals, so olddefconfig cannot silently
# re-enable them.
echo "# CONFIG_RD_ZSTD is not set" >>.config
echo "# CONFIG_RD_LZ4 is not set" >>.config
echo "# CONFIG_RD_XZ is not set" >>.config
echo "# CONFIG_RD_LZMA is not set" >>.config
echo "# CONFIG_RD_BZIP2 is not set" >>.config
echo "# CONFIG_RD_LZO is not set" >>.config

# Serial-only target: drop the VT terminal layer and accessibility
# console support. CONFIG_TTY stays on -- the AMBA PL011 console
Expand Down Expand Up @@ -931,6 +938,20 @@ build_linux() {
echo "# CONFIG_CGROUPS is not set" >>.config
echo "# CONFIG_SCHED_AUTOGROUP is not set" >>.config

# Patch 0014 replaces fair.c (CFS/EEVDF) with a compact O(1) priority
# round-robin SCHED_NORMAL class under CONFIG_SCHED_FAIR_TINY. fair.c
# body is wrapped in #ifndef; the #else branch provides a per-CPU
# bitmap + per-priority FIFO (HIGH/NORMAL/LOW) plus stubs for every
# symbol other TUs (rt.c, deadline.c stub, syscalls.c, topology.c,
# idle.c, build_utility.c) reference. Linux 7.0 has no CONFIG_SMP
# guard inside fair.c so balance code (select_task_rq, sched_balance_*,
# _nohz_idle_balance, ~7.8KB total) stays linked under UP via the
# sched_class table; this knob is the only way to remove it. nice
# values quantise to the three buckets (nice<0 -> HIGH, nice==0 ->
# NORMAL, nice>0 -> LOW); SCHED_IDLE collapses to LOW; rt_sched_class
# still pre-empts via the existing class chain walk.
echo "CONFIG_SCHED_FAIR_TINY=y" >>.config

run_logged "olddefconfig" kernel_make olddefconfig

# Verify critical config options survived olddefconfig resolution.
Expand Down Expand Up @@ -989,11 +1010,15 @@ build_linux() {
"# CONFIG_RD_ZSTD is not set" \
"# CONFIG_RD_LZ4 is not set" \
"# CONFIG_RD_XZ is not set" \
"# CONFIG_RD_LZMA is not set" \
"# CONFIG_RD_BZIP2 is not set" \
"# CONFIG_RD_LZO is not set" \
"# CONFIG_SCHED_DEBUG_OUTPUT is not set" \
"# CONFIG_SCHED_DEADLINE_CLASS is not set" \
"# CONFIG_PSI is not set" \
"# CONFIG_CGROUPS is not set" \
"# CONFIG_SCHED_AUTOGROUP is not set"; do
"# CONFIG_SCHED_AUTOGROUP is not set" \
"CONFIG_SCHED_FAIR_TINY=y"; do
if ! grep -q "^${opt}\$" .config; then
echo "ERROR: expected '${opt}' in .config after olddefconfig"
exit 1
Expand Down Expand Up @@ -1056,16 +1081,22 @@ build_linux() {
fi
done

# Decompressor library guard. RD_ZSTD/RD_LZ4/RD_XZ disabled above
# must cascade to ZSTD_DECOMPRESS / LZ4_DECOMPRESS / XZ_DEC, the
# umbrella DECOMPRESS_* hidden bools, and XXHASH (selected by
# ZSTD_DECOMPRESS, also pulled by BCACHE / BTRFS but those need
# BLOCK=y which this target lacks). If anything else still
# selects them (a future fs/ or net/ enable, e.g. squashfs+zstd),
# we must catch that drift loudly so the size win does not
# silently regress.
# Decompressor library guard. RD_ZSTD/RD_LZ4/RD_XZ/RD_LZMA/RD_BZIP2/
# RD_LZO disabled above must cascade to ZSTD_DECOMPRESS /
# LZ4_DECOMPRESS / XZ_DEC / LZO_DECOMPRESS, the umbrella DECOMPRESS_*
# hidden bools, and XXHASH (selected by ZSTD_DECOMPRESS, also pulled
# by BCACHE / BTRFS but those need BLOCK=y which this target lacks).
# LZO_DECOMPRESS has more upstream selectors than the others
# (squashfs / btrfs / jffs2 / f2fs / zram / crypto / lib), all of
# which depend on BLOCK=y or NET=y / crypto knobs that are off here;
# the negative guard catches any future drift that re-enables one of
# them. If anything else still selects these symbols (a future fs/ or
# net/ enable, e.g. squashfs+zstd), we must catch that drift loudly
# so the size win does not silently regress.
for sym in ZSTD_DECOMPRESS ZSTD_COMMON LZ4_DECOMPRESS XZ_DEC \
XXHASH DECOMPRESS_ZSTD DECOMPRESS_LZ4 DECOMPRESS_XZ; do
LZO_DECOMPRESS \
XXHASH DECOMPRESS_ZSTD DECOMPRESS_LZ4 DECOMPRESS_XZ \
DECOMPRESS_LZMA DECOMPRESS_BZIP2 DECOMPRESS_LZO; do
if grep -q "^CONFIG_${sym}=y\$" .config; then
echo "ERROR: CONFIG_${sym}=y survived olddefconfig (decompressor guard tripped)"
exit 1
Expand Down
Loading
Loading