#!/usr/bin/python
# Script to add SMBIOSdefault 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 SMBIOSdefault has been written or not
SMBIOSdefaultCheck = False
body = ""
for line in infile:
# if we finish the tags and haven't written SMBIOSdefault Yet
if "" in line and SMBIOSdefaultCheck == False:
line = " SMBIOSdefault\n"
line += " Yes\n"
line += "\n"
SMBIOSdefaultCheck = True
body += line
infile.close()
outfile = open(plist, "w")
outfile.write(body)
outfile.close()