ECE 441 · Week 3

Modern Computer: Secure Infrastructure

How to diff the live device tree against the source tree.

Week 3 of 10 · Solitude

ECE 441 · Week 3 · In class

How to diff the live device tree against the source tree.

ECE 441 · Week 3 · In class

Copy three section titles from the week-1 table you already turned in, onto a page, before you open the live tree.

ECE 441 · Week 3 · Lecture

Two trees, one board

ECE 441 · Week 3 · Lecture

Making the two comparable

# live tree, decompiled and sorted
dtc -q -s -I fs -O dts -o live.dts /proc/device-tree

# source tree, compiled then decompiled the same way
dtc -q -s -I dtb -O dts -o src.dts board.dtb

diff -u src.dts live.dts > tree.diff

-s sorts nodes and properties, so order alone does not show as a difference.

ECE 441 · Week 3 · Lecture

Reading the diff

DifferenceUsual cause
/chosen gains bootargsThe bootloader passed the command line
A memory node is filled inThe bootloader measured the DRAM size
MAC or serial number appearsThe bootloader fixed it up
status flips to "okay"An overlay enabled a device
phandle values differNumbering, usually not a change

ECE 441 · Week 3 · Lecture

Looking for a title in the tree

grep -n 'compatible' live.dts
ls /proc/device-tree/
find /proc/device-tree -name 'status' | head

ECE 441 · Week 3 · Lab

Lab

  1. Diff the live device tree against the source tree.
  2. For three section titles from your week-1 table, write down each title that does not appear in the live tree. Second pass: name one title that did appear, and leave it out of the three you turn in.
  3. Assemble the lab hand-in: The diff of the live device tree against the source tree, plus three week-1 section titles that do not appear in the live tree.

ECE 441 · Week 3 · Lab

Hand in

The diff of the live device tree against the source tree, plus three week-1 section titles that do not appear in the live tree.

ECE 441 · Week 3 · Homework

Homework

ECE 441 · Week 3 · Homework

Turn in

Three section titles copied from the week-1 table you already turned in.

ECE 441 · Week 3 · Read

Read

On the lab site: Module 5, Memory bring-up, and Module 9, Device tree and pin multiplexing, show the tree. This week grades the diff and the three titles.

ECE 441 · Week 3 · Next

Week 4

A rebuild has an identity: the hash of its image, and one console line only that build prints.

Arrow keys or space to move, F for full screen, N for speaker notes, Home and End for the first and last slide. Print gives one slide per page.