June 17, 2024

Antminer S9 U-boot install - set up a SD card

I have a 32G microSD card -- a "refurb" SanDisk Ultra.
I dig up an SD card reader and plug it in. It shows up on my system as /dev/sde The "lsblk" utility shows it nicely. It has some kind of small partition on it, but we will eradicate that, as per these instructions: We do this:
dd if=/dev/zero of=/dev/sde bs=1024 count=1
fdisk -l /dev/sde
Disk /dev/sde: 29.72 GiB, 31914983424 bytes, 62333952 sectors
Disk model: Multi-Card      
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
They suggest calculating the number of cyliners as size / 8225280.
In our case 31914983424 / 8225280 = 3880.1
I carefully follow their instructions, and end up with:
Device     Boot  Start      End  Sectors  Size Id Type
/dev/sde1  *      2048   411647   409600  200M  c W95 FAT32 (LBA)
/dev/sde2       411648 62333951 61922304 29.5G 83 Linux
I need to watch that my system does not automount the drive. I need to unplug and replug the device for all the partitions to show up in /dev -- then I do this:
mkfs.vfat -F 32 -n boot /dev/sde1
mkfs.ext4 -L root /dev/sde
I go ahead and format the linux partition, but I am well aware that for the present anyway, I won't be using it.

Copy boot.bin

This will be more interesting (perhaps) after I run bootgen to create a boot.bin that contains U-boot. But after my U-boot build, I look in the spl directory and find a "boot.bin" file in there. It is too much to resist:
mount /dev/sde1 /mnt
cp boot.bin /mnt
umount /mnt

It doesn't work -- which is no great surprise. It was not generated by bootgen, but is some curious product of the U-boot build mechanism.


Feedback? Questions? Drop me a line!

Tom's Computer Info / [email protected]