install

installer
Log | Files | Refs | README | LICENSE | git clone https://git.ne02ptzero.me/git/install

commit 67394a9b25ea915110a1f2c38bcafa34e92b61a4
parent 912fd3709c2d9000780babfdd4853fd8891f630c
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Sun, 27 Nov 2016 23:32:32 +0100

Fix(Install): Fix default choices and partition types:

Was hardcoded numbers, now fdisk hash. (Crossplatform)

Diffstat:
Mscreens/install/install.py | 18+++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/screens/install/install.py b/screens/install/install.py @@ -101,10 +101,10 @@ class Install: def create_partitions(self): # Object used to define types in fdisk types = { - "Grub": "4", - "Boot": "15", - "Root": "15", - "Swap": "14" + "Grub": "21686148-6449-6E6F-744E-656564454649", + "Boot": "0FC63DAF-8483-4772-8E79-3D69D8477DE4", + "Root": "0FC63DAF-8483-4772-8E79-3D69D8477DE4", + "Swap": "0657FD6D-A4AB-43C4-84E5-0933C84B4F4F" } layout = self.conf_lst["partitionning.layout"] # Partition future layout @@ -115,11 +115,19 @@ class Install: self.fdisk(["g", "p", "w"], disk) # List partitions to add + i = 0 for p in layout: if p["disk"] == disk: self.dlg.infobox("Creating partition"+ p["part"] +"...") self.fdisk(["n", p["part"][-1:], "", "+"+p["size"], "w"], disk) - self.fdisk(["t", p["part"][-1:], types[p["flag"]], "w"], disk) + + # If there is one partition on the disk, we do not need to pass + # a number to fdisk + if (i != 0): + self.fdisk(["t", p["part"][-1:], types[p["flag"]], "w"], disk) + else: + self.fdisk(["t", types[p["flag"]], "w"], disk) + i = i + 1 return 0 # Function that call the disk binary with options for the console