CloverBootloader/buildme

798 lines
22 KiB
Plaintext
Raw Normal View History

2021-05-09 16:12:12 +02:00
#!/bin/bash
# created by vector sigma on July 15 2019
2021-05-10 16:08:11 +02:00
# modified by LAbyOne on My 2021
2021-05-09 16:12:12 +02:00
# github version
# Linux users should be able to use this wrapper, although the following are needed:
# (Ubuntu alike)
# sudo apt-get install build-essential uuid-dev iasl git gcc-10 nasm python3-distutils
# $1 argument override MYTOOLCHAIN variable, in case you want GCC53 for example
# ====== COLORS ======
COL_BLACK="\x1b[30;01m"
COL_RED="\x1b[31;01m"
COL_GREEN="\x1b[32;01m"
COL_YELLOW="\x1b[33;01m"
COL_MAGENTA="\x1b[35;01m"
COL_CYAN="\x1b[36;01m"
COL_WHITE="\x1b[37;01m"
COL_BLUE="\x1b[34;01m"
COL_RESET="\x1b[39;49;00m"
cd "$(dirname $([ -L $0 ] && readlink $0 || echo $0))"
declare -r CLOVERROOT="$PWD"
declare -r SYSNAME="$(uname)"
MYTOOLCHAIN=${1:-GCC53}
2022-02-16 10:26:43 +01:00
revision=$(git describe --tags $(git rev-list --tags --max-count=1))
lsha1="not a git repo"
pyversion=$(echo $COL_CYAN"Installed Python version: "$COL_WHITE$(/usr/local/bin/python3 --version))
pynone=$(echo -e "$COL_RED Python3 seems missing on this machine, it is required to build Clover ")
2022-02-16 10:26:43 +01:00
export DIR_OUT=${DIR_OUT:-"$CLOVERROOT"/toolchain/tools/output}
export DIR_SCT=${DIR_SCT:-${CLOVERROOT}/toolchain/tools/Scripts}
if [[ ! -d ${DIR_SCT} ]] || [[ ! -d ${DIR_OUT} ]]; then
mkdir -p ${DIR_SCT} ${DIR_OUT}
2022-02-16 10:26:43 +01:00
fi
if [[ -d .git ]]; then
lsha1=$(git rev-parse --short HEAD)
fi
2021-05-09 16:12:12 +02:00
# Functions
pathmunge() {
if [[ ! $PATH =~ (^|:)$1(:|$) ]]; then
if [[ "${2:-}" = "after" ]]; then
export PATH=$PATH:$1
else
export PATH=$1:$PATH
fi
fi
}
checkXCODE() {
echo "[CHECK XCODE]"
if [[ ! -x /usr/bin/xcodebuild ]]; then
echo "ERROR: Install Xcode Tools from Apple before using this script."
exit 1
fi
if [[ ! -d "$(xcode-select --print-path)" ]]; then
echo "ERROR: Xcode Command Line Tools not selected:"
echo " open Xcode.app and go in Preferences->Locations,"
echo " and select the Command Line Tools"
exit 1
fi
}
checkGETTEXT() {
exportPaths
local locations=($(which msgmerge))
if [ "${#locations[@]}" -eq 0 ]; then
export GETTEXT_PREFIX="${TOOLCHAIN_DIR}"
"${CLOVERROOT}"/buildgettext.sh
else
# export gettex prefix to ensure buildpkg.sh will use it
# without the need to install it again
export GETTEXT_PREFIX="$(dirname "${locations[0]}")"
fi
}
exportPaths() {
if [[ "$SYSNAME" == Linux ]]; then
TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-/usr}
elif [[ "$SYSNAME" == Darwin ]]; then
pathmunge "$(xcode-select --print-path)"/usr/bin
if [[ -d ~/src/opt/local ]]; then
TOOLCHAIN_DIR=~/src/opt/local
else
TOOLCHAIN_DIR=${TOOLCHAIN_DIR:-"$CLOVERROOT"/toolchain}
fi
fi
pathmunge "$TOOLCHAIN_DIR"/bin
export TOOLCHAIN_DIR=$TOOLCHAIN_DIR
export DIR_MAIN=${DIR_MAIN:-"$CLOVERROOT"/toolchain}
export DIR_TOOLS=${DIR_TOOLS:-$DIR_MAIN/tools}
export DIR_DOWNLOADS=${DIR_DOWNLOADS:-$DIR_TOOLS/download}
export DIR_LOGS=${DIR_LOGS:-$DIR_TOOLS/logs}
export PREFIX=${TOOLCHAIN_DIR}
}
checkTools() {
# export any env vars before building anything
if [[ "$SYSNAME" == Darwin ]]; then
checkXCODE
exportPaths
local GCC53_BIN="$PREFIX/cross/bin/x86_64-clover-linux-gnu-gcc"
if [[ $MYTOOLCHAIN == GCC* ]] && [[ ! -x "${GCC53_BIN}" ]]; then
if [[ $MYTOOLCHAIN == GCC53 ]]; then
cd "${CLOVERROOT}"
./build_gcc12.sh
2021-05-09 16:12:12 +02:00
else
MYTOOLCHAIN=XCODE8
fi
fi
else
exportPaths
fi
}
# Clone OR Update OpenCorePkg
function clone_OpenCorePkg() {
cd "${CLOVERROOT}"
if [ ! -d OpenCorePkg/AppleModels ]; then
echo "Cloning OpenCorePkg...."
git clone https://github.com/CloverHackyColor/OpenCorePkg.git > /dev/null
cd "${OpenCorePkg}"
git submodule update --init
else
echo "Updating OpenCorePkg...."
cd "${OpenCorePkg}"
git pull > /dev/null
fi
}
2021-05-09 16:12:12 +02:00
updateClover() {
echo "[UPDATE CLOVER]"
cd "${CLOVERROOT}"
clone_OpenCorePkg
2021-05-09 16:12:12 +02:00
if [[ -d .git ]]; then
git fetch --all --recurse-submodules
git pull --recurse-submodules origin master
else
echo "Error: this is not a git repository, can't update!"
fi
}
updateResetClover() {
echo "[UPDATE RESET CLOVER]"
cd "${CLOVERROOT}"
if [[ -d .git ]]; then
git fetch --all --recurse-submodules
git submodule foreach --recursive git clean -d -f -f
git clean -d -f -f
git submodule foreach --recursive git reset --hard origin/master
git reset --hard origin/master
git pull --recurse-submodules origin master
else
echo "Error: this is not a git repository, can't update!"
fi
}
buildCloverHFSPlus() {
if [[ -f "${CLOVERROOT}"/FileSystems/HFSPlus/X64/HFSPlus.efi ]]; then
echo "building Clover with HFSPlus"
buildClover HFSPlus
else
echo "${CLOVERROOT}/FileSystems/HFSPlus/X64/HFSPlus.efi: no such file!"
sleep 3
menu
fi
}
2021-10-31 17:19:25 +01:00
makeRelease() {
checkTools
# to force recreation of the Conf folder. You can still use a custom CONF_PATH if you don't want recreation.
rm -rf "$CLOVERROOT"/Conf
mkdir "$CLOVERROOT"/Conf
cd "${CLOVERROOT}"
if [[ -z "$WORKSPACE" ]]; then
export EDK_TOOLS_PATH="${PWD}"/BaseTools
set +u
source ./edksetup.sh BaseTools
set -u
cd "$CLOVERROOT"
WORKSPACE="${PWD}"
fi
echo "[BUILD CLOVER RELEASE]"
./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -t $MYTOOLCHAIN
./ebuild.sh -fr -D NO_GRUB_DRIVERS_EMBEDDED -D LESS_DEBUG -t $MYTOOLCHAIN
# Run a post build script if exist (${DIR_TOOLS}/CloverScripts/postbuild.sh)
if [[ -x "${DIR_TOOLS}"/CloverScripts/postbuild.sh ]]; then
echo "Running Clover postbuild script"
"${DIR_TOOLS}"/CloverScripts/postbuild.sh "${CLOVERROOT}" $MYTOOLCHAIN
fi
2021-10-31 17:19:25 +01:00
}
2021-05-09 16:12:12 +02:00
buildCCPV() {
cd "${CLOVERROOT}"/Xcode/CloverConfigPlistValidator
make
2021-05-09 16:12:12 +02:00
}
BLC() {
if [[ ! -d "${CLOVERROOT}"/CloverPackage/BootLoaderChooser ]]; then
2021-05-24 04:10:02 +02:00
mkdir -p "${CLOVERROOT}"/CloverPackage/BootLoaderChooser
2021-05-09 16:12:12 +02:00
fi
curl -sLq https://github.com/jief666/BootloaderChooser/releases/download/0.5/BootX64.efi > "${CLOVERROOT}"/CloverPackage/BootLoaderChooser/BootX64.efi
chmod 775 "${CLOVERROOT}"/CloverPackage/BootLoaderChooser/BootX64.efi
}
buildClover() {
checkTools
# to force recreation of the Conf folder. You can still use a custom CONF_PATH if you don't want recreation.
rm -rf "$CLOVERROOT"/Conf
mkdir "$CLOVERROOT"/Conf
cd "${CLOVERROOT}"
if [[ -z "$WORKSPACE" ]]; then
export EDK_TOOLS_PATH="${PWD}"/BaseTools
set +u
source ./edksetup.sh BaseTools
set -u
cd "$CLOVERROOT"
WORKSPACE="${PWD}"
fi
echo "[BUILD CLOVER]"
# Run a custom build script if exist (${DIR_TOOLS}/Scripts/build.sh)
# This allow the user to run ebuild.sh with own parameters
if [[ -x "${DIR_TOOLS}"/Scripts/build.sh ]]; then
echo "Running custom build script"
"${DIR_TOOLS}"/Scripts/build.sh "${CLOVERROOT}" $MYTOOLCHAIN
else
local parameter=${1:-none}
if [[ "${parameter}" == HFSPlus ]]; then
#./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -D USE_APPLE_HFSPLUS_DRIVER -t $MYTOOLCHAIN
./ebuild.sh -fr -D NO_GRUB_DRIVERS_EMBEDDED -D USE_APPLE_HFSPLUS_DRIVER -t $MYTOOLCHAIN
else
#./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -t $MYTOOLCHAIN
./ebuild.sh -fr -D NO_GRUB_DRIVERS_EMBEDDED -D LESS_DEBUG -t $MYTOOLCHAIN
fi
fi
# Run a post build script if exist (${DIR_TOOLS}/CloverScripts/postbuild.sh)
if [[ -x "${DIR_TOOLS}"/CloverScripts/postbuild.sh ]]; then
echo "Running Clover postbuild script"
"${DIR_TOOLS}"/CloverScripts/postbuild.sh "${CLOVERROOT}" $MYTOOLCHAIN
fi
# Run a custom post build script if exist (${DIR_TOOLS}/Scripts/postbuild.sh)
if [[ -x "${DIR_TOOLS}"/Scripts/postbuild.sh ]]; then
echo "Running postbuild script"
"${DIR_TOOLS}"/Scripts/postbuild.sh "${CLOVERROOT}" $MYTOOLCHAIN
fi
2021-05-09 16:12:12 +02:00
}
buildtestsix() {
checkTools
# to force recreation of the Conf folder. You can still use a custom CONF_PATH if you don't want recreation.
rm -rf "$CLOVERROOT"/Conf
mkdir "$CLOVERROOT"/Conf
cd "${CLOVERROOT}"
echo "[BUILD CLOVERDB]"
./hebuild.sh
}
buildtestsev() {
checkTools
# to force recreation of the Conf folder. You can still use a custom CONF_PATH if you don't want recreation.
rm -rf "$CLOVERROOT"/Conf
mkdir "$CLOVERROOT"/Conf
cd "${CLOVERROOT}"
echo "[BUILD CLOVERDB]"
./ebuild.sh -t GCC53 -mc
}
2021-05-09 16:12:12 +02:00
buildCloverTest() {
checkTools
cd "${CLOVERROOT}"
if [[ -z "$WORKSPACE" ]]; then
export EDK_TOOLS_PATH="${PWD}"/BaseTools
set +u
source ./edksetup.sh BaseTools
set -u
cd "$CLOVERROOT"
WORKSPACE="${PWD}"
fi
echo "[BUILD CLOVER TEST]"
./ebuild.sh -nb -t $MYTOOLCHAIN
}
buildPkg() {
if [[ "$SYSNAME" == Darwin ]]; then
cd "${CLOVERROOT}"/CloverPackage
echo "[BUILD PKG]"
checkXCODE
checkGETTEXT
make pkg
else
echo && echo "can't build pkg on a non Darwin OS!"
fi
}
buildApp() {
local withClover=${1-"none"}
if [[ "$SYSNAME" == Darwin ]]; then
if [[ -f "${CLOVERROOT}"/CloverPackage/CloverV2/EFI/CLOVER/CLOVERX64.efi ]]; then
rm -f "${CLOVERROOT}"/CloverPackage/sym/.withV2
mkdir -p "${CLOVERROOT}"/CloverPackage/sym
if [[ $withClover == withV2 ]]; then
touch "${CLOVERROOT}"/CloverPackage/sym/.withV2
fi
cd "${CLOVERROOT}"/CloverApp
echo "[BUILD APP]"
checkXCODE
make
else
echo && echo "please, build Clover first!"
sleep 3
fi
else
echo && echo "Clover.app can only be built in macOS!"
fi
}
buildIso() {
cd "${CLOVERROOT}"/CloverPackage
echo "[BUILD ISO]"
make iso
2021-05-09 16:12:12 +02:00
}
makeV2() {
cd "${CLOVERROOT}"/CloverPackage
echo "[BUILD CloverV2]"
make zip
}
2021-05-09 16:12:12 +02:00
checkStatus() {
if [[ -d .git ]]; then
git fetch --recurse-submodules origin
git log -n 1 > "${DIR_OUT}"/status_${revision}-$(date +%Y%m%d-%H.%M.%S).txt
git status >> "${DIR_OUT}"/status_${revision}-$(date +%Y%m%d-%H.%M.%S).txt
git submodule foreach --recursive "git log -n 1 && git status" >> "${DIR_OUT}"/status_${revision}-$(date +%Y%m%d-%H.%M.%S).txt && open "${DIR_OUT}"/status_${revision}-*.txt
else
echo "Error: this is not a git repository, can't get info!"
fi
2021-05-09 16:12:12 +02:00
}
showdiff() {
if [[ -d .git ]]; then
git fetch --recurse-submodules origin
git diff > "${DIR_OUT}"/diff_${revision}-$(date +%Y%m%d-%H.%M.%S).txt && open "${DIR_OUT}"/diff_${revision}-*.txt
else
echo "Error: this is not a git repository, can't get info!"
fi
2021-05-09 16:12:12 +02:00
}
cleanBaseTools() {
cd "${CLOVERROOT}"/BaseTools
make clean
}
## Utilities
buildCPV() {
2022-02-16 10:26:43 +01:00
revision=r$(git describe --tags $(git rev-list --tags --max-count=1))
if [[ -d "${CLOVERROOT}"/CloverPackage/CloverConfigPlistValidator ]]; then
rm -Rf "${CLOVERROOT}"/CloverPackage/CloverConfigPlistValidator
fi
mkdir -p "${CLOVERROOT}"/CloverPackage/CloverConfigPlistValidator
cd "${CLOVERROOT}"/Xcode/CloverConfigPlistValidator
checkXCODE
xcodebuild -project ./CloverConfigPlistValidator.xcodeproj -quiet CONFIGURATION_BUILD_DIR="${CLOVERROOT}"/CloverPackage/CloverConfigPlistValidator
mv -f "${CLOVERROOT}"/CloverPackage/CloverConfigPlistValidator/CloverConfigPlistValidator "${CLOVERROOT}"/CloverPackage/CloverConfigPlistValidator/CloverConfigPlistValidator_${revision}
rm -r "${CLOVERROOT}"/CloverPackage/CloverConfigPlistValidator/*.dSYM
open "${CLOVERROOT}"/CloverPackage/CloverConfigPlistValidator
2021-05-09 16:12:12 +02:00
}
PlistEDPlus() {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils
fi
cd $HOME/Desktop/ClovUtils && curl -qsSLk https://github.com/ic005k/PlistEDPlus/releases/download/1.2.35/PlistEDPlus_Mac.dmg > PlistEDPlus_Mac.dmg
hdiutil attach -quiet -noverify -nobrowse PlistEDPlus_Mac.dmg && cp -Rf /Volumes/bin\:release\:PlistEDPlus/PlistEDPlus.app $HOME/Desktop/ClovUtils
hdiutil detach -force /Volumes/bin\:release\:PlistEDPlus
rm -r $HOME/Desktop/ClovUtils/PlistEDPlus_Mac.dmg && open $HOME/Desktop/ClovUtils
2021-05-09 16:12:12 +02:00
}
Hackintool() {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils
fi
cd $HOME/Desktop/ClovUtils && curl -sLq https://github.com/headkaze/Hackintool/releases/download/3.8.4/Hackintool.zip -o Hackintool.zip
unzip -q Hackintool.zip && rm -r Hackintool.zip && open $HOME/Desktop/ClovUtils
2021-05-09 16:12:12 +02:00
}
BitmaskDecode() {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils
fi
cd $HOME/Desktop/ClovUtils && git clone -q https://github.com/corpnewt/BitmaskDecode && open $HOME/Desktop/ClovUtils
2021-05-09 16:12:12 +02:00
}
MaciASL() {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils
fi
cd $HOME/Desktop/ClovUtils && curl -sLq https://github.com/acidanthera/MaciASL/releases/download/1.6.2/MaciASL-1.6.2-RELEASE.dmg > MaciASL-1.6.2-RELEASE.dmg
hdiutil attach -quiet -noverify -nobrowse MaciASL-1.6.2-RELEASE.dmg && cp -Rf /Volumes/MaciASL/MaciASL.app $HOME/Desktop/ClovUtils
hdiutil detach -force /Volumes/MaciASL
rm -r $HOME/Desktop/ClovUtils/MaciASL-1.6.2-RELEASE.dmg && open $HOME/Desktop/ClovUtils
2021-05-09 16:12:12 +02:00
}
dmidecode() {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils/dmidecode
fi
cd $HOME/Desktop/ClovUtils && git clone -q https://github.com/acidanthera/dmidecode dmi-decode && xcodebuild -project ./dmi-decode/dmidecode.xcodeproj -quiet
cp -r dmi-decode/dmidecode $HOME/Desktop/ClovUtils/dmidecode && rm -Rf $HOME/Desktop/ClovUtils/dmi-decode && open $HOME/Desktop/ClovUtils
2021-05-09 16:12:12 +02:00
}
Get-IOReg-Devices() {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils
fi
cd $HOME/Desktop/ClovUtils && git clone -q https://github.com/LAbyOne/Get-IOReg-Devices
mv -f Get-IOReg-Devices/Get\ IOReg\ Devices $HOME/Desktop/ClovUtils/Get\ IOReg-Devices && chmod a+x $HOME/Desktop/ClovUtils/Get\ IOReg-Devices/*.command
rm -rf Get-IOReg-Devices && open $HOME/Desktop/ClovUtils
2021-05-09 16:12:12 +02:00
}
NDBrightness () {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils
fi
cd $HOME/Desktop/ClovUtils && git clone -q https://github.com/KAMIKAZEUA/NativeDisplayBrightness NDBrightness
xcodebuild -project ./NDBrightness/NativeDisplayBrightness.xcodeproj -quiet -configuration Release clean build ARCHS=x86_64 ONLY_ACTIVE_ARCH=YES CONFIGURATION_BUILD_DIR=$HOME/Desktop/ClovUtils
rm -Rf $HOME/Desktop/ClovUtils/NDBrightness && rm -r $HOME/Desktop/ClovUtils/*.dSYM && open $HOME/Desktop/ClovUtils
2021-05-09 16:12:12 +02:00
}
SSDTTime() {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils
fi
cd $HOME/Desktop/ClovUtils && git clone -q https://github.com/corpnewt/SSDTTime && open $HOME/Desktop/ClovUtils
2021-05-09 16:12:12 +02:00
}
USBMap() {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils
fi
cd $HOME/Desktop/ClovUtils && git clone -q https://github.com/corpnewt/USBMap
open $HOME/Desktop/ClovUtils
2021-05-09 16:12:12 +02:00
}
Xiasl() {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils
fi
cd $HOME/Desktop/ClovUtils && curl -sLq https://github.com/ic005k/Xiasl/releases/download/1.1.66/Xiasl_Mac.dmg > Xiasl_Mac.dmg
2022-02-16 10:26:43 +01:00
hdiutil attach -quiet -noverify -nobrowse Xiasl_Mac.dmg && cp -Rf /Volumes/bin\:release\:Xiasl/Xiasl.app $HOME/Desktop/ClovUtils
hdiutil detach -force /Volumes/bin\:release\:Xiasl
2022-02-16 10:26:43 +01:00
rm -r $HOME/Desktop/ClovUtils/Xiasl_Mac.dmg && open $HOME/Desktop/ClovUtils
2021-05-09 16:12:12 +02:00
}
CsrDecode() {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils/CsrDecode
fi
cd $HOME/Desktop/ClovUtils && git clone -q https://github.com/corpnewt/CsrDecode && open $HOME/Desktop/ClovUtils
2021-05-09 16:12:12 +02:00
}
gibMacOS() {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils
fi
cd $HOME/Desktop/ClovUtils && git clone -q https://github.com/corpnewt/gibMacOS && open $HOME/Desktop/ClovUtils
2021-05-09 16:12:12 +02:00
}
2021-10-07 19:11:18 +02:00
mountR/W() {
2022-02-16 10:26:43 +01:00
if [[ ! -d $HOME/Desktop/ClovUtils ]]; then
mkdir -p $HOME/Desktop/ClovUtils
fi
cd $HOME/Desktop/ClovUtils && curl -sLq https://github.com/jacklukem/BigSurmountsrw/releases/download/1.0/BigSurmountsrw2.app.zip -o BigSurmountsrw2.app.zip && open $HOME/Desktop/ClovUtils
unzip -q $HOME/Desktop/ClovUtils/BigSurmountsrw2.app.zip && rm -r $HOME/Desktop/ClovUtils/BigSurmountsrw2.app.zip $HOME/Desktop/ClovUtils/__MACOSX
}
2021-10-07 19:11:18 +02:00
testing() {
2021-05-24 04:10:02 +02:00
clear
echo
2022-02-16 10:26:43 +01:00
echo -e $COL_GREEN" ------------------------------------------------------------------------------"
echo -e " 🍀 Clover r${revision}$COL_WHITE (SHA: $lsha1)"
echo -e $COL_CYAN" Test Builds"
echo -e $COL_GREEN" ------------------------------------------------------------------------------"$COL_RESET
echo -e "\n\n\n\n\n\n\n\n\n\n\n"
PS3='
Please enter your choice: '
options=( 'test Clover with boot6'
'test Clover with boot7'
2021-05-24 04:26:03 +02:00
'test build (no autogen, no boot files)'
'back to buildme'
2021-05-24 04:26:03 +02:00
'quit')
select opt in "${options[@]}"
do
case $opt in
"test Clover with boot6")
buildtestsix
2021-05-24 04:10:02 +02:00
break
;;
"test Clover with boot7")
buildtestsev
2021-05-24 04:10:02 +02:00
break
;;
"test build (no autogen, no boot files)")
2021-05-25 16:08:30 +02:00
buildCloverTest
2021-05-24 04:10:02 +02:00
break
;;
"back to buildme")
menu
2021-05-24 04:10:02 +02:00
break
;;
"quit")
exit
2021-05-24 04:10:02 +02:00
break
;;
*)
2021-05-24 04:10:02 +02:00
echo "invalid option $REPLY"
break
;;
esac
done
testing
}
2021-05-09 16:12:12 +02:00
Utilities() {
echo
2022-02-16 10:26:43 +01:00
echo -e $COL_GREEN" ------------------------------------------------------------------------------"
echo -e " 🍀 Clover r${revision}$COL_WHITE (SHA: $lsha1)"
echo -e $COL_CYAN" External Utilities "
echo -e $COL_GREEN" ------------------------------------------------------------------------------"$COL_RESET
echo -e "\n\n\n\n\n\n\n\n"
2021-05-09 16:12:12 +02:00
PS3='
Files will be put on Desktop/ClovUtils: '
options=( 'Get CloverConfigPlistValidator '
'Get PlistEDPlus '
'Get Hackintool '
'Get BitmaskDecode '
'Get MaciASL '
'Get dmidecode '
'Get IOReg-Devices '
'Get NativeDisplayBrightness '
2021-05-24 04:18:43 +02:00
'Get SSDTTime'
'Get USBMap'
'Get Xiasl'
2021-05-24 04:18:43 +02:00
'Get CsrDecode'
'Get gibMacOS'
'Get mountR/W'
'back to buildme'
2021-05-24 04:18:43 +02:00
'quit')
2021-05-09 16:12:12 +02:00
select opt in "${options[@]}"
do
case $opt in
"Get CloverConfigPlistValidator ")
2021-05-09 16:12:12 +02:00
buildCPV
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"Get PlistEDPlus ")
2021-05-09 16:12:12 +02:00
PlistEDPlus
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"Get Hackintool ")
2021-05-09 16:12:12 +02:00
Hackintool
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"Get BitmaskDecode ")
2021-05-09 16:12:12 +02:00
BitmaskDecode
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"Get MaciASL ")
2021-05-09 16:12:12 +02:00
MaciASL
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"Get dmidecode ")
2021-05-09 16:12:12 +02:00
dmidecode
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"Get IOReg-Devices ")
2021-05-09 16:12:12 +02:00
Get-IOReg-Devices
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"Get NativeDisplayBrightness ")
2021-05-09 16:12:12 +02:00
NDBrightness
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"Get SSDTTime")
SSDTTime
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"Get USBMap")
USBMap
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"Get Xiasl")
Xiasl
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"Get CsrDecode")
CsrDecode
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"Get gibMacOS")
gibMacOS
2021-05-24 04:10:02 +02:00
break
2021-05-09 16:12:12 +02:00
;;
2021-10-07 19:11:18 +02:00
"Get mountR/W")
mountR/W
break
;;
2021-05-10 16:50:41 +02:00
"back to buildme")
2021-05-09 16:12:12 +02:00
menu
2021-05-24 04:10:25 +02:00
break
2021-05-09 16:12:12 +02:00
;;
"quit")
exit
2021-05-24 04:10:02 +02:00
break
;;
2021-05-09 16:12:12 +02:00
*)
2021-05-24 04:10:02 +02:00
echo "invalid option $REPLY"
2021-05-09 16:12:12 +02:00
break
;;
esac
done
Utilities
}
menu() {
echo
2022-02-16 10:26:43 +01:00
echo -e $COL_GREEN" ------------------------------------------------------------------------------"
2022-10-18 18:45:30 +02:00
if [[ ! -x "/usr/local/bin/python3" ]]; then
echo -e " ${pynone}"
fi
echo -e "$COL_GREEN 🍀 Clover r${revision}$COL_WHITE (SHA: $lsha1)"
2022-02-16 10:26:43 +01:00
echo -e "$COL_CYAN TOOLCHAIN: $MYTOOLCHAIN (override example: './buildme XCODE8')"
2022-10-18 18:45:30 +02:00
if [[ -x "/usr/local/bin/python3" ]]; then
echo -e $COL_GREEN" ------------------- ${pyversion}$COL_GREEN ------------------ "$COL_RESET
2022-10-18 18:45:30 +02:00
echo -e "\n\n\n\n\n\n\n\n"
else
echo -e $COL_GREEN" ------------------------------------------------------------------------------"$COL_RESET
echo -e "\n\n\n\n\n\n\n"
fi
2021-05-09 16:12:12 +02:00
PS3='
Please enter your choice: '
options=( 'build Clover'
'update Clover'
2021-05-09 16:12:12 +02:00
'build Clover with HFSPlus'
'make pkg'
2021-05-09 16:12:12 +02:00
'make iso'
2021-10-31 17:19:25 +01:00
'make app'
2021-05-09 16:12:12 +02:00
'build all'
2021-10-31 17:19:25 +01:00
'make Release'
2021-05-24 04:10:02 +02:00
'test Clover'
2021-10-31 17:19:25 +01:00
'check status'
2021-05-09 16:12:12 +02:00
'show diff'
'open CloverV2/EFI/CLOVER directory'
'update Clover (reset changes)'
'clean BaseTools'
'Utilities'
'quit')
select opt in "${options[@]}"
do
case $opt in
"build Clover")
buildClover
break
;;
"update Clover")
updateClover
2021-05-09 16:12:12 +02:00
break
;;
"build Clover with HFSPlus")
buildCloverHFSPlus
2021-05-09 16:12:12 +02:00
break
;;
"make pkg")
2021-05-24 04:10:02 +02:00
buildCCPV
BLC
buildPkg
2021-05-09 16:12:12 +02:00
break
;;
2021-10-31 17:19:25 +01:00
"make iso")
buildIso
2021-05-09 16:12:12 +02:00
break
;;
2021-10-31 17:19:25 +01:00
"make app")
2021-05-09 16:12:12 +02:00
buildApp withV2
break
;;
2021-10-31 17:19:25 +01:00
# "make app (with Clover)")
# buildApp withV2
# break
# ;;
"build all")
buildClover
buildCCPV
BLC
buildPkg
buildIso
makeV2
2021-05-09 16:12:12 +02:00
break
;;
2021-10-31 17:19:25 +01:00
"make Release")
makeRelease
2021-05-24 04:10:02 +02:00
buildCCPV
BLC
2021-05-09 16:12:12 +02:00
buildPkg
buildIso
makeV2
2021-05-09 16:12:12 +02:00
break
;;
"test Clover")
testing
break
;;
2021-10-31 17:19:25 +01:00
"check status")
2021-05-09 16:12:12 +02:00
checkStatus
break
;;
"show diff")
showdiff
2021-05-09 16:12:12 +02:00
break
;;
"open CloverV2/EFI/CLOVER directory")
if [[ -d "${CLOVERROOT}"/CloverPackage/CloverV2/EFI/CLOVER ]]; then
open "${CLOVERROOT}"/CloverPackage/CloverV2/EFI/CLOVER
else
echo && echo "Directory not found. Compile Clover first!!"
sleep 2
fi
break
;;
"update Clover (reset changes)")
read -p "Are you sure? (type y to confirm or any other to negate) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
updateResetClover
fi
break
2021-05-24 04:18:43 +02:00
;;
2021-05-09 16:12:12 +02:00
"clean BaseTools")
read -p "Are you sure? (type y to confirm or any other to negate) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
cleanBaseTools
fi
break
;;
"Utilities")
2021-05-24 04:10:25 +02:00
Utilities
2021-05-09 16:12:12 +02:00
break
;;
"quit")
exit 0
;;
*)
echo "invalid option $REPLY"
break
;;
esac
done
menu
}
# Main
clone_OpenCorePkg
2021-05-09 16:12:12 +02:00
set -e
if [[ "$2" == ci ]]; then
clone_OpenCorePkg
2021-05-09 16:12:12 +02:00
buildClover
2021-05-24 04:10:02 +02:00
buildCCPV
BLC
2021-05-09 16:12:12 +02:00
buildPkg
buildIso
buildApp
else
clone_OpenCorePkg
2021-05-09 16:12:12 +02:00
menu
fi