- Jul 06, 2024
-
-
Increase LINE_LENGTH from 1024 to 2048 because nowadays for some boards U-Boot CONFIG_SYS_CBSIZE (and CONFIG_SYS_PBSIZE respectively) is greater than 1024. This leads to truncating longer lines which can be fatal in specific cases, for example with a long bootcmd. Signed-off-by:
Leon Anavi <leon.anavi@konsulko.com> Acked-by:
Stefano Babic <stefano.babic@swupdate.org>
-
- May 29, 2024
-
-
Stefano babic authored
In U-Boot, it is possible to list which variables could be changed via CONFIG_ENV_WRITEABLE_LIST. This was not supported by this library, but it does not raise a security leak. In fact, U-Boot will simply discard if a variable is not in the list. However, in user space any variable can be set, and the output of fw_printenv is not what the bootloader really accepts. This patch fills the gap and let add (just for YML configuration) a list of variables that can be set and their flags. The default policy is that all variables are accepted, exactly as it is done in U-Boot, and check is done only if the list is found in the configuration file. Signed-off-by:
Stefano Babic <stefano.babic@swupdate.org>
-
Stefano babic authored
Signed-off-by:
Stefano Babic <stefano.babic@swupdate.org>
-
Stefano babic authored
Signed-off-by:
Stefano Babic <stefano.babic@swupdate.org>
-
- May 10, 2024
-
-
Stefano babic authored
Removed unused entry for code.
-
- Apr 21, 2024
-
-
If UBI_IOCATT was called while the attachment was already in progress we may get an EEXIST error. If this happens get the ubi_num with ubi_get_dev_id_from_mtd instead. Signed-off-by:
James Hilliard <james.hilliard1@gmail.com> Acked-by:
Stefano Babic <stefano.babic@swupdate.org>
-
- Jan 22, 2024
-
-
FreeBSD and other BSDs have not defined u{8,32,64}, so use their stdint.h pendants. This is in the BSD #ifdef path providing a shim for MTD which is not available on BSDs anyway. Signed-off-by:
Christian Storm <christian.storm@siemens.com> Signed-off-by:
Stefano Babic <stefano.babic@swupdate.org>
-
- Dec 06, 2023
-
-
Signed-off-by:
Christian Storm <christian.storm@siemens.com>
-
consume_event() is only used locally in the same compilation unit and needn't be exported. Signed-off-by:
Christian Storm <christian.storm@siemens.com>
-
- Nov 28, 2023
-
-
Stefano babic authored
This is to support other OS that do not have MTD support like Linux. Signed-off-by:
Stefano Babic <stefano.babic@swupdate.org>
-
- Oct 08, 2023
-
-
Stefano babic authored
Signed-off-by:
Stefano Babic <stefano.babic@swupdate.org>
-
- Oct 06, 2023
-
-
In cases where the env is in an unattached UBI volume we may need to specify the volume name via the MTD path to attach. For this to work correctly we should first scan for any already attached UBI devices to see if they correspond to the mtd partition number in our configuration, if no corresponding attached mtd devices are found we should attempt to ubiattach to the configured MTD path. Signed-off-by:
James Hilliard <james.hilliard1@gmail.com>
-
- Sep 20, 2023
-
-
Stefano babic authored
Move code from fw_printenv to library. libuboot_namespace_from_dt looks into DT and reads the namespace for the bootloader, if any. Signed-off-by:
Stefano Babic <stefano.babic@swupdate.org> Suggested-by:
Frieder Schrempf <frieder.schrempf@kontron.de> Reviewed-by:
Frieder Schrempf <frieder.schrempf@kontron.de>
-
- Sep 02, 2023
-
-
Stefano babic authored
Signed-off-by:
Stefano Babic <stefano.babic@swupdate.org>
-
Signed-off-by:
Frieder Schrempf <frieder.schrempf@kontron.de>
-
Signed-off-by:
Frieder Schrempf <frieder.schrempf@kontron.de>
-
The bootloader might be able to tell us where the currently used environment is located. Use the string from the "/chosen/u-boot,env-config" devicetree property as namespace selector if available. Signed-off-by:
Frieder Schrempf <frieder.schrempf@kontron.de> Reviewed-by:
Stefano Babic <stefano.babic@swupdate.org>
-
- Aug 14, 2023
-
-
Using strtoull() is unreliable for testing if the input is a number. It is implementation-defined, whether or not errno is set. Furthermore, the decimal type has to be handled separately from the hex type. U-Boot will reject an "0x10" entry as decimal, "16" is expected instead. Reviewed-by:
Stefano Babic <sbabic@denx.de> Signed-off-by:
Philip Oberfichtner <pro@denx.de>
-
value should start with the '0' character, corresponding to 0x30. Before this patch we checked for 0x00 instead. Reviewed-by:
Stefano Babic <sbabic@denx.de> Signed-off-by:
Philip Oberfichtner <pro@denx.de>
-
- Jun 15, 2023
-
-
Stefano Babic authored
This reverts commit 44ecc1c2. mtd writesize was errouneously interpreted as maximum allowed size, but it is the minimum size. The patch raises performance issues because on NOR flashes single bytes are written. Signed-off-by:
Stefano Babic <sbabic@denx.de>
-
- Jun 02, 2023
-
-
Stefano Babic authored
Signed-off-by:
Stefano Babic <sbabic@denx.de>
-
- Apr 12, 2023
-
-
Stefano Babic authored
This helps the caller to identify the version of the running version of libubootenv. It returns a pointer to a static structure. Applications should use this information to judge if things are possible to do or not, instead of using compile-time checks, as libraries loaded via dlopen() can be changed independent from the application. Signed-off-by:
Stefano Babic <sbabic@denx.de>
-
Stefano Babic authored
Make transition to new API simpler. Older application can still call libuboot_read_config() as in the past. This function requires to have a valid context as input. Newer applications just call libuboot_read_config_ext(struct uboot_env **ctx). It gets the pointer to an array of ctx. Allocation is done by the libuboot_read_config_ext(9 function. Old API: // Allocate ctx struct uboot_env *ctx; libuboot_initialize(&ctx); libuboot_read_config(ctx, configfile); New API: struct uboot_env *ctx; libuboot_read_config_ext(&ctx, configfile); Signed-off-by:
Stefano Babic <sbabic@denx.de> Tested-by:
Joris Offouga <offougajoris@gmail.com>
-
- Apr 04, 2023
-
-
Stefano Babic authored
CI with focal reports: /builds/swupdate/swupdate/libubootenv/src/uboot_env.c:1247:4: error: a label can only be part of a statement and a declaration is not a statement 1247 | struct uboot_ctx *newctx; Just move the declaration at the beginning of the function. Signed-off-by:
Stefano Babic <sbabic@denx.de>
-
- Apr 01, 2023
-
-
Stefano Babic authored
Signed-off-by:
Stefano Babic <sbabic@denx.de>
-
Stefano Babic authored
Signed-off-by:
Stefano Babic <sbabic@denx.de>
-
Stefano Babic authored
Signed-off-by:
Stefano Babic <sbabic@denx.de>
-
Michael Heimpold authored
Now that we might have set name and lockfile of the structure, we need to free these fields, too. It should also not be assumed that the list start is passed as pointer. Signed-off-by:
Michael Heimpold <mhei@heimpold.de> Acked-by:
Stefano Babic <sbabic@denx.de>
-
Michael Heimpold authored
According to the documentation, the function returns zero on success, else a negative value. However, at the moment the return value of parse_yaml_config might also be passed through which can be FAILURE (define as 1). So map this one to a generic -1 and pass all other as-is to match the documented API. Signed-off-by:
Michael Heimpold <mhei@heimpold.de> Acked-by:
Stefano Babic <sbabic@denx.de>
-
Michael Heimpold authored
Now that it is possible to define a custom lockfile via YAML configuration let's use it when it is appropriate. Signed-off-by:
Michael Heimpold <mhei@heimpold.de> Acked-by:
Stefano Babic <sbabic@denx.de>
-
- Mar 31, 2023
-
-
Michael Heimpold authored
This improves the rendering in HTML output of doxygen and displaying via Github. Signed-off-by:
Michael Heimpold <mhei@heimpold.de>
-
- Mar 26, 2023
-
-
Stefano Babic authored
Legacy configuration file was taken by U-Boot project. Its format is very simple, but unflexible and it cannot be extended. Changes in the format could lead to uncompatibility with U-Boot tools, that are still part of U-Boot. This introduces a new format, letting the old format as fallback if YAML cannot be parsed. It uses the libyaml library. Multiple sets can be configured - an environment is not bound with the bootloader, and can be used for other purposes, but still having the features provided by the handling for the bootloader (redundancy, power-cut safe). See documentation for the format of the yaml file. Each not recognized keyword generates an error. Signed-off-by:
Stefano Babic <sbabic@denx.de>
-
- Mar 21, 2023
-
-
Michael Heimpold authored
Instead of compiling the same source file twice, just add a symlink at install time. This is how the "original" tools also worked. It also reduces the storage footprint. Signed-off-by:
Michael Heimpold <mhei@heimpold.de>
-
Michael Heimpold authored
While at, remove .gitignore self from the list since it does not make sense to ignore these files when it is recommended a few lines above to add subdirectory files where appropriate. Signed-off-by:
Michael Heimpold <mhei@heimpold.de>
-
- Feb 23, 2023
-
-
Michael Heimpold authored
For headings, apply Title Case. For the tables remove abbreviations and apply consistent spacing around. Also use Title Case for the heading line. Signed-off-by:
Michael Heimpold <mhei@heimpold.de>
-
Michael Heimpold authored
While reading over the doxygen generated output I stumpled over a few minor things, eg. typos, HTML-like tags which do not make it into the final HTML output and other minor stuff. Signed-off-by:
Michael Heimpold <mhei@heimpold.de>
-
Michael Heimpold authored
Signed-off-by:
Michael Heimpold <mhei@heimpold.de>
-
- Sep 05, 2022
-
-
Stefano Babic authored
Signed-off-by:
Stefano Babic <sbabic@denx.de>
-
Ming Liu authored
Signed-off-by:
Ming Liu <liu.ming50@gmail.com>
-
Ming Liu authored
Avoid to hard-code configuration and environment files, allow them to be configurable during build. This is usefull when some end users want to distinguish these files at build time rather than run time with command parameters. Signed-off-by:
Ming Liu <liu.ming50@gmail.com> Reviewed-by:
Stefano Babic <sbabic@denx.de>
-