diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/manifest.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/manifest.rs b/src/manifest.rs index 6168706..8e9d13c 100644 --- a/src/manifest.rs +++ b/src/manifest.rs @@ -69,7 +69,7 @@ impl ArtifactManifest { } Self::new( packages, - collect_files(rootfs)?, + collect_files(rootfs, initrd.as_ref())?, initrd, collect_services(rootfs)?, collect_archive_members(archive.as_ref())?, @@ -119,7 +119,9 @@ impl ArtifactManifest { bail!("multiple initrd images found in archive {}", archive_path.display()); } } - files.push(FileRecord::file(path, digest)); + if !path.starts_with("boot/initrd-") || !path.ends_with(".img") { + files.push(FileRecord::file(path, digest)); + } } EntryType::Symlink => { let target = entry @@ -153,7 +155,7 @@ impl ArtifactManifest { } } -fn collect_files(rootfs: &Path) -> Result<Vec<FileRecord>> { +fn collect_files(rootfs: &Path, initrd: Option<&InitrdRecord>) -> Result<Vec<FileRecord>> { let mut files = Vec::new(); let mut entries = WalkDir::new(rootfs) .follow_links(false) @@ -169,6 +171,9 @@ fn collect_files(rootfs: &Path) -> Result<Vec<FileRecord>> { continue; } let path = portable_path(relative)?; + if initrd.is_some_and(|record| record.path == path) { + continue; + } let file_type = entry.file_type(); if file_type.is_file() { let metadata = entry.metadata().with_context(|| format!("inspect rootfs file {}", entry.path().display()))?; |