Skip to content

Commit 76ccdd9

Browse files
committed
lib/bios: make Boot System Or From Connected Disk more generic
Signed-off-by: Filip Lewiński <[email protected]>
1 parent b193b25 commit 76ccdd9

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

lib/bios/common.robot

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,14 @@ Boot System Or From Connected Disk # robocop: disable=too-long-keyword
156156
ELSE
157157
${disk_name}= Set Variable ${ssd_list[0]}
158158
END
159-
${system_index}= Get Index From List ${menu_construction} ${disk_name}
159+
# Search the menu for disk name occurrence
160+
${system_index}= Set Variable -1
161+
${system_index}= Evaluate
162+
... next((i for i, entry in enumerate(${menu_construction}) if "${disk_name}" in entry), -1)
160163
IF ${system_index} == -1
161164
Fail Disk: ${disk_name} not found in Boot Menu
162165
END
163166
ELSE
164167
${system_index}= Get Index Of Matching Option In Menu ${menu_construction} ${system_name}
165168
END
166-
Press Key N Times And Enter ${system_index} ${ARROW_DOWN}
169+
Select Boot Menu Option ${system_index} ${ARROW_DOWN}

lib/bios/edk2.robot

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,3 +496,8 @@ Get Firmware Version From Tianocore Setup Menu
496496
${firmware_line}= Get Lines Containing String ${output} Dasharo (coreboot+UEFI)
497497
${firmware_version}= Get Regexp Matches ${firmware_line} v\\d{1,}\.\\d{1,}\.\\d{1,}
498498
RETURN ${firmware_version}
499+
500+
Select Boot Menu Option
501+
[Documentation] Select the boot menu option using the given index.
502+
[Arguments] ${index} ${key}
503+
Press Key N Times ${index} ${key}

lib/bios/seabios.robot

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,15 @@ Enter IPXE
111111
Enter Boot Menu
112112
${menu}= Get Boot Menu Construction
113113
Enter Menu From Snapshot ${menu} iPXE
114+
115+
# robocop: disable=unused-argument
116+
117+
Select Boot Menu Option
118+
[Documentation] Select the boot menu option using the given index.
119+
... Accounts for indices counting from zero, and SeaBIOS options counting
120+
... from '1.'. Has to take a dummy parameter for compatibility with the
121+
... EDK2 version of this keyword.
122+
[Arguments] ${index} ${dummy}
123+
${option}= Evaluate ${index} + 1
124+
Write Bare Into Terminal '${option}'
125+
# robocop: disable=unused-argument

platform-configs/optiplex-7010-seabios.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Resource optiplex-7010.robot
55
*** Variables ***
66
${BIOS_LIB}= seabios
77
${FW_STRING}= ESC
8-
${SEABIOS_BOOT_DEVICE}= 2
8+
# ${SEABIOS_BOOT_DEVICE}= 2
99
${BOOT_MENU_KEY}= ${ESC}
1010
${DMIDECODE_FIRMWARE_VERSION}= Dasharo (coreboot+SeaBIOS) v0.1.0
1111
${DMIDECODE_RELEASE_DATE}= 11/27/2024

0 commit comments

Comments
 (0)