Using DD to copy uboot

That was it. I knew I had found a unix utility to search for text.

So just add to my pipeline?
dd if=/dev/da0 bs=512 count=32770 | hd | strings -a
 
I was thinking that I need to add a way to search for text inside binary disk too.
Tools mentioned here can do that for sure. On Linux I use either strings or grep. I'm not sure if grep can be used on FreeBSD nowadays, I think the perl regex was a problem there if my memory serves me well.

Depending on what you do you could use editors/bvi. You can skip and set size too, that is really neat feature. Just beware of the sector size if you do use that on an actual disk.
With xxd you can do this (searching for "EFI"): xxd -os -g0 /dev/ada0| grep 454649 | head -1
 
Thanks _martin the tip on hexdump has been very useful.

I have a bunch of microSD cards and I lose track of them. So its nice to peek at uboot.

I refined my process some:
Code:
# dd if=/dev/da0 | hexdump -C | grep RK
00008000  52 4b 4e 53 00 00 00 00  80 01 02 00 01 00 00 00  |RKNS............|
0000bbb0  a1 73 01 91 40 00 80 52  4b 1e 00 94 e7 03 00 aa  |.s..@..RK.......|
0000df50  6b 00 80 52 4b 20 8b 1a  ef 01 09 0b ef 05 00 11  |k..RK ..........|
00015ab0  df 20 df 20 ef 10 ef 10  52 4b 35 68 00 00 00 2d  |. . ....RK5h...-|
00015ac0  52 4b 35 68 00 00 00 2a  52 4b 35 68 00 00 00 21  |RK5h...*RK5h...!|
00015ad0  52 4b 35 68 00 00 00 33  52 4b 35 68 00 00 00 42  |RK5h...3RK5h...B|
00019170  4b 81 00 b9 5f 01 0d b9  2b 00 80 52 4b 01 01 b9  |K..._...+..RK...|
00042920  2d 70 69 6e 63 74 72 6c  00 52 4b 33 33 39 39 2d  |-pinctrl.RK3399-|
00042950  6f 34 00 52 4b 33 33 36  38 2d 47 50 49 4f 00 52  |o4.RK3368-GPIO.R|
00042960  4b 33 33 32 38 2d 47 50  49 4f 00 52 4b 33 33 30  |K3328-GPIO.RK330|
00042970  38 2d 47 50 49 4f 00 52  4b 33 32 38 38 2d 47 50  |8-GPIO.RK3288-GP|
00042990  70 69 6f 37 00 67 70 69  6f 38 00 52 4b 33 32 32  |pio7.gpio8.RK322|
000429a0  38 2d 47 50 49 4f 00 52  4b 33 31 38 38 2d 47 50  |8-GPIO.RK3188-GP|
000429b0  49 4f 00 52 4b 33 31 32  38 2d 47 50 49 4f 00 52  |IO.RK3128-GPIO.R|
000429c0  4b 33 30 36 36 62 2d 47  50 49 4f 00 52 4b 33 30  |K3066b-GPIO.RK30|
000429d0  36 36 61 2d 47 50 49 4f  00 52 4b 33 30 33 36 2d  |66a-GPIO.RK3036-|
000429e0  47 50 49 4f 00 52 4b 32  39 32 38 2d 47 50 49 4f  |GPIO.RK2928-GPIO|
000429f0  00 52 4b 31 38 30 38 2d  47 50 49 4f 00 52 56 31  |.RK1808-GPIO.RV1|
^C5347+0 records in
 
I don't have a fantastic answer but I do note the arm64 (and armv7) install instructions of OpenBSD is quite useful to know where uboot (and other bits) are read from:

For systems based on Allwinner Axx SoCs:

dd if=/usr/local/share/u-boot/board/u-boot-sunxi-with-spl.bin \
of=/dev/sdXc bs=1024 seek=8

For systems based on Rockchip RK33xx SoCs:

dd if=/usr/local/share/u-boot/board/idbloader.img \
of=/dev/sdXc seek=64
dd if=/usr/local/share/u-boot/board/u-boot.itb \
of=/dev/sdXc seek=16384

For systems based on Rockchip RK356x SoCs:

dd if=/usr/local/share/u-boot/board/u-boot-rockchip.bin \
of=/dev/sdXc seek=64

Its the sort of information that I find far more useful than just pre-made images (which actually annoy me). "Give a man a fish and you feed him for a day [...]" and all that.
 
Back
Top