Re: [PATCH V3] Support 'r' format for printing raw bytes with fdtget

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On 09.12.2021 06:52, David Gibson wrote:
diff --git a/tests/ b/tests/
index d100d5a..11068e1 100755
--- a/tests/
+++ b/tests/
@@ -855,6 +855,8 @@ fdtget_tests () {
      run_fdtget_test 8000 -tx $dtb /cpus/PowerPC,970@1 d-cache-size
      run_fdtget_test "61 62 63 0" -tbx $dtb /randomnode tricky1
      run_fdtget_test "a b c d de ea ad be ef" -tbx $dtb /randomnode blob
+    run_fdtget_test "MyBoardName\0MyBoardFamilyName\0" -tr $dtb / compatible
+    run_fdtget_test "\x0a\x0b\x0c\x0d\xde\xea\xad\xbe\xef" -tr $dtb /randomnode blob

I think using \ escapes in strings will be shell dependent behaviour.
Have you tested this in shells other than bash?

It isn't back dependent but printf dependent. See :
printf '%b\n' "$expect" > $EXPECT

It seems even busybox's printf supports %b:
# printf "%b" "\x0a\x0b\x0c\x0d\xde\xea\xad\xbe\xef" | hexdump -C
00000000  0a 0b 0c 0d de ea ad be  ef                       |.........|

[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux