pub fn find_kernel() -> Result<Option<PathBuf>>Expand description
Find a bootable kernel image on the host.
Resolution chain:
KTSTR_KERNELenv var, parsed viaKernelId:- Path: search that directory for an arch-specific image
- Version/CacheKey: require cache access (error if cache directory cannot be opened); on cache miss, skip the general cache scan (step 2) and fall to filesystem
- XDG cache: most recent cached image (newest first)
- Local build trees (
./linux,../linux,/lib/modules/{release}/build) - Host paths (
/lib/modules/{release}/vmlinuz,/boot/vmlinuz-{release},/boot/vmlinuz)
Returns Err when KTSTR_KERNEL is a path that does not contain
a kernel image, or when it is a version/cache key and the cache
directory cannot be opened. Returns Ok(None) when no kernel is
found.