2018-02-08 |
Merge branch 'for-next/misc'
Sascha Hauer
committed
on 8 Feb 2018
|
Merge branch 'for-next/constify'
Sascha Hauer
committed
on 8 Feb 2018
|
env: Add more context to error message
...
When setenv complains that it can't set a device parameter, then print
which parameter it tried to set.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Feb 2018
|
FIT: Allow to open buffer as FIT image
...
This adds fit_open_buf() which can open a buffer as FIT image.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Feb 2018
|
FIT: Implement opening images with no configuration
...
different images can be grouped together to build a FIT configuration.
So far we only supported opening images as parts of configurations.
This patch adds support for opening images that are not part of a
configuration. This mode is used when the configuration parameter of
fit_open_image is NULL.
The main difference is in the way the RSA signature is checked. When
being part of a configuration all involved nodes (including the hash
nodes of the images, but not the image itself) are covered by the
signature, thus during opening an image only the validity of the image
data hash has to be checked. When not being part of a configuration,
the image data itself is signed and must be checked.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Feb 2018
|
FIT: factor out some helper functions
...
Create and use fit_alloc_digest() and fit_read_rsa_public_key()
which we can use a second time in the next step.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Feb 2018
|
FIT: move handle->verify check to fit_verify_hash()
...
Preparation for the next step which will allow to open
images which are not part of a configuration.
This has one change inside: We used to iterate over all
subnodes of a image expecting all of them containing a hash,
so it could happen that we check multiple hashes if more exist
or that we falsely interpret some unrelated subnode as hash node.
With this patch we expect the hash in a subnode named "hash@1"
as required by the FIT image format description.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Feb 2018
|
FIT: store device_nodes in fit_handle
...
We need the /images and /configurations nodes more than once,
so store them in the fit_handle rather than searching for them
each time again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Feb 2018
|
FIT: Let user specify the configuration to use
...
The images in FIT images can be opened in two different ways. They
can be either opened directly based on their names in the images/
node or as part of a configuration based on their names in the
corresponding /configuration/ node.
So far we only supported the latter. To prepare supporting the former
we return a cookie belonging to the configuration from
fit_open_configuration() which we use in fit_open_image() to refer
to the desired configuration.
While at it document fit_open_configuration().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Feb 2018
|
FIT: Do not pre-open images
...
Only do what fit_open_configuration() suggests: open the configuration,
but not the images in it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Feb 2018
|
bootm: FIT: do not depend on FIT pre-opened images
...
When calling fit_open_configuration the FIT code already opens
the images "kernel", "ramdisk" and "dtb". This does not fit well
into the FIT code, so make the bootm code independent of these
pre-opened images so that we can drop the opening from the FIT
code in the next step.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 8 Feb 2018
|
2018-02-06 |
bootchooser: Drop SHELL_NONE conflict
...
Earlier versions of the bootchooser code executed scripts,
thus had to depend on shell support. We do not need this anymore, so
the dependency can be dropped.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Feb 2018
|
boot: Make independent of command support
...
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>
Sascha Hauer
committed
on 6 Feb 2018
|
startup: Load default environment earlier
...
Some files compiled into the default environment may be needed earlier in
the boot process, so move loading of the default environment to fs_initcall.
Only the default environment is loaded earlier, but not the overwriting with
the persistent environment files, so when the files are used that early, only
the compiled in version is available; it's not overwritable at that
time.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Feb 2018
|
state: Add 'init_from_defaults' parameter
...
The init_from_defaults parameter allows to detect if a state has been
initialized from default values, i.e. state_load failed.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Feb 2018
|
state: refuse to set dirty parameter via setenv
...
The dirty parameter is readonly, so refuse to set it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 6 Feb 2018
|
2018-02-05 |
filetype: Add type detection at an offset
...
Add file_name_detect_type_offset to allow file system detection for loop
mounts at an offset.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Philipp Zabel
authored
on 1 Feb 2018
Sascha Hauer
committed
on 5 Feb 2018
|
2018-01-30 |
imd: Make all pointers into image const
...
The IMD code should be readonly and never modify any pointers. Make
all pointers const so that const pointers can be passed in to IMD.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 30 Jan 2018
|
ratp: remove unused context fields
...
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Aleksander Morgado
authored
on 29 Jan 2018
Sascha Hauer
committed
on 30 Jan 2018
|
ratp: move barebox-specific command to ratp_bb.h
...
The ratp_run_command() is really an implementation detail of the
barebox ratp 'command' operation support. Move it to the barebox
specific header and rename it with the correct prefix.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Aleksander Morgado
authored
on 28 Jan 2018
Sascha Hauer
committed
on 30 Jan 2018
|
ratp: rename global context variable
...
The 'ratp_command_ctx' seems to specify that this variable is only
used to process command operations, but it really is used in every
async operation (e.g. also in FS), so just rename it to a more generic
name for clarity.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Aleksander Morgado
authored
on 28 Jan 2018
Sascha Hauer
committed
on 30 Jan 2018
|
2018-01-26 |
bootargs: Fix memory leak in linux_bootargs_get()
...
globalvar_get_match() returns an allocated string which may be
empty. We have to free() the empty string aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 26 Jan 2018
|
2018-01-25 |
uimage: Use is_tftp_fs() and cache_file() to ease TFTP workaround
...
We have helper functions now to ease file caching when a file
is on TFTP. Use them.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 25 Jan 2018
|
uimage: fix memory leak in error path
...
handle->name is dynamically allocated, so free it in the error path.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Stefan Lengfeld <contact@stefanchrist.eu>
Sascha Hauer
committed
on 25 Jan 2018
|
2018-01-23 |
startup: create /tmp
...
Some commands create temporary files in /. Create /tmp to offer
these commands an appropriate place for storing temporary files.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 23 Jan 2018
|
2018-01-22 |
Merge branch 'for-next/misc'
Sascha Hauer
committed
on 22 Jan 2018
|
Merge branch 'for-next/fastboot-sparse'
Sascha Hauer
committed
on 22 Jan 2018
|
Merge branch 'for-next/build'
Sascha Hauer
committed
on 22 Jan 2018
|
blspec: fix crash when trying to boot from loop mounts
...
When trying to boot from a loop mount path, the blspec code passes a
NULL pointer to dev_name, because cdev->dev is not set for loop mounts:
unable to handle NULL pointer dereference at address 0x00000020
pc : [<4fe09e28>] lr : [<4fe02305>]
sp : 4ffef7c0 ip : 31b75c78 fp : 31b6a388
r10: 31b6a368 r9 : 315a4cac r8 : 00000001
r7 : 00000001 r6 : 311b8540 r5 : ffffffea r4 : 31b6a3f8
r3 : 00000000 r2 : 10000000 r1 : 00000001 r0 : 00000000
Flags: nzcv IRQs off FIQs off Mode SVC_32
[<4fe09e28>] (dev_id+0xc/0x38) from [<4fe02305>] (blspec_scan_directory+0x3e1/0x484)
[<4fe02305>] (blspec_scan_directory+0x3e1/0x484) from [<4fe02551>] (blspec_bootentry_provider+0x1d/0x3c)
[<4fe02551>] (blspec_bootentry_provider+0x1d/0x3c) from [<4fe0984b>] (bootentry_create_from_name+0x23/0xdc)
[<4fe0984b>] (bootentry_create_from_name+0x23/0xdc) from [<4fe246f9>] (do_boot+0x95/0x160)
[<4fe246f9>] (do_boot+0x95/0x160) from [<4fe032e9>] (execute_command+0x21/0x48)
[<4fe032e9>] (execute_command+0x21/0x48) from [<4fe088e3>] (run_list_real+0x56b/0x634)
[<4fe088e3>] (run_list_real+0x56b/0x634) from [<4fe08249>] (parse_stream_outer+0xd9/0x164)
[<4fe08249>] (parse_stream_outer+0xd9/0x164) from [<4fe08b6d>] (run_shell+0x31/0x60)
[<4fe08b6d>] (run_shell+0x31/0x60) from [<4fe032e9>] (execute_command+0x21/0x48)
[<4fe032e9>] (execute_command+0x21/0x48) from [<4fe088e3>] (run_list_real+0x56b/0x634)
[<4fe088e3>] (run_list_real+0x56b/0x634) from [<4fe085fd>] (run_list_real+0x285/0x634)
[<4fe444b9>] (unwind_backtrace+0x1/0x58) from [<4fe00b7d>] (panic+0x1d/0x34)
[<4fe00b7d>] (panic+0x1d/0x34) from [<4fe42a75>] (do_exception+0xd/0x10)
[<4fe42a75>] (do_exception+0xd/0x10) from [<4fe42ad5>] (do_data_abort+0x21/0x2c)
[<4fe42ad5>] (do_data_abort+0x21/0x2c) from [<4fe42394>] (do_abort_6+0x48/0x54)
Fix this by checking cdev->dev as well as cdev before calling dev_name.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Philipp Zabel
authored
on 18 Jan 2018
Sascha Hauer
committed
on 22 Jan 2018
|
partitions: dos: Treat all extended partition types equally
...
Creating logical DOS partitions with fdisk (Fedora 27, fdisk from
util-linux 2.30.2) results in extended partition of type 0x05 being
created on the device. Partitioned like this, device is succesfully
recognized by Linux, but, due to algorithm in dos_partition(), not
Barebox.
Looking closer at the actual contents of MBR shows that while marked
as "Extended partition with CHS addressing" that partition still have
all of the LBA adressed fields filled correctly.
Given the above and the fact that similar code in Linux
kernel (block/partitions/msdos.c) does not make a distinction between
types 0x0f and 0x05, port Linux's is_extended_partition() and convert
the code to treat types 0x05, 0x0f and 0x85 the same way.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 17 Jan 2018
Sascha Hauer
committed
on 22 Jan 2018
|