summaryrefslogtreecommitdiffstats
path: root/commands/boot.c
Commit message (Collapse)AuthorAgeFilesLines
* boot: Call blspec_scan_directory() only on strings containing an absolute pathSascha Hauer2016-07-221-3/+6
| | | | | | Avoids an unnecessary "Nothing bootable found on..." warning. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* blspec: Remove once/default handlingSascha Hauer2016-07-221-28/+5
| | | | | | | | This is widely unused and in the way of subsequent cleanups. If you are indeed using it please complain on the list, we'll find a solution to add it back in a different way. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* boot command: Make verbose/dryrun options work againSascha Hauer2016-06-291-2/+5
| | | | | | | | | | Fixes: bc94fb3 bootm: Initialize bootm_data defaults in single place bootm_data_init_defaults() must be called before filling in the values from the commandline options, otherwise the values will be overwritten in bootm_data_init_defaults(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* string: Fix (v)asprintf prototypesSascha Hauer2016-04-151-3/+3
| | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: Initialize bootm_data defaults in single placeSascha Hauer2016-01-261-12/+2
| | | | | | | | Both the bootm and the boot code initialize the struct bootm_data with defaults from the bootm global variables. Create a common function for doing this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* boot command: Allow to enable watchdogSascha Hauer2015-08-281-1/+25
| | | | | | | | Enabling the watchdog before booting the kernel is a common usecase. Add an option to the boot command and also add a global variable for it to make it configurable easily. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* boot: fix typoRolf Evers-Fischer2014-07-011-1/+1
| | | | | Signed-off-by: Rolf Evers-Fischer <rolf.evers.fischer@delphi.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* boot: Fix boot -mSascha Hauer2014-06-191-1/+1
| | | | | | We have to continue when bootentries_collect succeeds, not when it fails. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-20/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+1
| | | | | | | | | | | | | | | | | | | 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>
* boot: iterate over directories in alphabetical orderSascha Hauer2014-05-131-13/+13
| | | | | | | | When iterating over directories in order to find boot scripts do this alphabetically to get a predictable order. This can be done with glob() rather than readdir(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* boot: fix multiple boot sourcesSascha Hauer2014-05-131-1/+0
| | | | | | | | When there are multiple bootsources barebox should try booting them until one succeeds. This is broken because we bail out of the iteration loop with a goto. Remove the goto to fix this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* blspec: honor default/once entries againSascha Hauer2014-03-241-5/+32
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* boot command: only create boot entries from scriptsSascha Hauer2014-03-191-0/+5
| | | | | | When given a directory ignore all files that are not shell scripts. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* boot command: honour global.boot.default also for -l and -mSascha Hauer2014-03-191-31/+48
| | | | | | | | The boot command is expected to work on bootsources from the commandline if given, on global.boot.default otherwise. Fix this behaviour for the -m and -l options also. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/nfs'Sascha Hauer2014-03-071-1/+1
|\ | | | | | | | | Conflicts: defaultenv/defaultenv-2-base/bin/ifup
| * run_command: remove unused flag parameterSascha Hauer2014-03-071-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | boot command: Remove redundant assignmentAlexander Shiyan2014-02-171-1/+1
|/ | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* blspec: Fix another crash with menu disabledUwe Kleine-König2013-11-111-1/+3
| | | | | | | | | boot -l crashes with CONFIG_MENU disabled because blspec_alloc returns with blspec->menu being NULL in this case. So guard the usage of blspec->menu accordingly. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* boot command: Add timeout support for menuSascha Hauer2013-11-051-1/+11
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* boot command: make more flexibleSascha Hauer2013-11-051-127/+194
| | | | | | | | | | | | | | | | | | With this we can do 'boot <name>' where name is one of: - a filename under /env/boot/ - a full path to a boot script - a device name - a partition name under /dev/ - a full path to a directory which - contains boot scripts, or - contains a loader/entries/ directory containing bootspec entries Multiple names can be given, they are tried in order. So any mixture between bootspec entries and bootscripts can be given. bootspec entries can now also be given as a path to a directory containing bootspec entries. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* boot: Print boot entries in the order they areSascha Hauer2013-11-051-14/+4
| | | | | | | Instead of first printing the traditional entries and the bootloader spec entries afterwards. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* blspec: rename _hwdevice functions to _devicenameSascha Hauer2013-11-051-1/+1
| | | | | | | Since it's not necessarily the hardware device this seems to be a more appropriate name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* boot: remove incomplete 'title' handling in menuSascha Hauer2013-10-161-13/+2
| | | | | | | | The 'boot -m' command executes the /env/boot/* scripts in order to determine the title of a boot menu entry. This is not complete and depends on changes in the environment, so remove it for now. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Implement bootloader spec support for bareboxSascha Hauer2013-10-141-23/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* bootm: Replace getenv_loadaddr with getenv_ulSascha Hauer2013-10-071-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* defenv-2: replace boot script with commandSascha Hauer2013-09-301-0/+258
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>