From b4e8371b04d32c76fcd529db39cdd76f9aa93dc2 Mon Sep 17 00:00:00 2001 From: tiann Date: Thu, 5 Jan 2023 10:51:04 +0800 Subject: [PATCH] ksud: clean module dir earlier --- userspace/ksud/src/event.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/userspace/ksud/src/event.rs b/userspace/ksud/src/event.rs index 405c4807..0834f2dd 100644 --- a/userspace/ksud/src/event.rs +++ b/userspace/ksud/src/event.rs @@ -13,6 +13,9 @@ pub fn on_post_data_fs() -> Result<()> { // modules.img is the default image let mut target_update_img = &module_img; + // we should clean the module mount point if it exists + ensure_clean_dir(module_dir)?; + if Path::new(module_update_img).exists() { if module_update_flag.exists() { // if modules_update.img exists, and the the flag indicate this is an update @@ -32,9 +35,6 @@ pub fn on_post_data_fs() -> Result<()> { return Ok(()); } - // we should clean the module mount point if it exists - ensure_clean_dir(module_dir)?; - println!("mount {} to {}", target_update_img, module_dir); mount_image(target_update_img, module_dir)?;