1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-24 07:49:42 +02:00

work on exfat

This commit is contained in:
didier 2025-04-18 09:13:37 +02:00
parent 06085a6368
commit db271085e0
2 changed files with 12 additions and 9 deletions

View file

@ -180,12 +180,15 @@ echo '0 20 * * * /sbin/poweroff' >> /etc/crontab
#--------------------- #---------------------
cd /home/$SUDO_USER/pandora-box cd /home/$SUDO_USER/pandora-box
# FIM, pmount, psmisc (for killall) and vim # FIM, psmisc (for killall) and vim
apt --fix-broken install -y apt --fix-broken install -y
apt install -y fim pmount psmisc vim apt install -y fim psmisc vim
# Add user in plugdev group to allow pmount # Add exfat filesystem
usermod -aG plugdev $SUDO_USER apt install exfat-fuse exfatprogs
# Allow sudo_user users to mount and umount devices
echo "$SUDO_USER ALL=(ALL) NOPASSWD: /bin/mount, /bin/umount" > /etc/sudoers.d/usbmount
# Python libraries # Python libraries
su - $SUDO_USER -c "./.local/bin/pip install pypandora psutil pyudev" su - $SUDO_USER -c "./.local/bin/pip install pypandora psutil pyudev"

View file

@ -510,7 +510,7 @@ def mount_device():
# Mount device # Mount device
try: try:
subprocess.run( subprocess.run(
["pmount", device.device_node, "/media/box"], ["sudo", "mount", device.device_node, "/media/box"],
stdout=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
check=True, check=True,
@ -520,7 +520,7 @@ def mount_device():
logging.error(f"Mount failed: return code {e.returncode}") logging.error(f"Mount failed: return code {e.returncode}")
return None return None
except FileNotFoundError: except FileNotFoundError:
logging.error("Command 'pmount' not found") logging.error("Command 'mount' not found")
return None return None
except Exception as e: except Exception as e:
logging.error(f"Unexpected error: {e}") logging.error(f"Unexpected error: {e}")
@ -546,17 +546,17 @@ def umount_device():
else: else:
try: try:
subprocess.run( subprocess.run(
["pumount", "/media/box"], ["sudo", "umount", "/media/box"],
stdout=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
check=True, check=True,
) )
logging.info("Umount successful") logging.info("Umount successful")
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
logging.error(f"pumount failed: return code {e.returncode}") logging.error(f"umount failed: return code {e.returncode}")
return None return None
except FileNotFoundError: except FileNotFoundError:
logging.error("Command 'pumount' not found") logging.error("Command 'umount' not found")
return None return None
except Exception as e: except Exception as e:
logging.error(f"Umount - Unexpected error: {e}") logging.error(f"Umount - Unexpected error: {e}")