coreboot-kgpe-d16/util/kconfig
Krystian Hebel 9ab3a1fe4a util/kconfig: Fix default value getter for integer options
CB:37152 was supposed to be uprev to Linux's kconfig, but it got this
one case wrong, Linux never returned "0" [1]. As a result, when an
option has default value different than 0, and it was changed to 0,
savedefconfig skips saving it. However, during the build from such
defconfig the option is assigned default value.

TEST=Set SEABIOS_DEBUG_LEVEL to 0 and see that savedefconfig writes
it to defconfig file.

[1] 7cf3d73b43

Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Change-Id: I821e45dcec99904fab85f136298cbd0315237ff6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72650
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2023-05-22 12:34:50 +00:00
..
lxdialog util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
patches util/kconfig: Add comment explaining difference from upstream 2023-01-15 17:59:39 +00:00
.gitignore util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
Makefile util/kconfig: Uprev to Linux 5.17's kconfig 2022-10-30 08:46:03 +00:00
Makefile.inc util/kconfig: Add pre-built parser 2021-09-13 15:35:03 +00:00
README.md util/kconfig/README.md: Add notes about adding a new quilt patch 2022-12-01 22:12:29 +00:00
conf.c util/kconfig: Uprev to Linux 5.17's kconfig 2022-10-30 08:46:03 +00:00
confdata.c util/kconfig: Add comment explaining difference from upstream 2023-01-15 17:59:39 +00:00
description.md
expr.c util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
expr.h util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
gconf-cfg.sh util/kconfig: Uprev to Linux 5.19's kconfig 2022-10-30 08:46:50 +00:00
gconf.c util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
gconf.glade
images.c util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
images.h util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
internal.h util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
lexer.l util/kconfig: Uprev to Linux 5.16's kconfig 2022-10-30 08:45:52 +00:00
lexer.lex.c_shipped util/kconfig: Add pre-built parser 2021-09-13 15:35:03 +00:00
list.h util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
lkc.h util/kconfig: Uprev to Linux 6.0's kconfig 2022-10-30 08:47:21 +00:00
lkc_proto.h util/kconfig: Uprev to Linux 5.16's kconfig 2022-10-30 08:45:52 +00:00
mconf-cfg.sh util/kconfig: Uprev to Linux 5.19's kconfig 2022-10-30 08:46:50 +00:00
mconf.c util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
menu.c util/kconfig: Uprev to Linux 6.0's kconfig 2022-10-30 08:47:21 +00:00
merge_config.sh util/kconfig: Uprev to Linux 5.15's kconfig 2021-11-02 08:10:47 +00:00
nconf-cfg.sh util/kconfig: Uprev to Linux 5.19's kconfig 2022-10-30 08:46:50 +00:00
nconf.c util/kconfig: Uprev to Linux 5.19's kconfig 2022-10-30 08:46:50 +00:00
nconf.gui.c util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
nconf.h util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
parser.tab.c_shipped util/kconfig: Add pre-built parser 2021-09-13 15:35:03 +00:00
parser.tab.h_shipped util/kconfig: Add pre-built parser 2021-09-13 15:35:03 +00:00
parser.y util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
preprocess.c util/kconfig: Uprev to Linux 5.17's kconfig 2022-10-30 08:46:03 +00:00
qconf-cfg.sh util/kconfig: Uprev to Linux 6.0's kconfig 2022-10-30 08:47:21 +00:00
qconf.cc util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
qconf.h util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00
regex.c util/kconfig/regex.c: Remove leftover 2022-09-16 14:52:44 +00:00
regex.h
streamline_config.pl util/kconfig: Uprev to Linux 5.17's kconfig 2022-10-30 08:46:03 +00:00
symbol.c util/kconfig: Fix default value getter for integer options 2023-05-22 12:34:50 +00:00
toada.c
util.c util/kconfig: Uprev to Linux 5.13's kconfig 2021-07-13 20:28:14 +00:00

README.md

coreboot kconfig

This is coreboot's copy of kconfig which tracks Linux as upstream but comes with a few patches for portability but also a few semantic changes.

The patches that lead to this tree can be found in the patches/ subdirectory in a quilt friendly format that is also simple enough to manage manually with Unix tooling.

Updating kconfig

The first step is to unapply the patches. This can either be done with quilt in an already-configured tree (quilt pop -a should cleanly unapply them all) or manually if quilt doesn't have its tracking metadata around yet:

$ for i in `ls patches/*.patch | tac`; do patch -p1 -R -i "$i"; done

The result should be a subtree that, apart from a few coreboot specific files on our side (e.g. documentation, integration in our build system) and a few files on the upstream end that we don't carry (e.g. the tests), is identical to the scripts/kconfig/ directory of Linux as of the most recent uprev we did. Check the uprev version by looking through git log util/kconfig output in our tree.

Assuming that you want to uprev from Linux 5.13 to 5.14, with a Linux git tree available in ~/linux,

$ cd util/kconfig && (cd ~/linux/ && git diff v5.13..v5.14 scripts/kconfig) | patch -p2`

applies the changes to your local tree.

Then reapply our patch train, which might be as simple as quilt push -a --refresh but might also require some meddling with the patches to make them apply again with the changes you just imported from Linux.

Check that kconfig still works, git add and git commit the changes and write a meaningful commit message that documents what Linux kconfig version the tree has been upreved to.

Adding a new patch

The format of the patches to kconfig is a mix of the headers produced by git format-patch and the patch format of quilt. However neither git nor quilt seems to have any functionality to directly produce a file in such a format

To add a patch in this format:

  1. Add your changes to the sources and git commit them

  2. Generate a git patch for the commit:

    $ git format-patch HEAD~

  3. Reverse apply the newly created patch file to restore the tree back to the state quilt thinks it is in:

    $ git apply -R

  4. Import the patch info quilt:

    $ quilt import

  5. Force push the change to the top of quilt's patch stack (quilt won't like the git diff style and would normally refuse to apply the patch):

    $ quilt push -f

  6. Add the changed files to be tracked against the quilt:

    $ quilt add

  7. Re-apply your changes from the patch file:

    $ git apply

  8. Add the changes to quilt to regenerate the patch file in a quilt compatible format while keeping the git header:

    $ quilt refresh

  9. The new patch file and updated patches/series files can now be added to the git commit