Jump to content

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


Micky1979
2,126 posts in this topic

Recommended Posts

@Mickey1979- Thanks again for the script, all of us non-coders have been saved! :)

 

I don't know who wrote the Clover preference screen:

 

post-922667-0-09366900-1474078747_thumb.png

 

But adding a "Update Now" button using your script would be extremely cool...

 

Thanks again.

 

EDIT: In the installer, maybe the the option "Install Clover Preference Page" shouldn't be an option, it should just automatically be installed... 

  • Like 1
Link to comment
Share on other sites

Hi Micky1979

 

just my opinion its possible to check automatic revision in header so we don't need to check manually?

like this :

 

===============================================================================

Build_Clover script v3.9

                          <----------------------------------------------------

===============================================================================

By Micky1979 based on Slice, Zenith432, STLVNUB, JrCs, cecekpawon, Needy,

cvad, Rehabman, philip_petev

 

Supported OSes:macOS X, Ubuntu 16.04

 

Online = Revision: 3757       Local = Revision: 3752

===============================================================================

                          <----------------------------------------------------

Please enter your choice: 

1) update Clover only (no building)

2) update & build Clover

3) run my script on the source

4) build existing revision (no update, standard build)

5) build existing revision with FORCEREBUILD (no update, standard build)

6) build existing revision with custom macros enabled

7) info and limitations about this script

8) enter Developers mode

Link to comment
Share on other sites

Hi Micky1979,

I think that Version.h was not updated

0:100 0:000 Starting Clover revision: 3751 on American Megatrends EFI

0:100 0:000 Build with: [Args: --ia32 -D NO_GRUB_DRIVERS_EMBEDDED | -D NO_GRUB_DRIVERS_EMBEDDED -D USE_LOW_EBDA -a IA32 -b RELEASE -t XCODE5 -n 5 | OS: 10.12 | XCODE: 8.0]

Link to comment
Share on other sites

@Mickey1979- Thanks again for the script, all of us non-coders have been saved! :)

 

I don't know who wrote the Clover preference screen:

 

attachicon.gifScreen Shot 2016-09-16 at 10.16.29 PM.png

 

But adding a "Update Now" button using your script would be extremely cool...

 

Thanks again.

 

EDIT: In the installer, maybe the the option "Install Clover Preference Page" shouldn't be an option, it should just automatically be installed... 

That is Slice depend..

Hi Micky1979

 

just my opinion its possible to check automatic revision in header so we don't need to check manually?

like this :

 

===============================================================================

Build_Clover script v3.9

                          <----------------------------------------------------

===============================================================================

By Micky1979 based on Slice, Zenith432, STLVNUB, JrCs, cecekpawon, Needy,

cvad, Rehabman, philip_petev

 

Supported OSes:macOS X, Ubuntu 16.04

 

Online = Revision: 3757       Local = Revision: 3752

===============================================================================

                          <----------------------------------------------------

Please enter your choice: 

1) update Clover only (no building)

2) update & build Clover

3) run my script on the source

4) build existing revision (no update, standard build)

5) build existing revision with FORCEREBUILD (no update, standard build)

6) build existing revision with custom macros enabled

7) info and limitations about this script

8) enter Developers mode

Should be done, but only a doubt if someone is offline and it print some error.. (can you try what happen with no internet connection?)

Hi Micky1979,

I think that Version.h was not updated

0:100 0:000 Starting Clover revision: 3751 on American Megatrends EFI

0:100 0:000 Build with: [Args: --ia32 -D NO_GRUB_DRIVERS_EMBEDDED | -D NO_GRUB_DRIVERS_EMBEDDED -D USE_LOW_EBDA -a IA32 -b RELEASE -t XCODE5 -n 5 | OS: 10.12 | XCODE: 8.0]

Did you use -fr?

 

The fact is that ebuild.sh is called multiple times to build boo3/6 and 7, so the string in Version.h get replaced with last argument used.

Did you build always all 3 of them? ... maybe with some job, ebuild.sh can read what you are attempt to do from a file and create a good string always in one time.

.. want to make a try..

./ebuild.sh -boot3 -boot6 -boot7

in one time?

Link to comment
Share on other sites

Here's a prototype, if anybody is interested I could finish it.

 

Best regards.

cool, but I get this in El Capitan:

Last login: Sat Sep 17 10:50:07 on ttys004
Micky1979s-MBP:~ Micky1979$ svn info --show-item "revision" svn://svn.code.sf.net/p/cloverefiboot/code
svn: invalid option: --show-item
Type 'svn help' for usage.
Micky1979s-MBP:~ Micky1979$ 

what's your svn version?

 

EDIT

Starting with Subversion 1.9 you can use option --show-item to get a value of one of fields of svn info command's output. This command will display revision number only:
svn info --show-item=revision <URL-to-repository>

Ok, we can use it based on the subversion-version :yes:

 

You are in Sierra :P

Link to comment
Share on other sites

cool, but I get this in El Capitan:

Last login: Sat Sep 17 10:50:07 on ttys004
Micky1979s-MBP:~ Micky1979$ svn info --show-item "revision" svn://svn.code.sf.net/p/cloverefiboot/code
svn: invalid option: --show-item
Type 'svn help' for usage.
Micky1979s-MBP:~ Micky1979$ 

what's your svn version?

 

EDIT

Starting with Subversion 1.9 you can use option --show-item to get a value of one of fields of svn info command's output. This command will display revision number only:
svn info --show-item=revision <URL-to-repository>

Ok, we can use it based on the subversion-version :yes:

 

You are in Sierra :P

Sorry, I forgot to check the availability of the commands.

 

Sure, we could check for svn version and execute the appropriate command.

svn, version 1.9.4 (r1740329)
   compiled Jun 30 2016, 13:49:35 on x86_64-apple-darwin15.0.0
Link to comment
Share on other sites

Different revisions?

iMac:Clover slice$ svn info --show-item "revision" svn://svn.code.sf.net/p/cloverefiboot/code
3758      
iMac:Clover slice$ svn info | grep '^Revision:' | tr -cd [:digit:] 
3757iMac:Clover slice$ 


That is Slice depend..


Should be done, but only a doubt if someone is offline and it print some error.. (can you try what happen with no internet connection?)


Did you use -fr?

 

The fact is that ebuild.sh is called multiple times to build boo3/6 and 7, so the string in Version.h get replaced with last argument used.

Did you build always all 3 of them? ... maybe with some job, ebuild.sh can read what you are attempt to do from a file and create a good string always in one time.

.. want to make a try..

./ebuild.sh -boot3 -boot6 -boot7

in one time?

I used simple script

#!/bin/bash

./ebuild.sh --ia32  -D NO_GRUB_DRIVERS_EMBEDDED
./ebuild.sh -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED
./ebuild.sh -D NO_GRUB_DRIVERS_EMBEDDED
cd CloverPackage
./makepkg
./makeiso
#make iso
cd ..
echo "done!"

Link to comment
Share on other sites

 

Different revisions?

iMac:Clover slice$ svn info --show-item "revision" svn://svn.code.sf.net/p/cloverefiboot/code
3758      
iMac:Clover slice$ svn info | grep '^Revision:' | tr -cd [:digit:] 
3757iMac:Clover slice$ 

I used simple script

#!/bin/bash

./ebuild.sh --ia32  -D NO_GRUB_DRIVERS_EMBEDDED
./ebuild.sh -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED
./ebuild.sh -D NO_GRUB_DRIVERS_EMBEDDED
cd CloverPackage
./makepkg
./makeiso
#make iso
cd ..
echo "done!"

Run the following command in the same folder.

svn info --show-item "revision"

What's the output?

Link to comment
Share on other sites

Slice,

./ebuild.sh --ia32 -D NO_GRUB_DRIVERS_EMBEDDED

./ebuild.sh -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED
./ebuild.sh -D NO_GRUB_DRIVERS_EMBEDDED

 

each of it should replace  the build string in Version.h only if you add -fr (like the old behavior).

As told me by you here, and what I did, was to avoid Version.h to be overwritten again and again if the revision is the same. In fact if it is the same does not get updated.

 

So you need to add -fr:

./ebuild.sh -fr --ia32 -D NO_GRUB_DRIVERS_EMBEDDED
./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED
./ebuild.sh -fr -D NO_GRUB_DRIVERS_EMBEDDED

You can make a secondary script and call it when you want build binaries to be shared with Version.h updated for all. Otherwise it behave as you told me to do (if we change it every time... it behave as before)

Or use that:

#!/bin/bash

developing(){
    ./ebuild.sh --ia32  -D NO_GRUB_DRIVERS_EMBEDDED
    ./ebuild.sh -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED
    ./ebuild.sh -D NO_GRUB_DRIVERS_EMBEDDED
    cd CloverPackage
    ./makepkg
    ./makeiso
    #make iso
    cd ..
    echo "done!"
}

release(){
    ./ebuild.sh -fr --ia32  -D NO_GRUB_DRIVERS_EMBEDDED
    ./ebuild.sh -fr -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED
    ./ebuild.sh -fr -D NO_GRUB_DRIVERS_EMBEDDED
    cd CloverPackage
    ./makepkg
    ./makeiso
    #make iso
    cd ..
    echo "done!"
}

if [ -z "${1}" ]; then developing; else release; fi

when you call the script with no argumet it call "developing" (i.e. like you use now). instead if you call it with an argument (can be any, also one letter):

./yourScript blabla

use release...

 

 

-fr = update Version.h (and every module that use it get rebuilted, what you wanted to avoid during your daily development, but needed to share binaries)

 

 


 

Different revisions?

iMac:Clover slice$ svn info --show-item "revision" svn://svn.code.sf.net/p/cloverefiboot/code
3758
iMac:Clover slice$ svn info | grep '^Revision:' | tr -cd [:digit:]
3757iMac:Clover slice$

committed but not synced?

Link to comment
Share on other sites

Shall we use an universal command?

svn info | grep '^Revision:' | tr -cd [:digit:] 

Edit: Different command.

 

That work (sorry did not see your edit till now)

Maybe a useful feature:

Debug menu:

Debugging/testing GUI/Clover ( UEFI and legacy ) using iso with either qemu or some other VM.

Feel free to add..

Link to comment
Share on other sites

That work (sorry did not see your edit till now)

 

Okay. 

 

Shall I finish the implementation?

 

Furthermore, the REMOTE_REV and the LOCAL_REV can be used as global variables, therefore, variables like, local CLOVER_REV, local online, can be replaced with those.

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

Please work on this: Build_Clover.command_v4.0beta.zip

(I had to move your code ahead in the script becasue in Linux we must ensure subversion is installed before use svn command)

I see.

 

I will create a function then.

 

Edit: Done. The script will display the svn errors when the user is offline. Shall we suppress those errors? @Micky1979, look at the clover() function, that's what I meant.

 

Best regards.

Build_Clover_Beta.command.zip

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

Edit: Done. The script will display the svn errors when the user is offline. Shall we suppress those errors? @Micky1979, look at the clover() function, that's what I meant.

 

no, the error should be showned... so I hope no one will try to update w/o internet connection (or the repository is not reachable). 

I had to revert the svn update part to simply 'svn update' that was causing problems in Linux.

Attached final v4.0 with your modifications

Build_Clover.command_v4.0.zip

  • Like 2
Link to comment
Share on other sites

no, the error should be showned... so I hope no one will try to update w/o internet connection (or the repository is not reachable). 

I had to revert the svn update part to simply 'svn update' that was causing problems in Linux.

Attached final v4.0 with your modifications

By the way, the getRev() function can be used for the edk2() function as well.

 

Best regards.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...