forked from acidanthera/OpenCorePkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macbuild.tool
executable file
·85 lines (78 loc) · 2.84 KB
/
macbuild.tool
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
package() {
if [ ! -d "$1" ]; then
echo "Missing package directory"
exit 1
fi
local ver=$(cat Include/OpenCore.h | grep OPEN_CORE_VERSION | sed 's/.*"\(.*\)".*/\1/' | grep -E '^[0-9.]+$')
if [ "$ver" = "" ]; then
echo "Invalid version $ver"
fi
selfdir=$(pwd)
pushd "$1" || exit 1
rm -rf tmp || exit 1
mkdir -p tmp/EFI || exit 1
mkdir -p tmp/EFI/OC || exit 1
mkdir -p tmp/EFI/OC/ACPI || exit 1
mkdir -p tmp/EFI/OC/Drivers || exit 1
mkdir -p tmp/EFI/OC/Kexts || exit 1
mkdir -p tmp/EFI/OC/Tools || exit 1
mkdir -p tmp/EFI/BOOT || exit 1
mkdir -p tmp/Docs/AcpiSamples || exit 1
mkdir -p tmp/Utilities || exit 1
cp BootKicker.efi tmp/EFI/OC/Tools/ || exit 1
cp BOOTx64.efi tmp/EFI/BOOT/ || exit 1
cp ChipTune.efi tmp/EFI/OC/Tools/ || exit 1
cp CleanNvram.efi tmp/EFI/OC/Tools/ || exit 1
cp GopStop.efi tmp/EFI/OC/Tools/ || exit 1
cp HdaCodecDump.efi tmp/EFI/OC/Tools/ || exit 1
cp HiiDatabase.efi tmp/EFI/OC/Drivers/ || exit 1
cp KeyTester.efi tmp/EFI/OC/Tools/ || exit 1
cp NvmExpressDxe.efi tmp/EFI/OC/Drivers/ || exit 1
cp OpenCanopy.efi tmp/EFI/OC/Drivers/ || exit 1
cp OpenControl.efi tmp/EFI/OC/Tools/ || exit 1
cp OpenCore.efi tmp/EFI/OC/ || exit 1
cp OpenRuntime.efi tmp/EFI/OC/Drivers/ || exit 1
cp OpenUsbKbDxe.efi tmp/EFI/OC/Drivers/ || exit 1
cp Shell.efi tmp/EFI/OC/Tools/OpenShell.efi || exit 1
cp VerifyMsrE2.efi tmp/EFI/OC/Tools/ || exit 1
cp XhciDxe.efi tmp/EFI/OC/Drivers/ || exit 1
cp "${selfdir}/Docs/Configuration.pdf" tmp/Docs/ || exit 1
cp "${selfdir}/Docs/Differences/Differences.pdf" tmp/Docs/ || exit 1
cp "${selfdir}/Docs/Sample.plist" tmp/Docs/ || exit 1
cp "${selfdir}/Docs/SampleFull.plist" tmp/Docs/ || exit 1
cp "${selfdir}/Changelog.md" tmp/Docs/ || exit 1
cp -r "${selfdir}/Docs/AcpiSamples/" tmp/Docs/AcpiSamples/ || exit 1
cp -r "${selfdir}/Utilities/BootInstall" tmp/Utilities/ || exit 1
cp -r "${selfdir}/Utilities/CreateVault" tmp/Utilities/ || exit 1
cp -r "${selfdir}/Utilities/LogoutHook" tmp/Utilities/ || exit 1
pushd tmp || exit 1
zip -qry -FS ../"OpenCore-${ver}-${2}.zip" * || exit 1
popd || exit 1
rm -rf tmp || exit 1
popd || exit 1
}
cd $(dirname "$0")
ARCHS=(X64 IA32)
SELFPKG=OpenCorePkg
DEPNAMES=('EfiPkg' 'MacInfoPkg')
DEPURLS=('https://github.com/acidanthera/EfiPkg' 'https://github.com/acidanthera/MacInfoPkg')
DEPBRANCHES=('master' 'master')
src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/ocbuild/master/efibuild.sh) && eval "$src" || exit 1
if [ "$BUILD_UTILITIES" = "1" ]; then
UTILS=(
"AppleEfiSignTool"
"EfiResTool"
"disklabel"
"RsaTool"
)
cd Utilities || exit 1
for util in "${UTILS[@]}"; do
cd "$util" || exit 1
make || exit 1
cd - || exit 1
done
cd .. || exit 1
fi
cd Library/OcConfigurationLib || exit 1
./CheckSchema.py OcConfigurationLib.c || exit 1