Update e correction for buildme

This commit is contained in:
vectorsigma 2019-09-11 13:13:44 +02:00
parent ff099df45a
commit 622566285c

64
buildme
View File

@ -59,13 +59,12 @@ pathmunge "$TOOLCHAIN_DIR"/bin
export TOOLCHAIN_DIR=$TOOLCHAIN_DIR export TOOLCHAIN_DIR=$TOOLCHAIN_DIR
export DIR_MAIN=${DIR_MAIN:-$(dirname $CLOVERROOT)} export DIR_MAIN=${DIR_MAIN:-$(dirname $CLOVERROOT)}
export DIR_TOOLS=${DIR_TOOLS:-$DIR_MAIN/tools} export DIR_TOOLS=${DIR_TOOLS:-$DIR_MAIN/tools}
export DIR_BUILD=${DIR_BUILD:-$RAMDISK_MNT_PT}
export DIR_DOWNLOADS=${DIR_DOWNLOADS:-$DIR_TOOLS/download} export DIR_DOWNLOADS=${DIR_DOWNLOADS:-$DIR_TOOLS/download}
export DIR_LOGS=${DIR_LOGS:-$DIR_TOOLS/logs} export DIR_LOGS=${DIR_LOGS:-$DIR_TOOLS/logs}
} }
checkTools() { checkTools() {
if [[ "$(uname)" == Darwin && $TOOLCHAIN != GCC* ]]; then if [[ "$(uname)" == Darwin && $MYTOOLCHAIN != GCC* ]]; then
checkXCODE checkXCODE
fi fi
@ -76,9 +75,20 @@ if [[ "$(uname)" == Darwin ]]; then
fi fi
} }
updateCloverTakeTheirs() { updateClover() {
echo "[UPDATE CLOVER]" echo "[UPDATE CLOVER]"
cd "${CLOVERROOT}" cd "${CLOVERROOT}"
if [[ -d .git ]]; then
git fetch --all
git pull 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 if [[ -d .git ]]; then
git fetch --all git fetch --all
git reset --hard origin/master git reset --hard origin/master
@ -88,25 +98,36 @@ else
fi fi
} }
updateCloverTakeYours() {
echo "[UPDATE CLOVER]"
cd "${CLOVERROOT}"
if [[ -d .git ]]; then
git stash
git pull origin master
git stash apply
else
echo "Error: this is not a git repository, can't update!"
fi
}
buildClover() { buildClover() {
checkTools checkTools
cd "${CLOVERROOT}" 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]" echo "[BUILD CLOVER]"
# Run a custom build script if exist (~/src/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
./ebuild.sh -fr -t $MYTOOLCHAIN ./ebuild.sh -fr -t $MYTOOLCHAIN
./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -t $MYTOOLCHAIN ./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -t $MYTOOLCHAIN
fi
# Run a post build script if exist (~/src/tools/Scripts/postbuild.sh)
if [[ -x "${DIR_TOOLS}"/Scripts/postbuild.sh ]]; then
echo "Running postbuild script"
"${DIR_TOOLS}"/Scripts/postbuild.sh
fi
} }
buildPkg() { buildPkg() {
@ -123,7 +144,6 @@ make iso
checkStatus() { checkStatus() {
cd "${CLOVERROOT}" cd "${CLOVERROOT}"
cd "${CLOVERROOT}"
if [[ -d .git ]]; then if [[ -d .git ]]; then
git fetch origin git fetch origin
git status git status
@ -167,8 +187,8 @@ options=( 'build Clover'
'make iso' 'make iso'
'build all' 'build all'
'status' 'status'
'update Clover (discard local changes)' 'update Clover'
'update Clover (stash local changes)' 'update Clover (reset changes)'
'show diff' 'show diff'
'open drivers directory' 'open drivers directory'
'clean BaseTools' 'clean BaseTools'
@ -195,12 +215,12 @@ do
buildIso buildIso
break break
;; ;;
"update Clover (discard local changes)") "update Clover")
updateCloverTakeTheirs updateClover
break break
;; ;;
"update Clover (stash local changes)") "update Clover (reset changes)")
updateCloverTakeYours updateResetClover
break break
;; ;;
"status") "status")