9
0
Fork 0
Commit Graph

1505 Commits

Author SHA1 Message Date
Sascha Hauer ce1b0d4ae3 Merge branch 'for-next/doc' 2014-07-04 17:19:40 +02:00
Holger Schurig 477199c684 menutree: let it select GLOB and GLOB_SORT
The menutree doesn't select CONFIG_GLOB, but it depends on it. Without
it will just hang. So let it select it automatically. Also remove the
dependency of CONFIG_GLOB on CONFIG_HUSH, because glob() will run with
the simple shell as well.

Also let CONFIG_MENUTREE select on CONFIG_GLOB_SORT. While is not
strictly needed, many people use menu/00-foo menu/10-bar menu/20-barf
to sort their menu entries. So select it out of convenience.

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-02 07:26:55 +02:00
Sascha Hauer 98360be0fe Documentation: remove doxygen documentation
The doxygen documentation is long outdated. Remove it. It will
be replaced with sphinx based documentation later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-26 10:09:52 +02:00
Antony Pavlov 8e89bc594a treewide: remove address of the Free Software Foundation
The FSF address has changed; The FSF site says that
address is

  Free Software Foundation
  51 Franklin Street, Fifth Floor
  Boston, MA 02110-1301
  USA

(see http://www.fsf.org/about/contact/)

Instead of updating it each time the address changes,
just drop it completely treewide.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-11 08:35:25 +02:00
Sascha Hauer 8f8a18906b fix format specifiers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-05 09:35:31 +02:00
Sascha Hauer 6331e58a2c Merge branch 'for-next/misc'
Conflicts:
	commands/devinfo.c
2014-06-04 21:03:36 +02:00
Holger Schurig 93ba05b5fd bootm: beautify output
* fix indentation of options in 'help bootm'
* add missing help for -m
* put some output into debug/verbose mode

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-02 09:07:12 +02:00
Holger Schurig bfd5d7f112 misc: upper-case some abbreviations
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-02 09:07:12 +02:00
Holger Schurig bd278ae4fd meminfo: purely cosmetical changes
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-02 09:07:12 +02:00
Sascha Hauer d384b5639f of: Drop devicetree merge support
I assume I am the only person knowing that barebox is able to
merge devicetrees. This feature seems broken for a while now since
trying to merge devicetress results in:

unflatten: too many end nodes

Remove this feature to save the complexity.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-22 08:09:13 +02:00
Sascha Hauer e275b2653f complete: Add devicetree completion
The of_* commands take devicetree nodes as parameters. Add a
devicetree completion function to ease passing nodes to these
commands.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-19 22:23:56 +02:00
Sascha Hauer e5c59c3867 complete: Fix completion after options
the command specific complete callbacks only work when no
option is typed already. For example "devinfo <tab><tab>"
correctly completes the devices, but "devinfo -x <tab><tab>"
does nothing. That is because the options are passed to
the input string of the completion handlers. Skip the option
string by finding the last space in the input string. This
is not perfect since "devinfo -f<tab><tab>" still does not
work, but it's better than what we have now.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-19 22:23:55 +02:00
Sascha Hauer f81f26afbd hush: setting variables may fail
In case of device parameters setting variables may fail. return
the result of set_local_var so that the user has a chance to detect
the failure with $?.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-16 15:12:57 +02:00
Holger Schurig 2071940c76 commands: move CONFIG_LONGHELP to commands/Kconfig
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-14 10:03:49 +02:00
Holger Schurig 26a34100e8 commands: HUSH_GETOPT -> CMD_GETOPT
* this compile option actually turns on a command, so name it
  accordingly
* also move the Kconfig definition into commands/Kconfig, thus
  placing getopt into the "Shell scripting commands" section
* while at it, improve Kconfig documention

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-14 10:03:48 +02:00
Holger Schurig 07d90fdd39 commands: CMD_MEMORY -> COMPILE_MEMORY
* CMD_MEMORY was defined both in common/Kconfig and commands/Kconfig
* that symbol turned not a command on, but just the compilation of
  commands/mem.c, so rename it accordingly

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-14 10:03:47 +02:00
Holger Schurig f1f532084a commands: harmonize in-barebox documentation
This patch does probably too much, but it's hard (and very
cumbersome/time consuming) to break it out. What is does is this:

* each command has one short description, e.g. "list MUX configuration"
* made sure the short descriptions start lowercase
* each command has one usage. That string contains just the
  options, e.g. "[-npn]". It's not part of the long help text.
* that is, it doesn't say "[OPTIONS]" anymore, every usable option
  is listed by character in this (short) option string (the long
  description is in the long help text, as before)
* help texts have been reworked, to make them
  - sometimes smaller
  - sometimes describe the options better
  - more often present themselves in a nicer format
* all long help texts are now created with BUSYBOX_CMD_HELP_
  macros, no more 'static const __maybe_unused char cmd_foobar_help[]'
* made sure the long help texts starts uppercase
* because cmdtp->name and cmdtp->opts together provide the new usage,
  all "Usage: foobar" texts have been removed from the long help texts
* BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this
  is nicer in the source code
* BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself
* made sure no line gets longer than 77 characters
* delibertely renamed cmdtp->usage, so that we can get compile-time
  errors (e.g. in out-of-tree modules that use register_command()
* the 'help' command can now always emit the usage, even without
  compiled long help texts
* 'help -v' gives a list of commands with their short description, this
  is similar like the old "help" command before my patchset
* 'help -a' gives out help of all commands

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-14 10:03:43 +02:00
Holger Schurig ab23d0bb3f commands: group 'help' output
The old output of "help" was just producing a long list, that usually
scrolled of the screen (even on a X11 terminal). This list is more
compact, and also sorted by groups.

The old output format (plus grouping) is now available with 'help -v'.

Example:

   Information commands:
     ?, devinfo, help, iomem, meminfo, version
   Boot commands:
     boot, bootm, go, loadb, loads, loadx, loady, saves, uimage
   ...

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-14 07:59:55 +02:00
Sascha Hauer 4626972921 Merge branch 'for-next/memtest' 2014-05-05 11:05:51 +02:00
Sascha Hauer f8327af20c Merge branch 'for-next/ioresource' 2014-05-05 11:05:51 +02:00
Sascha Hauer 2274c6ea77 Merge branch 'for-next/env' 2014-05-05 11:05:50 +02:00
Michael D. Burkey a8334c68c9 Fix bug in export 64 bit unsigned environment variable.
This patch corrects exporting unsigned 64-bit environment variables.
I had left out a signed off line before.

Signed-off-by: Michael Burkey <mdburkey at gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-30 08:55:47 +02:00
Sascha Hauer ebb8a4b594 env: erase/protect in envfs_save
So that the envfs_save is more useful outside of the saveenv command

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-28 11:41:02 +02:00
Sascha Hauer 54bea204e2 environment: drop envfs_register_partition
The purpose of envfs_register_partition is to print an error
message when the partition does not exist. Print an error message
from generic code instead and drop this function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-28 11:37:42 +02:00
Alexander Aring e013b93977 memtest: copyright to UPPER case and fix typo
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 12:20:03 +02:00
Lucas Stach 4ab9051bd3 don't cast negative error codes to unsigned size_t
The cast prevents us from doing proper error checking.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 09:21:17 +02:00
Lucas Stach 9c63e92baa treewide: fix signedness mixups in printf format specifiers
This most likely doesn't fix any real bugs, but it's the
right thing to do and reduces the noise level with static
checkers.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 09:05:51 +02:00
Sascha Hauer 55fb660e0b loadenv: detect truncated environment files
Properly detect when an environment file is truncated. This can happen
when a previous saveenv failed because the environment partition is too
small.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-09 17:00:37 +02:00
Sascha Hauer aa49d86b2d saveenv: Properly detect write errors
The return value check of the write call is completely bogus. We
check if we have written at minimum sizeof(struct envfs_super) bytes
instead of all bytes. Properly check for all bytes written instead
and allow write to write less bytes than requested.
Do not use write_full because this file is compiled for userspace
aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-09 17:00:29 +02:00
Michel Stam 4d94f56c6c common: Allow for I/O mapped I/O
Rework the current framework so that I/O mapped I/O resources are
also possible.

Signed-off-by: Michel Stam <michel@reverze.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-08 08:17:55 +02:00
Sascha Hauer 0a5529d0ed Merge branch 'for-next/ppc' 2014-04-04 10:06:22 +02:00
Sascha Hauer a5c3b05b4d Merge branch 'for-next/menutree' 2014-04-04 10:06:22 +02:00
Sascha Hauer a5a82ca2cd Merge branch 'for-next/boot' 2014-04-04 10:06:14 +02:00
Sascha Hauer 0ae451a7bc environment: Fix unitiliazed variable
envfs_load_data needs a pointer to the envfs_super, otherwise it
works on an unitialized struct when detecting the envfs version.

This is broken since:

| commit 0a2a8f7059
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date:   Thu Feb 20 08:16:01 2014 +0100
|
|     environment: Add function to load envfs from buffer
|
|     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Grmpf. Most compilers do not issue a warning, only the blackfin
gcc 4.3.5 warns about this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 06:45:11 +01:00
Sascha Hauer 294dc7160e defenv-2: replace menu with menutree
This makes the menu easier to extend and to maintain.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 09:44:44 +01:00
Sascha Hauer ca8edb3b65 add menutree command
Creating menus from the shell using the regular 'menu' command is rather
complicated. This adds a 'menutree' command which creates a menu from
a directory structure. In the directory structure each directory corresponds
to a single menu entry. The directory contains the following files:

title -  A file containing the title of the entry as shown in the menu
box -    If present, the entry is a 'bool' entry. The file contains a variable
         name from which the current state of the bool is taken from and saved
         to.
action - if present this file contains a shell script which is executed when
         when the entry is selected.

If neither 'box' or 'action' are present this entry is considered a submenu
containing more entries.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 09:37:09 +01:00
Sascha Hauer 45693e0265 Add shell_expand function
shell_expand expands shell variables in a string.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 09:36:36 +01:00
Sascha Hauer 237cbf1ac7 defaultenv-2: Fix menu files selection
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 08:49:35 +01:00
Sascha Hauer 6979118ede blspec: Check if an entry is compatible with the current machine
When a bootspec entry has the 'devicetree' property specified, check
if the tree is compatible with the currently running machine, otherwise
ignore the entry. This makes it possible to have entries for multiple
machines on an SD card and pick a suitable one.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-24 07:58:33 +01:00
Renaud Barbier 64e38721cd common: DDR3 SPD verification support
Add DDR3 SPD verification support for use by the PPC 8xxx DDR driver.

This is based on the equivalent files from U-Boot version git-be937b5.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-18 17:32:31 +01:00
Sascha Hauer 144358e0aa Merge branch 'for-next/nfs'
Conflicts:
	defaultenv/defaultenv-2-base/bin/ifup
2014-03-07 09:25:44 +01:00
Sascha Hauer a8a08f88cc Merge branch 'for-next/misc'
Conflicts:
	common/environment.c
2014-03-07 09:25:09 +01:00
Sascha Hauer 92ab6b5ea5 Merge branch 'for-next/gpio-keys' 2014-03-07 09:24:40 +01:00
Sascha Hauer 86f681abec blspec: Add NFS support
With this barebox can start root filesystems containing bootloader
spec entries via NFS. It is used as:

boot nfs://<ipaddr>[:<port]//path/to/nfsroot

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-07 07:41:40 +01:00
Sascha Hauer a162dfe503 net: Add ifup support
The defaultenv-2 has ifup support as a shell script. This patch
replaces it with a command which is more robust, can be called
from C and now can also bring up all configured interfaces.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-07 07:41:36 +01:00
Sascha Hauer 93578fb233 run_command: remove unused flag parameter
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-07 07:41:26 +01:00
Sascha Hauer 24ae621e17 defaultenv: Add boot option for DFU
DFU is for device firmware upgrade, but for development purposes it's
sometmes useful to just start a kernel vie DFU. This adds a boot option
for doing this and also the corresponding counterpart on the host. With
this it's possible to boot a system with:

scripts/dfuboot.sh -k linuximage -d dtb -c "root=ubi0:root ubi.mtd=ubi rootfstype=ubifs ignore_loglevel"

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 08:14:14 +01:00
Sascha Hauer 7fa10256c3 defaultenv: Allow multiple defaultenvironment overlays
We can compile barebox for multiple boards at once, but currently
they all share a single default environment. This patch adds a
defaultenv_append() which boards can call to customize the default
environment during runtime. Each board now generate default environment
snippets using bbenv-y and add them during runtime with defaultenv_append()

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 08:14:14 +01:00
Sascha Hauer b850dbad65 move defaultenv-2 to defaultenv/defaultenv-2-*
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-21 17:06:50 +01:00
Sascha Hauer 464a531423 move defaultenv-1 to defaultenv/defaultenv-1
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-21 17:06:46 +01:00