[yocto] Resizing root flash partition/filesystem on first boot

Alex J Lennon ajlennon at dynamicdevices.co.uk
Wed Mar 4 13:32:40 PST 2015


Hi,

I'd like to be able to build an SD card image, deploy to a system and
have it automatically resize on first boot. I haven't seen functionality
that would do this in Yocto. If there is a setting for this could
anybody let me know where that is?

Alternatively if this isn't supported out of the box I was thinking of
adding something, say as a recipe with a post installation task that ran
fdisk, then resizee2fs then either remounted the root f/s if possible or
alternatively rebooted.

I have had a look at this and in a manual hand-rolled way it seems to
work fine.

That said,

e2fsprogs doesn't seem to package resize2fs but I have a small patch to
enable that.

The next problem is that I can automate fdisk with a pipe but when I
delete a partition and create it the default is to start at 1,
overlapping the existing DOS partition that I have on my i.MX6 SD card
images. Odd as I am sure this is different behaviour from what I'd
expect from fdisk on a desktop. I'd have to do some parsing of the
existing partition sizes I guess which I would rather avoid for
simplicity if possible.

If anybody could let me know if this has been done so is a waste of my
time, or if there's a better way to achieve this I'd be grateful.

Thanks,

Alex



More information about the yocto mailing list