Plebian-Linux / quartz64-images

GitHub Actions Repository for automatically generated images for the Quartz64 family of single board computers
https://plebian.org
GNU General Public License v3.0
41 stars 10 forks source link

Resize rootfs improvements #6

Closed diederikdehaas closed 1 year ago

diederikdehaas commented 1 year ago

See the (extensive) commit messages.

diederikdehaas commented 1 year ago

It is quite similar to https://salsa.debian.org/raspi-team/image-specs/-/merge_requests/73 but it's missing the last commit in that MR: Recheck the root filesystem after expanding it. as you no longer do the resize of the filesystem yourself.

CounterPillow commented 1 year ago

Thanks! I was wondering about the fsck thing, thank you for looking into it, that's one less worry on my mind.

diederikdehaas commented 1 year ago

I still would like to figure out why it doesn't get automatically included. Feels like an important missing piece of my understanding of initramfs.

neggles commented 1 year ago

Perhaps because systemd-repart and the x-systemd.growfs mount option can be used trigger an automatic resize of the partition and the filesystem on firstboot? This seems to be what Mobian does now 🤷‍♂️

diederikdehaas commented 1 year ago

Those could be reasons why you want to include it (AFAIC you always want it). If you regenerate the initramfs, fsck will be included (there's also a hook defined in the initramfs-tools package for fsck).
What I want to know is why is it included then but not on image creation.

It doesn't get included with this project, but also not in https://salsa.debian.org/raspi-team/image-specs (where I proposed ~ the same improvement.

neggles commented 1 year ago

hm. interesting. Maybe need to run update-initramfs -u after the image deployment section (i.e. off a loopdev rather than a chroot?)

diederikdehaas commented 1 year ago

That would break what we have in the 'image-specs' project as we put hooks/scripts in place, generate the initramfs and then remove the hooks/scripts again, so that they won't be included in the initramfs the next time it is generated.
(It's only useful/needed on first boot)

neggles commented 1 year ago

Would it? You wouldn't be running update-initramfs twice, just moving it to after the filesystem-deploy action (AFAICT, commands/scripts run after that step will still execute, just from the pre-finalization loopdev)

diederikdehaas commented 1 year ago

It can be different for this project (then for RPi image-specs project).

CounterPillow commented 1 year ago

@neggles

Perhaps because systemd-repart and the x-systemd.growfs mount option can be used trigger an automatic resize of the partition and the filesystem on firstboot? This seems to be what Mobian does now man_shrugging

We already use the growfs mount option. I was trying to use systemd-repart, but it wants to stomp over the bootloader, and when you make the bootloader partitions so it doesn't stomp over it it throws its toys out of the pram and complains that the size it tried to allocate for the root partition wasn't possible.

I still want to go back to trying systemd-repart eventually, since the initramfs repartitioning is slow and sucks, but to get a working image out quickly it wasn't the right choice.