summaryrefslogtreecommitdiffstats
path: root/commands
Commit message (Collapse)AuthorAgeFilesLines
* timeout: factor out wait-for-key-press loop into separate fileMarc Kleine-Budde2015-04-231-49/+13
| | | | | | | | This patch factors out the wait-for-key-press loop from the shell command "timeout" into a sparate file, so that it can be used from C, too. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* command: timeout: add documentation for option '-v'Marc Kleine-Budde2015-04-231-1/+2
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* command: timeout: remove unhandled '-t' optionMarc Kleine-Budde2015-04-231-1/+1
| | | | | | | | This patch removes the option '-t', as it's unhandled in the code since it was added to barebox. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* command: state: harmonize in-barebox documentationMarc Kleine-Budde2015-04-171-7/+9
| | | | | | | | | According to this patch by Holger Schurig: f1f532084a6e commands: harmonize in-barebox documentation Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2015-04-133-0/+83
|\
| * state: add framework for persistent state handlingSascha Hauer2015-03-123-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a framework to describe, access, store and restore a set of variables. A state variable set can be fully described in a devicetree node. This node could be part of the regular devicetree blob or it could be an extra devicetree solely for the state. The state variable set contains variables of different types and a place to store the variable set. For more information see: Documentation/devicetree/bindings/barebox/barebox,state.rst Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2015-04-131-1/+1
|\ \
| * | commands: dmesg: fi format security warningMarc Kleine-Budde2015-04-031-1/+1
| |/ | | | | | | | | | | | | | | commands/dmesg.c: In function ‘do_dmesg’: commands/dmesg.c:71:3: warning: format not a string literal and no format arguments [-Wformat-security] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | command: hashsum: Conding style fixupAntony Pavlov2015-03-301-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | command: digest/hashsum: set key at command levelJean-Christophe PLAGNIOL-VILLARD2015-03-273-22/+21
| | | | | | | | | | | | | | and only set the key when specified Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | crypto: digest: speficied when a digest need a key to be usedJean-Christophe PLAGNIOL-VILLARD2015-03-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | such as for hmac(xxx) you must provide a key This will allow to enforce the correct parameter at digest command <digest>sum is not impacted Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | command: add generic digest commandJean-Christophe PLAGNIOL-VILLARD2015-03-205-62/+234
| | | | | | | | | | | | | | That can be used for digest calculation and verify Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | command: rename digest.c to hashsum.cJean-Christophe PLAGNIOL-VILLARD2015-03-193-8/+8
| | | | | | | | | | | | | | as I'll add a new generic command named digest Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | crypto: digest: digest_file_window/digest_file/digest_file_by_name drop key ↵Jean-Christophe PLAGNIOL-VILLARD2015-03-191-2/+8
| | | | | | | | | | | | | | | | | | params expect the key to be set before calling Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | command: add hmac sum supportfor md5, sha1, sha224, sha256, sha384, sha512Jean-Christophe PLAGNIOL-VILLARD2015-03-131-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pass the key via -h param barebox@barebox sandbox:/ sha256sum -h test /dev/fd0 c297473e9bb221c5dc51d47ad75c76095f1bdc4ca9dff1d5931c2e22bf11a0de /dev/fd0 0x00000000 ... 0xffffffffffffffff use the same idea as openssl command $ openssl dgst -sha256 -hmac "test" TODO HMAC-SHA256(TODO)= c297473e9bb221c5dc51d47ad75c76095f1bdc4ca9dff1d5931c2e22bf11a0de Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | command: add sha384sum and sha512sum supportJean-Christophe PLAGNIOL-VILLARD2015-03-122-0/+66
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | digest: make it multi-instanceJean-Christophe PLAGNIOL-VILLARD2015-03-121-1/+2
| | | | | | | | | | | | | | | | | | | | Now you need to call digest_alloc and when you finish to use it digest_free. We need this for upcomming aes encryption support and secure boot as we will need multiple instance of the same digest. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | digest: introduce digest_{init/update/final/length}Jean-Christophe PLAGNIOL-VILLARD2015-03-121-2/+2
|/ | | | | | | | This will allow to move from a one at a time digest to a multi-instance with too much impact on the code using it Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-03-091-7/+3
|\
| * environment: envfs_{load, save}: add possibility to call with filename and ↵Marc Kleine-Budde2015-03-061-7/+3
| | | | | | | | | | | | | | | | | | dirname == NULL This patch moves fallback to default into the envfs_{load,save} functions. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | cmdlinepart: add function to parse a cmdline partition stringSascha Hauer2015-02-121-24/+1
| | | | | | | | | | | | | | This adds a function to parse a full cmdline partition string. The addpart command is switched to use this function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | cmdlinepart: make argument types saferSascha Hauer2015-02-121-2/+2
| | | | | | | | | | | | | | The return size should be loff_t to support partitions bigger than 4G. Also use const for the devname and endp. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | move cmdline partition parsing code to separate fileSascha Hauer2015-02-121-77/+4
|/ | | | | | | So it's no longer local to the addpart/delpart code and can be used from other code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-02-043-11/+31
|\
| * commands: crc: support setting environment variablesJan Luebbe2015-02-021-1/+22
| | | | | | | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * loadenv: fix typo in help textWjatscheslaw Stoljarski2015-02-021-2/+2
| | | | | | | | | | Signed-off-by: Wjatscheslaw Stoljarski <wjatscheslaw.stoljarski@kiwigrid.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * memtest: fix 4GB overflow failDmitry Lavnikevich2015-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | Add condition for checking size_t overflow. This fixes memtest fail > Memtest failed. Error: -22 which appears when 4GB RAM is present. Was tested on phyFLEX-i.MX6 modules with 4GB and 1GB RAM. Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * memtest: Fix SDRAM size calculationsSascha Hauer2015-01-261-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calculating the size and end of the test region as end = PAGE_ALIGN_DOWN(bank->res->end) - 1; size = end - start + 1; is wrong. For an example resource of start = 0x80000000, end = 0x8fffffff end results in: end = PAGE_ALIGN_DOWN(0x8fffffff) - 1 = 0x8fffefff instead of 0x8fffffff. The size is then calculated to size = end - start + 1 = 0x8fffefff - 0x80000000 + 1 = 0x0ffff000 instead of 0x10000000 The correct way to do this is to calculate the real size and apply a PAGE_ALIGN_DOWN afterwards: size = PAGE_ALIGN_DOWN(bank->res->end - start + 1) = 0x10000000 Fix this in three different places. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Fix spelling: pathes -> pathsWadim Egorov2015-01-282-2/+2
| | | | | | | | | | Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands/splash: fix '-y' option handlingAntony Pavlov2015-01-261-0/+1
| | | | | | | | | | | | | | | | The '-y' and '-o' options are independent, so just add missing 'break'. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: fix a warning in help.cMasahiro Yamada2015-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following warning: commands/help.c: In function ‘list_group’: commands/help.c:57:4: warning: format not a string literal and no format arguments [-Wformat-security] printf(cmdtp->name); ^ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | command/splash: fix return valueJean-Christophe PLAGNIOL-VILLARD2015-01-131-4/+6
|/ | | | | | | | | return errno when possible otherwise return 0 for ok or 1 for error Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: loady: fix bug with netconsoleRobert Jarzmik2015-01-051-3/+3
| | | | | | | | | | | | | Netconsole doesn't have a baudrate. Loady supposes a console has one, and tries to compute the console's baudrate variable value, regardless of its existence. This triggers a NULL pointer dereference on netconsole. If attempting loady on a netconsole is a bit useless, barebox should not panic. Fix this by checking the variable exists before reading its value. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/randconfig'Sascha Hauer2014-12-081-3/+3
|\
| * command: load[sbxy]: Depend on CONSOLE_FULLSascha Hauer2014-11-271-3/+3
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/persistent-vars'Sascha Hauer2014-12-088-29/+336
|\ \ | | | | | | | | | | | | Conflicts: arch/arm/boards/efika-mx-smartbook/defaultenv-efikasb/config
| * | globalvar: Add support for printing all global variablesSascha Hauer2014-11-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | This could previously only be done with 'devinfo global'. While this is still possible this adds a more direct access via the globalvar command. This variant also adds a '*' in front of the variable if the corresponding non volatile variable exists. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Add defaultenv commandSascha Hauer2014-11-063-0/+103
| | | | | | | | | | | | | | | | | | | | | This adds a command to explicitly restore the environment (or parts thereof) from the default environment. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | cp: Add recursive copySascha Hauer2014-11-061-13/+23
| | | | | | | | | | | | | | | | | | This adds the -r option to the cp command. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Add support for non volatile variablesSascha Hauer2014-11-064-3/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds (back) support for non volatile variables. Non volatile variables are variables which are stored in the environment over reboot. They are used in the same way as the global variables, but with a 'nv' command and device. The variables are stored under /env/nv/, one variable per file. Adding a nv variable automatically adds a global variable with the same name. Changing a nv variable also changes the same global variable, but not the other way round. This allows for example to configure the username as: nv user=sha; saveenv Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | magicvar: Add support for dynamically added magicvarsSascha Hauer2014-11-061-13/+98
| | | | | | | | | | | | | | | | | | | | | | | | Add support to add a new magicvar using the magicvar command. This is useful for magicvars assigned and used only in the environment. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2014-12-081-1/+3
|\ \ \ | |_|/ |/| |
| * | command: dmesg: depend on !CONSOLE_NONESascha Hauer2014-11-271-0/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | command: passwd: depend on CMD_LOGIN rather than selecting itSascha Hauer2014-11-271-1/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | command: login: depend on !CONSOLE_NONESascha Hauer2014-11-271-0/+1
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | xymodem: select CRC16 from libJan Weitzel2014-11-121-1/+0
| | | | | | | | | | Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | command: memset: Fix argument order in help textSascha Hauer2014-11-101-1/+1
|/ | | | | | | memset takes ADDR DATA COUNT just like the C function, not ADDR COUNT DATA. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tegra'Sascha Hauer2014-11-051-9/+16
|\
| * commands: lspci: go down into subordinate bussesLucas Stach2014-10-081-9/+16
| | | | | | | | | | | | | | | | This way we also list devices that are behind bridges. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/fs'Sascha Hauer2014-11-053-0/+53
|\ \