Repository navigation
Getting started
$ pip install boot-log-diff
$ boot-log-diff --version
boot-log-diff 0.2.0Python 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 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.logThe output has up to four parts:
- 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.
- 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.
-
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. - A summary line, plus a note when lines only moved.
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.
| 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- Capture logs from your own board: Capturing boot logs
- Add your board's fault knowledge: Known faults
- Put it into CI: Reports and CI
boot-log-diff · MIT licensed · the example logs are from a fictitious board (Acme EPC-8M).