From 60933093c318b080b894bf4a5928a0dd3a557fe7 Mon Sep 17 00:00:00 2001 From: Lin Wang Date: Tue, 12 Mar 2024 00:08:44 +0800 Subject: [PATCH] nydus-image: merge main branch and remove unnecessary output. --- src/bin/nydus-image/deduplicate.rs | 5 ++++- src/bin/nydus-image/main.rs | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/bin/nydus-image/deduplicate.rs b/src/bin/nydus-image/deduplicate.rs index 8ce4b46fa4c..db6dcc15a53 100644 --- a/src/bin/nydus-image/deduplicate.rs +++ b/src/bin/nydus-image/deduplicate.rs @@ -194,6 +194,9 @@ pub fn update_ctx_from_parent_bootstrap( ctx.conversion_type = ConversionType::TarToTarfs; ctx.blob_features |= BlobFeatures::TARFS; } + ctx.fs_version = + RafsVersion::try_from(sb.meta.version).context("Failed to get RAFS version")?; + ctx.compressor = config.compressor; Ok(()) } @@ -1306,7 +1309,7 @@ impl Table for BlobTable { .lock() .map_err(|e| DatabaseError::PoisonError(e.to_string()))?; let mut stmt: rusqlite::Statement<'_> = conn_guard.prepare( - "SELECT blob_id, blob_compressed_size, blob_uncompressed_size from blob + "SELECT blob_id, blob_compressed_size, blob_uncompressed_size, blob_compressor, blob_meta_ci_compressed_size, blob_meta_ci_uncompressed_size, blob_meta_ci_offset from blob ORDER BY id LIMIT ?1 OFFSET ?2", )?; let blob_iterator = stmt.query_map(params![limit, offset], |row| { diff --git a/src/bin/nydus-image/main.rs b/src/bin/nydus-image/main.rs index 1caca4180e5..577b7da1227 100644 --- a/src/bin/nydus-image/main.rs +++ b/src/bin/nydus-image/main.rs @@ -1344,7 +1344,14 @@ impl Command { chunkdict_chunks, chunkdict_blobs, )?; - OutputSerializer::dump(matches, output, build_info).unwrap(); + OutputSerializer::dump( + matches, + output, + build_info, + build_ctx.compressor, + build_ctx.fs_version, + ) + .unwrap(); info!( "Chunkdict metadata is saved at: {:?}", matches