summaryrefslogtreecommitdiffstats
path: root/payloads/nvramcui
Commit message (Collapse)AuthorAgeFilesLines
* payloads/nvramcui/nvramcui.c: Reformat codeElyes Haouas2022-05-161-23/+12
| | | | | | | | Change-Id: If5b4ae7d9f9046e56ca098c0469b503130bc8707 Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61955 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@tutanota.com>
* nvramcui: Use libpayload's new `Makefile.payload`Nico Huber2021-02-072-31/+8
| | | | | | | | Change-Id: I34bf659c1a069ccc27ca613bbf86780d4da49259 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47636 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* nvramcui: Unexport COREBOOT_EXPORTSNico Huber2021-02-071-0/+2
| | | | | | | | | | | | | coreboot's Makefile exports a lot of variables that influence make sub- processes (e.g. for Kconfig). We don't want these variables leak into sub-processes for (lib)payload builds, hence unexport them. Change-Id: I8da2d8db6238d456723b9c22bee80c62e97027b0 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/48940 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Felix Singer <felixsinger@posteo.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* nvramcui: Make local render_form() function staticNico Huber2021-01-131-1/+1
| | | | | | | | | | | Allows us to build with `-Wmissing-prototypes`. Change-Id: I722b41e515ee472697028a912b9136ce59611051 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47635 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* .gitignore: Split into subdirectory filesPatrick Georgi2020-10-301-0/+2
| | | | | | | | | | | | | | There's no need for the global list of files to ignore, so use git's ability to work with more local configuration. Change-Id: I50882e6756cbc0fdfd899353cc23962544690fb3 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46879 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Christian Walter <christian.walter@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/nvramcui: Fix `make clean`Nico Huber2020-08-181-2/+2
| | | | | | | | | | | After `make clean` a new build should not be based on stale artifacts. Hence we have to remove them. Change-Id: I540a83a6c87b843b1c4c9c55990bf3e91fe90d79 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/44180 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* treewide: Remove "this file is part of" linesPatrick Georgi2020-05-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stefan thinks they don't add value. Command used: sed -i -e '/file is part of /d' $(git grep "file is part of " |egrep ":( */\*.*\*/\$|#|;#|-- | *\* )" | cut -d: -f1 |grep -v crossgcc |grep -v gcov | grep -v /elf.h |grep -v nvramtool) The exceptions are for: - crossgcc (patch file) - gcov (imported from gcc) - elf.h (imported from GNU's libc) - nvramtool (more complicated header) The removed lines are: - fmt.Fprintln(f, "/* This file is part of the coreboot project. */") -# This file is part of a set of unofficial pre-commit hooks available -/* This file is part of coreboot */ -# This file is part of msrtool. -/* This file is part of msrtool. */ - * This file is part of ncurses, designed to be appended after curses.h.in -/* This file is part of pgtblgen. */ - * This file is part of the coreboot project. - /* This file is part of the coreboot project. */ -# This file is part of the coreboot project. -# This file is part of the coreboot project. -## This file is part of the coreboot project. --- This file is part of the coreboot project. -/* This file is part of the coreboot project */ -/* This file is part of the coreboot project. */ -;## This file is part of the coreboot project. -# This file is part of the coreboot project. It originated in the - * This file is part of the coreinfo project. -## This file is part of the coreinfo project. - * This file is part of the depthcharge project. -/* This file is part of the depthcharge project. */ -/* This file is part of the ectool project. */ - * This file is part of the GNU C Library. - * This file is part of the libpayload project. -## This file is part of the libpayload project. -/* This file is part of the Linux kernel. */ -## This file is part of the superiotool project. -/* This file is part of the superiotool project */ -/* This file is part of uio_usbdebug */ Change-Id: I82d872b3b337388c93d5f5bf704e9ee9e53ab3a9 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41194 Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* Makefile.inc, payloads: Enable -WvlaJacob Garber2019-08-201-1/+1
| | | | | | | | | | | Variable length arrays are dangerous, so let's make sure they don't sneak back into coreboot or any of the payloads. Change-Id: Idf2488cf0efab51c9569a3789ae953368b61880c Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33846 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX)Julius Werner2019-03-071-1/+1
| | | | | | | | | | | | | This patch is a raw application of find payloads/ -type f | \ xargs sed -i -e 's/IS_ENABLED\s*(CONFIG_/CONFIG(/g' Change-Id: I883b03b189f59b5d998a09a2596b0391a2d5cf33 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31775 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* payloads/nvramcui/payload.sh: Fix shellcheck warningsMartin Roth2018-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | In payloads/nvramcui/payload.sh line 5: DIR=`dirname $0` ^-- SC2006: Use $(..) instead of deprecated `..` ^-- SC2086: Double quote to prevent globbing and word \ splitting. In payloads/nvramcui/payload.sh line 6: lpgcc -o $DIR/nvramcui.elf $DIR/nvramcui.c 2>&1 >/dev/null || exit 1 ^-- SC2086: Double quote to prevent globbing and word \ splitting. ^-- SC2086: Double quote to prevent \ globbing and word splitting. ^-- SC2069: The order of \ of the 2>&1 and the \ redirect matters. The \ 2>&1 has to be last. Change-Id: Iceab2d0df49c642f54e6b911793aa1479f542644 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/23373 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* nvramcui: Use regular `if` over `#if` for `IS_ENABLED`Paul Menzel2017-06-061-3/+2
| | | | | | | | | | | When using the regular `if` construct, the compiler will check the guarded code independently from the condition. Change-Id: I988fa9379e8c748013a67ef29fa908b4d9a970ad Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Reviewed-on: https://review.coreboot.org/18794 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* nvramcui: Add USB supportNicola Corna2017-03-131-0/+4
| | | | | | | | | | | | | | Enable the USB during the initialization of nvramcui. Without it the USB keyboards don't work, which makes this payload pointless on the systems where a PS/2 keyboard port isn't available. Based on https://review.coreboot.org/#/c/17507/ Change-Id: I04697c5f582b41e6f6ffe98955bf59f4fe57f66e Signed-off-by: Nicola Corna <nicola@corna.info> Reviewed-on: https://review.coreboot.org/18765 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph <siro@das-labor.org>
* nvramcui: Declare variable outside for loopPaul Menzel2017-01-251-2/+4
| | | | | | | | | | | | Make the code C89 compatible, which doesn’t allow loop initial declarations. Older compilers use C89 by default, so just declare the variable outside. Change-Id: I3c5a8109e66f7a25687f4e4b2c72718d74276e04 Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: https://review.coreboot.org/18196 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* nvramcui: remove undeclared variableAntonello Dettori2016-09-011-2/+2
| | | | | | | | | | | | | | | | | Remove an undeclared variable that was accidentally left over, nvramcui is currently unable to compile and operate because of this. Regression introduced in: 904dd303cbe99541025cbea008855f807a5d9f5c (nvramcui: refactor code) Fixes: https://ticket.coreboot.org/issues/70 Change-Id: Ieaba615838d7593546ab5696baf1b8f9828da345 Signed-off-by: Antonello Dettori <dev@dettori.io> Reviewed-on: https://review.coreboot.org/16333 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com>
* nvramcui: refactor codeAntonello Dettori2016-08-231-28/+54
| | | | | | | | | | | | Split the main() into a couple of smaller functions in order to more easily extend the payload. Change-Id: I4c2b144e2a28c6f15e360d55c49974675e6a80d2 Signed-off-by: Antonello Dettori <dev@dettori.io> Reviewed-on: https://review.coreboot.org/16248 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
* nvramcui: Update MakefileMartin Roth2016-06-291-6/+8
| | | | | | | | | | | | | | | | | | | | | | - Add all, clean and distclean to .PHONY - Rebuild nvramcui.elf when the makefile changes. - Update libpayload target to $(LIBPAYLOAD_DIR) target - these are the same thing, but by using the variable it makes it more obvious. - Remove .config.old as well as .config when running distclean. - Add CFLAGS to the LPGCC command line: -- Enable all warnings, set warnings as errors. -- Optimize for size -- Enable '-ffreestanding -nostdinc -nostdlib' to keep from building in system functions and to fix the warning: libpayload.h: warning: conflicting types for built-in function 'log2' static inline int log2(u32 x) { return sizeof(x) * 8 - clz(x) - 1; } Change-Id: Icc6c70b259cd7c22dc960cdb732927f9c0c93ee8 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/14482 Tested-by: build bot (Jenkins) Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* nvramcui: Cast u8 * values to char * to eliminate warningsMartin Roth2016-05-031-8/+8
| | | | | | | | | | | | error: pointer targets of 'strcmp' differ in signedness expected 'const char *' but argument is of type 'u8 * {aka unsigned char *}' Change-Id: Id5cbb6fc2efd7c57abc59b08416047e10461436f Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/14521 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* payloads/nvramcui: Make the makefile non-executableJonathan Neuschäfer2016-05-011-0/+0
| | | | | | | | | Change-Id: Id584cbf02c9d3ecb89fcf2a3190f0a73816954a8 Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-on: https://review.coreboot.org/14526 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* nvramcui: Reformat nvramcui.cMartin Roth2016-04-261-51/+67
| | | | | | | | Change-Id: I89dca25d93a4c94cc51f313397e49ba763948450 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/14484 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* nvramcui: Remove unnecessary header filesMartin Roth2016-04-261-3/+0
| | | | | | | | Change-Id: If845729bc34df646a5628ac2a35acc737fd4701d Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/14483 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* nvramcui: Update MakefileIru Cai2016-04-201-2/+22
| | | | | | | | | | | * use crossgcc to build nvramcui * build libpayload dependency Change-Id: Ife3054aeb03b4da0568ad47f96c633460d6c07ae Signed-off-by: Iru Cai <mytbk920423@gmail.com> Reviewed-on: https://review.coreboot.org/14377 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
* nvramcui: Add distclean targetMartin Roth2016-03-111-0/+2
| | | | | | | | | | | | | This doesn't do anything more than the clean target, but having both clean and distclean targets in all makefiles makes standardizing the cleaning routines easier. Change-Id: I41578de371a8f767ee23266c30e65e928f0985c4 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/13939 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins)
* nvramcui: Add MakefileDenis 'GNUtoo' Carikli2016-02-261-0/+10
| | | | | | | | | | | | | Users had to build nvramcui manually because payload.sh was only meant for abuild. Now the user can build it with: cd payloads/libpayload/ && make menuconfig && make && make install cd ../nvramcui && make Change-Id: I409a3c39a1e1738e8071febb1a3f169e1aee959a Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> Reviewed-on: https://review.coreboot.org/13778 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* tree: drop last paragraph of GPL copyright headerPatrick Georgi2015-10-311-4/+0
| | | | | | | | | | | | | | | | It encourages users from writing to the FSF without giving an address. Linux also prefers to drop that and their checkpatch.pl (that we imported) looks out for that. This is the result of util/scripts/no-fsf-addresses.sh with no further editing. Change-Id: Ie96faea295fe001911d77dbc51e9a6789558fbd6 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11888 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
* Remove empty lines at end of fileElyes HAOUAS2015-06-081-1/+0
| | | | | | | | | | | | 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>
* Remove address from GPLv2 headersPatrick Georgi2015-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per discussion with lawyers[tm], it's not a good idea to shorten the license header too much - not for legal reasons but because there are tools that look for them, and giving them a standard pattern simplifies things. However, we got confirmation that we don't have to update every file ever added to coreboot whenever the FSF gets a new lease, but can drop the address instead. util/kconfig is excluded because that's imported code that we may want to synchronize every now and then. $ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *MA[, ]*02110-1301[, ]*USA:Foundation, Inc.:" {} + $ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA:Foundation, Inc.:" {} + $ find * -type f -exec sed -i "s:Foundation, Inc., 59 Temple Place[-, ]*Suite 330, Boston, MA *02111-1307[, ]*USA:Foundation, Inc.:" {} + $ find * -type f -exec sed -i "s:Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.:Foundation, Inc.:" {} + $ find * -type f -a \! -name \*.patch \ -a \! -name \*_shipped \ -a \! -name LICENSE_GPL \ -a \! -name LGPL.txt \ -a \! -name COPYING \ -a \! -name DISCLAIMER \ -exec sed -i "/Foundation, Inc./ N;s:Foundation, Inc.* USA\.* *:Foundation, Inc. :;s:Foundation, Inc. $:Foundation, Inc.:" {} + Change-Id: Icc968a5a5f3a5df8d32b940f9cdb35350654bef9 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/9233 Tested-by: build bot (Jenkins) Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
* nvramcui: reboot at the end as TODO suggestsVladimir Serbinenko2015-05-191-1/+2
| | | | | | | | | | Use cf9 to reboot at the end. Change-Id: I642a5ec89c864fb03bbcdf6e4fcbb1e28f3fc34c Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/4693 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* nvramcui: don't init curses too earlyLubomir Rintel2015-02-251-18/+19
| | | | | | | | | | | | Init curses as late as possible and tear them down early. There are possible error outs after that and they don't look nice with curses initialized. Change-Id: I9128ae8eee25940716b8d223cc7ec6c0abb6838e Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Reviewed-on: http://review.coreboot.org/8528 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* nvramcui: fix a buffer overflowLubomir Rintel2015-02-251-1/+1
| | | | | | | | | | | | | | | | | Missing parentheses around addition. ==22611== Invalid write of size 8 ==22611== at 0x401B26: main (nvramcui.c:146) ==22611== Address 0x5a67c40 is 32 bytes inside a block of size 33 alloc'd ==22611== at 0x4C2BC0F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==22611== by 0x401AA9: main (nvramcui.c:137) Change-Id: I9fd6a619dd03ebaaa066bca8fa5838e76374c984 Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Reviewed-on: http://review.coreboot.org/8527 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* nvramcui: don't wait for the first key update to render the formLubomir Rintel2015-02-251-1/+3
| | | | | | | | | | | Flush out the initial screen window and render the form before the first keypress. It looks overly weird otherwise and is very likely unintended. Change-Id: I8700e36e608f2ba115359070f75b7dc9f230291e Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Reviewed-on: http://review.coreboot.org/8526 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* nvramcui: drop unused variableLubomir Rintel2015-02-251-1/+0
| | | | | | | | | | | | | | nvramcui.c: In function ‘main’: nvramcui.c:68:8: warning: unused variable ‘cur’ [-Wunused-variable] ITEM *cur; ^ Change-Id: I5c692fc2e6da460cd7c6f7978378c92587d829d2 Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Reviewed-on: http://review.coreboot.org/8525 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* nvramcui: Trim values when setting.Vladimir Serbinenko2014-01-191-0/+4
| | | | | | | | | | | Values get space-padded by curses and then enum search fails to match them. Rtrim to compensate for curses. Change-Id: Iecf095f21cfade9425eaa039b67625615eb80481 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/4692 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins)
* GPLv2 notice: Unify all files to just use one space in »MA 02110-1301«Paul Menzel2013-03-011-1/+1
| | | | | | | | | | | | | | | | | In the file `COPYING` in the coreboot repository and upstream [1] just one space is used. The following command was used to convert all files. $ git grep -l 'MA 02' | xargs sed -i 's/MA 02/MA 02/' [1] http://www.gnu.org/licenses/gpl-2.0.txt Change-Id: Ic956dab2820a9e2ccb7841cab66966ba168f305f Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: http://review.coreboot.org/2490 Tested-by: build bot (Jenkins) Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
* Add nvramcuiPatrick Georgi2012-11-192-0/+254
nvramcui is a small libpayload based utility that provides an interactive CMOS editor for pre-boot environments. Change-Id: I514b8a7682f89d242d1b31b6907cc6bff34da4bf Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/1871 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>