BT
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
14 additions and
0 deletions
-
contrib/partitioner/partitioner.py
|
|
@ -96,6 +96,20 @@ def main(): |
|
|
|
|
|
|
|
|
|
|
|
if len(usb_devs()) == 1: |
|
|
|
if len(usb_partitions()) < 1: |
|
|
|
try: |
|
|
|
print("Running parted...") |
|
|
|
os.system('/sbin/parted -s /dev/sda mkpart p ext4 3 100%'); |
|
|
|
print('Making first partition'); |
|
|
|
os.system('/sbin/mkfs.ext4 -F /dev/sda1'); |
|
|
|
except: |
|
|
|
print('Error running parted'); |
|
|
|
sys.exit(1); |
|
|
|
else: |
|
|
|
print("Already partitioned") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(usb_partitions()) == 1: |
|
|
|
try: |
|
|
|
os.system('/bin/mount /dev/' + usb_partitions()[0] + ' /mnt/data') |
|
|
|