Only create the initramfs when necessary
Created by: ollieparanoid
Right now we create the initramfs whenever it could be necessary (simply to avoid running an old version, which is really annoying for development, and because it introduces bugs all the time).
It depends on a lot of factors, when one of those changes we should rebuild the initramfs:
- installed kernel (with the flavor for which we want to generate the initramfs)
- device package
- postmarketos-splash
- postmarketos-mkinitfs
- initramfs hooks changed/got updated
Maybe we should save a file with all versions of the last generated initramfs, and compare that file with the last one to decide if a rebuild is necessary. Note that generating the initramfs is done in the chroot, and must work completely independent of pmbootstrap (so we can update it once it is installed on the device with the package manager).