#!/usr/bin/python␊ |
# Script to add GenerateCStates for Chameleon boot loaders␊ |
# Script to add CSTUsingSystemIO for Chameleon boot loaders␊ |
␊ |
import sys␊ |
import os␊ |
|
boot = "/Extra/org.chameleon.Boot.plist"␊ |
plist = vol + boot␊ |
infile = open(plist, "r")␊ |
# check if GenerateCStates has been written or not␊ |
GenerateCStatesCheck = False␊ |
# check if CSTUsingSystemIO has been written or not␊ |
CSTUsingSystemIOCheck = False␊ |
␊ |
body = ""␊ |
␊ |
for line in infile:␊ |
# if we finish the tags and haven't written GenerateCStates Yet␊ |
if "</dict>" in line and GenerateCStatesCheck == False:␊ |
line = " <key>GenerateCStates</key>\n"␊ |
# if we finish the tags and haven't written CSTUsingSystemIO Yet␊ |
if "</dict>" in line and CSTUsingSystemIOCheck == False:␊ |
line = " <key>CSTUsingSystemIO</key>\n"␊ |
line += " <string>Yes</string>\n"␊ |
line += "</dict>\n"␊ |
GenerateCStatesCheck = True␊ |
CSTUsingSystemIOCheck = True␊ |
␊ |
body += line␊ |
␊ |