binary_extraction.md
1 # Intel IFD Binary Extraction Tutorial 2 3 ## Part 1: Extracting Binaries 4 5 To begin extracting the binaries, first create a directory labeled "binaries" 6 in the coreboot directory (i.e. /path/to/coreboot/binaries/). 7 8 Now, 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 make 13 ./ifdtool -d COREBOOT_IMAGE # dump flash descriptor to stdout 14 ./ifdtool -x COREBOOT_IMAGE # extract IFD binaries into files (e.g. ME, IFD, GBE...) 15 16 In the above steps, COREBOOT_IMAGE is the name of the ROM image to extract the 17 binaries from, including the file path (ex. /build/coreboot.rom). 18 19 Copy 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 21 indicate what they are and their purpose. 22 23 To extract the mrc.bin, move to the /coreboot/build directory and run the 24 following command: 25 26 cd /path/to/coreboot/build/ 27 ./cbfstool COREBOOT_IMAGE extract -n mrc.bin -f /path/to/destination/filename 28 29 where 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 31 is 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 37 To 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 39 extract the flashdescriptor.bin and intel_me.bin files. 40 41 To run this script, switch to the /path/to/coreboot/util/chromeos/ directory 42 and 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 47 Executing 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 53 To begin using the binaries extracted above, enable the use of binary 54 repositories in the menuconfig. From the main coreboot directory, run 55 'make menuconfig'. Select "General Setup", then select "Allow use of 56 binary-only repository", then exit to the main menu. 57 58 To configure the ROM image for a specific board, select "Mainboard". Select 59 "Mainboard vendor" and scroll to the correct vendor. Then select "Mainboard 60 model" and select the name of the board model. Exit back to the main menu. 61 62 To add the binaries you extracted, select "Chipset". Scroll and select "Add a 63 System Agent Binary" and set the filepath to your mrc.bin file's filepath. 64 Scroll and select "Add Intel descriptor.bin file" and type the filepath for 65 your descriptor.bin file. Scroll down and select "Add Intel ME/TXE firmware 66 file" and type the filepath for your ME file. Exit to the main menu. 67 68 Select "Exit", and select "Yes" when prompted to save your configuration.