Login
cleave-kconfig
Login

Kconfig's conf in Crystal, so that the Linux and U-Boot builds can be configured in the BQ2 seed without flex and bison. It writes the same files as the real conf, byte for byte: .config, include/config/auto.conf and its .cmd, include/generated/autoconf.h, Linux's rustc_cfg, U-Boot's tristate.conf, and the include/config/ dependency files. Make then never needs to build or run conf.

cleave-kconfig [--dialect linux|u-boot|qemu|zephyr] [--srctree DIR] [--functions FILE] \
               (--olddefconfig | --defconfig FILE | --syncconfig) Kconfig

It runs in the object tree, with the environment make gives conf, because Kconfig files read it ($(CC), $(srctree), and so on). The simplest way to get that environment is to put cleave-kconfig where kbuild expects scripts/kconfig/conf.

Dialects

This dialect lives in src/cleave/kconfig/uboot.cr.

Checked against Zephyr v4.4.2's whole tree for qemu_cortex_a53, with the files Zephyr's CMake generates under KCONFIG_BINARY_DIR written by hand: it reads all of it and writes a .config with no warnings. Glint's values from Kconfiglib for the several definitions of PRIVILEGED_STACK_SIZE (arm64 and x86) are a spec.

How it parses

It uses the crystal-robots multipass pattern, like cleave-dtc:

A syntax error names the first line left unreduced inside the blocks, not the line that opens the block holding it.

Not done

Checked