From de9433550b01547c3207de9f7060092242c91569 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Thu, 19 Jan 2023 15:37:40 +0100 Subject: [PATCH 01/10] fs/fat: avoid noisy message fat_read_file() UEFI applications call file system functions to determine if a file exists. The return codes are evaluated to show appropriate messages. U-Boot's file system layer should not interfere with the output. Rename file_fat_read_at() to fat_read_file() adjusting the parameter sequence and names and eliminate the old wrapper function. Signed-off-by: Heinrich Schuchardt Reviewed-by: Tom Rini Reviewed-by: Ilias Apalodimas --- fs/fat/fat.c | 22 +++++----------------- include/fat.h | 2 -- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/fs/fat/fat.c b/fs/fat/fat.c index a945904785f..2da93dae3cf 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -1243,8 +1243,8 @@ out_free_itr: return ret; } -int file_fat_read_at(const char *filename, loff_t pos, void *buffer, - loff_t maxsize, loff_t *actread) +int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len, + loff_t *actread) { fsdata fsdata; fat_itr *itr; @@ -1261,12 +1261,12 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer, if (ret) goto out_free_both; - debug("reading %s at pos %llu\n", filename, pos); + debug("reading %s at pos %llu\n", filename, offset); /* For saving default max clustersize memory allocated to malloc pool */ dir_entry *dentptr = itr->dent; - ret = get_contents(&fsdata, dentptr, pos, buffer, maxsize, actread); + ret = get_contents(&fsdata, dentptr, offset, buf, len, actread); out_free_both: free(fsdata.fatbuf); @@ -1280,25 +1280,13 @@ int file_fat_read(const char *filename, void *buffer, int maxsize) loff_t actread; int ret; - ret = file_fat_read_at(filename, 0, buffer, maxsize, &actread); + ret = fat_read_file(filename, buffer, 0, maxsize, &actread); if (ret) return ret; else return actread; } -int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len, - loff_t *actread) -{ - int ret; - - ret = file_fat_read_at(filename, offset, buf, len, actread); - if (ret) - printf("** Unable to read file %s **\n", filename); - - return ret; -} - typedef struct { struct fs_dir_stream parent; struct fs_dirent dirent; diff --git a/include/fat.h b/include/fat.h index bd8e450b33a..a9756fb4cd1 100644 --- a/include/fat.h +++ b/include/fat.h @@ -200,8 +200,6 @@ static inline u32 sect_to_clust(fsdata *fsdata, int sect) int file_fat_detectfs(void); int fat_exists(const char *filename); int fat_size(const char *filename, loff_t *size); -int file_fat_read_at(const char *filename, loff_t pos, void *buffer, - loff_t maxsize, loff_t *actread); int file_fat_read(const char *filename, void *buffer, int maxsize); int fat_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info); int fat_register_device(struct blk_desc *dev_desc, int part_no); From 8a7301b1fabdbe60c50a3ab03b83d2884a23a4ba Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 14 Jan 2023 20:15:15 +0100 Subject: [PATCH 02/10] doc: man-page for source command Provide a man-page for the source command. Signed-off-by: Heinrich Schuchardt Reviewed-by: Sean Anderson --- doc/usage/cmd/source.rst | 193 +++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 2 files changed, 194 insertions(+) create mode 100644 doc/usage/cmd/source.rst diff --git a/doc/usage/cmd/source.rst b/doc/usage/cmd/source.rst new file mode 100644 index 00000000000..61a45059096 --- /dev/null +++ b/doc/usage/cmd/source.rst @@ -0,0 +1,193 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. Copyright 2022, Heinrich Schuchardt + +source command +============== + +Synopsis +-------- + +:: + + source [][:[]|#[]] + +Description +----------- + +The *source* command is used to execute a script file from memory. + +Two formats for script files exist: + +* legacy U-Boot image format +* Flat Image Tree (FIT) + +The benefit of the FIT images is that they can be signed and verifed as +decribed in :download:`signature.txt <../../uImage.FIT/signature.txt>`. + +Both formats can be created with the mkimage tool. + +addr + location of the script file in memory, defaults to CONFIG_SYS_LOAD_ADDR. + +image + name of an image in a FIT file + +config + name of a configuration in a FIT file. A hash sign following white space + starts a comment. Hence, if no *addr* is specified, the hash sign has to be + escaped with a backslash or the argument must be quoted. + +If both *image* and *config* are omitted, the default configuration is used, or +if no configuration is defined, the default image. + +Examples +-------- + +FIT image +''''''''' + +For creating a FIT image an image tree source file (\*.its) is needed. Here is +an example (source.its). + +.. code-block:: + + /dts-v1/; + + / { + description = "FIT image to test the source command"; + #address-cells = <1>; + + images { + default = "script-1"; + + script-1 { + data = "echo 1"; + type = "script"; + compression = "none"; + }; + + script-2 { + data = "echo 2"; + type = "script"; + compression = "none"; + }; + }; + + configurations { + default = "conf-2"; + + conf-1 { + script = "script-1"; + }; + + conf-2 { + script = "script-2"; + }; + }; + }; + +The FIT image file (boot.itb) is created with: + +.. code-block:: bash + + mkimage -f source.its boot.itb + +In U-Boot the script can be loaded and execute like this + +.. code-block:: + + => load host 0:1 $loadaddr boot.itb + 1552 bytes read in 0 ms + => source $loadaddr#conf-1 + ## Executing script at 00000000 + 1 + => source $loadaddr#conf-2 + ## Executing script at 00000000 + 2 + => source $loadaddr:script-1 + ## Executing script at 00000000 + 1 + => source $loadaddr:script-2 + ## Executing script at 00000000 + 2 + => source $loadaddr + ## Executing script at 00000000 + 2 + => source \#conf-1 + ## Executing script at 00000000 + 1 + => source '#conf-1' + ## Executing script at 00000000 + 1 + => source ':script-1' + ## Executing script at 00000000 + 1 + => source + ## Executing script at 00000000 + 2 + => + +Instead of specifying command line instructions directly in the *data* property +of the image tree source file another file can be included. Here is a minimal +example which encapsulates the file boot.txt: + +.. code-block:: + + /dts-v1/; + / { + description = ""; + images { + script { + data = /incbin/("./boot.txt"); + type = "script"; + }; + }; + }; + +Legacy U-Boot image +''''''''''''''''''' + +A script file using the legacy U-Boot image file format can be created based on +a text file. Let's use this example text file (boot.txt): + +.. code-block:: bash + + echo Hello from a script + echo ------------------- + +The boot scripts (boot.scr) is created with: + +.. code-block:: bash + + mkimage -T script -n 'Test script' -d boot.txt boot.scr + +The script can be execute in U-boot like this: + +.. code-block:: + + => load host 0:1 $loadaddr boot.scr + 122 bytes read in 0 ms + => source $loadaddr + ## Executing script at 00000000 + Hello from a script + ------------------- + => source + ## Executing script at 00000000 + Hello from a script + ------------------- + => + +Configuration +------------- + +The source command is only available if CONFIG_CMD_SOURCE=y. +The FIT image file format requires CONFIG_FIT=y.# +The legacy U-Boot image file format requires CONFIG_LEGACY_IMAGE_FORMAT=y. +On hardened systems support for the legacy U-Boot image format should be +disabled as these images cannot be signed and verified. + +Return value +------------ + +If the scripts is executed successfully, the return value $? is 0 (true). +Otherwise it is 1 (false). diff --git a/doc/usage/index.rst b/doc/usage/index.rst index cf3666a77d8..53e4aeec567 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -75,6 +75,7 @@ Shell commands cmd/setexpr cmd/size cmd/sound + cmd/source cmd/temperature cmd/tftpput cmd/true From 389be395c69782f3faf3d27efe92133954dc9c07 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 15 Jan 2023 11:35:55 +0100 Subject: [PATCH 03/10] doc: man-page for blkcache Provide a man-page for the blkcache command. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- doc/usage/cmd/blkcache.rst | 74 ++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 2 files changed, 75 insertions(+) create mode 100644 doc/usage/cmd/blkcache.rst diff --git a/doc/usage/cmd/blkcache.rst b/doc/usage/cmd/blkcache.rst new file mode 100644 index 00000000000..d3b2254cfad --- /dev/null +++ b/doc/usage/cmd/blkcache.rst @@ -0,0 +1,74 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. Copyright 2023, Heinrich Schuchardt + +blkcache command +================ + +Synopsis +-------- + +:: + + blkcache show + blkcache configure + +Description +----------- + +The *blkcache* command is used to control the size of the block cache and to +display statistics. + +The block cache buffers data read from block devices. This speeds up the access +to file-systems. + +show + show and reset statistics + +configure + set the maximum number of cache entries and the maximum number of blocks per + entry + +blocks + maximum number of blocks per cache entry. The block size is device specific. + The initial value is 8. + +entries + maximum number of entries in the cche. The initial value is 32. + +Example +------- + +.. code-block:: + + => blkcache show + hits: 296 + misses: 149 + entries: 7 + max blocks/entry: 8 + max cache entries: 32 + => blkcache show + hits: 0 + misses: 0 + entries: 7 + max blocks/entry: 8 + max cache entries: 32 + => blkcache configure 16 64 + changed to max of 64 entries of 16 blocks each + => blkcache show + hits: 0 + misses: 0 + entries: 0 + max blocks/entry: 16 + max cache entries: 64 + => + +Configuration +------------- + +The blkcache command is only available if CONFIG_CMD_BLOCK_CACHE=y. + +Return code +----------- + +If the command succeeds, the return code $? is set 0 (true). In case of an +error the return code is set to 1 (false). diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 53e4aeec567..9284d159d75 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -23,6 +23,7 @@ Shell commands cmd/addrmap cmd/askenv cmd/base + cmd/blkcache cmd/bootd cmd/bootdev cmd/bootefi From b1315ad33391e83736907265db3b3b15682c0109 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 15 Jan 2023 12:45:44 +0100 Subject: [PATCH 04/10] doc: man-page for bdinfo Provide a man-page for the bdinfo command Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- doc/usage/cmd/bdinfo.rst | 119 +++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 2 files changed, 120 insertions(+) create mode 100644 doc/usage/cmd/bdinfo.rst diff --git a/doc/usage/cmd/bdinfo.rst b/doc/usage/cmd/bdinfo.rst new file mode 100644 index 00000000000..6b3cde2ccb5 --- /dev/null +++ b/doc/usage/cmd/bdinfo.rst @@ -0,0 +1,119 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. Copyright 2023, Heinrich Schuchardt + +bdinfo command +============== + +Synopsis +-------- + +:: + + bdinfo + +Description +----------- + +The *bdinfo* command prints information about the board. + +Example +======= + +:: + + => bdinfo + boot_params = 0x0000000000000000 + DRAM bank = 0x0000000000000000 + -> start = 0x0000000040000000 + -> size = 0x0000000100000000 + flashstart = 0x0000000000000000 + flashsize = 0x0000000004000000 + flashoffset = 0x00000000000e87f8 + baudrate = 115200 bps + relocaddr = 0x000000013fefb000 + reloc off = 0x000000013fefb000 + Build = 64-bit + current eth = virtio-net#32 + ethaddr = 52:52:52:52:52:52 + IP addr = 10.0.2.15 + fdt_blob = 0x000000013edbadb0 + new_fdt = 0x000000013edbadb0 + fdt_size = 0x0000000000100000 + lmb_dump_all: + memory.cnt = 0x1 + memory[0] [0x40000000-0x13fffffff], 0x100000000 bytes flags: 0 + reserved.cnt = 0x2 + reserved[0] [0x13ddb3000-0x13fffffff], 0x0224d000 bytes flags: 0 + reserved[1] [0x13edb6930-0x13fffffff], 0x012496d0 bytes flags: 0 + devicetree = board + arch_number = 0x0000000000000000 + TLB addr = 0x000000013fff0000 + irq_sp = 0x000000013edbada0 + sp start = 0x000000013edbada0 + Early malloc usage: 3a8 / 2000 + => + +boot_params + address of the memory area for boot parameters + +DRAM bank + index, start address and end address of a memory bank + +baudrate + baud rate of the serial console + +relocaddr + address to which U-Boot has relocated itself + +reloc off + relocation offset, difference between *relocaddr* and the text base + +Build + bitness of the system + +current eth + name of the active network device + +IP addr + network address, value of the environment variable *ipaddr* + +fdt_blob + address of U-Boot's own device tree, NULL if none + +new_fdt + location of the relocated device tree + +fdt_size + space reserved for relocated device space + +lmb_dump_all + available memory and memory reservations + +devicetree + source of the device-tree + +arch_number + unique id for the board + +TLB addr + address of the translation lookaside buffer + +irq_sp + address of the IRQ stack pointer + +sp start + initial stack pointer address + +Early malloc usage + amount of memory used in the early malloc memory and its maximum size + as defined by CONFIGSYS_MALLOC_F_LEN + +Configuration +------------- + +The bdinfo command is available if CONFIG_CMD_BDI=y. + +Return code +----------- + +The return code $? is 0 (true). diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 9284d159d75..7d4a1cbc10d 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -23,6 +23,7 @@ Shell commands cmd/addrmap cmd/askenv cmd/base + cmd/bdinfo cmd/blkcache cmd/bootd cmd/bootdev From 5ef229a007b19caa03228531ef32ac4cd5f25239 Mon Sep 17 00:00:00 2001 From: Dario Binacchi Date: Mon, 9 Jan 2023 12:52:40 +0100 Subject: [PATCH 05/10] doc: fix references to distro documentation Commit 37c5195dfcd157 ("doc: Move distro boot doc to rST") renamed doc/README.distro to doc/develop/distro.rst. Signed-off-by: Dario Binacchi Reviewed-by: Patrice Chotard Reviewed-by: Soeren Moch Reviewed-by: Patrick Delaunay --- doc/README.gpt | 2 +- doc/README.uniphier | 2 +- doc/board/emulation/qemu-x86.rst | 3 ++- doc/board/st/stm32mp1.rst | 2 +- doc/board/tbs/tbs2910.rst | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/README.gpt b/doc/README.gpt index cc2a1b7ac78..386ac2e0fc8 100644 --- a/doc/README.gpt +++ b/doc/README.gpt @@ -177,7 +177,7 @@ To restore GUID partition table one needs to: "name=u-boot,size=60MiB;name=boot,size=60Mib,bootable;name=rootfs,size=0" It can be used to locate bootable disks with command "part list -bootable ", - please check out doc/README.distro for use. + please check out doc/develop/distro.rst for use. 2. Define 'CONFIG_EFI_PARTITION' and 'CONFIG_CMD_GPT' diff --git a/doc/README.uniphier b/doc/README.uniphier index badfacd66aa..af746f6c316 100644 --- a/doc/README.uniphier +++ b/doc/README.uniphier @@ -336,7 +336,7 @@ Deployment for Distro Boot -------------------------- UniPhier SoC family boot the kernel in a generic manner as described in -doc/README.distro . +doc/develop/distro.rst. To boot the kernel, you need to deploy necesssary components to a file system on one of your block devices (eMMC, NAND, USB drive, etc.). diff --git a/doc/board/emulation/qemu-x86.rst b/doc/board/emulation/qemu-x86.rst index db842f2ece6..e7dd4e994d3 100644 --- a/doc/board/emulation/qemu-x86.rst +++ b/doc/board/emulation/qemu-x86.rst @@ -57,7 +57,8 @@ to instantiate. Note, the maximum supported CPU number in QEMU is 255. U-Boot uses 'distro_bootcmd' by default when booting on x86 QEMU. This tries to load a boot script, kernel, and ramdisk from several different interfaces. For the default boot order, see 'qemu-x86.h'. For more information, see -'README.distro'. Most Linux distros can be booted by writing a uboot script. +'doc/develop/distro.rst'. Most Linux distros can be booted by writing a uboot +script. For example, Debian (stretch) can be booted by creating a script file named 'boot.txt' with the contents:: diff --git a/doc/board/st/stm32mp1.rst b/doc/board/st/stm32mp1.rst index 9780ac9768c..3f70634d283 100644 --- a/doc/board/st/stm32mp1.rst +++ b/doc/board/st/stm32mp1.rst @@ -478,7 +478,7 @@ or: +-------+--------+---------+------------------------+------------------------+ And the 4th partition (Rootfs) is marked bootable with a file extlinux.conf -following the Generic Distribution feature (doc/README.distro for use). +following the Generic Distribution feature (doc/develop/distro.rst for use). The size of fip or ssbl partition must be enough for the associated binary file, 4MB and 2MB are default values. diff --git a/doc/board/tbs/tbs2910.rst b/doc/board/tbs/tbs2910.rst index e97f2b6e613..9d4be61783e 100644 --- a/doc/board/tbs/tbs2910.rst +++ b/doc/board/tbs/tbs2910.rst @@ -181,7 +181,7 @@ If that fails it will then try to boot from several interfaces using 'distro_bootcmd': It will first try to boot from the microSD slot, then the SD slot, then the internal eMMC, then the SATA interface and finally the USB interface. For more information on how to configure your distribution to boot, -see 'README.distro'. +see 'doc/develop/distro.rst'. Links: ------ From de94f0f3209e27ff36b264c58d5e6a8d54e07c65 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Wed, 18 Jan 2023 22:25:00 +0100 Subject: [PATCH 06/10] efi_loader: Set default console colors on efi_cout_clear_screen if needed Ensures a consistent background color of the whole screen for succeeding outputs as both demanded by the spec and implemented in EDK2 as well. Signed-off-by: Jan Kiszka Reviewed-by: Heinrich Schuchardt --- lib/efi_loader/efi_console.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c index 4d08dd3763a..9316995073e 100644 --- a/lib/efi_loader/efi_console.c +++ b/lib/efi_loader/efi_console.c @@ -489,6 +489,12 @@ static efi_status_t EFIAPI efi_cout_clear_screen( { EFI_ENTRY("%p", this); + /* Set default colors if not done yet */ + if (efi_con_mode.attribute == 0) { + efi_con_mode.attribute = 0x07; + printf(ESC "[0;37;40m"); + } + efi_clear_screen(); return EFI_EXIT(EFI_SUCCESS); From e585b79ee4b1424f43dc7dbf66fc4f054255cb57 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Wed, 18 Jan 2023 22:24:59 +0100 Subject: [PATCH 07/10] efi_loader: Avoid overwriting previous outputs on console screen clearing Before clearing the screen, ensure that no previous output of firmware or UEFI programs will be overwritten on serial devices or other streaming consoles. This helps generating complete boot logs. Tested regarding multi-output against qemu-x86_defconfig. Still, there were remaining concerns about side effects, so this is provided as an opt-in feature. Signed-off-by: Jan Kiszka Reviewed-by: Heinrich Schuchardt --- lib/efi_loader/Kconfig | 9 +++++++++ lib/efi_loader/efi_console.c | 13 ++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index b630d88ef9e..c56904afc2e 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -124,6 +124,15 @@ config EFI_SET_TIME Provide the SetTime() runtime service at boottime. This service can be used by an EFI application to adjust the real time clock. +config EFI_SCROLL_ON_CLEAR_SCREEN + bool "Avoid overwriting previous output on clear screen" + help + Instead of erasing the screen content when the console screen should + be cleared, emit blank new lines so that previous output is scrolled + out of sight rather than overwritten. On serial consoles this allows + to capture complete boot logs (except for interactive menus etc.) + and can ease debugging related issues. + config EFI_HAVE_CAPSULE_SUPPORT bool diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c index 9316995073e..1ed8c7aa36e 100644 --- a/lib/efi_loader/efi_console.c +++ b/lib/efi_loader/efi_console.c @@ -461,10 +461,21 @@ static efi_status_t EFIAPI efi_cout_set_attribute( } /** - * efi_cout_clear_screen() - clear screen + * efi_clear_screen() - clear screen */ static void efi_clear_screen(void) { + if (CONFIG_IS_ENABLED(EFI_SCROLL_ON_CLEAR_SCREEN)) { + unsigned int row, screen_rows, screen_columns; + + /* Avoid overwriting previous outputs on streaming consoles */ + screen_rows = efi_cout_modes[efi_con_mode.mode].rows; + screen_columns = efi_cout_modes[efi_con_mode.mode].columns; + printf(ESC "[%u;%uH", screen_rows, screen_columns); + for (row = 1; row < screen_rows; row++) + printf("\n"); + } + /* * The Linux console wants both a clear and a home command. The video * uclass does not support [H without coordinates, yet. From 90c420509ed66ef4cb8453b7e388beb168c34a97 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Thu, 19 Jan 2023 14:49:33 +0100 Subject: [PATCH 08/10] efi_loader: ensure that file ubootefi.var is created Currently file ubootefi.var is only created if the user sets a non-volatile EFI variable. If the file is missing, a warning is written. With the change PlatformLang is always persisted. So the file will exist on second boot. Signed-off-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- lib/efi_loader/efi_variable.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c index 503a33ed65c..7c32adf6e5b 100644 --- a/lib/efi_loader/efi_variable.c +++ b/lib/efi_loader/efi_variable.c @@ -334,9 +334,11 @@ efi_status_t efi_set_variable_int(const u16 *variable_name, else ret = EFI_SUCCESS; - /* Write non-volatile EFI variables to file */ - if (attributes & EFI_VARIABLE_NON_VOLATILE && - ret == EFI_SUCCESS && efi_obj_list_initialized == EFI_SUCCESS) + /* + * Write non-volatile EFI variables to file + * TODO: check if a value change has occured to avoid superfluous writes + */ + if (attributes & EFI_VARIABLE_NON_VOLATILE) efi_var_to_file(); return EFI_SUCCESS; From cd63e2d26c7c080c8bdb4ea40b4bfc1320ce2aee Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Thu, 19 Jan 2023 16:29:15 +0200 Subject: [PATCH 09/10] efi_loader: update the error message of TCG protocol installation "Unable to find TPMv2 device" doesn't explain much with regards to the error origin. Update it to match what we have in the RNG protocol installation. Signed-off-by: Ilias Apalodimas Reviewed-by: Heinrich Schuchardt --- lib/efi_loader/efi_tcg2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c index a525ebf75b5..918e9a26864 100644 --- a/lib/efi_loader/efi_tcg2.c +++ b/lib/efi_loader/efi_tcg2.c @@ -2417,7 +2417,7 @@ efi_status_t efi_tcg2_register(void) ret = platform_get_tpm2_device(&dev); if (ret != EFI_SUCCESS) { - log_warning("Unable to find TPMv2 device\n"); + log_warning("Missing TPMv2 device for EFI_TCG_PROTOCOL\n"); return EFI_SUCCESS; } From e10fffe8b56f4430e0e242977bfa67ab589b8235 Mon Sep 17 00:00:00 2001 From: Ilias Apalodimas Date: Fri, 20 Jan 2023 13:58:48 +0200 Subject: [PATCH 10/10] efi_loader: fix CapsuleMax variable reporting Currently the code that adds the CapsuleMax variable is under a Kconfig named 'EFI_HAVE_CAPSULE_UPDATE. Git history only shows a single occurrence of that. The IS_ENABLED should be checking for EFI_HAVE_CAPSULE_SUPPORT Reported-by: Heinrich Schuchardt Signed-off-by: Ilias Apalodimas --- lib/efi_loader/efi_setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c index 54376411353..f0f01d3b1d5 100644 --- a/lib/efi_loader/efi_setup.c +++ b/lib/efi_loader/efi_setup.c @@ -128,7 +128,7 @@ static efi_status_t efi_init_capsule(void) { efi_status_t ret = EFI_SUCCESS; - if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_UPDATE)) { + if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)) { ret = efi_set_variable_int(u"CapsuleMax", &efi_guid_capsule_report, EFI_VARIABLE_READ_ONLY |