CBFSTOOL(8)
๐ CBFSTOOL โ NAME
cbfstool โ bestie, this is the management utility for CBFS formatted ROM images, straight outta the coreboot tools ๐
๐ธ SYNOPSIS
cbfstool [-h]
cbfstool FILE COMMAND [-v] [PARAMETERS]...
โจ DESCRIPTION
Okay so real talk: this is the management utility for CBFS formatted ROM images. That's the whole vibe. It's giving "I poke at firmware and I'm good at it" ๐
๐ OPTIONS
Every single one, no skipping, periodt:
-Hheader_offset โ do NOT go looking for the header, just use this offset* ๐ฏ-Tโ output a top-aligned memory address-uโ accept short data; fill upward / from the bottom-dโ accept short data; fill downward / from the top-Fโ force it. Do the thing. No cap.-gโ generate position and alignment arguments-Uโ unprocessed; don't decompress or make ELF-vโ give me verbose output (-v=INFO,-vv=DEBUG output) ๐ฃ๏ธ-hโ display this help message (the classic)--ext-win-baseโ base of extended decode window in host address space (x86 only)--ext-win-sizeโ size of extended decode window in host address space (x86 only)
๐ฅ COMMANDS
โ add
add [-r image,regions] -f FILE -n NAME -t TYPE [-A hash]
[-c compression] [-b base-address | -a alignment] [-p padding
size] [-y|--xip if TYPE is FSP] [-j topswap-size] (Intel CPUs
only) [--ibb] [--ext-win-base win-base --ext-win-size win-size]
Add a component โจ
-jvalid size:0x100000x200000x400000x800000x100000
๐ add-payload
add-payload [-r image,regions] -f FILE -n NAME [-A hash]
[-c compression] [-b base-address] (linux specific: [-C cmdline]
[-I initrd])
Add a payload to the ROM. Linux girlies get the extra -C cmdline and -I initrd moment ๐ง
๐ญ add-stage
add-stage [-r image,regions] -f FILE -n NAME [-A hash]
[-c compression] [-b base] [-S
comma-separated-section(s)-to-ignore] [-a alignment]
[-Q|--pow2page] [-y|--xip] [--ibb] [--ext-win-base win-base
--ext-win-size win-size]
Add a stage to the ROM ๐
๐งฑ add-flat-binary
add-flat-binary [-r image,regions] -f FILE -n NAME
[-A hash] -l load-address -e entry-point [-c compression] [-b
base]
Add a 32bit flat mode binary
๐ข add-int
add-int [-r image,regions] -i INTEGER -n NAME [-b base]
Add a raw 64-bit integer value. Just a number, living its truth ๐ซถ
๐ add-master-header
add-master-header [-r image,regions] [-j topswap-size] (Intel CPUs only)
Add a legacy CBFS master header
โ remove
remove [-r image,regions] -n NAME
Remove a component. Gone. Blocked. Unfollowed ๐
๐งน compact
compact -r image,regions
Defragment CBFS image. Self-care for your ROM ๐ง
๐ copy
copy -r image,regions -R source-region
Create a copy (duplicate) cbfs instance in fmap
๐๏ธ create (legacy style)
create -m ARCH -s size [-b bootblock offset]
[-o CBFS offset] [-H header offset] [-B bootblock]
Create a legacy ROM file with CBFS master header* โจ
๐ create (new-style)
create -M flashmap [-r list,of,regions,containing,cbfses]
Create a new-style partitioned firmware image
๐บ๏ธ layout
layout [-w]
List mutable (or, with -w, readable) image regions
๐จ๏ธ print
print [-r image,regions] [-k]
Show the contents of the ROM. Show me what you got ๐
๐ค extract
extract [-r image,regions] [-m ARCH] -n NAME -f FILE [-U]
Extracts a file from ROM
โ๏ธ write
write [-F] -r image,regions -f file [-u | -d] [-i int]
Write file into same-size [or larger] raw region
๐ read
read [-r fmap-region] -f file
Extract raw region contents into binary file
โ๏ธ truncate
truncate [-r fmap-region]
Truncate CBFS and print new size on stdout
๐ expand
expand [-r fmap-region]
Expand CBFS to span entire region
๐งฎ OFFSETS
So the numbers that come along with the -b, -H, and -o switches* can show up in two possible formats, bestie:
- if their value is greater than
0x80000000, they get interpreted as a top-aligned x86 memory address - otherwise, they're treated as an offset into flash
That's it, that's the rule ๐
๐๏ธ ARCHITECTURES
arm64, arm, mips, ppc64, power8, riscv, x86, unknown
๐๏ธ TYPES
bootblock, cbfs header, legacy stage, stage, simple elf, fit_payload, optionrom, bootsplash, raw, vsa, mbi, microcode, intel_fit, fsp, mrc, cmos_default, cmos_layout, spd, mrc_cache, mma, efi, struct, deleted, null, amdfw
okay so listen, this part is important: these actions and switches are only valid when working with legacy images whose structure is described primarily by a CBFS master header.
New-style images, in contrast, exclusively make use of an FMAP to describe their layout. That FMAP must minimally contain an 'FMAP' section specifying the location of this FMAP itself, plus a 'COREBOOT' section describing the primary CBFS. ๐ซถ
Also worth noting: when you're working with such images, the -F and -r switches default to 'COREBOOT' for convenience, and the -b switch becomes relative to the selected CBFS region's lowest address.
The one exception to this rule is the top-aligned address, which is always relative to the end of the entire image rather than relative to the local region. This is true for both input (sufficiently large) and output (-T) data. No cap, that's just how it is ๐
๐ AUTHORS
- coresystems GmbH.
- Man page written by Ahmad Khalifa.
and that's the whole page, bestie ๐ it shipped as part of System Administration Utilities back in November 2024 โ go forth and manage those ROM images, you absolute icon ๐โจ๐ฆ
๐ฆ where this page comes from
- debian trixie: coreboot-utils 24.12+dfsg-2 ยท GPL-2.0-only
- ubuntu questing: coreboot-utils 24.12+dfsg-2ubuntu1
- ubuntu resolute: coreboot-utils 25.09+dfsg-1ubuntu1 ยท GPL-2.0-only
- ubuntu stonking: coreboot-utils 25.09+dfsg-1ubuntu1 ยท GPL-2.0-only
- ๐ the page's license: GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms