diff options
-rw-r--r-- | .gitlab-ci.yml | 7 | ||||
-rw-r--r-- | .travis.yml | 4 | ||||
-rwxr-xr-x | arch/arm/mach-rockchip/make_fit_atf.py | 4 | ||||
-rw-r--r-- | arch/arm/mach-rockchip/misc.c | 2 | ||||
-rw-r--r-- | include/env.h | 1 | ||||
-rw-r--r-- | lib/efi_loader/efi_unicode_collation.c | 5 | ||||
-rw-r--r-- | lib/efi_loader/efi_variable.c | 13 | ||||
-rw-r--r-- | tools/env/fw_env.c | 10 |
8 files changed, 24 insertions, 22 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 84e79bf0321..a1c5b4fc766 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -145,6 +145,13 @@ Build tools-only: script: - make tools-only_config tools-only -j$(nproc) +# Ensure env tools build +Build envtools: + tags: [ 'all' ] + stage: testsuites + script: + - make tools-only_config envtools -j$(nproc) + Run binman, buildman, dtoc and patman testsuites: tags: [ 'all' ] stage: testsuites diff --git a/.travis.yml b/.travis.yml index 59d2e97fe0c..0ce09e35b7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -361,6 +361,10 @@ matrix: - name: "Build tools-only" script: - make tools-only_config tools-only -j$(nproc) + # Ensure env tools build + - name: "Build envtools" + script: + - make tools-only_config envtools -j$(nproc) # test/py - name: "test/py sandbox" diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py index b9a19882984..585edcf9d56 100755 --- a/arch/arm/mach-rockchip/make_fit_atf.py +++ b/arch/arm/mach-rockchip/make_fit_atf.py @@ -82,7 +82,7 @@ def append_conf_section(file, cnt, dtname, segments): file.write('\t\t\tdescription = "%s";\n' % dtname) file.write('\t\t\tfirmware = "atf_1";\n') file.write('\t\t\tloadables = "uboot"') - if segments != 0: + if segments > 1: file.write(',') for i in range(1, segments): file.write('"atf_%d"' % (i + 1)) @@ -90,7 +90,7 @@ def append_conf_section(file, cnt, dtname, segments): file.write(',') else: file.write(';\n') - if segments == 0: + if segments <= 1: file.write(';\n') file.write('\t\t\tfdt = "fdt_1";\n') file.write('\t\t};\n') diff --git a/arch/arm/mach-rockchip/misc.c b/arch/arm/mach-rockchip/misc.c index fdb763cc53c..c0e4fdbc00f 100644 --- a/arch/arm/mach-rockchip/misc.c +++ b/arch/arm/mach-rockchip/misc.c @@ -70,7 +70,7 @@ int rockchip_cpuid_from_efuse(const u32 cpuid_offset, } /* read the cpu_id range from the efuses */ - ret = misc_read(dev, cpuid_offset, cpuid, sizeof(cpuid)); + ret = misc_read(dev, cpuid_offset, cpuid, cpuid_length); if (ret) { debug("%s: reading cpuid from the efuses failed\n", __func__); diff --git a/include/env.h b/include/env.h index a74a261337e..b72239f6a58 100644 --- a/include/env.h +++ b/include/env.h @@ -9,6 +9,7 @@ #ifndef __ENV_H #define __ENV_H +#include <compiler.h> #include <stdbool.h> #include <linux/types.h> diff --git a/lib/efi_loader/efi_unicode_collation.c b/lib/efi_loader/efi_unicode_collation.c index 243c51a8dbe..c700be87560 100644 --- a/lib/efi_loader/efi_unicode_collation.c +++ b/lib/efi_loader/efi_unicode_collation.c @@ -43,11 +43,6 @@ const efi_guid_t efi_guid_unicode_collation_protocol2 = * See the Unified Extensible Firmware Interface (UEFI) specification for * details. * - * TODO: - * The implementation does not follow the Unicode collation algorithm. - * For ASCII characters it results in the same sort order as EDK2. - * We could use table UNICODE_CAPITALIZATION_TABLE for better results. - * * Return: 0: s1 == s2, > 0: s1 > s2, < 0: s1 < s2 */ static efi_intn_t EFIAPI efi_stri_coll( diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c index 48ee255f879..4c554c546b2 100644 --- a/lib/efi_loader/efi_variable.c +++ b/lib/efi_loader/efi_variable.c @@ -443,8 +443,6 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name, if (ret) goto out; -#define ACCESS_ATTR (EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS) - old_val = env_get(native_name); if (old_val) { old_val = parse_attr(old_val, &attr); @@ -455,7 +453,9 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name, goto out; } - if ((data_size == 0) || !(attributes & ACCESS_ATTR)) { + if ((data_size == 0 && + !(attributes & EFI_VARIABLE_APPEND_WRITE)) || + !attributes) { /* delete the variable: */ env_set(native_name, NULL); ret = EFI_SUCCESS; @@ -470,7 +470,7 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name, if (attributes & EFI_VARIABLE_APPEND_WRITE) { if (!prefix(old_val, "(blob)")) { - return EFI_DEVICE_ERROR; + ret = EFI_DEVICE_ERROR; goto out; } old_size = strlen(old_val); @@ -478,8 +478,9 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name, old_size = 0; } } else { - if ((data_size == 0) || !(attributes & ACCESS_ATTR) || - (attributes & EFI_VARIABLE_APPEND_WRITE)) { + if ((data_size == 0 && + !(attributes & EFI_VARIABLE_APPEND_WRITE)) || + !attributes) { /* delete, but nothing to do */ ret = EFI_NOT_FOUND; goto out; diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 95c99847a3a..e2801f595f6 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -119,13 +119,6 @@ static struct environment environment = { static int have_redund_env; -static unsigned char ENV_REDUND_ACTIVE = 1; -/* - * ENV_REDUND_OBSOLETE must be 0 to efficiently set it on NOR flash without - * erasing - */ -static unsigned char ENV_REDUND_OBSOLETE; - #define DEFAULT_ENV_INSTANCE_STATIC #include <env_default.h> @@ -1142,6 +1135,7 @@ static int flash_flag_obsolete(int dev, int fd, off_t offset) { int rc; struct erase_info_user erase; + char tmp = ENV_REDUND_OBSOLETE; erase.start = DEVOFFSET(dev); erase.length = DEVESIZE(dev); @@ -1153,7 +1147,7 @@ static int flash_flag_obsolete(int dev, int fd, off_t offset) return rc; } ioctl(fd, MEMUNLOCK, &erase); - rc = write(fd, &ENV_REDUND_OBSOLETE, sizeof(ENV_REDUND_OBSOLETE)); + rc = write(fd, &tmp, sizeof(tmp)); ioctl(fd, MEMLOCK, &erase); if (rc < 0) perror("Could not set obsolete flag"); |