Creating a current armbian-Image with network-fix
#1
I recently got my sopine modules and my clusterboard only to notice that the network is not working. So I searched the forums and found a way to conveniently build an Armbian-Image which has the network fix applied (using Ubuntu):

I tested this with the current Armbian Focal release.

Thanks to @AZClusterboard  who made an initial guide on how to setup the clusterboard which gave me confidence to buy my own cluster!

Step [b]Overview:[/b]

  1. Download current Armbian Focal release
  2. Mount the Image to make modifications
  3. Make changes to the .dtb file (allwinner network fix)
  4. Write the changed Image to as many sopines as you wish
  5. (Give each sopine a unique hostname by hand)

Step number 5 is not necessary but it helps in identifying sopine modules by name. So you can boot all modules at once, look at a "nmap" printout and can see each hostname and the corresponding ip-adress.

More thorough explanation of the steps:

1. Download current Armbian Focal release (https://www.armbian.com/sopine-a64/)

2. Mount the Image to make modifications (more informations here)

2.1. create a dir to mount the image to: e.g.

Code:
sudo mkdir /mnt/img

2.2. find the location of the partition within the image


Code:
fdisk -l <armbian-image.img>
This command gives you an overview about the image: Important are 2 things: sector-size (512 byte in my case) and beginning of the partition (sector 8192 in my case). The product is

Code:
512 bytes/sector * 8292 sectors =4194304 bytes
We need this number to correctly mound the image in the next step.

2.3. mound the image at the correct sector to the created directory in /mnt/img

Code:
sudo mount -o loop,rw,sync,offset=4194304 <armbian-image.img> /mnt/img
The image is now mounted with read and write permissions. Every change we do to the image will remain


3. Make changes to the .dtb file

3.1. navigate to the correct .dtb file

Code:
cd /mnt/img/boot/dtb/allwinner/

3.2. Now we need to translate the .dtb file. To do so we change it into a modifiable state using dtc. The file we want to change is sun50i-a64-sopine-baseboard.dtb (see here). I will name this modifiable file "temp.dts". This command will most likely throw some warnings but it will work.

Code:
sudo dtc -I dtb -O dts -o temp.dts sun50i-a64-sopine-baseboard.dtb

3.3. apply the fix to temp.dts described here

Code:
sudo nano temp.dts

go to the segment

Code:
ethernet@1c30000

and add

Code:
allwinner,tx-delay-ps = <500>;

as described here [LINK]

It will then look similar to 

Code:
                ethernet@1c30000 {
                        compatible = "allwinner,sun50i-a64-emac";
                        syscon = <0x2d>;
                        reg = <0x1c30000 0x10000>;
                        interrupts = <0x0 0x52 0x4>;
                        interrupt-names = "macirq";
                        resets = <0x2 0xd>;
                        reset-names = "stmmaceth";
                        clocks = <0x2 0x24>;
                        clock-names = "stmmaceth";
                        status = "okay";
                        pinctrl-names = "default";
                        pinctrl-0 = <0x2e>;
                        phy-mode = "rgmii";
                        phy-handle = <0x2f>;
                        phy-supply = <0x30>;
                        phandle = <0x6f>;
                        allwinner,tx-delay-ps = <500>;

                        mdio {
                                compatible = "snps,dwmac-mdio";
                                #address-cells = <0x1>;
                                #size-cells = <0x0>;
                                phandle = <0x70>;

                                ethernet-phy@1 {
                                        compatible = "ethernet-phy-ieee802.3-c22";
                                        reg = <0x1>;
                                        phandle = <0x2f>;
                                };
                        };
                };


3.3. translate the modified .dts to and .dtb file and overwrite the old(faulty) .dtb-file. This command will produce some warnings, but it will work.

Code:
sudo dtc -O dtb -o sun50i-a64-sopine-baseboard.dtb -b 0 temp.dts

3.4. remove the temp.dts

Code:
sudo rm temp.dts

3.5. unmount the image, go to your home directory first, so the unmount process is successful

Code:
cd ~/
sudo umount /mnt/img

4. The image is now ready to be  written to a sd-card!

5. To change the hostname of each "sd-card"
After the sd-card is written, mount the sd-card and navigate

Code:
cd etc/

and change 2 files:

[1]In hostname, specify a hostname (old one is most likely "pine64so") you like (probaly something like "master" or "worker1" or "worker2" ...),
[2] in hosts, change every entry with the old hostname to your new hostname.

Save the changes made to both files, unmount you sd-card, put it in the sopine-module, wait for it to boot (may take some minutes), login with "root" and "1234" and enjoy your cluster!

If you have any questions, comments or suggestions for improvement let me know!
  Reply
#2
Thanks a lot for creating this guide!

Edit: Anyone got a easy guide to network boot the 6 other modules from the first one and eMMC?
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Clusterboard Armbian aww 17 4,123 07-01-2020, 02:40 PM
Last Post: wayward83
  Network problems (actually bad power supply) Unkn0wn 14 1,614 12-01-2019, 10:02 AM
Last Post: venix1
  Armbian Bionic 4.19.y PigLover 1 322 02-02-2019, 02:30 PM
Last Post: mdmbc

Forum Jump:


Users browsing this thread: 1 Guest(s)