Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4226

Advanced users • Re: prevent auto resize

$
0
0


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.
I am doubtful: the resizing is carried out in the initramfs, not by the init command in cmdline.
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"
handles the older cases where only resizing was done in /usr/lib/raspi-config/init_resize.sh.

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
handles Bullseye, only disabling auto-resizing.

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



Viewing all articles
Browse latest Browse all 4226

Trending Articles