WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit fccce17

Browse files
committed
RedfishClientPkg/BootOption: enhance boot option check function
Check boot option description in check() function. When the description is changed, the boot option is considered as different boot option. Feature driver will delete it and upload new boot option in provision() function. Signed-off-by: Nickle Wang <[email protected]>
1 parent d3abd1e commit fccce17

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Redfish feature driver implementation - common functions
33
44
(C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP<BR>
5-
Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
5+
Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
66
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
77
88
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -554,7 +554,7 @@ RedfishCheckResourceCommon (
554554
REDFISH_RESPONSE Response;
555555
BOOLEAN DeleteResourceRequired;
556556
EFI_STRING DevicePathString;
557-
CHAR8 *DevicePathAsciiString;
557+
CHAR8 *TmpAsciiString;
558558
CHAR8 *PatchedJson;
559559

560560
if ((Private == NULL) || IS_EMPTY_STRING (Json)) {
@@ -563,7 +563,7 @@ RedfishCheckResourceCommon (
563563

564564
ZeroMem (&Response, sizeof (REDFISH_RESPONSE));
565565
DevicePathString = NULL;
566-
DevicePathAsciiString = NULL;
566+
TmpAsciiString = NULL;
567567
DeleteResourceRequired = FALSE;
568568
BootOptionName = NULL;
569569
BootOption = NULL;
@@ -610,16 +610,16 @@ RedfishCheckResourceCommon (
610610
if (BootOptionCs->UefiDevicePath != NULL) {
611611
DevicePathString = ConvertDevicePathToText (LoadOption.FilePath, TRUE, FALSE);
612612
if (DevicePathString != NULL) {
613-
DevicePathAsciiString = StrUnicodeToAscii (DevicePathString);
614-
if (DevicePathAsciiString != NULL) {
615-
if (AsciiStrCmp (DevicePathAsciiString, BootOptionCs->UefiDevicePath) != 0) {
613+
TmpAsciiString = StrUnicodeToAscii (DevicePathString);
614+
if (TmpAsciiString != NULL) {
615+
if (AsciiStrCmp (TmpAsciiString, BootOptionCs->UefiDevicePath) != 0) {
616616
//
617617
// The device path of this boot option is not the one in system.
618618
//
619619
DeleteResourceRequired = TRUE;
620620
}
621621

622-
FreePool (DevicePathAsciiString);
622+
FreePool (TmpAsciiString);
623623
}
624624

625625
FreePool (DevicePathString);
@@ -628,6 +628,23 @@ RedfishCheckResourceCommon (
628628
}
629629
}
630630

631+
//
632+
// Check the Description
633+
//
634+
if ((BootOptionCs->Description != NULL) && (LoadOption.Description != NULL)) {
635+
TmpAsciiString = StrUnicodeToAscii (LoadOption.Description);
636+
if (TmpAsciiString != NULL) {
637+
if (AsciiStrCmp (TmpAsciiString, BootOptionCs->Description) != 0) {
638+
//
639+
// The description of this boot option is not the one in system.
640+
//
641+
DeleteResourceRequired = TRUE;
642+
}
643+
644+
FreePool (TmpAsciiString);
645+
}
646+
}
647+
631648
EfiBootManagerFreeLoadOption (&LoadOption);
632649
} else {
633650
DeleteResourceRequired = TRUE;

0 commit comments

Comments
 (0)