mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-20 05:49:40 +02:00
fix mount
This commit is contained in:
parent
2677c7b397
commit
91be92f63e
1 changed files with 8 additions and 5 deletions
|
@ -331,14 +331,17 @@ def mount_device(device):
|
|||
return "/media/box"
|
||||
|
||||
"""Unmount USB device"""
|
||||
def umount_device():
|
||||
log("Sync partitions")
|
||||
res = os.system("sync")
|
||||
def umount_device(mount_point):
|
||||
if USB_AUTO_MOUNT:
|
||||
os.system("umount " + mount_point)
|
||||
else:
|
||||
os.system("punmount /media/box")
|
||||
|
||||
"""Main device loop"""
|
||||
def device_loop():
|
||||
# First unmount remaining device
|
||||
umount_device()
|
||||
if not USB_AUTO_MOUNT:
|
||||
umount_device("/media/box")
|
||||
# Loop
|
||||
context = pyudev.Context()
|
||||
monitor = pyudev.Monitor.from_netlink(context)
|
||||
|
@ -402,7 +405,7 @@ def device_loop():
|
|||
else:
|
||||
if not CURSES:
|
||||
display_image("OK")
|
||||
umount_device()
|
||||
umount_device(mount_point)
|
||||
|
||||
if device.action == "remove":
|
||||
log("Device removed")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue