powerpc-utils/powerpc-utils-1.3.8-using-od.patch

40 lines
1.7 KiB
Diff
Raw Normal View History

2021-05-03 11:42:43 +00:00
diff -up powerpc-utils-1.3.8/scripts/hcnmgr.me powerpc-utils-1.3.8/scripts/hcnmgr
--- powerpc-utils-1.3.8/scripts/hcnmgr.me 2021-04-29 11:52:12.557488115 +0200
+++ powerpc-utils-1.3.8/scripts/hcnmgr 2021-04-29 16:31:07.936124101 +0200
@@ -167,7 +167,7 @@ search_dev() {
# Look at pci ethernet devices
for pci_dev in "$DT_PATH"/pci*; do
[ -d "$pci_dev" ] || continue
- index=$(xxd -l 4 -p "$pci_dev"/ibm,my-drc-index)
+ index=$(od -tx -An --endian=big -N 4 "$pci_dev"/ibm,my-drc-index | tr -d ' ')
if [[ $index != "$1" ]]; then
continue
fi
@@ -188,7 +188,7 @@ search_dev() {
hcnlog DEBUG "search vnic device with drc_index $1"
for dev in "$DT_PATH"/vdevice/vnic*; do
[ -d "$dev" ] || continue
- index=$(xxd -l 4 -p "$dev"/ibm,my-drc-index)
+ index=$(od -tx -An --endian=big -N 4 "$dev"/ibm,my-drc-index | tr -d ' ')
if [[ $index == "$1" ]]; then
hcnlog DEBUG "found matching drc_index $index in $dev"
if [ -e "$dev"/ibm,hcn-id ] && get_dev_hcn "$dev"; then
@@ -204,7 +204,7 @@ search_dev() {
hcnlog DEBUG "search ibmveth device with drc_index $1"
for dev in "$DT_PATH"/vdevice/l-lan*; do
[ -d "$dev" ] || continue
- index=$(xxd -l 4 -p "$dev"/ibm,my-drc-index)
+ index=$(od -tx -An --endian=big -N 4 "$dev"/ibm,my-drc-index | tr -d ' ')
if [[ $index == "$1" ]]; then
hcnlog DEBUG "found matching drc_index $index in $dev"
if [ -e "$dev"/ibm,hcn-id ] && get_dev_hcn "$dev"; then
@@ -232,7 +232,7 @@ get_dev_hcn() {
local dev=$1
hcnlog DEBUG "get_dev_hcn: enter $1"
- HCNID=$(xxd -l 4 -p "$dev"/ibm,hcn-id)
+ HCNID=$(od -tx -An --endian=big -N 4 "$dev"/ibm,hcn-id | tr -d ' ')
MODE=$(tr -d '\0' <"$dev"/ibm,hcn-mode)
PHYSLOC=$(tr -d '\0' <"$dev"/ibm,loc-code)