ksud: Add some logs

This commit is contained in:
weishu
2024-02-29 22:40:42 +08:00
parent 8c0d06bc68
commit 6de330b00a
2 changed files with 11 additions and 11 deletions

View File

@@ -391,16 +391,13 @@ fn _install_module(zip: &str) -> Result<()> {
println!("- Legacy image, migrating to new format, please be patient...");
create_module_image(tmp_module_img, sparse_image_size, journal_size)?;
let _dontdrop =
mount::AutoMountExt4::try_new(tmp_module_img, module_update_tmp_dir, true)?;
utils::copy_module_files(defs::MODULE_DIR, module_update_tmp_dir)?;
mount::AutoMountExt4::try_new(tmp_module_img, module_update_tmp_dir, true)
.with_context(|| format!("Failed to mount {tmp_module_img}"))?;
utils::copy_module_files(defs::MODULE_DIR, module_update_tmp_dir)
.with_context(|| "Failed to migrate module files".to_string())?;
} else {
utils::copy_sparse_file(modules_img, tmp_module_img, true).with_context(|| {
format!(
"Failed to copy {} to {}",
modules_img.display(),
tmp_module_img
)
})?;
utils::copy_sparse_file(modules_img, tmp_module_img, true)
.with_context(|| "Failed to copy module image".to_string())?;
}
}

View File

@@ -260,8 +260,11 @@ fn copy_xattrs(src_path: impl AsRef<Path>, dest_path: impl AsRef<Path>) -> Resul
xattr.to_string_lossy(),
value.to_string_lossy(),
);
if let Err(e) =
extattr::lsetxattr(dest_path.as_ref(), &xattr, &value, extattr::Flags::empty())
.with_context(|| format!("Failed to set xattr for {:?}", dest_path.as_ref()))?;
{
log::warn!("Failed to set xattr: {}", e);
}
}
Ok(())
}