summaryrefslogtreecommitdiffstats
path: root/commands
Commit message (Collapse)AuthorAgeFilesLines
* menu: simplify usage for clientsSascha Hauer2010-08-301-41/+7
| | | | | | | | | | | | | | | Clients now only have to call menu_add_submenu or menu_add_command_entry instead of allocating many strings. This also fixes some problems in the menu code. The priv field in struct menu_entry was a pointer to struct menu or a pointer to an allocated string. It was never freed, only had to be freed when it was an allocated string. The reference to a submenu is now kept as a string and not to the menu itself. The code checked the existence of the submenu when creating it, but crashed when the submenu was removed and referenced afterwards. Now the code hapily allows references to nonexistant menus but complains during runtime when the menu is not there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: do not go to free if there's nothing to freeSascha Hauer2010-08-301-2/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: use an initialized struct list as menu listSascha Hauer2010-08-301-0/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: use list_for_each_entry where appropriateSascha Hauer2010-08-301-7/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: remove superfluous struct menu_entry member from struct menuSascha Hauer2010-08-301-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: Use strdup instead of malloc/strncpySascha Hauer2010-08-301-26/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Menu/cmd: add sub menu entry command supportJean-Christophe PLAGNIOL-VILLARD2010-08-301-9/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this will simplify the creation of navigation link as this menu -a -m boot -d "Boot Menu" menu -a -m network -d "Network settings" menu -e -a -m network -u boot -d "Back" menu -e -a -m boot -u network -d "Network settings ->" menu -e -a -m boot -c reset -R -d "Reset" menu -e -a -m boot -c clear -d "Exit" menu -s -m boot in C struct menu m_boot = { .name = "boot", .display = "Boot Menu", }; struct menu m_network = { .name = "network", .display = "Network settings", }; struct menu_entry e_to_network = { .display = "Network settings ->", .action = menu_action_show, .priv = &m_network, }; struct menu_entry e_to_boot = { .display = "Back", .action = menu_action_show, .priv = &m_boot, }; struct menu_entry e_reset = { .display = "Reset", .action = menu_action_run, .priv = "reset", }; struct menu_entry e_exit = { .display = "Exit", .action = menu_action_run, .non_re_ent = 1, .priv = "clear", }; void menu_test(void) { menu_add(&m_boot); menu_add(&m_network); menu_add_entry(&m_boot, &e_to_network); menu_add_entry(&m_boot, &e_reset); menu_add_entry(&m_boot, &e_exit); menu_add_entry(&m_network, &e_to_boot); menu_show(&m_boot); } Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add Menu FrameworkJean-Christophe PLAGNIOL-VILLARD2010-08-303-0/+492
| | | | | | | | | | | | | | | | | | | | | | | Introduce a menu framework that allow us to create list menu to simplify barebox and make it more user-frendly This kind of menu is very usefull when you do not have a keyboard or a serial console attached to your board to allow you to interract with barebox For the develloper part, The framework introduce two API 1) C that allow you to create menu, submenu, entry and complex menu action 2) Command that allow you as the C API to create menu, submenu, entry and complex menu action but this time the actions will be store in a function and then be evaluated and excecuted at runtime. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* loadb: get console baudrate from class_dev not devMichael Grzeschik2010-08-111-1/+1
| | | | | | | | | With this fix its possible to run loadb -f /dev/ram0 again with the latest next patchstack. Without you will run into data_abort. Tested with omap3530 beagleboard. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mw: fix help textBaruch Siach2010-08-061-1/+3
| | | | | Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add UBI commands: ubiattach, ubidetach, ubimkvol, ubirmvolSascha Hauer2010-07-053-0/+136
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* trivial: fix typos concerning "instead"Uwe Kleine-König2010-07-051-1/+1
| | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge remote branch 'origin/assorted-pu' into nextSascha Hauer2010-06-281-11/+19
|\
| * memcpy cmd: Do not expect to read/write the whole chunk at onceSascha Hauer2010-06-241-11/+19
| | | | | | | | | | | | | | read() does not necessarily return the number of bytes we want to read, so deal with less bytes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fix command loadbEric Bénard2010-06-241-1/+1
|/ | | | | | | which was broken after commit c3789cd49b43ec1c414ba1b0e9f48e8ccc19f8e1 Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove old network stackSascha Hauer2010-06-171-42/+0
| | | | | | All network commands now use the new stack, so remove the old one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: remove need for eth_halt/eth_openSascha Hauer2010-06-171-8/+12
| | | | | | | | | | | We used to eth_open/eth_halt the network devices during NetLoopInit which is called whenever the user enters a network command. Change this behaviour so that the current network device gets opened when making it the current one. With this change it's always possible to send packages and we are able to implement a new network stack in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: add i2c commandsEric Bénard2010-05-263-0/+223
| | | | | | | | | theses commands allow low level access to i2c bus and can be useful to setup an i2c device without having to add code, compile and flash barebox. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'next'Sascha Hauer2010-04-065-9/+113
|\
| * go command: shutdown barebox before calling an applicationSascha Hauer2010-03-301-7/+12
| | | | | | | | | | | | | | Also, do not allow to continue barebox after returning from the application since we don't know anything about the state we are in. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * echo: add -e option supportSascha Hauer2010-03-302-2/+23
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * add unlzo supportSascha Hauer2010-03-303-0/+78
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | trivial: fix command case for erase usage lineUwe Kleine-König2010-03-301-1/+1
|/ | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Make some help comments less confusingJuergen Beisert2010-03-181-1/+1
| | | | | Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cfi_flash: move include/cfi_flash.c next to driverSascha Hauer2010-02-081-1/+0
| | | | | | | | This file has no useful things for others than the driver, so move it next to the driver and remove the corresponding include from other files. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'pu'Sascha Hauer2010-02-0146-215/+59
|\
| * remove typedef cmd_tbl_t and replace it with struct commandSascha Hauer2010-02-0146-59/+59
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Move tftp/nfs specific code to net/*Sascha Hauer2010-02-011-108/+0
| | | | | | | | | | | | | | This adds a few bytes of binary space but is done to put the code where it belongs to. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * remove unused cdp codeSascha Hauer2010-01-251-48/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | addpart: support @<offset>Peter Korsgaard2010-01-161-14/+23
| | | | | | | | | | | | | | | | We claim to be compatible with the kernel's cmdlinepart parser, so support <size>@<offset> like the kernel does. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Add a special command to load and start a bzImage on x86Juergen Beisert2010-01-143-0/+372
|/ | | | | | | | | Other architectures are supporting the uImage format used by barebox's 'bootm' command. x86 does'nt. So, we need a special command to be able to boot the x86 specific bzImage format. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: Remove reference to non-existent CONFIG_CMD_I2C.Robert P. J. Day2009-12-211-1/+0
| | | | | Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: correct "CONFIG_SIMPLE_PARSER" to "CONFIG_SHELL_SIMPLE".Robert P. J. Day2009-12-211-1/+1
| | | | | | | | Based on suggestion from S. Hauer, fix the obvious typo in commands/Makefile. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/nand.c: Fix memory holeSascha Hauer2009-12-211-5/+17
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Remove unnecessary casts in key definesSascha Hauer2009-12-181-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Cleanup colleteral damage from renamingSascha Hauer2009-12-151-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-1547-181/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Some doxygen related fixesJuergen Beisert2009-12-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Nishanth Menon wrote: > no signed off by and no diffstat? Ups. > can you use git-format-patch to send please? it is easier to review. Sure. Here it comes: jbe ------8<---------8<---------8<---------8<---------8<---------8<---- Subject: [PATCH] Some doxygen related fixes: - fix a few doxygen comments that are used in a wrong way - move some pages and their content to a better place in the generated documentation Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand bb: Be sure that fd is at the beginning when erasingSascha Hauer2009-12-101-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* crc: Do not lseek if not necessary (bb devs do not allow lseek)Sascha Hauer2009-12-101-4/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* command line gpio supportSascha Hauer2009-12-103-0/+131
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Enable 'saveenv' for non eraseable mediaJuergen Beisert2009-11-191-2/+3
| | | | | | | | | 'close()' clobbers the 'errno' value from the erase command. So it must be done *after* the check for ENOSYS to ingnore it correctly. Signed-off by: Juergen Beisert <j.beisert@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* xyzModem: fix digit init in xyzModem_stream_openJean-Christophe PLAGNIOL-VILLARD2009-10-201-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* commands: remove maxargsSascha Hauer2009-10-1944-57/+1
| | | | | | | No need to check for maximum argument counts. The commands are safe to be called with more arguments, so lets safe some bytes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* printenv: do not return negative values in a commandSascha Hauer2009-10-191-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove obsolete and broken command 'splash'Sascha Hauer2009-10-193-143/+0
| | | | | | Has been replaced with 'bmp' Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* cat: return error if file is not readableSascha Hauer2009-10-191-0/+1
| | | | Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* call getopt_reset only onceSascha Hauer2009-10-1910-19/+0
| | | | | | | instead of calling getopt_reset in each command, call it only once before calling the command. Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* commands: return COMMAND_ERROR_USAGESascha Hauer2009-10-1924-116/+58
| | | | | | | instead of calling u_boot_cmd_usage in each command to safe space. Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* remove global variable BootFileSascha Hauer2009-10-191-2/+0
| | | | Signed-off-by: Sascha Hauer <sha@pengutronix.de>