I2C-STUB-FROM-DUMP(8)
β¨ I2C-STUB-FROM-DUMP β¨
okay bestie, so this is a page from the System Manager's Manual β section 8, system administration girlies rise up π
β and the command is called i2c-stub-from-dump. Let's get into it π
π NAME π
i2c-stub-from-dump β feed i2c-stub with dump files π
πΈ SYNOPSIS πΈ
i2c-stub-from-dump address[,address,...] dump-file [dump-file ...]
π¦ DESCRIPTION π¦
So what IS this? i2c-stub-from-dump is a lil helper script for the i2c-stub kernel driver, and it's genuinely so useful, no cap. It lets you set up one or more fake I2C chips on the i2c-stub bus, based on dumps of the chips you wanna emulate π
Important detail bestie: i2c-stub-from-dump needs i2cdetect and i2cset to be installed and reachable through the user's PATH. The way that i2cdetect is used is to find out the i2c-stub bus number, while i2cset is the one that does the writing to your fake I2C chips βοΈβ¨
π EXAMPLE π
Say you have an I2C chip on system A π °οΈ and you wanna do some development on its driver over on system B π ±οΈ. Iconic. Here are the few steps you have to follow:
Step 1 β on system A, use i2cdump to capture a dump from the chip. Assuming the chip in question lives at address 0x4c on I2C bus 0, you would run:
i2cdump -y 0 0x4c b > chip.dump
Adjust the bus number and chip address for your case, fr fr. i2cdetect can help you find out their values. And heads up: if the device uses word (16-bit) register access instead of the traditional byte (8-bit) access, use mode w instead of b π
Step 2 β copy the dump file to system B. Slay, we're moving π¨
Step 3 β on system B, run:
i2c-stub-from-dump 0x4c chip.dump
This will load the required i2c-dev and i2c-stub kernel drivers if needed, then write all the register values to the emulated I2C chip at address 0x4c. Again, adjust the address as needed π
π LIMITATIONS π
ngl, there are some limitations to the kind of devices that can be handled, and we're listing them for you so you don't get got:
- Device must not have banks (as most Winbond devices do). π
π BUGS π
To report bugs or send fixes, please write to the Linux I2C mailing list <linux-i2c@vger.kernel.org> with Cc to the current maintainer: Jean Delvare <jdelvare@suse.de> π
bestie don't be shy, they literally want your bug reports π«Ά
π SEE ALSO π
π AUTHOR π
Jean Delvare β¨
and that's the whole page, main character energy only π this one's dated March 2010 β vintage, lowkey iconic, still out here doing the lord's work π stay emulated bestie π¦
π¦ where this page comes from
- alpine 3.24: i2c-tools-doc 4.4-r3 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- arch rolling: i2c-tools 4.4-4 Β· GPL
- centos-stream 10: i2c-tools-perl 4.3-14.el10 Β· GPL-2.0-or-later
- centos-stream 9: i2c-tools-perl 4.3-3.el9 Β· GPLv2+
- debian bookworm: i2c-tools 4.3-2+b3
- debian trixie: i2c-tools 4.4-2 Β· GPL-2.0-or-later
- fedora 43: i2c-tools-perl 4.4-3.fc43 Β· GPL-2.0-or-later
- fedora 44: i2c-tools-perl 4.4-4.fc44 Β· GPL-2.0-or-later
- nixpkgs unstable: i2c-tools 4.4
- opensuse-leap 16.0: i2c-tools 4.4-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: i2c-tools 4.4-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: i2c-tools 4.4-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: i2c-tools 4.4-160000.2.2 Β· GPL-2.0-or-later
- ubuntu jammy: i2c-tools 4.3-2build1
- ubuntu noble: i2c-tools 4.3-4build2
- ubuntu questing: i2c-tools 4.4-2
- ubuntu resolute: i2c-tools 4.4-2build3 Β· GPL-2.0-or-later
- ubuntu stonking: i2c-tools 4.4-3 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms