Tux, the pinguin

A Kconfig parser written in rust.

Build status code coverage Minimum supported rust version: 1.56.0 or plus crates.io Version

Kconfig is a language that describes configuration options for the linux Kernel. The syntax looks like this: ```bash

https://github.com/torvalds/linux/blob/master/arch/riscv/Kconfig#L771

config EFI bool "UEFI runtime support" depends on MMU default y select EFI_STUB help This option provides support for runtime services provided by UEFI firmware. ```

There are plenty of other keywords in the Kconfig language, check out the official documentation for more details.

Features

Getting started

bash cargo add nom-kconfig

```rust use std::path::PathBuf; use nomkconfig::{kconfig::parsekconfig, KconfigInput, KconfigFile};

// curl https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.4.9.tar.xz | tar -xJ -C /tmp/ fn main() -> Result<(), Box> { let kconfigfile = KconfigFile::new( PathBuf::from("/tmp/linux-6.4.9"), PathBuf::from("/tmp/linux-6.4.9/Kconfig") ); let input = kconfigfile.readtostring().unwrap(); let kconfig = parsekconfig(KconfigInput::newextra(&input, kconfig_file)); println!("{:?}", kconfig); Ok(()) } ```

Resources