Chameleon

Chameleon Commit Details

Date:2011-09-21 16:30:33 (8 years 1 month ago)
Author:blackosx
Commit:1556
Parents: 1555
Message:Update Keymaps/postinstall to match trunk
Changes:
R/branches/blackosx/package/Scripts/Keymaps/postinstall.in → /branches/blackosx/package/Scripts/Keymaps/postinstall

File differences

branches/blackosx/package/Scripts/Keymaps/postinstall.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/python
# Script to add Graphics_Mode for Chameleon boot loaders
import sys
import os
import shutil
vol = str(sys.argv[3])
# Check for .ChameleonEFI file at root of target volume
# to indicate user wants to install to EFI system partition.
espfile = "/.ChameleonEFI"
espvol = vol + espfile
if os.path.exists(espvol):
if not os.path.exists('/Volumes/EFI/Extra'):
os.makedirs('/Volumes/EFI/Extra')
plist = "/Volumes/EFI/Extra/org.chameleon.Boot.plist"
else:
boot = "/Extra/org.chameleon.Boot.plist"
plist = vol + boot
if not os.path.exists(plist):
shutil.copy('/Library/Preferences/SystemConfiguration/com.apple.Boot.plist', plist)
infile = open(plist, "r")
# check if Graphics_Mode has been written or not
KeyLayoutCheck = False
body = ""
for line in infile:
# if we finish the tags and haven't written KeyLayout Yet
if "</dict>" in line and KeyLayoutCheck == False:
line = " <key>KeyLayout</key>\n"
line += " <string>@@KEYMAP@@</string>\n"
line += "</dict>\n"
KeyLayoutCheck = True
body += line
infile.close()
outfile = open(plist, "w")
outfile.write(body)
outfile.close()
branches/blackosx/package/Scripts/Keymaps/postinstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/python
# Script to add Graphics_Mode for Chameleon boot loaders
import sys
import os
import shutil
vol = str(sys.argv[3])
# Check for .ChameleonEFI file at root of target volume
# to indicate user wants to install to EFI system partition.
espfile = "/.ChameleonEFI"
espvol = vol + espfile
if os.path.exists(espvol):
if not os.path.exists('/Volumes/EFI/Extra'):
os.makedirs('/Volumes/EFI/Extra')
plist = "/Volumes/EFI/Extra/org.chameleon.Boot.plist"
else:
boot = "/Extra/org.chameleon.Boot.plist"
plist = vol + boot
if not os.path.exists(plist):
shutil.copy('/Library/Preferences/SystemConfiguration/com.apple.Boot.plist', plist)
infile = open(plist, "r")
# check if Graphics_Mode has been written or not
KeyLayoutCheck = False
body = ""
for line in infile:
# if we finish the tags and haven't written KeyLayout Yet
if "</dict>" in line and KeyLayoutCheck == False:
line = " <key>KeyLayout</key>\n"
line += " <string>@@KEYMAP@@</string>\n"
line += "</dict>\n"
KeyLayoutCheck = True
body += line
infile.close()
outfile = open(plist, "w")
outfile.write(body)
outfile.close()

Archive Download the corresponding diff file

Revision: 1556