mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 13:50:16 +00:00
fix(autoconfigure/linux): sort kernels by version, newer kernels first
This commit is contained in:
@@ -5,6 +5,7 @@ use crate::entries::EntryDeclaration;
|
|||||||
use crate::generators::GeneratorDeclaration;
|
use crate::generators::GeneratorDeclaration;
|
||||||
use crate::generators::list::ListConfiguration;
|
use crate::generators::list::ListConfiguration;
|
||||||
use crate::utils;
|
use crate::utils;
|
||||||
|
use crate::utils::vercmp;
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use uefi::CString16;
|
use uefi::CString16;
|
||||||
@@ -170,6 +171,9 @@ pub fn scan(
|
|||||||
return Ok(false);
|
return Ok(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sort the kernel pairs by kernel version, if it has one, newer kernels first.
|
||||||
|
pairs.sort_by(|a, b| vercmp::compare_versions(&a.kernel, &b.kernel).reverse());
|
||||||
|
|
||||||
// Generate a unique name for the linux chainload action.
|
// Generate a unique name for the linux chainload action.
|
||||||
let chainload_action_name = format!("{}{}", LINUX_CHAINLOAD_ACTION_PREFIX, root_unique_hash,);
|
let chainload_action_name = format!("{}{}", LINUX_CHAINLOAD_ACTION_PREFIX, root_unique_hash,);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user