freebsd / crochet

Build FreeBSD images for RaspberryPi, BeagleBone, PandaBoard, and others.
BSD 2-Clause "Simplified" License
611 stars 187 forks source link

dd: /dev/md4: Invalid argument on u-boot installation for banana-pi #191

Closed MoritzFago closed 7 years ago

MoritzFago commented 7 years ago

During the image creation process the setup.sh burns the various boot loader files to the image.

Installing U-Boot files
+ dd if=/usr/local/share/u-boot/u-boot-bananapi/sunxi-spl.bin of=/dev/md4 bs=1024 seek=8
dd: /dev/md4: Invalid argument
486+1 records in
486+0 records out
497664 bytes transferred in 5.784579 secs (86033 bytes/sec)

I am building in a jail with the following flags allow.mount=true,enforce_statfs=1

fjerhammer commented 7 years ago

This is also happening for me. 11.0-STABLE, not using jails.

arrowd commented 7 years ago

And me too.

alexey1234 commented 7 years ago

And me too

swilde commented 7 years ago

Here too.

arrowd commented 7 years ago

So, is crochet completely unusable right now? The offending line is https://github.com/freebsd/crochet/blob/master/lib/disk.sh#L47 but I don't know what to do with it.

arrowd commented 7 years ago

Ah, no, that line has nothing to do with the problem.

loos-br commented 7 years ago

IIRC conv=notrunc,sync should fix this issue

kientzle commented 7 years ago

To debug this, you can (temporarily) edit board/BananaPi/setup.sh to print out more information at the top of the allwinner_partition_image() function. In particular, it would probably make sense to try ls -l /dev/${DISK_MD} to make sure the md device was created, and maybe mdconfig -l to list all the existing md devices.

kientzle commented 7 years ago

@loos-br might be right. If /usr/local/share/u-boot/u-boot-bananapi/sunxi-spl.bin is not a multiple of the block size, then adding conv=sync to the dd command originally mentioned may fix it.

kientzle commented 7 years ago

I believe #199 fixes this; please try and let us know.