I am doubtful: the resizing is carried out in the initramfs, not by the init command in cmdline.
I agree, this may have been ok back when it was just init=/usr/lib/raspi-config/init_resize.sh but not anymore today.
The snippet I provided prevents auto-resizing while preserving all other operations of firstboot and doesn't require rebuilding initramfs.
The script (included in the initramfs) is /usr/share/initramfs-tools/scripts/local-premount/firstboot
The snippet I provided works on all versions of Raspberry Pi OS from Wheezy through Bookworm.
Code:
sed -i '/^[[:space:]]*#/!s| init=/usr/lib/raspi-config/init_resize\.sh||' "${BOOTPATH}/cmdline.txt"
Code:
sed -i 's|^\(\s*whiptail --infobox \"Resizing root filesystem.*\)$| return 0\n\n\1|' "${ROOTPATH}/usr/lib/raspberrypi-sys-mods/first-boot" &> /dev/null
Renaming 'firstboot' to 'first-boot' handles Bookworm due to the following in /usr/share/initramfs-tools/scripts/local-premount/firstboot:
Code:
if ! grep -q firstboot /proc/cmdline; then exit 0fi
Statistics: Posted by RonR — Mon Feb 05, 2024 6:19 pm