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>
* 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>
* 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>
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>
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>
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>
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>
Instead of asking explicitly for the default environment compression
type ask for the in-barebox default compression type. This also adds
a DEFAULT_COMPRESSION_SUFFIX make variable which can be used together
with the wildcard rules for compressed files to generate compressed
files without explicitly support each compression type.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This allows to load all the lowlevel init code, including the
uncompressor, inside SRAM and not just the bare init part. This is
useful when pbl is used as a first-stage bootloader but is loaded by an
external firmware.
Signed-off-by: David Vincent <freesilicon@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch adds the crc32 command to be build
as host and optionally as target tool.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
CONFIG_MAXARGS is only used with the simple console support, so add
a 'depends on'. While at it, move it below the shell selection.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The build of target tools fails on sandbox architecture.
We don't need any target tools in this case, so add a dependency.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds a tool for installing kernels according to the bootloader
spec. systemd already has a similar tool, but it is limited to installing
kernels on the currently running system. The barebox kernel-install
tool instead can also be used to install kernels on removable media on a
development host for cross development. It is compiled in two variants,
as 'kernel-install' for the host and as 'kernel-install-target' using
$CROSS_COMPILE.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The Bootloader Specification describes a way how kernels can
be installed on devices and how they can be started by the bootloader.
The bootloader spec is currently supported by (x86) gummiboot and
by systemd which provides a kernel-install script. With the bootloader
spec it's possible for the Operating system to install a new kernel
without knowing about the bootloader and for the bootloader it's possible
to discover and start Operating Systems on a media without being
configured.
For more details about the spec see:
http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/
This patch adds barebox support for the spec. It enhances the 'boot'
command so that not only boot script names can be given, but also
devices containing bootloader spec entries. With this it's possible
to call the 'boot' command like: 'boot sd emmc net'. It would then
first look for bootloader spec entries on the (removable) sd card,
then, is nothing is found, on the internal emmc and if still
unsuccessful would call the 'net' bootscript.
The bootloader Spec currently doesn't specify which entry should be
default if multiple entries are found on a single device. Therefore
barebox currently has two extensions of the spec. The $BOOT diretory
can contain a file named 'default'. If present, the content of the
file is treated as a filename under $BOOT/loader/entries/ which is
used as default. Similarly if a file named 'once' is present, the
entry is started once and the file is removed afterwards. This is
useful for testing if a newly installed kernel works before making
it the default.
As on ARM and other Architectures a devicetree has to be specified
for the kernel, the 'devicetree' property is used to specify a
devicetree. Like 'kernel' and 'initrd' this also contains a pth
relative to $BOOT.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This replaces the 'boot' script in the defaultenv-2 with a command
with the same behaviour. A command gives more flexibility for future
externsions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
With this the verbosity of barebox can be controlled during runtime
using the 'loglevel' globalvar.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
even if the env is broken you will have a password
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
With this all code uses barebox_get_model() and no longer
a compile time generated string.
Also this renames barebox_boardinfo() to barebox_get_model()
since we are going to add the corresponding _set_ function
and 'model' corresponds to the devicetree notion.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The CONFIG_PANIC_HANG a part of the U-Boot heritage.
It is used in the barebox code, but there is no mention
of this option in Kconfig files.
Sometimes this option is very helpful, so
let's resurrect it.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Being able to trace initcall is very useful when trying to
find out where startup hangs. This adds a kconfig option for
it to make it easier to access.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
ENABLE_DEVICE_NOISE is used only in two network drivers and is
otherwise unused. ENABLE_FLASH_NOISE is completely unused.
ENABLE_PARTITION_NOISE enables DEBUG in the partition command,
but this code has no debug messages at all.
Remove all this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Much of the bootm code is implemented in the command itself. Move
it to a common place to be able to call it from C aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
For making the same binary executable on different SoCs which have
different DRAM addresses we have to be independent of the compile
time link address.
This patch adds relocatable binary support for the ARM architecture.
With this two new functions are available. relocate_to_current_adr
will fixup the binary to continue executing from the current position.
relocate_to_adr will copy the binary to a given address, fixup the
binary and continue executing from there.
For the PBL and the real image relocatable support can be enabled
independently. This is done to (hopefully) better cope with setups
where the PBL runs from SRAM or ROM and the real binary does not.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This allows to boot a sequence of boot entries until one succeeds.
boot sources can be passed in $global.boot.default, which is now treated
as a list. Also a list of boot entries can be specified as arguments
to the boot script. The entries can be:
- a plain filename from /env/boot/
- a full path to an arbitrary file
- a directory containing boot entries
With this this command:
boot net nand-ubi /env/boot.d
would first use the /env/boot/net entry, if this fails the /env/boot/nand-ubi
entry and if this also fails the files from /env/boot.d/ (which could also
be links to boot scripts)
To make the above the default, global.boot.default would be specified as:
global.boot.default="net nand-ubi /env/boot.d"
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
so we can support multiple format
use filetpye to detect the parser to use
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This optionally enabled the MMU in the PBL or during early startup for
the non PBL case. The regular MMU init code will pickup the already enabled
MMU later. This might complicate debugging early code, so this has been
made optional.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
so it more easy to add new entry and to maintain
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>