| Crates.io | ikconfig |
| lib.rs | ikconfig |
| version | 0.2.0 |
| created_at | 2022-12-17 09:10:18.817486+00 |
| updated_at | 2023-02-12 09:18:59.282482+00 |
| description | A CLI utility to extract the .config file from a kernel image. |
| homepage | https://github.com/yestyle/extract-ikconfig-rs |
| repository | https://github.com/yestyle/extract-ikconfig-rs |
| max_upload_size | |
| id | 739709 |
| size | 86,892 |
This is a Rust re-implementation of extract-ikconfig from Linux kernel, to extract the .config file from a kernel image.
This will only work when the kernel was compiled with CONFIG_IKCONFIG, which is enabled on Arch Linux by default but not on Ubuntu.
It supports all 7 compression algorithms in Linux kernel:
CONFIG_KERNEL_GZIPCONFIG_KERNEL_BZIP2CONFIG_KERNEL_LZMACONFIG_KERNEL_XZCONFIG_KERNEL_LZOCONFIG_KERNEL_LZ4CONFIG_KERNEL_ZSTDThis crate requires liblzma being present in the system before installation and pkg-config is used to find liblzma and other libraries during the build.
sudo pacman -S pkgconf xz
sudo apt install pkg-config liblzma-dev
Please refer to system manuals for other distributions. You can check if liblzma is installed by running:
$ pkg-config --libs liblzma
And it should output -llzma if liblzma is correctly installed.
This crate has been published onto crates.io, so you can use the following command to install ikconfig executable in ~/.cargo/bin directory:
cargo install ikconfig
ikconfig <path_of_kernel_image>
The extracted config file will be printed on standard output as the original shell script does. Please use output redirection to save as a file if needed, e.g.:
ikconfig /boot/vmlinuz-linux > .config
The integration tests in this repository will compare the execution time of ikconfig and extract-ikconfig shell script.
The latter uses the commands on system to accomplish corresponding decompression, most of which are pre-installed except
lzop(1), so you might need to install it before running cargo test.
sudo pacman -S lzop
sudo apt install lzop
This project is licensed under GPL-3.0 or MIT license.