1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-18 21:09:41 +02:00

add log on pumount

This commit is contained in:
didier 2025-04-17 14:55:41 +02:00
parent d17b8ee8a4
commit e8f4256913

View file

@ -495,7 +495,7 @@ def mount_device():
try:
os.statvfs(mount_point)
except Exception as ex:
log(f"Unexpected error: {ex}", flush=True)
log(f"Mount - Unexpected error: {ex}", flush=True)
loop += 1
continue
break
@ -507,7 +507,24 @@ def umount_device():
log("Sync partitions", flush=True)
os.system("sync")
else:
os.system("pumount /media/box 2>/dev/null >/dev/null")
# os.system("pumount /media/box 2>/dev/null >/dev/null")
try:
result = subprocess.run(
["pumount", "/media/box"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
check=True
)
logging.info("Umount successful")
except subprocess.CalledProcessError as e:
logging.error(f"pumount failed: return code {e.returncode}")
return None
except FileNotFoundError:
logging.error("Command 'pumount' not found")
return None
except Exception as e:
logging.error(f"Umount - Unexpected error: {e}")
return None
def log_device_info(dev):