11

I have an Intel wireless card driven by iwlwifi, and I can see the following message in dmesg:

iwlwifi 0000:03:00.0: loaded firmware version 17.168.5.3 build 42301

Given that I know which blob is loaded, how I can find out the version of this blob (.ucode file)?

If you look at the below where the ucode is loaded, it doesn't tell me the version information just that a blob was loaded. But I know Intel versions these.

$ sudo dmesg | grep ucode
[   26.132487] iwlwifi 0000:03:00.0: firmware: direct-loading firmware iwlwifi-6000g2a-6.ucode
[40428.475015] (NULL device *): firmware: direct-loading firmware iwlwifi-6000g2a-6.ucode
Evan Carroll
  • 28,578
  • 45
  • 164
  • 290
daisy
  • 53,527
  • 78
  • 236
  • 383
  • 1
    I suspect it may not load a firmware every time the system boots up, but only reports what firmware version is running on the ethernet card. – fduff Jul 19 '12 at 12:53

2 Answers2

8

The iwlwifi driver loads the microcode file for your wifi adapter at startup. If you want to know the version of the blobs you have on your machine, try Andrew Brampton's script. Run:

## Note the firmware may stored in `/usr/lib`
./ucode.py /lib/firmware/iwlwifi-*.ucode

And compare the output to your journal (dmesg output).

Note that the script works with python2.

Evan Carroll
  • 28,578
  • 45
  • 164
  • 290
don_crissti
  • 79,330
  • 30
  • 216
  • 245
1

As a side note, and looking at the Andrew Brampton script mentioned in @don_crissti's answer, you can get the same output from Radare2 which is a reverse-engineering framework.

pf x[4]z[64]zN1N1N1N1 magicfile magicblob text serial api minor major
  • pf print formatted data
    • x 0xHEX value and flag (fd @ addr) (see 'd' and 'i')
    • [4]z null terminated string of min-length 4 size
    • [64]z null terminated string of min-length 64 size
    • N1N1N1N1 next char specifies size of unsigned value (1, 2, 4 or 8 byte(s))

You can run that from a script like this,

for f in /lib/firmware/iwlwifi-*.ucode; do
    echo $f;
    radare2 -qc "pf x[4]z[64]zN1N1N1N1 magicfile magicblob text serial api minor major" "$f";
done;

Here is some example output

 magicfile : 0x00000000 = 0x00000000
 magicblob : 0x00000004 = IWL.
      text : 0x00000008 = 6000g2b fw v18.168.6.1 build 0.
    serial : 0x00000048 = 1
       api : 0x00000049 = 6
     minor : 0x0000004a = 168
     major : 0x0000004b = 18

You play them backwards, major.minor.api.serial to get 18.168.6.1

Evan Carroll
  • 28,578
  • 45
  • 164
  • 290