summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/LinHES-config/mv_install.py
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core-testing/LinHES-config/mv_install.py')
-rwxr-xr-xabs/core-testing/LinHES-config/mv_install.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/abs/core-testing/LinHES-config/mv_install.py b/abs/core-testing/LinHES-config/mv_install.py
index 9d70a55..e96dd56 100755
--- a/abs/core-testing/LinHES-config/mv_install.py
+++ b/abs/core-testing/LinHES-config/mv_install.py
@@ -307,6 +307,19 @@ def create_partitions(diskdevice, size, ptype, startsector):
(newpart.getDeviceNodeName(), newpart.getSize(), diskdevice))
return newpart.getDeviceNodeName()
+def set_active_parition(diskdevice):
+ """ Set the bootable flag for this partition. """
+ logging.debug(" Setting active parition")
+ device = parted.getDevice(diskdevice)
+ partdisk = parted.Disk(device)
+ try:
+ for partition in partdisk.partitions:
+ partition.setFlag(parted.PARTITION_BOOT)
+ partdisk.commit()
+ except:
+ logging.info(" Couldn't set the active partition")
+ logging.info(" Depending on your system this may not matter")
+
def partition_disk():
global hostoptions
@@ -319,6 +332,7 @@ def partition_disk():
label = "data"
partitions_removeall("/dev/"+datadisk, label)
hostoptions["rootpartition"] = create_partitions("/dev/"+rootdisk, hostoptions["rootsize"], "NORMAL", 0)
+ set_active_parition("/dev/"+rootdisk)
hostoptions["swappartition"] = create_partitions("/dev/"+rootdisk, hostoptions["swapsize"], "SWAP", 1)
if datadisk != rootdisk:
hostoptions["datapartition"] = create_partitions("/dev/"+datadisk, hostoptions["datasize"], "NORMAL", 0)