Skip to content

Commit

Permalink
bfcfg: Support dumping of long dhcp_class_id (Mellanox#143)
Browse files Browse the repository at this point in the history
The current 'bfcfg -d' command truncates the dhcp_class_id when it
is longer than 12 characters. This commit fixes it by using xxd
since the maximum length of dhcp_class_id has been increased from
9 to 32 in UEFI.

Co-authored-by: Liming Sun <[email protected]>
  • Loading branch information
lsun100 and lsun100 authored Oct 4, 2022
1 parent 8dbf2b5 commit b21415e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bfcfg
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,7 @@ misc_cfg()
# PXE DHCP Class Identifier.
value=""
if [ -f "${pxe_dhcp_class_id_sysfs}" ]; then
value=$(hexdump -C ${pxe_dhcp_class_id_sysfs} 2>/dev/null | head -1 | awk '{print $NF}')
value=$(echo ${value:5:-1})
value=$(hexdump -C ${pxe_dhcp_class_id_sysfs} 2>/dev/null | xxd -r -p)
fi
echo "misc: PXE_DHCP_CLASS_ID=${value}"
else
Expand Down

0 comments on commit b21415e

Please sign in to comment.