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

Advanced users • Re: Disable partition resizing on bookworm 1st boot

$
0
0
Below is a snippet of what I use. It works on any version of Raspberry Pi OS.

This snippet assumes the ROOT partition is mounted on /mnt and the BOOT partition is mounted on /mnt/boot (non-Bookworm) or /mnt/boot/firmware (Bookworm).

Code:

#!/bin/bashMNTPATH="/mnt"BOOTMNT="${MNTPATH}$(sed -n 's|^\S\+\s\+\(/boot\S*\)\s\+.*$|\1|p' ${MNTPATH}/etc/fstab)"sed -i 's| init=/usr/lib/raspi-config/init_resize\.sh||' "${BOOTMNT}/cmdline.txt"if [ -f "${MNTPATH}/usr/lib/raspberrypi-sys-mods/firstboot" ]; then  cp "${MNTPATH}/usr/lib/raspberrypi-sys-mods/firstboot" "${MNTPATH}/usr/lib/raspberrypi-sys-mods/first-boot"  sed -i 's|firstboot|first-boot|g' "${MNTPATH}/usr/lib/raspberrypi-sys-mods/first-boot"  sed -i 's|^\(\s*whiptail --infobox \"Resizing root filesystem.*\)$|  return 0\n\n\1|' "${MNTPATH}/usr/lib/raspberrypi-sys-mods/first-boot"  sed -i 's| init=/usr/lib/raspberrypi-sys-mods/firstboot| init=/usr/lib/raspberrypi-sys-mods/first-boot|' "${BOOTMNT}/cmdline.txt"fi
It looks like the firstboot that is released with bookworm has been modified. For example, it doesn't have the "Resizing root filesystem." for example. Although, removing it from cmdline.txt does the trick.

Statistics: Posted by peoplenn — Wed Dec 06, 2023 8:18 pm



Viewing all articles
Browse latest Browse all 3556

Trending Articles