2017-07-03 |
barebox-state: get devicetree from file
...
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Steffen Trumtrar
committed
on 3 Jul 2017
|
libdt: support finding devices by partuuid
...
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Steffen Trumtrar
committed
on 3 Jul 2017
|
2017-06-30 |
barebox-state: Fail for unhandled arguments
...
When passing unhandled arguments as in
% barebox-state foo
these will be silently ignored. This may lead to misunderstandings and
unintended behavior, thus the user should be informed and the programm
should exit with an error in these cases.
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Enrico Jorns
committed
on 30 Jun 2017
|
barebox-state: fix termination of long_options[]
...
From the getopt_long() documentation:
| The argument longopts must be an array of these structures, one for each
| long option. Terminate the array with an element containing all zeros.
Otherwise barebox-state will segfault for unknown options:
% ./barebox-state --foo
[1] 17946 segmentation fault (core dumped) ./barebox-state --foo
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Enrico Jorns
committed
on 30 Jun 2017
|
2017-06-27 |
common: Include sys/types.h header
...
Build with musl library fails with following error:
In file included from src/crypto/sha1.c:21:0:
./src/digest.h:95:10: error: unknown type name ‘ulong’
ulong start, ulong size);
...
Fix that by including sys/types.h header in common.h, so ulong type
is defined with musl library.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Marcin Niestroj
authored
on 23 Jun 2017
Sascha Hauer
committed
on 27 Jun 2017
|
common: Rename strlcpy to DT_strlcpy
...
strlcpy function is defined in uClibc library, causing "static
declaration of ‘strlcpy’ follows non-static declaration" build
errors.
Rename internal strlcpy function to DT_strlcpy to avoid conflicts.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Marcin Niestroj
authored
on 23 Jun 2017
Sascha Hauer
committed
on 27 Jun 2017
|
2017-04-24 |
barebox-state: backend_raw: init digest earlier
...
In backend_format_raw_pack() digest_length is used before it's
initialized in backend_raw_digest_init() which results in a too small
memory allocation for the raw backend. Fix this and prevent a memory
corruption.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 24 Apr 2017
|
2017-03-31 |
Release v2017.03.0
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
libdt: support "partitions" subnode on mtd devices
...
In case there is an additional "partitions" subnode between the device
itself and its partitions like /soc/spi@?/mram@?/partitions/partition@?
also try the parent of the parent before giving up finding the device
node.
See kernel docs for reference:
Documentation/devicetree/bindings/mtd/partition.txt
Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Bastian Stender
authored
on 29 Mar 2017
Sascha Hauer
committed
on 31 Mar 2017
|
state: Remove -EUCLEAN check from userspace tool
...
The state code is used for the userspace tool aswell, kept in sync
manually. This patch only introduces a change for the userspace
tool, not for barebox.
In Linux userspace there is no direct possibility to check for -EUCLEAN.
To indirectly check for -EUCLEAN the state tool reads the number of
corrected bits before and after reading a block. Unfortunately it does
not take the number of acceptable bitflips into account, but instead
returns -EUCLEAN even when only a single bitflip occurred on a whole
page. To be correct the algorithm must be more complicated: We would
have to read the bitflip_threshold from sysfs. This value is per ECC
step (often 512 byte), not per page. We would have to read the page
in ECC step size chunks, testing for bitflips lower than the threshold
for each chunk. Even if we would do that, there's still another issue.
The eccstats ioctl delivers the eccstats for the whole device, so a
concurrent reader would falsify the result.
Let's decide that this is not worth the hassle and assume that no
device has enough uptime that a cleanup in barebox is not sufficient.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
barebox-state: implement skipping authentification (again)
...
Implement authentification again, this time wihtout the need of
passing a "force" argument through half of the function call stack.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: Do not load state during state_new_from_node
...
The caller of state_new_from_node() may have it's own ideas what to
do when loading the state fails, so do not load it in the initialization
function, but instead let the caller do it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
barebox-state: make state_get() definition consistent to its prototype
...
In 2839d4f6f4 state_get() got an additional argument, but its prototype
in barebox-state.h was never adjusted. Include the file containing
the prototype from the file containing the function definition so that
this bug can be detected by the compiler. Also add the missing argument
to the callers.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: Allow to load without authentification
...
Sometimes it's useful to be able to load a state even when it
can't be authentificated. Add an option for this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend bucket circular: Explain metadata
...
Explain why we have metadata and where it is used.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_circular: Set minumum writesize to 8
...
NOR flashes have a write size of 1. With this the metadata may
end up on non-4-byte-aligned offsets. Force the minimum writesize
to 8 so that the metadata is always at aligned offsets.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_raw: alloc digest only when needed
...
Instead of deferring probe just allocate the digest when
it's needed. This way the credentials can be added later,
possibly on the commandline.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_storage: rename more variables
...
Use "buckets" rather than "copies" in variable names.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_storage: make locally used variable static
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_storage: rewrite function doc
...
The function documentation for state_storage_file_buckets_init() is not
very accurate. Rewrite it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_storage: Rename variable desired_copies to desired_buckets
...
We defined what a bucket is, so rename the variable that holds the
number of desired buckets from desired_copies to desired_buckets.
While at it, make locally used variable static.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_storage: Rename variable nr_copies to n_buckets
...
We defined what a bucket is, so use n_buckets when counting buckets,
and not nr_copies.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_circular: rewrite function doc
...
The commment talks about copies where buckets are meant and also
claims we start at offset 0, which may not be true. Rewrite comment.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_circular: default to circular storage
...
Default to the new circular storage format which saves erase
cycles. The old format can still be selected with
backend-storage-type = "noncircular".
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend: Add some documentation
...
Write some sentences to make the concepts clearer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: storage: direct: do not close file that is not opened
...
When open failed to not try to close the invalid fd afterwards.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_circular: remove unnecessary warning
...
It's expected that NAND flashes contain bad blocks, do not warn
about them.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend: Add more fields to struct state_backend_storage
...
To save a few function arguments.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: backend_bucket_direct: max_size is always given
...
max_size is always != 0, so if(direct->max_size) can be skipped.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|
state: bucket: Make output more informative
...
Print offset and number of the bucket along with the bucket
specific messages to give a hint which bucket a message is for.
Also it's pretty much expected that buckets sometimes have no
data or need cleanup, so instead of complaining loudly, only
write which bucket is used and which buckets are cleaned up.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 31 Mar 2017
|