Pull request for efi-2021-07-rc5-2
Documentation: * man-page for askenv bug fixes * correct display of BootOrder in efidebug command * do not allow TPL_HIGH_LEVEL for CreateEvent(Ex) * correct handling of unknown properties in SMBIOS tables -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmDaDcEACgkQxIHbvCwF GsTjZQ//elKP0sKZYEMePzOZKZfzD0MnjnzTwsWALqA9h8kv1sAvQLtf5ZDXWIci bo4PNhgRD+FHQuprdoLUrQ2+fSNKTUZugmz8lW1Yudiyh+W4oyjYfINRx+gLTH8L h5W8w5QkV0R+3Ti8U42YYj+SqsUs0htGW5b2k55kZhH0uUFB63GG2ic0KkHr9cHl QQ3Y3tnW+PMxNaer5Q6q3DQjnPTnTO6vfwD9VAoesTd4aunlaPEvK7xAObJzxjpQ ySrj0+Yw4S+y0+02eZRnHXgAIZgI73aN2LiiSuT+FrgGN6JPmVlT6ey3LqLCxPDP VcEF8S25ULoIu7G7ZgIzzVgbvDjWU9WZNduPU3onVfqT2RaSsRPZoVdyGty+EKRi At40vUsAjC3TkttuhDZhfOOoM3ot9vEeeTIQ5Po7bnwwJyMT+PfUTi7PJT/vkfqy iN3KHCi0vuzxS/TbpV9ivrFnMdBP6g6v602VgeMeUTEvHFO9xAA3rHYqFQT7qNxH 4IrRAma6t0R//oeQ5DKD3iqFdkoireHkobEJh0o3hRK7nDAenZiRmvec+o/iogKV YO+lZMboz5igAITBlJI5QoifGDs9B1DwoKxUe9dW61jA1CE7qqGg9Qvo251DZ8Ce 6f8RLkglAkJUbgotyq/YGRRfad28KISEMewj8ATxbQWRCK2vSNQ= =ZMB2 -----END PGP SIGNATURE----- Merge tag 'efi-2021-07-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2021-07-rc5-2 Documentation: * man-page for askenv bug fixes * correct display of BootOrder in efidebug command * do not allow TPL_HIGH_LEVEL for CreateEvent(Ex) * correct handling of unknown properties in SMBIOS tables
This commit is contained in:
commit
605cbcb0a4
@ -1340,7 +1340,7 @@ static int show_efi_boot_order(void)
|
||||
num = size / sizeof(u16);
|
||||
for (i = 0; i < num; i++) {
|
||||
efi_create_indexed_name(var_name16, sizeof(var_name16),
|
||||
"Boot", i);
|
||||
"Boot", bootorder[i]);
|
||||
|
||||
size = 0;
|
||||
ret = EFI_CALL(efi_get_variable(var_name16,
|
||||
|
87
doc/usage/askenv.rst
Normal file
87
doc/usage/askenv.rst
Normal file
@ -0,0 +1,87 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0+:
|
||||
|
||||
askenv command
|
||||
===============
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
askenv name [message] [size]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Display message and get environment variable name of max size characters
|
||||
from stdin.
|
||||
|
||||
name
|
||||
name of the environment variable
|
||||
|
||||
message
|
||||
message is displayed while the command waits for the value to be
|
||||
entered from stdin.if no message is specified,a default message
|
||||
"Please enter name:" will be displayed.
|
||||
|
||||
size
|
||||
maximum number of characters that will be stored in environment
|
||||
variable name.this is in decimal number format (unlike in
|
||||
other commands where size values are in hexa-decimal). Default
|
||||
value of size is 1023 (CONFIG_SYS_CBSIZE - 1).
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
Value of a environment variable env1 without message and size parameters:
|
||||
|
||||
::
|
||||
|
||||
=> askenv env1;echo $?
|
||||
Please enter 'env1': val1
|
||||
0
|
||||
=> printenv env1
|
||||
env1=val1
|
||||
|
||||
Value of a environment variable env2 with message and size parameters:
|
||||
|
||||
::
|
||||
|
||||
=> askenv env2 Please type-in a value for env2: 10;echo $?
|
||||
Please type-in a value for env2: 1234567890123
|
||||
0
|
||||
=> printenv env2
|
||||
env2=1234567890
|
||||
|
||||
Value of a environment variable env3 with size parameter only:
|
||||
|
||||
::
|
||||
|
||||
=> askenv env3 10;echo $?
|
||||
Please enter 'env3': val3
|
||||
0
|
||||
=> printenv env3
|
||||
env3=val3
|
||||
|
||||
Return Value of askenv command, when used without any other arguments:
|
||||
|
||||
::
|
||||
|
||||
=> askenv;echo $?
|
||||
askenv - get environment variables from stdin
|
||||
|
||||
Usage:
|
||||
askenv name [message] [size]
|
||||
- display 'message' and get environment variable 'name' from stdin (max 'size' chars)
|
||||
1
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
The askenv command is only available if CMD_ASKENV=y
|
||||
|
||||
Return value
|
||||
------------
|
||||
|
||||
The return value $? is set to 0 (true).
|
||||
If no other arguments are specified (along with askenv), it is set to 1 (false).
|
@ -17,6 +17,7 @@ Shell commands
|
||||
:maxdepth: 1
|
||||
|
||||
addrmap
|
||||
askenv
|
||||
base
|
||||
bootefi
|
||||
booti
|
||||
|
@ -60,7 +60,7 @@ struct __packed smbios_entry {
|
||||
#define BIOS_CHARACTERISTICS_SELECTABLE_BOOT (1 << 16)
|
||||
|
||||
#define BIOS_CHARACTERISTICS_EXT1_ACPI (1 << 0)
|
||||
#define BIOS_CHARACTERISTICS_EXT1_UEFI (1 << 3)
|
||||
#define BIOS_CHARACTERISTICS_EXT2_UEFI (1 << 3)
|
||||
#define BIOS_CHARACTERISTICS_EXT2_TARGET (1 << 2)
|
||||
|
||||
struct __packed smbios_type0 {
|
||||
|
@ -264,7 +264,6 @@ efi_status_t is_valid_tpl(efi_uintn_t tpl)
|
||||
case TPL_APPLICATION:
|
||||
case TPL_CALLBACK:
|
||||
case TPL_NOTIFY:
|
||||
case TPL_HIGH_LEVEL:
|
||||
return EFI_SUCCESS;
|
||||
default:
|
||||
return EFI_INVALID_PARAMETER;
|
||||
|
@ -55,7 +55,7 @@ static int setup(const efi_handle_t handle,
|
||||
return EFI_ST_FAILURE;
|
||||
}
|
||||
ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_WAIT,
|
||||
TPL_HIGH_LEVEL, notify, NULL, &event_wait);
|
||||
TPL_NOTIFY, notify, NULL, &event_wait);
|
||||
if (ret != EFI_SUCCESS) {
|
||||
efi_st_error("could not create event\n");
|
||||
return EFI_ST_FAILURE;
|
||||
|
24
lib/smbios.c
24
lib/smbios.c
@ -47,7 +47,7 @@ struct smbios_ctx {
|
||||
* @addr: start address to write the structure
|
||||
* @handle: the structure's handle, a unique 16-bit number
|
||||
* @ctx: context for writing the tables
|
||||
* @return: size of the structure
|
||||
* Return: size of the structure
|
||||
*/
|
||||
typedef int (*smbios_write_type)(ulong *addr, int handle,
|
||||
struct smbios_ctx *ctx);
|
||||
@ -72,7 +72,7 @@ struct smbios_write_method {
|
||||
*
|
||||
* @ctx: SMBIOS context
|
||||
* @str: string to add
|
||||
* @return: string number in the string area (1 or more)
|
||||
* Return: string number in the string area (1 or more)
|
||||
*/
|
||||
static int smbios_add_string(struct smbios_ctx *ctx, const char *str)
|
||||
{
|
||||
@ -111,7 +111,7 @@ static int smbios_add_string(struct smbios_ctx *ctx, const char *str)
|
||||
*
|
||||
* @ctx: context for writing the tables
|
||||
* @prop: property to write
|
||||
* @return 0 if not found, else SMBIOS string number (1 or more)
|
||||
* Return: 0 if not found, else SMBIOS string number (1 or more)
|
||||
*/
|
||||
static int smbios_add_prop_si(struct smbios_ctx *ctx, const char *prop,
|
||||
int sysinfo_id)
|
||||
@ -139,7 +139,7 @@ static int smbios_add_prop_si(struct smbios_ctx *ctx, const char *prop,
|
||||
* smbios_add_prop() - Add a property from the devicetree
|
||||
*
|
||||
* @prop: property to write
|
||||
* @return 0 if not found, else SMBIOS string number (1 or more)
|
||||
* Return: 0 if not found, else SMBIOS string number (1 or more)
|
||||
*/
|
||||
static int smbios_add_prop(struct smbios_ctx *ctx, const char *prop)
|
||||
{
|
||||
@ -187,7 +187,7 @@ int smbios_update_version(const char *version)
|
||||
* This computes the size of the string area including the string terminator.
|
||||
*
|
||||
* @ctx: SMBIOS context
|
||||
* @return: string area size
|
||||
* Return: string area size
|
||||
*/
|
||||
static int smbios_string_table_len(const struct smbios_ctx *ctx)
|
||||
{
|
||||
@ -229,9 +229,9 @@ static int smbios_write_type0(ulong *current, int handle,
|
||||
t->bios_characteristics_ext1 = BIOS_CHARACTERISTICS_EXT1_ACPI;
|
||||
#endif
|
||||
#ifdef CONFIG_EFI_LOADER
|
||||
t->bios_characteristics_ext1 |= BIOS_CHARACTERISTICS_EXT1_UEFI;
|
||||
t->bios_characteristics_ext2 |= BIOS_CHARACTERISTICS_EXT2_UEFI;
|
||||
#endif
|
||||
t->bios_characteristics_ext2 = BIOS_CHARACTERISTICS_EXT2_TARGET;
|
||||
t->bios_characteristics_ext2 |= BIOS_CHARACTERISTICS_EXT2_TARGET;
|
||||
|
||||
/* bios_major_release has only one byte, so drop century */
|
||||
t->bios_major_release = U_BOOT_VERSION_NUM % 100;
|
||||
@ -258,7 +258,11 @@ static int smbios_write_type1(ulong *current, int handle,
|
||||
fill_smbios_header(t, SMBIOS_SYSTEM_INFORMATION, len, handle);
|
||||
smbios_set_eos(ctx, t->eos);
|
||||
t->manufacturer = smbios_add_prop(ctx, "manufacturer");
|
||||
if (!t->manufacturer)
|
||||
t->manufacturer = smbios_add_string(ctx, "Unknown");
|
||||
t->product_name = smbios_add_prop(ctx, "product");
|
||||
if (!t->product_name)
|
||||
t->product_name = smbios_add_string(ctx, "Unknown Product");
|
||||
t->version = smbios_add_prop_si(ctx, "version",
|
||||
SYSINFO_ID_SMBIOS_SYSTEM_VERSION);
|
||||
if (serial_str) {
|
||||
@ -288,7 +292,11 @@ static int smbios_write_type2(ulong *current, int handle,
|
||||
fill_smbios_header(t, SMBIOS_BOARD_INFORMATION, len, handle);
|
||||
smbios_set_eos(ctx, t->eos);
|
||||
t->manufacturer = smbios_add_prop(ctx, "manufacturer");
|
||||
if (!t->manufacturer)
|
||||
t->manufacturer = smbios_add_string(ctx, "Unknown");
|
||||
t->product_name = smbios_add_prop(ctx, "product");
|
||||
if (!t->product_name)
|
||||
t->product_name = smbios_add_string(ctx, "Unknown Product");
|
||||
t->version = smbios_add_prop_si(ctx, "version",
|
||||
SYSINFO_ID_SMBIOS_BASEBOARD_VERSION);
|
||||
t->asset_tag_number = smbios_add_prop(ctx, "asset-tag");
|
||||
@ -313,6 +321,8 @@ static int smbios_write_type3(ulong *current, int handle,
|
||||
fill_smbios_header(t, SMBIOS_SYSTEM_ENCLOSURE, len, handle);
|
||||
smbios_set_eos(ctx, t->eos);
|
||||
t->manufacturer = smbios_add_prop(ctx, "manufacturer");
|
||||
if (!t->manufacturer)
|
||||
t->manufacturer = smbios_add_string(ctx, "Unknown");
|
||||
t->chassis_type = SMBIOS_ENCLOSURE_DESKTOP;
|
||||
t->bootup_state = SMBIOS_STATE_SAFE;
|
||||
t->power_supply_state = SMBIOS_STATE_SAFE;
|
||||
|
Loading…
Reference in New Issue
Block a user