snapcore / pi-gadget

Universal pi (pi2,pi3,pi4,cm3,cm4 and future) gadget snap for Ubuntu Core and classic systems.
30 stars 60 forks source link

Increase boot partition size to accommodate compression changes #88

Closed jawn-smith closed 2 weeks ago

jawn-smith commented 2 years ago

We had a discussion today about leaving space for organic growth of the initrd and the fact that changing compression sizes has led to larger initrd images.

murraybd commented 2 years ago

This looks good to me but is there somewhere (other than a t-shirt) we could put the formula used for calculating the size?

jawn-smith commented 2 years ago

How about right here?

In [1]: fudge_factor = 2

In [2]: num_copies = 2

In [3]: kernel_size = 10

In [4]: initrd_size = 57

In [5]: other_boot_assets = 23

In [6]: boot_size = fudge_factor * (num_copies * ( kernel_size + initrd_size +other_boot_assets))

In [7]: boot_size
Out[7]: 360

Then rounding up to a nicer number we landed on 384. Some more detail:

flash-kernel always ensures there are two sets of boot assets, one with normal file paths and one with a .bak appended to each file path. This is the reason for the num_copies variable.

initrd_size and kernel_size are taken from kernel 5.15.0-1003-raspi

The "other boot assets" include things like start.elf, uboot, piboot, etc.

I have requested a review from waveform80 as I believe some of this might change in the future, like removing uboot altogether.

jawn-smith commented 2 years ago

Dave and I had an offline conversation during which we decided to bump this to 512.

waveform80 commented 1 year ago

Is this now redundant with the classic-redesign branch?

waveform80 commented 2 weeks ago

Yup, this was resolved with classic-redesign getting merged; closing