mirror of
https://github.com/dakhnod/fzfs.git
synced 2025-05-19 08:40:30 -07:00
added mountpoint checks
This commit is contained in:
parent
a1dfb11fc7
commit
cfc2d8688b
@ -5,13 +5,11 @@ This driver allows you to mount the flipper zero over its serial connection and
|
||||
## Installation
|
||||
|
||||
```
|
||||
git clone --recursive --depth 1 git@github.com:dakhnod/fzfs.git
|
||||
git clone --recursive git@github.com:dakhnod/fzfs.git
|
||||
cd fzfs
|
||||
python3 -m venv venv
|
||||
. venv/bin/activate
|
||||
pip install protobuf
|
||||
pip install fusepy
|
||||
pip install pyserial
|
||||
pip install protobuf fusepy pyserial numpy
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
18
fzfs.py
18
fzfs.py
@ -10,13 +10,27 @@ import logging
|
||||
import time
|
||||
import threading
|
||||
import stat
|
||||
import os
|
||||
|
||||
def main():
|
||||
print('starting')
|
||||
if len(sys.argv) != 3:
|
||||
print('usage: python fzfs.py serial-device mountpoint')
|
||||
print('example: python fzfs.py /dev/ttyACM0 /home/user/flipper-zero')
|
||||
return
|
||||
|
||||
mountpoint = sys.argv[2]
|
||||
|
||||
if not os.path.isdir(mountpoint):
|
||||
print('mountpoint must be an empty folder')
|
||||
return
|
||||
|
||||
if len(os.listdir(mountpoint)) != 0:
|
||||
print('mountpoint must be an empty folder')
|
||||
return
|
||||
|
||||
try:
|
||||
fs = fuse.FUSE(FlipperZeroFileSysten(sys.argv[1]), sys.argv[2], foreground=True)
|
||||
except:
|
||||
print('stopping')
|
||||
fuse.fuse_exit()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user