xref: /aosp_15_r20/external/coreboot/Documentation/util/ifdtool/binary_extraction.md (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1# Intel IFD Binary Extraction Tutorial
2
3## Part 1: Extracting Binaries
4
5To begin extracting the binaries, first create a directory labeled "binaries"
6in the coreboot directory (i.e. /path/to/coreboot/binaries/).
7
8Now, execute the following commands to extract the binaries from a ROM image.
9**Note:** Make sure you are in the root coreboot directory.
10
11    cd /path/to/coreboot/util/ifdtool
12    ./ifdtool COREBOOT_IMAGE
13    ./ifdtool -d COREBOOT_IMAGE
14    ./ifdtool -x COREBOOT_IMAGE
15
16In the above steps, COREBOOT_IMAGE is the name of the ROM image to extract the
17binaries from, including the file path (ex. /build/coreboot.rom).
18
19Copy the extracted .bin files to the binaries directory you created previously.
20**Note:** You may want to rename your various .bin files to more clearly
21indicate what they are and their purpose.
22
23To extract the mrc.bin, move to the /coreboot/build directory and run the
24following command:
25
26    cd /path/to/coreboot/build/
27    ./cbfstool COREBOOT_IMAGE extract -n mrc.bin -f /path/to/destination/filename
28
29where COREBOOT_IMAGE is the filepath to the ROM image (same image as above),
30/path/to/destination is the filepath to the destination directory and filename
31is the output filename. An example command is given below:
32
33    ./cbfstool coreboot.rom extract -n mrc.bin -f /path/to/coreboot/binaries/mrc.bin
34
35## Part 2: Using extract_blobs.sh
36
37To simplify some of the steps above, there is a script in the
38/path/to/coreboot/util/chromeos/ directory called extract_blobs.sh what will
39extract the flashdescriptor.bin and intel_me.bin files.
40
41To run this script, switch to the /path/to/coreboot/util/chromeos/ directory
42and execute the script providing a coreboot image as an argument.
43
44    cd /path/to/coreboot/util/chromeos/
45    ./extract_blobs.sh COREBOOT_IMAGE
46
47Executing those commands will result in two binary blobs to appear in the
48/path/to/coreboot/util/chromeos/ directory under the names
49'flashdescriptor.bin' and 'me.bin'.
50
51## Part 3: Changing the coreboot configuration settings
52
53To begin using the binaries extracted above, enable the use of binary
54repositories in the menuconfig. From the main coreboot directory, run
55'make menuconfig'. Select "General Setup", then select "Allow use of
56binary-only repository", then exit to the main menu.
57
58To configure the ROM image for a specific board, select "Mainboard". Select
59"Mainboard vendor" and scroll to the correct vendor. Then select "Mainboard
60model" and select the name of the board model. Exit back to the main menu.
61
62To add the binaries you extracted, select "Chipset". Scroll and select "Add a
63System Agent Binary" and set the filepath to your mrc.bin file's filepath.
64Scroll and select "Add Intel descriptor.bin file" and type the filepath for
65your descriptor.bin file. Scroll down and select "Add Intel ME/TXE firmware
66file" and type the filepath for your ME file. Exit to the main menu.
67
68Select "Exit", and select "Yes" when prompted to save your configuration.