Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
Should work properly with NVMe and common drives now
Browse files Browse the repository at this point in the history
  • Loading branch information
Telmo Silva committed May 29, 2020
1 parent 0994203 commit 2096103
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions quick_partitioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
print("Which disk should be partitioned? ")
disk = select_disk()

suffix = "p" if ("nvme" in disk) else "" # NVMe numbers partitions as p1, p2, p3 instead of 1, 2, 3.

use_swap = yes_no_dialog(f"We detected {ram} MiB of RAM, should we create a swap partition?")

fw_interface = get_firmware_interface()
Expand Down Expand Up @@ -60,23 +62,23 @@

print("--- Formatting partitions ---")
if(fw_interface == "BIOS"):
os.system(f"mkfs.ext4 {disk}p1")
os.system(f"mkfs.ext4 {disk}{suffix}1")
else: # UEFI
os.system(f"mkfs.fat -F32 {disk}p1")
os.system(f"mkfs.fat -F32 {disk}{suffix}1")

if(use_swap):
os.system(f"mkswap {disk}p2")
os.system(f"swapon {disk}p2")
os.system(f"mkfs.ext4 {disk}p3")
os.system(f"mkswap {disk}{suffix}2")
os.system(f"swapon {disk}{suffix}2")
os.system(f"mkfs.ext4 {disk}{suffix}3")
print("--- Mounting partitions ---")
os.system(f"mount {disk}p3 /mnt")
os.system(f"mount {disk}{suffix}3 /mnt")
else:
os.system(f"mkfs.ext4 {disk}p2")
os.system(f"mkfs.ext4 {disk}{suffix}2")
print("--- Mounting partitions ---")
os.system(f"mount {disk}p2 /mnt")
os.system(f"mount {disk}{suffix}2 /mnt")

# These steps are the same for all combinations
os.system(f"mkdir /mnt/boot")
os.system(f"mount {disk}p1 /mnt/boot")
os.system(f"mount {disk}{suffix}1 /mnt/boot")

print("You're all set, run " + green("tali/install.py") + " again to continue installing " + cyan("Arch Linux") + ".")

0 comments on commit 2096103

Please sign in to comment.