-
Notifications
You must be signed in to change notification settings - Fork 20
/
Decompile.command
executable file
·54 lines (42 loc) · 1.42 KB
/
Decompile.command
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
#!/bin/sh
set -e
export PATH=${PATH}:/usr/local/bin
export LC_ALL="en_US.UTF-8"
patched_dir="/Volumes/EFI/EFI/CLOVER/ACPI/patched"
if [ ! -d "${patched_dir}" ]; then
echo "Please ensure that you've mounted your EFI partition before running this command"
exit 1
fi
function checkInstalledOrInstall {
local name=$1
local check=$2
local install_command=$3
echo "--- 👮 Checking ${name} is installed... \c"
if [ -z "${check}" ]; then
echo "could not find ${name}."
echo "--- 📦 Installing ${name}... \c"
eval $install_command
echo "done."
else
echo "👍"
fi
}
function checkInstalledOrFail {
local name=$1
local check=$2
local fail_message=$3
echo "--- 👮 Checking ${name} is installed... \c"
if [ -z "${check}" ]; then
echo "could not find ${name}."
echo "${fail_message}"
exit 1
else
echo "👍"
fi
}
echo "--- 🕵 Checking for and installing required dependencies"
checkInstalledOrFail "Homebrew" "$(which brew)" "--- 🚫 Stopping. Homebrew could not be found! Please install it from http://brew.sh"
checkInstalledOrInstall "acpica" "$(brew ls --versions acpica)" "brew install acpica --quiet"
echo "--- 🛠 Decompiling AMLs to DSL"
find "$patched_dir" -name "*.aml" -type f -not -name "\._*" -exec sh -c 'f=$(basename $0 .aml); iasl -d -p "Sources/$f.dsl" "$0"' {} \;
echo "--- ✅ Done! Decompiled DSL files have been updated in the 'Sources' directory"