Skip to content

Commit 89ad28b

Browse files
committed
kernel: armbian: remove some heavy kernel modules (so it fits in 2Gb RAM)
- Armbian kernels are meant for general-purpose initrd's, and including all modules is overkill - this allows to boot on 2Gb RAM machines (tmpfs allows only up to 50% RAM) Signed-off-by: Ricardo Pardini <[email protected]>
1 parent e3ef9c6 commit 89ad28b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bash/kernel/kernel_armbian.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ function calculate_kernel_version_armbian() {
9494
# Important: this tarball needs to have permissions for the root directory included! Otherwise linuxkit rootfs will have the wrong permissions on / (root)
9595
WORKDIR /armbian/modules_only
9696
RUN mv /armbian/image/lib /armbian/modules_only/
97+
RUN echo "Before cleaning: " && du -h -d 10 -x . | sort -h | tail -n 20
98+
# Trim the kernel modules to save space; hopefully your required hardware is not included here
99+
RUN rm -rfv ./lib/modules/*/kernel/drivers/net/wireless ./lib/modules/*/kernel/sound ./lib/modules/*/kernel/drivers/media
100+
RUN rm -rfv ./lib/modules/*/kernel/drivers/infiniband
101+
RUN echo "After cleaning: " && du -h -d 10 -x . | sort -h | tail -n 20
97102
RUN tar -cf /armbian/output/kernel.tar .
98103
99104
# Create a tarball with the dtbs in usr/lib/linux-image-*

0 commit comments

Comments
 (0)