Hi all,
So it seems that the boot.img size was getting too large for lk2nd (the bootloader) to handle and was giving these errors as described. Seems like lk2nd can't handle ~21 MB boot.img.
After removing networking from the Linux kernel (as it was the simplest way to massively reduce the Linux kernel size) as well as building the rust modules into the kernel itself, it seems to boot fine now:
[ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 6.18.0 (root@9e6cbc09906e) (Alpine clang version 20.1.8, LLD 20.1.8) #4 SMP PREEMPT Sun Dec 21 23:44:57 UTC 2025 [ 0.000000] CPU: ARMv7 Processor [511f04d4] revision 4 (ARMv7), cr=10c5787d [ 0.000000] CPU: div instructions available: patching division code [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache [ 0.000000] OF: fdt: Machine model: Samsung Galaxy Express SGH-I437
[ ... ]
[ 1.487035] rust_minimal: Rust minimal sample (init) [ 1.487297] rust_minimal: Am I built-in? true [ 1.492632] rust_print: Rust printing macros sample (init) [ 1.496873] rust_print: Emergency message (level 0) without args [ 1.502244] rust_print: Alert message (level 1) without args [ 1.508439] rust_print: Critical message (level 2) without args [ 1.514025] rust_print: Error message (level 3) without args [ 1.519702] rust_print: Warning message (level 4) without args [ 1.525592] rust_print: Notice message (level 5) without args [ 1.531239] rust_print: Info message (level 6) without args [ 1.537037] rust_print: A line that is continued without args [ 1.542440] rust_print: Emergency message (level 0) with args [ 1.548348] rust_print: Alert message (level 1) with args [ 1.554069] rust_print: Critical message (level 2) with args [ 1.559470] rust_print: Error message (level 3) with args [ 1.565177] rust_print: Warning message (level 4) with args [ 1.570458] rust_print: Notice message (level 5) with args [ 1.575829] rust_print: Info message (level 6) with args [ 1.581444] rust_print: A line that is continued with args [ 1.586893] rust_print: 1 [ 1.586925] rust_print: "hello, world" [ 1.592188] rust_print: [../samples/rust/rust_print_main.rs:35:5] c = "hello, world" [ 1.598511] rust_print: Arc<dyn Display> says 42 [ 1.598542] rust_print: Arc<dyn Display> says hello, world [ 1.606445] rust_print: "hello, world"
[ ... ]
Welcome to postmarketOS Kernel 6.18.0 on an armv7l (/dev/ttyMSM0) samsung-expressatt login: user Password: login: can't set groups: Function not implemented
Sorry for wasting everyone's time. I appreciate the helpful responses :)
Thanks,
Rudraksha