New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support kernels with embedded initramfs (e.g. Flattened uImage Tree) #2297
Comments
@cgwalters I'd be appreciate for any advice for this problem. |
At the moment having an initrd file is indeed required, and the workaround done in meta-updater when fitImage is used is just creating an empty initrd file (https://github.com/advancedtelematic/meta-updater/blob/master/recipes-sota/ostree-kernel-initramfs/ostree-kernel-initramfs_0.0.1.bb#L39). While the workaround works, having a proper fix would indeed be nice. |
(Sorry I missed this one earlier) Presumably we can detect these types of "flattened kernels" by sniffing the file type or so? Adding an ELF parser to ostree might be a heavy dependency, but if e.g. |
@cgwalters no, file can't detect that as far as I remember. But the problem is a bit deeper -- for example the FIT image could be signed and/or encrypted for the target device (based on i.MX processors for instance). In this case the format is hard to guess. |
Surely even if encrypted, there's some sort of header that allows identifying the file? (I didn't know much about this, found https://www.nxp.com/docs/en/supporting-information/DWF13_AMF_IND_T0291.pdf - is there a better reference specifically for i.MX encrypted kernels/u-boot integration?) I think instead of a deploy flag we'd want this flag to be part of the ostree commit metadata; that way it's clearly a property of the build and not how it's deployed. Something like |
I know there are people that do this "flatten kernel + initramfs + kernel cmdline" to a single UEFI binary that can be signed for a SB system, and we should ideally support that too. (Although, that would bring into scope us instead touching the ESP and not |
The format for i.MX is indeed pretty simple to detect. Do not know about other formats which may be vary. But tbh I don't like the idea of automation here without ability to provide additional info for deployment process. By deploy flag I exactly mean the readable metadata from the commit as a hint for the deploy. Any suggestion for metadata hints? |
I think in this case all the core ostree cares about is whether there's an initramfs included in the kernel (so we know not to auto-inject the |
from my perspective the |
@starnight @dsd I think we're in the process of moving away from FIT images (or already have), but what do you think about this proposal? |
SGTM - if someone is going to work on this please claim the issue! |
While working on Apertis OS we faced to following issue on i.mx6-based board:
Core reason
The reason is in hardcoded addition of
/usr/lib/ostree/ostree-prepare-root
in src/libostree/ostree-sysroot-deploy.c for deployments which do not include theinitramfs
file.But in our case we are using the single FIT (Flattened uImage Tree) bootable image which incorporate
kernel+initramfs+DTB
into a single binary, so it is treated bylibostree
as a kernel without initramfs.Problem
Looking into the future it is not enough just to disable that addition of
ostree-prepare-root
on library level.There are several approaches to inline kernel and initramfs into the single bootable image, like FIT above or similar for UEFI.
So need to define the common approach allowing to pass a hint for deploy process on commit level -- which binary type is used rather trying to guess as we have for now. This is also useful for cases when OS is switching from classic kernel+initramfs layout to multiplexed binary or vice versa since the
init=
parameter from kernel's cmdline should be processed additionally.From my point of view such information could be the part of commit's metadata.
The text was updated successfully, but these errors were encountered: