소스 검색

fix exist partition overlay problem

Samuka007 1 개월 전
부모
커밋
57ac4baaf4
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      dadk/src/actions/rootfs/loopdev.rs

+ 1 - 1
dadk/src/actions/rootfs/loopdev.rs

@@ -102,7 +102,7 @@ impl LoopDevice {
         let s = format!("{}p{}", self.loop_device_path.as_ref().unwrap(), nth);
         let direct_path = PathBuf::from(s);
         // 判断路径是否存在
-        if !direct_path.exists() {
+        if !direct_path.exists() || !direct_path.is_file() {
             Command::new("kpartx")
                 .arg("-a")
                 .arg(self.loop_device_path.as_ref().unwrap())