mirror of
https://github.com/edera-dev/sprout.git
synced 2026-11-04 20:12:21 +00:00
fix(autoconfigure): only pair kernels with an initramfs that is a file
The initramfs candidates were checked with try_exists, which also accepts a directory, and fails the whole scan on any error other than the file not being found. Only accept a regular file, and treat a candidate that can't be checked as missing.
This commit is contained in:
1 parent
9438c99c38
commit
133247c05a
1 file changed
+4
-3
@@ -125,10 +125,11 @@ fn scan_directory(filesystem: &mut FileSystem, path: &str) -> Result<Vec<KernelP
|
|||||||
let mut initramfs_path = path_for_join.clone();
|
let mut initramfs_path = path_for_join.clone();
|
||||||
initramfs_path.push(Path::new(&initramfs));
|
initramfs_path.push(Path::new(&initramfs));
|
||||||
|
|
||||||
// Check if the initramfs path exists, if it does, break out of the loop.
|
// Check if the initramfs path is a file, if it is, break out of the loop.
|
||||||
|
// A path that can't be checked is treated as not existing.
|
||||||
if filesystem
|
if filesystem
|
||||||
.try_exists(&initramfs_path)
|
.metadata(&initramfs_path)
|
||||||
.context("unable to check if initramfs path exists")?
|
.is_ok_and(|metadata| metadata.is_regular_file())
|
||||||
{
|
{
|
||||||
break Some(initramfs_path);
|
break Some(initramfs_path);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user