Jump to content

Build_Clover.command, another Script to build standard Clover (or customized)


Micky1979
2,126 posts in this topic

Recommended Posts

3 hours ago, Slice said:

I am lazy to do this as I see no profit.

If someone do this then I will agree.

Trying cost nothing. next days (next next next) I'll try to setup a test repo with Clover on git to se if that is easy for every one.

  • Like 2
Link to comment
Share on other sites

50 minutes ago, vector sigma said:

Trying cost nothing. next days (next next next) I'll try to setup a test repo with Clover on git to se if that is easy for every one.

Is there anything we can do to help?

  • Like 1
Link to comment
Share on other sites

Updated to v 4.8.1

is it normal it stay stuck for about 1 min then it takes forever to download updated revisons?

[edit] now 6 min later still downloading :P omg

Edited by LAbyOne
updated comment
  • Like 1
Link to comment
Share on other sites

4 minutes ago, LAbyOne said:

Updated to v 4.8.1

is it normal it stay stuck for about 1 min then it takes forever to download updated revisons?

[edit] now 6 min later still downloading :P omg

Yesterday, I've same problem: maybe Source-forge very slow 

Link to comment
Share on other sites

Guest ricoc90
6 minutes ago, LAbyOne said:

Updated to v 4.8.1

is it normal it stay stuck for about 1 min then it takes forever to download updated revisons?

[edit] now 6 min later still downloading :P omg

It takes some time for me too, however not that long... :lol:

Link to comment
Share on other sites

4 hours ago, vector sigma said:

Trying cost nothing. next days (next next next) I'll try to setup a test repo with Clover on git to se if that is easy for every one.

Ever heard of opportunity cost? He's saying he doesn't have time to implement such a non-vital, unneeded thing. The current Clover repo works perfectly fine, this was about the EDK2 repos and really has nothing to do with Clover as a project. This is topic is for a third-party script tool to automate build or help you build if you can not do it yourself.

Link to comment
Share on other sites

2 hours ago, apianti said:

Ever heard of opportunity cost? He's saying he doesn't have time to implement such a non-vital, unneeded thing. The current Clover repo works perfectly fine, this was about the EDK2 repos and really has nothing to do with Clover as a project. This is topic is for a third-party script tool to automate build or help you build if you can not do it yourself.

Sir, you are assuming that Slice only read your posts and talk only with you. Was also mentioned to have a version number with git that sure isn't necessary for edk2 so "cost nothing" meant demostrate that having it is possible but of course no one is asking you to switch to git. About sf that works perfectly, what to say:

On 1/4/2018 at 6:24 AM, apianti said:

Why don't you just start using the git version of the repo from github, the one on SF is terrible. The reason it has issues is because it's a badly synced svn mirror of the git repo.

EDIT: I only use the git repo of EDK2, and might explain why I haven't been having issues when others have been. The clover repo should be fine but the EDK2 repo on SF sucks since they moved to git.

the problem isn't the mirror per se, but sf is...as demostrated by all here. (not edk2 or Clover only but also any other repos on those server(s))

Link to comment
Share on other sites

13 hours ago, vector sigma said:

Sir, you are assuming that Slice only read your posts and talk only with you. Was also mentioned to have a version number with git that sure isn't necessary for edk2 so "cost nothing" meant demostrate that having it is possible but of course no one is asking you to switch to git. About sf that works perfectly, what to say:

the problem isn't the mirror per se, but sf is...as demostrated by all here. (not edk2 or Clover only but also any other repos on those server(s))

I am assuming that this topic is for a third party build script that has nothing to do with the actual clover project because that's what it is, and you suggested changing a bunch of stuff to do with the clover repo. The problem with the build script (which once again is not part of clover) is the mirroring of the EDK2 github repo to SF, not git versus svn. I provided the method to get the exact number of commits in a branch of git, it should be exactly the same as the commits in svn. It also doesn't even matter as long as you know which commit you need as the current recommended - that's all that matters. But I have never used the recommended commit once, I always updated to the newest EDK2 commit and have never had a problem, I really don't even think it's necessary. In addition, it's not like you could check out any previous version of clover and know which revision was recommended. The whole problem is that instead of providing patches (which are really just clover sources copied over existing sources in the EDK2), we should have moved the libraries to fix the issues inside the project and overrode the library classes and includes. One last thing, you also still don't seem to understand what opportunity cost is, you say it "cost nothing" but that is untrue. It costs time, effort, and giving up doing something else in that time that may be more beneficial to the project. Which is why he made the point if any developer is willing to do it, and I doubt any are because it would involve a huge time consuming process. I should know because I am currently trying to make the build process much easier and switch to git for v3... Which means there's even less incentive to perform any sort of dramatic overhaul on v2.

  • Like 2
Link to comment
Share on other sites

14 hours ago, apianti said:

The whole problem is that instead of providing patches (which are really just clover sources copied over existing sources in the EDK2), we should have moved the libraries to fix the issues inside the project and overrode the library classes and includes

Ok now you're talking clear

14 hours ago, apianti said:

One last thing, you also still don't seem to understand what opportunity cost is, you say it "cost nothing" but that is untrue.

Well, I'm Italian and I admit that I can probably mach a "sentence made" or wordings that for a native english man means other

   13 hours ago,  apianti said: 

It costs time, effort, and giving up doing something else in that time that may be more beneficial to the project. Which is why he made the point if any developer is willing to do it, and I doubt any are because it would involve a huge time consuming process. I should know because I am currently trying to make the build process much easier and switch to git for v3

I want to tell is that there's no effort here from me because all I can done is for my personal pleasure and my relax:) (I have a chaotic job). may be that some time I talk too much.. but it's a personal defect:hysterical:. I've understood your point.

Edited by vector sigma
  • Like 2
Link to comment
Share on other sites

3 hours ago, vector sigma said:

I want to tell is that there's no effort here from me because all I can done is for my personal pleasure and my relax:) (I have a chaotic job). may be that some time I talk too much.. but it's a personal defect:hysterical:. I've understood your point.

I also do this in my free time, as most everyone who is involved does, but once again that's an opportunity cost. I can choose to code v2 or I can choose to code for v3/other projects, play guitar/piano/other instruments, hang out with friends, play video games, watch tv/movies, or work more, etc. I can only perform so many of those tasks at once and most of those are mutually exclusive if you really want to do one, so basically I have to give up the opportunity to work, do a different hobby or be able to relax in order to code for v2. There is an opportunity cost to everything, its just a basic fact of life and principle of economics. Saying there's no effort makes it sound like you don't care, not that it is not doable, it obviously is. My whole point was that the opportunity cost is too high to make it worthwhile for any of the developers to do, it may not be for you but that's pretty much irrelevant because I don't think you would think the same way if you realized what the true scope and amount of work it would actually take is....

Now back to the actual topic here, the third party build script. You know if you guys aren't actually developing using the repos, you are actually better off just trying to figure out what the remote repo version is (which is easy for both svn and git), compare that it's newer than the previous version stored somewhere, then do not check out the repos but instead request the zipped archive (through svn or git) and unzip like you were checking it out instead. It will save an immense amount of time because you are not downloading the entire commit history of the source, only the source as it is at that commit. Also switch to using the github git repo for EDK2.

  • Like 2
Link to comment
Share on other sites

  • 1 month later...
2 hours ago, STLVNUB said:

Need to change build_gcc7.sh to build_gcc8.sh to compile 4456

 

 

No, I think I just made a mistake. Please try 4457.

 

EDIT: Oh nevermind, you were talking about the script was renamed.

 

@Zenith432

Why not have all versions? Why only have the one version of GCC to build? Is there any reason to constantly upgrade the script to the newest version? Or can't you just create a script that uses arguments to build different versions? I guess my main question is does the user need to be forced to upgrade GCC? It still builds with older versions does it not?

Edited by apianti
  • Haha 1
Link to comment
Share on other sites

  • 2 weeks later...

@SavageAUS, Matgen84:

You haven't posted build logs, but it's most likely because of the change to UDK2018 breaks build with EDK2.  To build with EDK2, revert the changes to

Patches_for_EDK2/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c

Patches_for_EDK2/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c

introduced in r4472

  • Like 1
Link to comment
Share on other sites

1 hour ago, Zenith432 said:
@SavageAUS, Matgen84:
You haven't posted build logs, but it's most likely because of the change to UDK2018 breaks build with EDK2.  To build with EDK2, revert the changes to
Patches_for_EDK2/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c
Patches_for_EDK2/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
introduced in r4472

My apologies, I was feeding my baby when it happened hence the lack of log, just a quick copy and paste to inform others of an error.
How do I revert the changes?

Sent from my SM-G930F using Tapatalk
 

log.rtf

Edited by SavageAUS
Attached Log
  • Like 1
Link to comment
Share on other sites

9 hours ago, Zenith432 said:

@SavageAUS, Matgen84:

You haven't posted build logs, but it's most likely because of the change to UDK2018 breaks build with EDK2.  To build with EDK2, revert the changes to

Patches_for_EDK2/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c

Patches_for_EDK2/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c

introduced in r4472

@Zenith432 : build log attached. We can compile now using UDK2018 instead of EDK2?

@SavageAUS I don't know too how to revert the changes?

 

Log

 

Edit: I download snapshot commit r4471, copy to Clover folder. I use option 3 and I can compile now r4778

Edited by Matgen84
Link to comment
Share on other sites

@SavageAUS, @Matget84:

The error is because you're building with EDK2, not UDK2018

  • update to r4479
  • revert MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c in edk2 tree to original from svn (or git).
  • revert the 5 other files listed here.
  • Replace Patches_for_EDK2/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c with file attached to this post.
  • Apply this patch to MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c under edk2 tree.
  • Now build should work ok.

Variable.c.gz

Edited by Zenith432
Link to comment
Share on other sites

1 hour ago, Philip Petev said:

@Zenith432 So, from now on Clover should be compiled with EDK2018 only? This reverting stuff only to switch from edk2 to edk2018 and vice versa seems pretty much complicated to me.

You can adapt this if you want:

#!/bin/bash

EDK2_REP='https://github.com/tianocore/edk2.git'
DIR_MAIN="${HOME}"/Desktop/EDK2_TEST
SHA1='3e72ffe8afdd03f1f89eba65c921cbdcb004cfee' # empty if you want the latest commit
GIT_DEPTH=1 # this speed up the download but too old revisions of edk2 will not be in the history (so you cannot revert before)
BUILD_BASETOOLS=NO

# this script checkout only packages needed by Clover (as per instructions).
# if you need more add it to the below 'edk2array'
edk2array=(
	MdePkg
	MdeModulePkg
	CryptoPkg
	DuetPkg
	EdkCompatibilityPkg
	IntelFrameworkModulePkg
	IntelFrameworkPkg
	OvmfPkg
	OptionRomPkg
	PcAtChipsetPkg
	ShellPkg
	UefiCpuPkg
	BaseTools
	)

updateOrReverEDK2Packages() {
  cd "${DIR_MAIN}"
  local cmmt=$(git rev-parse HEAD | tr -d '\r')
  if [[ "$cmmt" == "$SHA1" ]]; then
    echo "edk2 is already at the specified commit!"
  else
    echo "Resetting edk2 at $SHA1 because is at $cmmt"
    git reset --hard $SHA1
    BUILD_BASETOOLS=YES
  fi
}

checkoutEDK2Packages() {
  local checkout=""
  mkdir -p "${DIR_MAIN}"
  for pkg in "${edk2array[@]}"
  do
    checkout+="${pkg}/*\n"
  done

  git init "${DIR_MAIN}"
  cd "${DIR_MAIN}"
  git remote add origin ${EDK2_REP}
  git config core.sparsecheckout true
  echo -e "${checkout}" >> .git/info/sparse-checkout
  git pull --depth $GIT_DEPTH origin UDK2018

  if [[ -n "$SHA1" ]]; then
    updateOrReverEDK2Packages
  fi
  BUILD_BASETOOLS=YES
}

edk2() {
  mkdir -p "${DIR_MAIN}"
  if [[ -d "${DIR_MAIN}/.git" ]]; then
    updateOrReverEDK2Packages
  else
    checkoutEDK2Packages
  fi
}

clear
edk2

if [[ "$BUILD_BASETOOLS" == YES ]]; then
  echo "We should clean/build BaseTools, checkout/update Clover and apply patches.."
fi

..just ensure to clean old stuff downloaded from the old svn mirror and put the right $DIR_MAIN (actually you can test it by running it and will create ~/Desktop/EDK2_TEST with all you need). Using UDK2018 ensure less changes to Clover and less problems I guess.

 

EDIT

'SHA1' is the latest commit like your $EDK2_REV, 'local cmmt' is like $LOCAL_EDK2_REV,

 

P.S. was done to be ported to your script at the previous page, just changed 'master' to 'UDK2018'. and is very fast (takes only some seconds here to checkout it.. e.g. 20 seconds) :)

Edited by vector sigma
inserted the right SHA1
  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...