#!/usr/bin/python
# Script to add CSTUsingSystemIO for Chameleon boot loaders
import sys
import os
vol = str(sys.argv[3])
boot = "/Extra/org.chameleon.Boot.plist"
plist = vol + boot
infile = open(plist, "r")
# check if CSTUsingSystemIO has been written or not
CSTUsingSystemIOCheck = False
body = ""
for line in infile:
# if we finish the tags and haven't written CSTUsingSystemIO Yet
if "" in line and CSTUsingSystemIOCheck == False:
line = " CSTUsingSystemIO\n"
line += " Yes\n"
line += "\n"
CSTUsingSystemIOCheck = True
body += line
infile.close()
outfile = open(plist, "w")
outfile.write(body)
outfile.close()