| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a helper which can be called from board files to setup the
"boot.default" parameter to be independent of the initcall level.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20240313195606.3911219-2-m.felsch@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
| |
Depending on how boot_entry() is called, the actual error code may be
never printed anywhere for user inspection. Improve user experience by
always printing it along with the failure message.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240304190038.3486881-7-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
file_name_detect_type(), file_name_detect_type_offset() and
cdev_detect_type() return the filetype. With this all errors from these
functions remain undetected and are just returned as filetype_unknown.
Explicitly return an error code and pass the filetype as pointer
argument so that callers can detect and handle errors.
This fixes a bug in the bootm code where the returned filetype was
erroneously tested for being smaller than 0. This was never true
and so the corresponding error message was never printed. Now with
this patch a non existing initrd or device tree file is responded
with a meaningful error message.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Dry runs are quite useful for debugging or for time measurement, but so
far they weren't useful with scripts as they just did a very early exit.
This is understandable as scripts don't necessarily observe the
convention that everything done before the dry run should not have an
impact on later boot runs. For the cases, where the bootscript is vetted
to behave properly under a dry run, support specifing dryrun twice, so
the script is executed, but the automatic bootm afterwards isn't.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230803135217.1770111-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It can be expected for a boot entry to usually fail, e.g. when it checks
for a removable USB drive that's not always connected. Such boot targets
have the choice of either returning 0, which means it was a dry run and
boot aborts or an error code, which yields an error message.
Let's handle -ENOMEDIUM specially and not print an error for it, so it
can be used in such scenarios.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230612130322.1093717-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When multiple bootloader spec files are available, the first match in
lexical order will be the one to autoboot. Users can customize which one
to use interactively via boot -m, but no means to select a different by
default exists. Allow for this by having the boot command not only
accept a directory to search for bootloader spec entries in, but also
the path of a single bootloader spec file. This aligns it with what we
have for bootscripts, where both directories containing boot scripts
and the path to a specific boot script is understood.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220724184807.2123459-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
boot -m -t 3 already opens a boot menu with a countdown of 3 seconds
before selecting the first element. So far, only way to influence
preselection was shifting around boot entries, so they are iterated over
differently. Add a new -M option that works analogously to -m, but
takes an integer index of the boot menu entry to preselect. This allows
simple customizable interactive boots:
#!/bin/sh
boot -M "$nv.bootmenu_default" -t 3 mmc0.0
With mmc0.0 containing multiple bootloader spec files that would be iterated
over in lexical order. The index is 1-based like the index displayed in
the boot menu.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Link: https://lore.barebox.org/20220726054136.267069-1-ahmad@a3f.at
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
This allows us to control the output behaviour e.g. booting silently
to improve boot time. Furthermore it adds a 'WARNING:' prefixed output
in case of pr_warn which is colored as well (depending on your
terminal). This helps us to identify unwanted behaviour.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20210521163435.17365-3-m.felsch@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For all files in common/ that already have a license text:
- Replace with appropriate SPDX-License-Identifier
- Remove empty comment lines around replacement
- remove comment completely if only thing remaining is name
of file without description
Reviewed-by: Roland Hieber <rhi@pengutronix.de>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Like Linux, barebox supports co-existence of multiple watchdog
devices. On boot, barebox enables only the default watchdog, which
is defined as the watchdog with highest non-zero priority.
The kernel handles all watchdogs the same and defers to userspace,
which watchdogs to service. It can be useful to have barebox tell
the system, which watchdog it activated, so it can service the same.
Having this feature behind a global variable adds 354 bytes to a
LZO compressed THUMB2 barebox. Users can opt out by toggling the
Kconfig option, which defaults to off.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The boot entry lines could get quite long for bootspec entries and then
follow-up commit will make them even longer, thus split the lines into
two lines and indent the second.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
| |
Boot entry providers register themselves, so there is no need for the
common boot code to know about bootchooser or blspec or include their
headers. Remove them as well as other headers that aren't strictly
necessary and, if needed, include headers they include directly.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
BAREBOX_MAGICVAR now generates a unique identifier automatically,
so we can convert users of BAREBOX_MAGICVAR_NAMED to the simpler
BAREBOX_MAGICVAR macro.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far watchdog users could only configure the watchdog with the highest
priority. In preparation for having the wd command configure a watchdog
by name, extend watchdog_set_timeout with a struct watchdog *parameter
and export functions to query default watchdog and to find watchdog by
name.
No functional change.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
global.boot.default, global.linux.bootargs.base and global.user are
used in the boot code, so create them there.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
global.linux.bootargs.dyn.* variables are exclusively used in boot
scripts, so create them right before executing a script. This moves
the corresponding code from the unrelated startup code to the place
where the variables are used.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current boot code prints too much error messages without much value
in them. This patch prints the error string when it makes sense and
simplifies the return path of bootscript_boot(). Make use of pr_err()
in boot_entry() which is the shared code responsible for calling the
boot_entry->boot callback. Remove the unnecessary print statement
from bootsource_action() as well.
This removes a single print statement ATM, allowing us to go from this:
booting 'sd'
Cannot set parameter mci0.probe: No such device
running automount command 'mci${global.sd}.probe=1 && mount /dev/disk${global.sd}.0 /mnt/sd' failed
could not open /mnt/sd/zImage: No such device
ERROR: Booting 'sd' failed: No such device
booting 'sd' failed: No such device
boot: No such device
to this:
Booting entry 'sd'
Cannot set parameter mci0.probe: No such device
running automount command 'mci${global.sd}.probe=1 && mount /dev/disk${global.sd}.0 /mnt/sd' failed
could not open /mnt/sd/zImage: No such device
ERROR: Booting entry 'sd' failed
boot: No such device
Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
The boot code works with command support disabled if we skip
support for boot scripts. Bail out before parsing boot scripts
and allow to build with command support disabled.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
| |
This reverts commit 1b4a05c9263ae26083526acfabdea1ef96531a1d.
|
|
|
|
|
|
|
|
|
| |
Similar to the device parameter functions also make the globalvar
functions more consistent. This also adds support for readonly
globalvars and changes several existing globalvars which should
really be readonly to readonly.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
Instead of using a global function called by
bootentry_create_from_name(), register the bootchooser as bootentry
provider.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
Instead of using a global function called by
bootentry_create_from_name(), register blspec as bootentry
provider.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
bootentry_create_from_name() takes a name and creates bootentries
for it. It tries different providers that interpret the name:
blspec, bootchooser or script pathes. Instead of hardcoding the
different providers in the function, allow the providers to register
themselves.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
passing a string to menu_add_title() which then gets free by this
function is just plain ugly. Pass it a const char * which gets
duplicated in menu_add_title() when necessary.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are several use cases where a redundant Linux system is needed. The
barebox bootchooser framework provides the building blocks to model different
use cases without the need to start from the scratch over and over again.
The bootchooser works on abstract boot targets, each with a set of properties
and implements an algorithm which selects the highest priority target to boot.
See the documentation contained in this patch for more information.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| | |
Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| | |
Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
it already gets free in bootentries_free
no need to do this in ->release method
Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
|
|
| |
Fixes: cb47dde boot: Call blspec_scan_directory() only on strings containing an absolute path
This commit introduced a check if the path contains a '/' at the
beginning. For booting a bootloader spec entry from NFS we have to
test the path for starting with "nfs://" aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
It's nicer to read when target names have quotes around them, it
makes it clear that this is a string passed in somewhere.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
Normally code in commands/ shall only do the option parsing whereas the
functionality shall be in common/ to make the code usable from C aswell.
Do this in the boot code aswell, move it to common/boot.c and add the
function prototypes to include/boot.h
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|