mirror of
https://github.com/flatcar/scripts.git
synced 2025-10-15 09:21:21 +02:00
The /usr partition was too small some time ago and we gained space again by switching to btrfs with compression and also removing/splitting out content. The /boot partition is too small all the time and we added many hacks to fit the kernel+initrd under 60 MB. To handle the case where the /oem partition is too small for the A/B-updated OEM extensions we added the workaround to write the inactive one (or both) to the rootfs. All this would not be needed if we had increased the partition sizes a few years ago so that we could now assume that most nodes have the increased sizes and we can make use of them. Still, we can do it now to prepare for the next time when in five or ten years we have serious size problems and run out of workarounds. We have to do the change now and wait a few years so that most nodes have been provisioned with the new layout. Then we can drop the workarounds and have a full featured kernel and initrd, and we can also increase the /usr filesystem to make use of the larger partition. Ideally we use large enough sizes that we never have to worry again but since we also want to support small ARM boards which might only have 8 GB internal storage, let's target this when increasing the partition sizes. With 1 GB /boot, two 2 GB /usr, and 1 GB /oem partitions we are already at 6 GB, leaving 2 GB for the rootfs. For now, reduce the extracted /usr update payload size to the current combined filesystem and verity data usage (same size as before). The rootfs size was also reduced for the initial .bin image so that we don't overshoot 8 GB - it will be resized to fit the disk anyway on first boot. Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com> Signed-off-by: Kai Lueke <kailuke@microsoft.com>