Skip to content

Getting started

Ralf Steinert edited this page Oct 29, 2026 · 1 revision

Install

$ pip install boot-log-diff
$ boot-log-diff --version
boot-log-diff 0.2.0

Python 3.10 or newer. On Python 3.11+ there are no dependencies; on 3.10 the small tomli package is installed for reading rule files. pipx install boot-log-diff keeps it out of your project environments.

The first comparison

The repository has two example logs of an i.MX8M board: a good one and one with three faults. Get them and compare:

$ git clone https://github.com/steitec/boot-log-diff.git
$ cd boot-log-diff/examples
$ boot-log-diff golden.log faulty.log

The output has up to four parts:

  1. Facts that differ — values worth comparing on their own: RAM size, memory seen by the kernel, CPU count, board model, U-Boot and kernel version. Here: the board has 1 GiB instead of 2 GiB.
  2. Known faults — new lines that match a known fault pattern, with a severity and a diagnosis. Here: the Ethernet PHY is not found and the SD card slot times out.
  3. Hunks — the lines that differ, in the familiar diff form. - is a line of the golden log that is missing, + a new line of the board under test, +! a new line that looks like an error.
  4. A summary line, plus a note when lines only moved.

Your own noise

Without options, the example also reports the login prompt, because the board's host name contains its serial number (epc8m-00b7c2 instead of epc8m-00a1f3). Mask it:

$ boot-log-diff golden.log faulty.log --mask 'epc8m-[0-9a-f]+'

Every board has a few of these: serial numbers, host names, a random seed, a calibration value. Building a golden log shows how to find and mask them once, so a healthy board gives an empty result.

Exit status

Status Meaning
0 no deviations (lines that only moved do not count)
1 deviations found
2 usage or input error: bad regex, bad rules file, missing file, report not writable

That is all a test sequencer needs:

if boot-log-diff golden.log dut.log --html "reports/$SERIAL.html"; then
    echo "boot check passed"
fi

Next steps

Clone this wiki locally