Jump to content

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


Micky1979
2,126 posts in this topic

Recommended Posts

@droples that is a message printed by boot1f32 (or its "alt" variant) and not by boot3/6/7, I can't see nothing wrong with it (otherwise you will see "b1f: error"). What do you mean?

 

Hi Micky! Good work.

I should explain here.

Different variants of boot file boot1/3/6/7 exists to have a possibility choose one at startup by pressing a digit 1/3/6/7 as well as other digits or letter. Letter has a problem of case and keyboard.

We can make as follow

boot1 = Chameleon

boot2 = ntldr --- I don't know if it can work such way ;)

boot3 = CloverEFI 32 bits

boot6 = CloverEFI 64 bits

All this assignments are arbitrary, you can use them other way. Just remember what is what.

Currently Clover package has follow assignments

boot3 = CloverEFI 32 bits

boot6 = CloverEFI 64 bits

boot5 = CloverEFI 64 bits LOW_EBDA

boot7 = CloverEFI 64 bits LOW_EBDA USE_BIOS_BLOCKIO

boot8 = CloverEFI 64 bits USE_BIOS_BLOCKIO

 

All of them should inform user who is who and print on the screen one digit as you see on droples screen

 

b1f: init5

b1f: init comes from boot1f32 sector PBR

5 comes from boot5.

(I am sorry I was lazy to correct boot6 to print "6" it still printed "5" and boot7 printed "L", boot8 printed "B")

I will be glad if someone correct all of them.

This symbol is located at the begin of boot file at offset 0xa9. Hex 0x35 means "5", hex 0x42 means "B" and so on. Can be corrected at clover build script by, for example, dd command.

  • Like 1
Link to comment
Share on other sites

Hi Micky! Good work. 

 

Thanks  :)

 

b1f: init5

b1f: init comes from boot1f32 sector PBR

5 comes from boot5.

(I am sorry I was lazy to correct boot6 to print "6" it still printed "5" and boot7 printed "L", boot8 printed "B")

I will be glad if someone correct all of them.

This symbol is located at the begin of boot file at offset 0xa9. Hex 0x35 means "5", hex 0x42 means "B" and so on. Can be corrected at clover build script by, for example, dd command.

 

done   :lol:, that should work:

#!/bin/bash

#s1 is the path to boot5, boot6, boot7 etc

setInitBootMsg (){

    local byte="35"
    case "${1}" in
    *boot2)
        byte="32"
    ;;
    *boot3)
        byte="33"
    ;;
    *boot4)
        byte="34"
    ;;
    *boot5)
        byte="35"
    ;;
    *boot6)
        byte="36"
    ;;
    *boot7)
        byte="37"
    ;;
    *boot7-MCP79)
        byte="4d"
    ;;
    *boot8)
        byte="38"
    ;;
    *boot9)
        byte="39"
    ;;
    *)
        return;
    ;;
    esac

    if [[ -f "${1}" ]]; then
        printf "\x${byte}" | dd conv=notrunc of="${1}" bs=1 seek=$((0xa9))
    fi
}

setInitBootMsg "${1}"

.. maybe can be inserted in ebuild.sh in both X64 and IA32 statement?

# Install CloverEFI file
echo "Copy CloverEFI:"
copyBin "${BUILD_DIR}"/FV/boot "$CLOVER_PKG_DIR"/Bootloaders/x64/$cloverEFIFile
setInitBootMsg "$CLOVER_PKG_DIR"/Bootloaders/x64/$cloverEFIFile
....

# CloverEFI
copyBin "${BUILD_DIR}"/FV/boot "$CLOVER_PKG_DIR"/Bootloaders/ia32/$cloverEFIFile
setInitBootMsg "$CLOVER_PKG_DIR"/Bootloaders/ia32/$cloverEFIFile 

PS boot7-MPC79 ??  "b1f: initM" is ok?

 

EDIT

replacement is ok, to be tested booting-up the PC..

Link to comment
Share on other sites

New v2.9:

 

  • v2.9: added back -mc flag for boot7 in standard compilation.
  • v2.9: boot7-MPC79 removed from building when use custom macro.

 

@droples, this should fix the nuance you show me, please let me know

Link to comment
Share on other sites

looks ok, no?

EDIT
 
BTW you got an error downloading Clover:

svn: E000002: Can't open file '/Users/droplets/src/edk2/Clover/.svn/pristine/16/16ee93d446191bdfffd6efb43928ba9da2931d3a.svn-base': No such file or directory

That happen if you try to build the same src folder (with different subversion), i.e. in different OSX version. Here how to cure: http://stackoverflow.com/questions/18627616/cannot-upgrade-svn-cant-open-directory-svn-text-base-no-such-file-or-direct

Link to comment
Share on other sites

I'm sorry I did not see. These were problems with the Internet.

 

attachicon.gifnew_logCompile_build_clover2.9.txt.zip

 

PS

For personal use, I removed section (# build for chipset only NVIDIA NFORCE-MCP79 cloverEFI.64.blockio2 package) from  buildpkg.sh.

attachicon.gifwithout_blockio2.jpg

attachicon.gifwithout_blockio2.zip

 

Try this one,  build only boot6 if you select "x64 only",  skipping MCP79 blockio2 without touch the source.

Also added as default, for standard compilation, the "-D NO_GRUB_DRIVERS_EMBEDDED" flag, as should be for all architectures (I think, Slice can confirm..please).

To test this, you have to restore the original buildpkg.sh (just delete it and update Clover using option 2, and will be restored).

Build_Clover.command_v3.0.zip

Link to comment
Share on other sites

Try this one,  build only boot6 if you select "x64 only",  skipping MCP79 blockio2 without touch the source.

Also added as default, for standard compilation, the "-D NO_GRUB_DRIVERS_EMBEDDED" flag, as should be for all architectures (I think, Slice can confirm..please).

To test this, you have to restore the original buildpkg.sh (just delete it and update Clover using option 2, and will be restored).

Build_Clover.command_v3.0

Yes, MCP79   in the Installer is not visible.

post-617057-0-32691100-1471173837_thumb.jpg

Build_Clover3.0_boot6.txt

  • Like 1
Link to comment
Share on other sites

Thanks :) , v3.0 added at the Download section!

 

 

  • v3.0: added "-D NO_GRUB_DRIVERS_EMBEDDED" for standard compilations. 
  • v3.0: skip boot7-MCP79 for "x64 only" builds (thanks droples).
Link to comment
Share on other sites

New v2.9:

 

  • v2.9: added back -mc flag for boot7 in standard compilation.
  • v2.9: boot7-MPC79 removed from building when use custom macro.

 

@droples, this should fix the nuance you show me, please let me know

No, -mc flag doesn't produce boot7-MPC79. It was added because this is one of old boot files that really works with MCP79. Any new Clover can and I don't know why.

This question requires additional development.

Link to comment
Share on other sites

Yep, I mean for normal boot7:

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

'-mc' was removed by mistake.

 

About boot7-MCP79 I see that is already compiled, the script only make a temporary backup (boot7-MCP79.back) so that buildpkg.sh cannot find it... and the choice is not added to the package. That only if you add macros, or you want a package with boot6 only (as for @droples post), normal compilation of the pkg instead contains all boot6, 7 and MCP79.

 

did you see that post about fix the init message, is ok for you?

Link to comment
Share on other sites

#define FIRMWARE_VERSION "2.31"
#define FIRMWARE_BUILDDATE "2016-08-14 13:16:44"
#define FIRMWARE_REVISION L"3696"
#define REVISION_STR "Clover revision: 3696"
#define BUILDINFOS_STR "Args: ./ebuild.sh -ia32 -D NO_GRUB_DRIVERS_EMBEDDED -t XCODE5 | Command: build -D NO_GRUB_DRIVERS_EMBEDDED -D USE_LOW_EBDA -p Clover/Clover.dsc -a IA32 -b RELEASE -t XCODE5 -n 5 | OS: 10.11.6 | XCODE: 7.3.1"
 

ebuild.sh is called more than one time and "Version.h" is re-created each times, and the bad is that FIRMWARE_BUILDDATE and BUILDINFOS_STR change, is that the problem ?

Yes can be done automatically or we can use additional args to be received by ebuild.sh so we can also decide to update only some line, just let me understand better your intention.

Link to comment
Share on other sites

#define FIRMWARE_VERSION "2.31"
#define FIRMWARE_BUILDDATE "2016-08-14 13:16:44"
#define FIRMWARE_REVISION L"3696"
#define REVISION_STR "Clover revision: 3696"
#define BUILDINFOS_STR "Args: ./ebuild.sh -ia32 -D NO_GRUB_DRIVERS_EMBEDDED -t XCODE5 | Command: build -D NO_GRUB_DRIVERS_EMBEDDED -D USE_LOW_EBDA -p Clover/Clover.dsc -a IA32 -b RELEASE -t XCODE5 -n 5 | OS: 10.11.6 | XCODE: 7.3.1"
 

ebuild.sh is called more than one time and "Version.h" is re-created each times, and the bad is that FIRMWARE_BUILDDATE and BUILDINFOS_STR change, is that the problem ?

Yes can be done automatically or we can use additional args to be received by ebuild.sh so we can also decide to update only some line, just let me understand better your intention.

 

The bad thing is ebuild.sh rebuild all modules even if they are not actually changed.

I recompiled Clover several times per day and I don't want to wait all modules to be recompiled again and again.

Additional arg is simplest way but not the best.

Produce ver.txt, compare it with old_ver.txt, if differ then produce Version.h  :rolleyes:

  • Like 1
Link to comment
Share on other sites

compiled with Xcode 8  with Clover_command v3.0 = ok

 

0:100  0:000  Starting Clover revision: 3705 on American Megatrends EFI
0:100  0:000  Build with: [Args: ./ebuild.sh -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -t XCODE5 | Command: build -D DISABLE_USB_SUPPORT -D NO_GRUB_DRIVERS_EMBEDDED -D USE_BIOS_BLOCKIO -D USE_LOW_EBDA -p Clover/Clover.dsc -a X64 -b RELEASE -t XCODE5 -n 3 | OS: 10.12 | XCODE: 8.0]

  • Like 1
Link to comment
Share on other sites

The bad thing is ebuild.sh rebuild all modules even if they are not actually changed.

I recompiled Clover several times per day and I don't want to wait all modules to be recompiled again and again.

Additional arg is simplest way but not the best.

Produce ver.txt, compare it with old_ver.txt, if differ then produce Version.h  :rolleyes:

Hi Slice try this one:

ebuild.sh.zip

it skip the autogen of newer makefiles each time (the option is provided by edk2 in build.py), so that now all is rebuilted based on timestamp/guid/sha etc (I guess), and here is a lot faster.

...that only if local version differ from the one in:

"~/src/edk2/Clover/rEFIt_UEFI/Version.h".

and offcourse if exist (sign that Clover was at least compiled once).

 

The first time the revision did not match, behave as usual and so everything is rebuilted from scratch. Please test.

 

EDIT

here is the same + it also correct the init message for boot3, boot6, boot7 etc. Tested and working:

b1f: init7  :lol: 

ebuild.sh.zip

 

EDIT II

if that help we can add an argument to override this new default behavior, so that "SkipAutoGen" get skipped by force.

Usually when build my programs in Xcode for distribution I want to be sure that everithing is cleaned and done from scratch as per some limitations like when adding for example new header(s) in the project and/or I have more stuff to be linked.

  • Like 1
Link to comment
Share on other sites

compiled with Xcode 8  with Clover_command v3.0 = ok

 

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

0:100  0:000  Build with: [Args: ./ebuild.sh -mc --no-usb -D NO_GRUB_DRIVERS_EMBEDDED -t XCODE5 | Command: build -D DISABLE_USB_SUPPORT -D NO_GRUB_DRIVERS_EMBEDDED -D USE_BIOS_BLOCKIO -D USE_LOW_EBDA -p Clover/Clover.dsc -a X64 -b RELEASE -t XCODE5 -n 3 | OS: 10.12 | XCODE: 8.0]

thanks for testing this script! 

Link to comment
Share on other sites

Hi Slice try this one:

attachicon.gifebuild.sh.zip

it skip the autogen of newer makefiles each time (the option is provided by edk2 in build.py), so that now all is rebuilted based on timestamp/guid/sha etc (I guess), and here is a lot faster.

...that only if local version differ from the one in:

"~/src/edk2/Clover/rEFIt_UEFI/Version.h".

and offcourse if exist (sign that Clover was at least compiled once).

 

The first time the revision did not match, behave as usual and so everything is rebuilted from scratch. Please test.

 

EDIT

here is the same + it also correct the init message for boot3, boot6, boot7 etc. Tested and working:

b1f: init7  :lol: 

attachicon.gifebuild.sh.zip

 

EDIT II

if that help we can add an argument to override this new default behavior, so that "SkipAutoGen" get skipped by force.

Usually when build my programs in Xcode for distribution I want to be sure that everithing is cleaned and done from scratch as per some limitations like when adding for example new header(s) in the project and/or I have more stuff to be linked.

It works but no new effect.

I change one line and expected one file will be recompiled.

Screen Shot 2016-08-18 at 7.33.53.png

I didn't remember why we have two files

"$CLOVERROOT"/rEFIt_UEFI/Version.h

"$CLOVERROOT"/Version.h

Link to comment
Share on other sites

×
×
  • Create New...