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

Advanced users • Re: Filesystem expansion / reboot clashing with my own 1st-run script

$
0
0
If you want to check explicitly for the rootfs resize being in progress, you could check for "resize2fs" running (with pgrep, for instance), but you may then run into something else unexpected, like a reboot, etc., so be prepared for more "fun" ;)
Yeah - I think there's a law of diminishing returns on this if you check for one thing or another - I suspect the resize process has finished by the time my script is started by whatever means, but there's a pending reboot a few seconds later.

For now just waiting ~30sec after the browser launches *before* deleting the flag file seems to be the simplest solution.
You didn't describe your project in detail, but if you're going to be burning several Pi devices you may want to consider a different way of building your IMGs.

Specifically, the technique that sdm uses is to enable you to fully customize the IMG before you ever burn a disk. Then, using sdm to burn a disk you can do further customizations if you want, and sdm ensures that each device is unique. Contrast this to the typical "customize up my system, then clone it" approach which can propagate settings to other systems that you may not actually want to propagate.

Additionally, sdm has a specific "first boot", where final customizations are done that can only be done on the device when it's booted. In this "first boot" you can enable your service so that it runs during all subsequent boots, without worrying about rootfs resizing, etc., since it will only run during a normal boot.

If you find this approach interesting, happy to discuss your project further on the sdm GitHub, and jump start you with sdm if that would be helpful.

Statistics: Posted by bls — Mon Jul 21, 2025 5:14 pm



Viewing all articles
Browse latest Browse all 7521

Trending Articles