Blame README.md

Packit 400c17
## Synopsis
Packit 400c17
Packit 400c17
The aim of **kabi-dw** is to detect any changes in the ABI between the successive builds of the Linux kernel.
Packit 400c17
This is done by dumping the DWARF type information (the .debug\_info section) for the specific symbols into the text files and later comparing the text files.
Packit 400c17
Packit 400c17
## Example
Packit 400c17
Packit 400c17
Build your kernel with CONFIG\_DEBUG\_INFO set:
Packit 400c17
Packit 400c17
```
Packit 400c17
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Packit 400c17
cd linux && git checkout v4.5
Packit 400c17
make allyesconfig
Packit 400c17
make
Packit 400c17
```
Packit 400c17
Packit 400c17
Get all the modules *and* vmlinux into single directory
Packit 400c17
Packit 400c17
```
Packit 400c17
make modules_install && cp vmlinux /usr/lib/modules/4.5.0
Packit 400c17
```
Packit 400c17
Packit 400c17
... build another kernel you want to compare to, lets say v4.6.
Packit 400c17
Packit 400c17
Build a list of symbols you want to monitor:
Packit 400c17
Packit 400c17
~~~
Packit 400c17
cat > symbols << EOF
Packit 400c17
init_task
Packit 400c17
schedule
Packit 400c17
dev_queue_xmit
Packit 400c17
__kmalloc
Packit 400c17
printk
Packit 400c17
EOF
Packit 400c17
~~~
Packit 400c17
Packit 400c17
Generate the type information for both kernels based on the current whitelist
Packit 400c17
Packit 400c17
~~~
Packit 400c17
./kabi-dw generate -s symbols -o kabi-4.5 /usr/lib/modules/4.5.0
Packit 400c17
./kabi-dw generate -s symbols -o kabi-4.6 /usr/lib/modules/4.6.0
Packit 400c17
~~~
Packit 400c17
Packit 400c17
Compare the two type dumps:
Packit 400c17
Packit 400c17
~~~
Packit 400c17
./kabi-dw compare kabi-4.5 kabi-4.6
Packit 400c17
~~~
Packit 400c17
Packit 400c17
## Motivation
Packit 400c17
Packit 400c17
Traditionaly Unix System V had a stable ABI to allow external modules to work with the OS kernel without a recompilation called Device Driver Interface.
Packit 400c17
Linux however never developed such stable kernel ABI. Therefore it's vital to monitor all kernel interfaces used by the external module for change, and if such change happens, the module needs to be recompiled.
Packit 400c17
Packit 400c17
Linux has an option (CONFIG\_MODVERSIONS) to generate a checksum identifing all exported symbols thourhg the EXPORT\_SYMBOL() macro. But these checksum are not sufficient to actually identify the scope of the change. For example changing a couple of unused padding bits in a structure to a new field won't break any external modules, but such change changes the chekcsum of any function which receives such structure through its arguments.
Packit 400c17
Packit 400c17
## Installation
Packit 400c17
Packit 400c17
This program needs elfutils installed. Check out your distribution to figure out how to install elfutils.
Packit 400c17
Packit 400c17
For *Fedora* and *CentOS 7* systems:
Packit 400c17
~~~
Packit 400c17
dnf install kabi-dw
Packit 400c17
~~~
Packit 400c17
Packit 400c17
For *Ubuntu* systems, you need to compile it. Install the dependencies:
Packit 400c17
~~~
Packit 400c17
sudo apt-get install elfutils
Packit 400c17
~~~
Packit 400c17
Packit 400c17
Then just make and run:
Packit 400c17
~~~
Packit 400c17
make
Packit 400c17
./kabi-dw
Packit 400c17
~~~
Packit 400c17
Packit 400c17
## Contributors
Packit 400c17
Packit 400c17
Developed by Stanislav Kozina, Red Hat, Inc. with the help of others.
Packit 400c17
Packit 400c17
## License
Packit 400c17
Packit 400c17
This program is free software: you can redistribute it and/or modify
Packit 400c17
it under the terms of the GNU General Public License as published by
Packit 400c17
the Free Software Foundation, either version 3 of the License, or
Packit 400c17
(at your option) any later version.