fix: clippy
This commit is contained in:
+5
-2
@@ -214,7 +214,10 @@ fn check_kvm_capabilities() -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Create an uncompressed cpio initramfs from a directory
|
/// Create an uncompressed cpio initramfs from a directory
|
||||||
fn create_initramfs(rootfs: &PathBuf) -> Result<PathBuf> {
|
/// A filesystem entry for cpio archives: (name, mode, mtime, nlink, data)
|
||||||
|
type CpioEntry = (String, u32, u32, u32, Vec<u8>);
|
||||||
|
|
||||||
|
fn create_initramfs(rootfs: &Path) -> Result<PathBuf> {
|
||||||
// Create a temporary file for the initramfs (uncompressed cpio)
|
// Create a temporary file for the initramfs (uncompressed cpio)
|
||||||
// Use a temp file in the same directory as rootfs, or fall back to /tmp
|
// Use a temp file in the same directory as rootfs, or fall back to /tmp
|
||||||
let initramfs_path = rootfs
|
let initramfs_path = rootfs
|
||||||
@@ -387,7 +390,7 @@ fn collect_entries(
|
|||||||
current: &Path,
|
current: &Path,
|
||||||
pb: &ProgressBar,
|
pb: &ProgressBar,
|
||||||
seen_inodes: &mut std::collections::HashMap<(u64, u64), String>,
|
seen_inodes: &mut std::collections::HashMap<(u64, u64), String>,
|
||||||
) -> Result<Vec<(String, u32, u32, u32, Vec<u8>)>> {
|
) -> Result<Vec<CpioEntry>> {
|
||||||
let mut entries = Vec::new();
|
let mut entries = Vec::new();
|
||||||
let mut total_data: u64 = 0;
|
let mut total_data: u64 = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -54,19 +54,6 @@ impl Arch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the canonical name (uname -m style)
|
|
||||||
pub fn canonical_name(&self) -> &'static str {
|
|
||||||
match self {
|
|
||||||
Arch::Amd64 => "x86_64",
|
|
||||||
Arch::Arm64 => "aarch64",
|
|
||||||
Arch::Armhf => "armv7l",
|
|
||||||
Arch::Riscv64 => "riscv64",
|
|
||||||
Arch::Ppc64el => "ppc64le",
|
|
||||||
Arch::S390x => "s390x",
|
|
||||||
Arch::Unknown => "unknown",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get the Debian/Ubuntu style name
|
/// Get the Debian/Ubuntu style name
|
||||||
pub fn debian_name(&self) -> &'static str {
|
pub fn debian_name(&self) -> &'static str {
|
||||||
match self {
|
match self {
|
||||||
@@ -157,11 +144,6 @@ pub fn get_host_arch() -> Arch {
|
|||||||
Arch::from_str(machine.as_ref())
|
Arch::from_str(machine.as_ref())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Normalize an architecture string to canonical (uname -m) form
|
|
||||||
pub fn normalize_arch(arch: &str) -> String {
|
|
||||||
Arch::from_str(arch).canonical_name().to_string()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Map ecr architecture names to distro-specific names
|
/// Map ecr architecture names to distro-specific names
|
||||||
pub fn map_arch_for_distro(distro: &str, arch: &str) -> String {
|
pub fn map_arch_for_distro(distro: &str, arch: &str) -> String {
|
||||||
let arch_enum = Arch::from_str(arch);
|
let arch_enum = Arch::from_str(arch);
|
||||||
|
|||||||
Reference in New Issue
Block a user