ksud: clean module dir earlier
This commit is contained in:
@@ -13,6 +13,9 @@ pub fn on_post_data_fs() -> Result<()> {
|
|||||||
// modules.img is the default image
|
// modules.img is the default image
|
||||||
let mut target_update_img = &module_img;
|
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 Path::new(module_update_img).exists() {
|
||||||
if module_update_flag.exists() {
|
if module_update_flag.exists() {
|
||||||
// if modules_update.img exists, and the the flag indicate this is an update
|
// 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(());
|
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);
|
println!("mount {} to {}", target_update_img, module_dir);
|
||||||
mount_image(target_update_img, module_dir)?;
|
mount_image(target_update_img, module_dir)?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user