1 | #!/bin/bash␊ |
2 | ␊ |
3 | temp="/tmp/Chameleon"␊ |
4 | ␊ |
5 | # source com.apple.boot.plist␊ |
6 | if ! [ -f "${2}/.Chameleon/Extra/com.apple.Boot.plist" ]; then␊ |
7 | ␉if [ -f "${2}/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" ]; then␊ |
8 | ␉␉cp -f "${2}/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" "${2}/.Chameleon/Extra"␊ |
9 | ␉fi␊ |
10 | fi␊ |
11 | ␊ |
12 | # fix kext permissions␊ |
13 | find "${2}/.Chameleon/Extra/Extensions" -type f -exec chmod 644 {} \;␊ |
14 | find "${2}/.Chameleon/Extra/Extensions" -type d -exec chmod 755 {} \;␊ |
15 | chown -R 0:0 "${2}/.Chameleon/Extra/Extensions"␊ |
16 | ␊ |
17 | # build mkext for extras␊ |
18 | [ -d "${temp}" ] && rm -R -f "${temp}"␊ |
19 | mkdir -p "${temp}/Extensions"␊ |
20 | ditto --noextattr --noqtn --arch i386 "${2}/.Chameleon/Extra/Extensions" "${temp}/Extensions"␊ |
21 | find "${temp}" -type f -exec chmod 644 {} \;␊ |
22 | find "${temp}" -type d -exec chmod 755 {} \;␊ |
23 | chown -R 0:0 "${temp}"␊ |
24 | kextcache -m "${temp}/Extensions.mkext" "${temp}/Extensions"␊ |
25 | cp -f "${temp}/Extensions.mkext" "${2}/.Chameleon/Extra"␊ |
26 | rm -R -f "${temp}"␊ |
27 | ␊ |
28 | # remove link for extras install␊ |
29 | unlink "${2}/.Chameleon"␊ |
30 | ␊ |
31 | # umount efi partition␊ |
32 | if [ -d /Volumes/EFI ]; then␊ |
33 | ␉umount -f /Volumes/EFI␊ |
34 | ␉rm -R -f /Volumes/EFI␊ |
35 | fi␊ |
36 | ␊ |
37 | exit 0 |