<div dir="ltr"><div>I wrote a Perl script which can be plugged into the boot process to extend the root partition and root file system. The result is that the user is greeted with a fully extended root file system on first login (see screenlog.0).</div><div><br></div><div>Here’s how to install the script on top of the preview image:</div><div><br></div><div>sudo dd if=2016-11-24-raspberry-pi-3-stretch-PREVIEW.img of=/dev/sdb bs=5M</div><div>pmount sdb2</div><div><div>sudo cp ~/resizerootfs /media/sdb2/usr/bin/</div><div>sudo chmod +x /media/sdb2/usr/bin/resizerootfs </div><div>sudo cp ~/resizerootfs.service /media/sdb2/etc/systemd/system/</div><div>sudo mkdir /media/sdb2/etc/systemd/system/systemd-remount-fs.service.requires/<br></div><div>sudo ln -s /etc/systemd/system/resizerootfs.service /media/sdb2/etc/systemd/system/systemd-remount-fs.service.requires/resizerootfs.service</div><div>pumount sdb2</div></div><div>pmount sdb1</div><div>sed -i 's,elevator,rw elevator,g' /media/sdb1/cmdline.txt<br></div><div>pumount sdb1</div><div><br></div><div>One thing I still need to change is that resizerootfs should, after successful completion, disable resizerootfs.service (i.e. remove the symlink), so that the user has full control over the partition table after the first boot.</div><div><br></div><div>I’ll also add a safety-guard to resizerootfs to not touch the partition table in case partition 3 and 4 already exist, just in case the user applies their own partition layout before ever booting the image.</div><div><br></div><div>Any thoughts/comments? If not, I’ll go ahead and build a new preview image with the script included.</div><div><br></div>-- <br><div class="gmail_signature">Best regards,<br>Michael</div>
</div>