efibootmgr is returning utf-8

Bug #2072336 reported by Damien RANNOU
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Triaged
High
Unassigned

Bug Description

During node deploy or clean, Ironic Python Agent is doing call to efibootmgr in order for example to clean the EFI boot table

When IPA is calling get_boot_records() https://github.com/openstack/ironic-python-agent/blob/master/ironic_python_agent/efi_utils.py#L275 the code is translating to utf-16.
It seems that on some motherboards, like the one we are using (Tyan manufacturer), efibootmgr is returning UTF-8

/opt/ironic-python-agent/bin/python3
Python 3.11.2 (main, May 2 2024, 11:59:08) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ironic_python_agent import utils
>>> efi_output = utils.execute('efibootmgr', '-v', binary=True)
>>> print (efi_output)
(b'BootCurrent: 0004\nTimeout: 1 seconds\nBootOrder: 0004,0005,0006,0007,002D,0001,0009,0002\nBoot0000* AMIFWUpdate\tVenMedia(5023b95c-db26-429b-a648-bd47664c8012)/FvFile(1de64b8e-138b-4258-b7dd-f2d8ec142a9e)\nBoot0001 UEFI: Built-in EFI Shell\tVenMedia(5023b95c-db26-429b-a648-bd47664c8012)..BO\nBoot0002 debian\tVenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)\nBoot0004* UEFI: PXE IP4 Mellanox Network Adapter - A0:42:3F:41:4D:46\tPciRoot(0x3)/Pci(0x3,0x1)/Pci(0x0,0x0)/MAC(a0423f414d46,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO\nBoot0005* UEFI: PXE IP4 Mellanox Network Adapter - A0:42:3F:41:4D:47\tPciRoot(0x3)/Pci(0x3,0x1)/Pci(0x0,0x1)/MAC(a0423f414d47,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO\nBoot0006* UEFI: PXE IP4 Mellanox Network Adapter - 0C:42:A1:3D:3E:E8\tPciRoot(0x7)/Pci(0x3,0x1)/Pci(0x0,0x0)/MAC(0c42a13d3ee8,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO\nBoot0007* UEFI: PXE IP4 Mellanox Network Adapter - 0C:42:A1:3D:3E:E9\tPciRoot(0x7)/Pci(0x3,0x1)/Pci(0x0,0x1)/MAC(0c42a13d3ee9,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO\nBoot0009 AMI Virtual CDROM0 1.00\tBBS(USB,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,ff00)..BO\nBoot002D* UEFI: PXE IP4 American Megatrends Inc.\tPciRoot(0x0)/Pci(0x8,0x1)/Pci(0x0,0x3)/USB(1,0)/USB(1,1)/MAC(4a3d41211dc2,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO\n', b'')
>>> cmd_output = efi_output[0].decode('utf-16', errors='ignore')
>>> print (cmd_output)
潂瑯畃牲湥㩴〠〰楔敭畯㩴ㄠ猠捥湯獤䈊潯佴摲牥›〰㐰〬〰〰㘰〬〰〰䐲〬〰〰㤰〬〰ਲ潂瑯〰〰䵁䙉啗摰瑡॥敖䵮摥慩㔨㈰戳㔹扤㘲㐭㤲㙡㠴戭㑤㘷㐶㡣⤲䘯䙶汩⡥搱㙥戴攸㠳㈴㠵戭搷㉦㡤捥㐱愲改潂瑯〰†䕕䥆›畂汩湩䔠䥆匠敨汬嘉湥敍楤⡡〵㌲㥢挵搭㉢㈴戹愭㐶摢㜴㘶挴〸㈱䈮潂瑯〰㈰†敤楢湡嘉湥睈㤨改㜲攵㔷ち㐭㍢㉡㙥挭㌵㔸㙥っ挰⥢䈊潯ぴ〰⨴唠䙅㩉倠䕘䤠㑐䴠汥慬潮⁸敎睴牯摁灡整ぁ㐺㨲䘳㐺㨱䐴㐺श捐剩潯⡴砰⤳倯楣〨〬ㅸ⼩捐⡩砰砰⤰䴯䍁愨㐰㌲㑦㐱㑤⤱䤯癐⠴〰〮〮〮〬〬䈮潂瑯〰㔰䕕䥆›塐⁅偉‴敍汬湡硯丠瑥潷歲䄠慤瑰牥䄠㨰㈴㌺㩆ㄴ
㐺㩄㜴倉楣潒瑯〨⼩捐⡩砰砰⤱倯楣〨へ〬ㅸ⼩䅍⡃ち㈴昳ㄴ搴㜴ㄬ⼩偉㑶〨〮〮〮⤰佂䈊潯ぴ〰⨶唠䙅㩉倠䕘䤠㑐䴠汥慬潮⁸敎睴牯摁灡整䌰㐺㨲ㅁ㌺㩄䔳䔺स捐剩潯⡴砰⤷倯楣〨〬ㅸ⼩捐⡩砰砰⤰䴯䍁〨㑣愲㌱㍤敥⤱䤯癐⠴〰〮〮〮〬〬䈮潂瑯〰㜰䕕䥆›塐⁅偉‴敍汬湡硯丠瑥潷歲䄠慤瑰牥〠㩃㈴䄺㨱䐳㌺㩅㥅倉楣潒瑯〨㝸⼩捐⡩砰砰⤱倯楣〨へ〬ㅸ⼩䅍⡃挰㈴ㅡ搳攳㥥ㄬ⼩偉㑶〨〮〮〮⤰佂䈊潯ぴ〰‹䄠䥍嘠物畴污䌠剄䵏‰〰䈉卂唨䉓砰⤰嘯湥睈㔨散ㄸ㠲挲捥㐭昰㌸㈷㠭㘰〴㍥捤㔸晦〰䈮潂瑯〰䐲䕕䥆›塐⁅偉‴流牥捩湡䴠来瑡敲摮湉倉楣潒瑯〨へ
⼩捐⡩砰砰⤱倯楣〨へ〬⼩单⡂⤰唯䉓ㄨㄬ⼩䅍⡃愴搳ㄴㄲ搱㉣〬⼩偉㑶〨〮〮〮⤰佂
>>>
>>> cmd_output = efi_output[0].decode('utf-8', errors='ignore')
>>> print (cmd_output)
BootCurrent: 0004
Timeout: 1 seconds
BootOrder: 0004,0005,0006,0007,002D,0001,0009,0002
Boot0000* AMIFWUpdate VenMedia(5023b95c-db26-429b-a648-bd47664c8012)/FvFile(1de64b8e-138b-4258-b7dd-f2d8ec142a9e)
Boot0001 UEFI: Built-in EFI Shell VenMedia(5023b95c-db26-429b-a648-bd47664c8012)..BO
Boot0002 debian VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0004* UEFI: PXE IP4 Mellanox Network Adapter - A0:42:3F:41:4D:46 PciRoot(0x3)/Pci(0x3,0x1)/Pci(0x0,0x0)/MAC(a0423f414d46,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0005* UEFI: PXE IP4 Mellanox Network Adapter - A0:42:3F:41:4D:47 PciRoot(0x3)/Pci(0x3,0x1)/Pci(0x0,0x1)/MAC(a0423f414d47,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0006* UEFI: PXE IP4 Mellanox Network Adapter - 0C:42:A1:3D:3E:E8 PciRoot(0x7)/Pci(0x3,0x1)/Pci(0x0,0x0)/MAC(0c42a13d3ee8,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0007* UEFI: PXE IP4 Mellanox Network Adapter - 0C:42:A1:3D:3E:E9 PciRoot(0x7)/Pci(0x3,0x1)/Pci(0x0,0x1)/MAC(0c42a13d3ee9,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0009 AMI Virtual CDROM0 1.00 BBS(USB,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,ff00)..BO
Boot002D* UEFI: PXE IP4 American Megatrends Inc. PciRoot(0x0)/Pci(0x8,0x1)/Pci(0x0,0x3)/USB(1,0)/USB(1,1)/MAC(4a3d41211dc2,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO

The impact of that bug is that IPA is not cleaning the partition table, and deploy after deploy, filling the EFI table.

Afonne-CID (cidelight)
Changed in ironic:
importance: Undecided → High
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.