Build HOWTO: Difference between revisions

From coreboot
Jump to navigation Jump to search
(All boards use kconfig now.)
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[File:Coreboot menuconfig.png|thumb|right|'''make menuconfig''' in coreboot]]
[[File:Coreboot menuconfig.png|thumb|right|'''make menuconfig''' in coreboot]]


<div style="margin-top:0.5em; padding:0.5em 0.5em 0.5em 0.5em; background-color:#ffbbbb; align:right; border:1px solid #aabbcc;">
This page describes how you can build a coreboot image for your specific mainboard.
Note: kconfig is relatively new, please test if there are any issue on your boards!
</div>


This page describes how you can build a coreboot image for your specific mainboard using the new kconfig system.
== Requirements ==
 
* gcc / g++
* make
* ncurses-dev (for '''make menuconfig''')
 
Optional:
 
* doxygen (for generating/viewing documentation)
* iasl (for targets with ACPI support)
* gdb (for better debugging facilities on some targets)
* flex and bison (for regenerating parsers)


== Building a payload ==
== Building a payload ==


First you need to download the source code for the [[payloads|payload]] of your choice and build it.
First you need to download the source code for the [[Payloads|payload]] of your choice and build it.


Instructions for building the various payloads are not covered on this page, please see [[Payloads]] and the wiki page for the respective payload for details.
Instructions for building the various payloads are not covered on this page, please see [[Payloads]] and the wiki page for the respective payload for details.
Line 17: Line 26:
== Building coreboot ==
== Building coreboot ==


First, get the latest coreboot subversion version:
First, get the latest coreboot version from [[Git|our git repository]]:


  $ '''svn co svn://coreboot.org/coreboot/trunk coreboot'''
  $ '''git clone <nowiki>http://review.coreboot.org/p/coreboot</nowiki>'''
  $ '''cd coreboot'''
  $ '''cd coreboot'''
$ '''git submodule update --init --checkout'''


In the coreboot directory run kconfig to configure the build-time options of coreboot:
The last step is important! It checks out a sub-repository in the 3rdparty directory.
 
In the coreboot directory you can configure the build-time options of coreboot:


  $ '''make menuconfig'''
  $ '''make menuconfig'''
Line 33: Line 45:
** In '''ROM chip size''' select the exact size of the flash ROM chip you want to flash the coreboot image on.
** In '''ROM chip size''' select the exact size of the flash ROM chip you want to flash the coreboot image on.
* Enter the '''Payload''' menu.
* Enter the '''Payload''' menu.
** Set the '''Add a payload''' option to '''An ELF executable payload'''.
** By default, the [[SeaBIOS]] payload will be downloaded and built during the coreboot build process. If you want to use another payload:
** Then, specify the file name and path to your payload file (which you built before).
*** Set the '''Add a payload''' option to '''An ELF executable payload'''.
*** Then, specify the file name and path to your payload file (which you built before).
 
You also need to build crossgcc:
 
$ '''make crossgcc'''
 
That's the bare minimum. Feel free to adjust the other settings to your needs (see [[Coreboot Options]] for the full list), then exit menuconfig and build the coreboot image:
 
$ '''make'''
 
The file  '''build/coreboot.rom''' is your final coreboot image you can flash onto a ROM chip or add payloads to with cbfstool.


That's the bare minimum. Feel free to adjust the other settings to your needs, then exit menuconfig and build the coreboot image:
== Known issues ==


With certain versions of the gcc/ld toolchain shipped in some Linux distributions, it's possible that you'll see the following error when building coreboot:
src/arch/x86/coreboot_ram.ld:129 cannot move location counter backwards
This is a known bug in those versions of the toolchain. Before sending a complaint message to our mailing list, please try to switch to our reference cross-compilation toolkit then recompile the sources. To switch to the cross-compiler just run
$ '''make crossgcc'''
Then remove the '''.xcompile''' file and retry the compilation process:
$ '''rm .xcompile'''
  $ '''make'''
  $ '''make'''


The file  '''build/coreboot.rom''' is your final coreboot image you can flash onto a ROM chip.
== Development version ==
 
If you want to contribute a patch or report an issue about coreboot, you will need to set up your environment for full development.


== Flashing coreboot ==
You '''must''' run '''make crossgcc''' and rebuild coreboot before reporting an issue or contributing a patch.


You can flash the coreboot image on a flash ROM chip using either an external EEPROM-programmer, or a mainboard using the [[flashrom]] user-space utility.
To get set up to submit a patch please run '''make gitconfig''', then [[Git|register with gerrit]].


== Manipulating coreboot images with cbfstool ==
== Flashing coreboot ==


TODO
You can flash the coreboot image on a flash ROM chip using either an external EEPROM-programmer or a mainboard using the [http://www.flashrom.org flashrom] user-space utility.

Revision as of 17:06, 18 September 2014

make menuconfig in coreboot

This page describes how you can build a coreboot image for your specific mainboard.

Requirements

  • gcc / g++
  • make
  • ncurses-dev (for make menuconfig)

Optional:

  • doxygen (for generating/viewing documentation)
  • iasl (for targets with ACPI support)
  • gdb (for better debugging facilities on some targets)
  • flex and bison (for regenerating parsers)

Building a payload

First you need to download the source code for the payload of your choice and build it.

Instructions for building the various payloads are not covered on this page, please see Payloads and the wiki page for the respective payload for details.

The result of this step should be an ELF file (e.g. filo.elf, or coreinfo.elf) which you can use with coreboot (see below).

Building coreboot

First, get the latest coreboot version from our git repository:

$ git clone http://review.coreboot.org/p/coreboot
$ cd coreboot
$ git submodule update --init --checkout

The last step is important! It checks out a sub-repository in the 3rdparty directory.

In the coreboot directory you can configure the build-time options of coreboot:

$ make menuconfig

In that menu (which may look familiar, as other projects such as the Linux kernel or busybox use the same system), select at least the following options:

  • Enter the Mainboard menu.
    • In Mainboard vendor select the vendor of your board.
    • In Mainboard model select your exact mainboard name.
    • In ROM chip size select the exact size of the flash ROM chip you want to flash the coreboot image on.
  • Enter the Payload menu.
    • By default, the SeaBIOS payload will be downloaded and built during the coreboot build process. If you want to use another payload:
      • Set the Add a payload option to An ELF executable payload.
      • Then, specify the file name and path to your payload file (which you built before).

You also need to build crossgcc:

$ make crossgcc

That's the bare minimum. Feel free to adjust the other settings to your needs (see Coreboot Options for the full list), then exit menuconfig and build the coreboot image:

$ make

The file build/coreboot.rom is your final coreboot image you can flash onto a ROM chip or add payloads to with cbfstool.

Known issues

With certain versions of the gcc/ld toolchain shipped in some Linux distributions, it's possible that you'll see the following error when building coreboot:

src/arch/x86/coreboot_ram.ld:129 cannot move location counter backwards

This is a known bug in those versions of the toolchain. Before sending a complaint message to our mailing list, please try to switch to our reference cross-compilation toolkit then recompile the sources. To switch to the cross-compiler just run

$ make crossgcc

Then remove the .xcompile file and retry the compilation process:

$ rm .xcompile
$ make

Development version

If you want to contribute a patch or report an issue about coreboot, you will need to set up your environment for full development.

You must run make crossgcc and rebuild coreboot before reporting an issue or contributing a patch.

To get set up to submit a patch please run make gitconfig, then register with gerrit.

Flashing coreboot

You can flash the coreboot image on a flash ROM chip using either an external EEPROM-programmer or a mainboard using the flashrom user-space utility.