Commit Graph

63 Commits

Author SHA1 Message Date
Jacob Garber 554e55b0f0 util/kconfig: Use snprintf to avoid buffer overflow
'name' and 'env' are supposed to be file system paths,
but could overflow the buffer if configured incorrectly.
Let's avoid that entirely.

Found-by: Coverity Scan #1362515
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Change-Id: I1aef36819d49ebcbde1c51995dc0961c85e74150
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32686
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-05-13 09:14:42 +00:00
Werner Zeh 622a28d22b util/kconfig: Fix missing library issue with ld 2.24 and newer
When invoking 'make menuconfig' with gcc 4.9.2 an error is thrown:

ld: build/util/kconfig/lxdialog/checklist.o: undefined reference
to symbol 'acs_map'

This happens with ld version 2.24 and newer when menuconfig is
executed for the first time after make clean. This does not happen
with ld 2.20 (part of gcc 4.4.7).

It can be fixed with the flag -ltinfo in HOST_LOADLIBES.

Change-Id: I6216bb4d276d4bf98aa4ec06457b809fdcd73235
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32137
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-04-03 05:29:16 +00:00
Nico Huber 533bc0a7ef util/kconfig: Add `toada` Ada spec generation tool
Converts `auto.conf` to an Ada spec file. Write to
$(obj)/cb-config.ads and set the package name to
`CB.Config`.

Change-Id: I97c060d8a613c74a82a18aff9524ad4b01f9df56
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/31053
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-01-24 13:47:08 +00:00
Yegor Timoshenko c2e4941367 treewide: use /usr/bin/env where appropriate
Some Unix systems (GuixSD, NixOS) do not install programs like
Bash and Python to /usr/bin, and /usr/bin/env has to be used to
locate these instead.

Change-Id: I7546bcb881c532adc984577ecb0ee2ec4f2efe00
Signed-off-by: Yegor Timoshenko <yegortimoshenko@riseup.net>
Reviewed-on: https://review.coreboot.org/28953
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2018-11-17 07:32:03 +00:00
Tom Hiller 8ba9e8cf63 util: Add description.md to each util
Descriptions are taken from the files themselves or READMEs. Description
followed by a space with the language in marked up as code.

Change-Id: I5f91e85d1034736289aedf27de00df00db3ff19c
Signed-off-by: Tom Hiller <thrilleratplay@gmail.com>
Reviewed-on: https://review.coreboot.org/27563
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2018-07-26 13:26:50 +00:00
Elyes HAOUAS 1d3fde4693 {src,util}: Use NULL instead of 0 for pointer
Change-Id: I75fa4577055f25dde0a8b1044c005bba72cabd92
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/26857
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2018-06-11 08:52:08 +00:00
Martin Roth 00cbc7f72f Kconfig: Change symbol override from warning to notice
Overriding symbols within a .config is pretty common when doing
automated builds with various different options.  The warning
text makes it sound like this is an issue, so change it to say
'notice' instead.  We could get rid of it completely, but it's
not a bad thing to know that we have two copies of the same symbol
in the .config.

BUG=chrome-os-partner:54059
TEST=copy a disabled kconfig option to the end and set it to y.
See notice text instead of warning.

Change-Id: I9f575b2275233f638e42676263348c807e6515bd
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/16691
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-12-12 17:53:32 +01:00
Martin Roth c01ff74a6a util/kconfig/conf.c: Fix newline in error printf
For some reason the \n in the defconfig save error was not escaped.

Change-Id: I6a76b258f461a194fe17aae2b4fa04326b46d8d6
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/17742
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
2016-12-09 00:35:51 +01:00
Martin Roth 0cd338e6e4 Remove non-ascii & unprintable characters
These non-ascii & unprintable characters aren't needed.

Change-Id: I129f729f66d6a692de729d76971f7deb7a19c254
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15977
Tested-by: build bot (Jenkins)
Reviewed-by: Omar Pakker
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-08-01 21:44:45 +02:00
Martin Roth bfe6f6a72e kconfig: add olddefconfig target to help
olddefconfig is used to expand the miniconfig files with all the default
values removed by the 'savedefconfig' target.

Change-Id: Ic9c62f4c334919e8be478d30099819b90891670a
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/15319
Tested-by: build bot (Jenkins)
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-07-12 19:23:36 +02:00
Jonathan Neuschäfer e1a022ade4 util/kconfig: Fix gconfig build
This linker error was the problem:

build/util/kconfig/zconf.tab.o: In function `conf_read_simple':
/home/jn/dev/coreboot/util/kconfig/confdata.c:413: undefined reference to `kconfig_warnings'
/home/jn/dev/coreboot/util/kconfig/confdata.c:413: undefined reference to `kconfig_warnings'
build/util/kconfig/zconf.tab.o: In function `sym_calc_value':
/home/jn/dev/coreboot/util/kconfig/symbol.c:388: undefined reference to `kconfig_warnings'
/home/jn/dev/coreboot/util/kconfig/symbol.c:388: undefined reference to `kconfig_warnings'
collect2: error: ld returned 1 exit status
/home/jn/dev/coreboot/util/kconfig/Makefile:339: recipe for target 'build/util/kconfig/gconf' failed
make: *** [build/util/kconfig/gconf] Error 1

Change-Id: I4a667c7c15b35618fb9ad536f2be5044b8031ab4
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/15505
Tested-by: build bot (Jenkins)
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-07-01 19:29:53 +02:00
Patrick Georgi 4ed5cb3fb3 kconfig: make oldconfig work "non-strict"
oldconfig is regularly used to clean up templates that sometimes contain
duplicates or old symbols.
Since it cleans up the config, it doesn't need to fail on issues.

Change-Id: Ife0e9e3b9bfdde1eb6be0e2e38e81b9042cb7950
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/13687
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-02-15 08:03:56 +01:00
Martin Roth c37c7c8b1f util/kconfig: Ignore extra symbols in configs instead of failing
When updating an old .config file that has a symbol that has been
removed from the current Kconfig tree, kconfig will generate a warning
and fail to save the updated file.  This is incredibly annoying, and
not the goal when trying to eliminate Kconfig warnings.

Instead of generating a warning, just print a message that it's being
ignored.  This will remove the offending symbol, while allowing the
updated config file to be saved.

Split the change from 1 line to 3 lines to keep it at 80 characters.

Change-Id: I09d5775c9ed14bde80077b51b862a7f41bee098a
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/13674
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-02-12 17:03:36 +01:00
zbao 11a262c86c util/kconfig:xconf(QT): Update QT version of xconf
Update the qconf.cc and qconf.h to upstream code, which added support
of QT5 and removed the support of QT3.

All code is ported from kernel.org, with only one line added to qconf.cc.
int kconfig_warnings = 0;

Change-Id: Ice77cddcc00e43375039379978e55f42acf867f7
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/13130
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-02-03 03:46:18 +01:00
Martin Roth c24f3d615a Makefile: Individualize help targets & set as non-compile targets
- Including the help targets in the list of NOCOMPILE targets means they
can run even if the toolchain is mucked up.  Since they contain info on
building the toolchin, this is useful.
- Separate the three current parts of the help target into individual
components: help_coreboot, help_toolchain, and help_kconfig.  This is
mostly for the help_toolchin target which will be printed out by
toolchain.inc.

Change-Id: I365d95fd63e22bddd122fb1fede6f04270e03d63
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/12542
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-12-06 18:35:23 +01:00
zbao d38b22f8ec util/kconfig: Remove utsname for mingw
Mingw doesn't have that this function.

Change-Id: I640ea61ff24fba812e3f10771dd7e468dcfc63dd
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/11724
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-11-26 23:59:50 +01:00
Martin Roth 76f14b2b60 Makefiles: Add / Update help for makefile targets
Currently running 'make help' just gives help for the kconfig targets.

This adds help for common coreboot and toolchain targets.  It stops
printing some of the less common kconfig targets, but still leaves
them in the makefile as documentation.

Change-Id: I2a00fcbc06f05dc4029a91f3dff830c19e4d1329
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/12458
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-11-24 22:35:00 +01:00
zbao 2f3fd2640f util/kconfig: Set parameter of mkdir to only one for mingw.
The second parameter is to set file permissions for the directory, which
is not needed in mingw.

Change-Id: I88e317f075e8a39f0a280b3dd6e597d119f0f741
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/11723
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2015-11-20 05:37:20 +01:00
zbao 91ba80dd79 util/kconfig: fill glob_t with 0 before calling glob
On mingw, the function glob has some default options
which are not compliant with man page.

If gl_offs is not set as 0, there may be some slots which
is reserved.
If gl_pathc or gl_pathv is not set as 0, the result might
be appended to the list instead of being added as new ones.

Change-Id: I03110c4cdda70578828d6499262a085a81d26313
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/11711
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
2015-11-05 02:16:02 +01:00
Patrick Georgi 44853371f1 kconfig: fix build for xconfig, too
Change-Id: I1c5e3424cb56f1f10e75bb07db084c3500f3ba07
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11768
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2015-10-01 20:14:13 +00:00
Patrick Georgi 9595ed4731 kconfig: kconfig_warnings needs to be defined for all frontends
Change-Id: Iecefdd1e827e4eb8b4da573e4291850d6c47767f
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11754
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2015-09-30 10:48:21 +00:00
Stefan Reinauer 57a31317a2 kconfig: Allow KCONFIG_STRICT outside of confdata.c
To catch dependency errors in symbol.c (such as the ones
fixed by I51b4ee326f082c6a656a813ee5772e9c34f5c343) we need
to check for global kconfig warnings before saving config
files.

This patch will produce errors for wrong dependencies and
add catching of errors to conf, nconf and mconf. Sorry,
gconf users, you will have to wait.

Change-Id: Idf7ee406ce3869941af319219aea16fab826df84
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/11291
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-09-30 06:58:57 +00:00
Martin Roth 56354d503d util/kconfig: add olddefconfig target
There doesn't seem to have been an olddefconfig target in the coreboot
version of the Kconfig makefile.  It's listed in the .PHONY, but it
doesn't seem like it's ever been there.  This is useful for expanding
a miniconfig saved with 'make savedefconfig'.

Change-Id: I3798f8469135b58d32da68d4b0e434ab5351b501
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: http://review.coreboot.org/11273
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-25 15:40:12 +00:00
Stefan Reinauer f534203f06 Kconfig: Add KCONFIG_STRICT mode
This is basically a -Werror mode for Kconfig. When exporting
KCONFIG_STRICT in the Makefile, warnings in Kconfig will produce
errors instead.

This will make it easier to spot unclean Kconfig files, settings
and dependencies.

Change-Id: I941af24c3ccb10b8b9ddc5c98327154749ebbbc6
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10977
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-08-09 12:39:03 +02:00
Stefan Reinauer b12a448c97 kconfig: Fix defconfig targets
The syntax of "conf" has changed, but we never adapted
our Kconfig Makefile since we are not typically using those
targets (except for coreinfo)

Change-Id: Ib95b53d255d7456cc6d6bcc7048fcaa0db1ce142
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10716
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-06-30 21:45:50 +02:00
Stefan Reinauer ed56499ab1 libpayload: Drop duplicate copy of Kconfig
It's perfectly fine to have one single copy of kconfig in the tree.

Change-Id: Icfe32f0249dfc1c223009d6e7136462f8f8a7248
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10521
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-30 18:55:32 +02:00
Patrick Georgi db6dd817a2 kconfig: allow specifying the target for savedefconfig
Change-Id: Iee5ab0d3bdc8b754669356f2046d290d9ca555c2
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10511
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-16 18:08:15 +02:00
Patrick Georgi 4647bb11ca kconfig: enforce stable sort order
Locales differ in the order in which they sort entries. This ensures
predictable behavior.

Change-Id: I4ceec90a56bbc368a847d14298db0a21cc21e77c
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/10510
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-11 19:00:33 +02:00
Martin Roth f099e1bcff util/kconfig/Makefile: Add savedefconfig target
Add a savedefconfig target and the help for it to the kconfig
makefile.

The main advantage I found for using defconfigs instead of the full
.config is that they require less maintenence, so long as reasonable
default values are set when adding new config options.  When the
defconfig is expanded, it will use default values for all options not
saved in the defconfig.  This cuts the size of a saved config from
500ish lines to roughly 20 lines.

savedefconfig was added to the linux kernel in commit id
7cf3d73b4360e91b14326632ab1aeda4cb26308d

Change-Id: I45f3dc87b773fb6e9ee53e32fdcafff1f53074d2
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: http://review.coreboot.org/10462
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-10 03:15:10 +02:00
Elyes HAOUAS 52648623e0 Remove empty lines at end of file
Used command line to remove empty lines at end of file:
find . -type f -exec sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' {} \;

Change-Id: I816ac9666b6dbb7c7e47843672f0d5cc499766a3
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: http://review.coreboot.org/10446
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-06-08 00:55:07 +02:00
Patrick Georgi 3961834f66 kconfig: properly build parser when LKC_GENPARSER=1
The rules didn't actually trigger to rebuild the parser.

Change-Id: Id51aaa9816b069204c119622d60f7b728b762cad
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10168
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-05-12 18:41:10 +02:00
Patrick Georgi ccbcfd79ec kconfig: handle globbed files backwards
They're essentially collected on a stack before they're
parsed. So we push them backwards, then parse them in
the correct order.

Change-Id: Ibf29559389cd19f260d67bae8e0b5ef9f4f58d91
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10169
Tested-by: build bot (Jenkins)
Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
2015-05-11 09:06:53 +02:00
Patrick Georgi d36b80c791 kconfig: avoid using wordexp
OpenBSD refuses to implement it due to security concerns,
so use glob instead.

Change-Id: I7531cfe91deff240f7874d94d5acb340b87e51b6
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/10028
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-05-04 22:26:09 +02:00
Stefan Reinauer f78a09b60c kconfig: Add wildcard support for "source"
Kconfig's include directive "source" does not support
wildcards (e.g. source src/mainboard/*/Kconfig) which
makes automatic inclusion of all boards a tedious task
and prevents us from implementing "drop in" boards.

In our Makefile.inc files we already include mainboard
directories per wildcard, so let's add the infrastructure
to do the same with Kconfig.

Change-Id: I1988ff6ce3e167e86bb5cb65fc04a13748599dad
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/9294
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-04-06 23:52:57 +02:00
Stefan Reinauer 362f048979 kconfig: Replace mentions of "list_struct" to "list_head"
There's no such thing as "list_struct".

Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

Change-Id: Ida39beb7b81801b277b623ff5a40291d643706ee
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/9314
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-04-06 23:15:10 +02:00
Stefan Reinauer 5910aa88a7 kconfig: calloc/xcalloc: Fix argument order
The calloc() and xcalloc() functions takes @nmemb first and then @size.  Fix all w/
pattern "calloc\s*(\s*sizeof".

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1417866043-1877-1-git-send-email-arjun024@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Change-Id: I8b51cc59b3f3631b93b7e215fec5bf140cc2cbf9
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/9313
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-04-06 23:14:59 +02:00
Stefan Reinauer 1824ce3c40 kconfig: Fix warning "‘jump’ may be used uninitialized"
Warning:
In file included from scripts/kconfig/zconf.tab.c:2537:0:
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c:590:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     jump->offset = strlen(r->s);

Simplifies the test logic because (head && local) means (jump != 0)
and makes GCC happy when checking if the jump pointer was initialized.

Signed-off-by: Peter Kümmel <syntheticpp@gmx.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>

Change-Id: I43de391c9573a28c66d17e7dc535033be39060de
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/9312
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-04-06 23:14:09 +02:00
Stefan Reinauer 6654ab02fc kbuild: trivial - remove trailing empty lines
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

Change-Id: I019ba09f7371cff2699a6c854c478fec53e51126
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/9311
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-04-06 23:13:50 +02:00
Stefan Reinauer f2927e9470 kconfig: lxdialog: fix spelling
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>

Change-Id: I033338a4a3f3a20944feace46b679c85ee32d14e
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/9310
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-04-06 23:13:40 +02:00
Stefan Reinauer cce666207f kconfig: use va_end to match corresponding va_start
Although on some systems va_end is a no-op, it is good practice
to use va_end, especially since the manual states:

"Each invocation of va_start() must be matched by a corresponding
invocation of va_end() in the same function."

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>

Change-Id: Ia08a57c37a6294e002cb6ce4c0a010c0d2edf973
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/9309
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-04-06 23:13:29 +02:00
Stefan Reinauer 3ec23b3d51 kbuild: trivial - use tabs for code indent where possible
Imported from upstream linux kernel kconfig.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>

Change-Id: Ieed948c6b9c5fc40c1f3d652df11fa70ec6e93a0
Original-Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Original-Signed-off-by: Michal Marek <mmarek@suse.cz>
Reviewed-on: http://review.coreboot.org/9308
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-04-06 23:13:15 +02:00
Stefan Reinauer 14f72bc2cc kconfig/lxdialog: get ncurses CFLAGS with pkg-config
This makes "make menuconfig" also work on systems where ncurses is not
installed in a standard location (such as on NixOS).

This patch changes ccflags() so that it tries pkg-config first, and only
if pkg-config fails does it go back to the fallback/manual checks. This
is the same algorithm that ldflags() already uses.

Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>

Change-Id: Ie2372ca35546c1fc2d6cf603614683312ee4ea4c
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/9315
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
2015-04-06 23:12:55 +02:00
Stefan Reinauer 172d33594e util: Add miniconfig, a script to minimize coreboot configurations
This script produces a "minimal" configuration from a full coreboot
configuration, e.g. a configuration file that only contains the differences
between the default configuration of a board and the input configuration
file.

Usage: util/kconfig/miniconfig config.big config.mini

This will read config.big and produce config.mini. If you omit config.mini,
config.big will be changed in place.

Minimal configurations are easier to read and more robust when reusing
them among different versions of coreboot as they reflect exactly the
changes made to the default configuration instead of a full snapshot
of all configuration options.

Change-Id: Ifbee49e0192c2c557b18bcc1a92fe2a5d5164a3a
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/8974
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@google.com>
2015-03-26 03:06:54 +01:00
Patrick Georgi 129462da1b kconfig: create files in target directory if requested
Otherwise rename() fails when used across filesystem
boundaries.

Change-Id: I22a62310f0e46ac9cfee50b7e9eeed93536ed409
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/7504
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Tested-by: build bot (Jenkins)
2014-11-18 08:25:50 +01:00
Patrick Georgi d520840d4c kconfig: update to follow upstream more closely
This might break a bunch of stuff (eg. win32 support),
but otherwise introduces nconfig (ncurses based configuration
frontend), partial configuration headers for improved dependency
tracking (which requires some more build system support) and
various bug fixes.

Change-Id: I5d8a280810c6a26fc3fd056d5d94cb9e591a0ff5
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/5487
Tested-by: build bot (Jenkins)
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2014-05-07 19:39:28 +02:00
Roman Zippel 330bb6acc8 kconfig: fix choice dependency check
Properly check the dependency of choices as a group.
Also fix that sym_check_deps() correctly terminates the dependency loop
error check (otherwise it would continue printing the dependency chain).

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

=======

Cherry-picked from the Linux kernel.

Change-Id: I0c98760dd0f55cf2ff70c53e0b014288b59574c8
Signed-off-by: Gabe Black <gabeblack@chromium.org>
Reviewed-on: http://review.coreboot.org/3290
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-05-26 11:50:11 +02:00
Roel Kluin 48757668a5 kconfig: reversed borderlines in inputbox
Fix reversal of dlg.border.atr and dlg.dialog.atr for draw_box()
Makes the inputbox look like expected

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

=======

Cherry-picked from the Linux kernel.

Change-Id: I596915aab0204ef0e392fefa56fad8e25204e207
Signed-off-by: Gabe Black <gabeblack@chromium.org>
Reviewed-on: http://review.coreboot.org/3289
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-05-26 11:49:30 +02:00
Roman Zippel 543aa7ba7b kconfig: add named choice group
As choice dependency are now fully checked, it's quite easy to add support
for named choices. This lifts the restriction that a choice value can only
appear once, although it still has to be within the same group,
but multiple choices can be joined by giving them a name.
While at it I cleaned up a little the choice type logic to simplify it a
bit.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

=======

Cherry-picked from the Linux kernel.

Change-Id: If0f00d1783907d606220cda5307b8960d3bfc38d
Signed-off-by: Gabe Black <gabeblack@chromium.org>
Reviewed-on: http://review.coreboot.org/3291
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-05-26 11:49:12 +02:00
Zheng Bao def50b061d kconfig: Some terms or curses libraries treat backspace as 0x08
Change-Id: Ie4e4a2f0d68643a8f46d24ee7bd1b953e9fe14a5
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1605
Tested-by: build bot (Jenkins)
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-10-23 05:05:53 +02:00
Zheng Bao 545167252d build: build coreboot on mingw.
regex, pdcurses, wsock(for itohl) are seperated libraries. mmap and unmmap are
ported from git.

Issues:
1. The length of command line is limited. That makes the Thather can not be built
  because too many obj.o need to be built.

Change-Id: I1d60ec5c7720c1e712e246c4cd12e4b718fed05f
Signed-off-by: Zheng Bao <zheng.bao@amd.com>
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: http://review.coreboot.org/1604
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-10-22 21:49:54 +02:00