[BPI-R2 new image] debian 10 buster image with Kernel 4.19.62

Hi,

i’ve created a debian 10 (buster) image with

  • Kernel: 4.19.62
  • uboot 2019-07 with erase-env + sata-support
  • new preloader (2019-07-22)
  • configured to ip 192.168.0.11 on lan0
  • openssh-server running with root-login (should be disabled afterwards)

username/password: root/bananapi

https://drive.google.com/open?id=1oP7jy1KrrIOifvImo2nQ59wx3_9hHkgk

how i have created: https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:storage#short_install-guide

How to install to emmc: [BPI-R2 new image] debian 10 buster image with Kernel 4.19.62

Preloader for emmc: https://github.com/BPI-SINOVOIP/BPI-files/blob/master/SD/100MB/BPI-R2-EMMC-boot0-DDR1600-20191024-0k.img.gz

regards Frank

3 Likes

Hi Frank,

What are the BPI-R2 features supported on this image ?

Also can you please update the table with the kernel feature list from your github page with the 5.x releases ?

image

Thanks,

support is based on kernel…so see the table you mention for 4.19 :wink:

the debian itself is only a base-system (no x-server, no dhcp/dns-server & no hostapd atm)

5.x has no LTS at the moment so it’s not listed in the table…most time i don’t find the time to merge all features in the main-branch because the merge-window of next kernel-version starts/rc1 is out before and i need to port the drivers to this new version which takes some time…also in 5.x i have spend much time for testing/debugging phylink-patches on bpi-r2 and bpi-r64

mostly i have ported all drivers (hdmi,wifi,poweroff) in the first week after rc1 is out…you can test them separately or merging these together to have a all-feature kernel

mhm, i’ve seen i forgot to set filesystem-label so it may cause problems installing newer kernel using my build.sh, have fixed this…

change sdc to your device

sudo fatlabel /dev/sdc1 BPI-BOOT
sudo e2label /dev/sdc2 BPI-ROOT

How to stop get random mac on every boot? Because my provider want me to have static MAC to enter network and then I need to get DHCP IP address. I have these lines in /etc/network/interfaces

auto wan allow-hotplug wan iface wan inet dhcp hwaddress ether 6c:3b:6b:48:b7:8c

but problem is that it try to obtain IP from DHCP before these lines applied and of course no internet connection until I manually ssh to box and run - dhclient wan. After it - all goes well.

You can set mac in dts (need to recompile kernel or using separated dtb)

Afaik there is no BIA (or at least we don’t know how to access it) so it have to be set manually

I’m new to this. Is there step by step guide how to do this from scratch?

Just google and correct me if I wrong:

first i use this command to convert dtb from binary to text

dtc -I dtb -O dts bpi-r2.dtb > bpi-r2.dts

then I need to edit this file bpi-r2.dts and add needed mac to section

        mac@1 {
                compatible = "mediatek,eth-mac";
                reg = < 0x01 >;
                phy-mode = "trgmii";
                phandle = < 0x50 >;

                fixed-link {
                        speed = < 0x3e8 >;
                        full-duplex;
                        pause;
                };
        };

so it looks like

            mac@1 {
                    compatible = "mediatek,eth-mac";
                    reg = < 0x01 >;
                    phy-mode = "trgmii";
                    mac-address = [ 02 02 02 02 02 02 ];
                    phandle = < 0x50 >;

                    fixed-link {
                            speed = < 0x3e8 >;
                            full-duplex;
                            pause;
                    };
            };

and then compile it with command

dtc -O dtb -o bpi-r2-new.dtb bpi-r2.dts

then I just backup old bpi-r2.dtb and put newly compiled file to /boot/bananapi/bpi-r2/linux/dtb/ with the name bpi-r2.dtb

Just clone my repo change the dts and compile full kernel…else you need to setup uboot to use kernel without dtb and separate dtb…

Just clone my repo change the dts and compile full kernel

need step-by-step instructions for it

also can’t I just decompile dts file, make changes and compilte it with replacing file?

My image using (like the other images) dtb inside kernel-binary so just build full kernel…

git clone https://github.com/frank-w/BPI-R2-4.14
cd BPI-R2-4.14
git checkout 4.19-main
./build.sh dts
./build.sh importconfig
./build.sh

When installing to Sdcard use name uImage (just remove version info).else you need to change uenv.txt

What file do I need to edit to add mac to wan interface?

p.s. I see file bpi-r2-mac.dts in root of kernel source but can’t understand how to specify wan or eth1 iface.

p.s.s this one:

arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts

?

p.s.s.s oooohhh just runned command ./build.sh dts and opened text editor :wink: compiling it now, let’s see what’s happen.

this file is an example for devicetree-overlay, but you have to configure uboot to use separate dts and this overlay which is not trivial, so as a start just change the dts itself which is the easiest way

this is how it looks in 4.14:

gmac0: mac@0 {
    compatible = "mediatek,eth-mac";
    reg = <0>;
    phy-mode = "trgmii";
    mac-address = [02 02 02 02 02 02];

    fixed-link {
        speed = <1000>;
        full-duplex;
        pause;
    };
};

gmac1: mac@1 {
    compatible = "mediatek,eth-mac";
    reg = <1>;
    phy-mode = "trgmii";
    mac-address = [02 03 03 03 03 03];

    fixed-link {
        speed = <1000>;
        full-duplex;
        pause;
    };
};

gmac0=lan,gmac1=wan

in 4.19 i had only defined lan, just copy the property to gmac1 and change mac-address

then compile and install your kernel to sdcard

also need to add ethernet1 to alias section?

no, only add the

mac-address

property to the gmac you want with the mac-address in the format above…alias is also only needed for dto

edit: have added it now also in 4.19 so you can also use package created by travis if build is complete

@sHAsHiLx have you got it working?

Yes, compiled on x86 linux and booted success. Also found that your kernel lacks some module to get pptp vpn to work - ppp_async so edited .config file and recompiled it again. May be you can put this in your debian buster distro by default? Also interesting for which purposes - eth0/eth1? First I was think I can give eth0 local IP and all lanX interfaces will reply to this IP… but no… was make br0 and put all lanX interfaces to it…

just say me the config-options needed…i don’t wanted an all-yes-config so i activated only the options needed by me and the people reported options to me. but this is kernel-related, not image-related.

eth0/eth1 are the (internal) cpu-ports between SOC and Switch, lanX/wan are the (physical/external) dsa-ports of the switch where you put your rj45-jack in. CPU-POrts have to only be set “up” without any other config. IP-configuration has to be done on dsa-ports (lanx). if all lan-ports need to be in same lan-segment, they have to be bridged and get 1 IP-address. if you use different lan-segments (like me) you can give any lan-port another IP-adress

Yes, need all lan ports to be in one network like other router this do out-of-box. I don’t ask about all-yes but CONFIG_SOME_MODULE=m - will be great and slim and don’t need to waste hour time to google - what the heck is logs says and found that it need module that not present…

p.s. also found if I choose deb package on kernel compile - it give kernel wrong names. If I choose pack - all names correct.

for bridge, i have wrote an example here: https://www.fw-web.de/dokuwiki/doku.php?id=en/bpi-r2/network/start#netbridge

everybody needs another “some_module” :wink: and figuring out which module can be needed by somebody and its depencies will waste my time :wink: it is a basic kernel where everyone can add stuff he needs :wink: and maybe tell me what’s needed additional to it. but i don’t want to add modules/builtin-function nobody needs

for naming-issue you mean the file of deb/tar.gz? or inside the file?

deb is designed to install multiple kernels so the uImage has the version-number appended and change uEnv.txt on install

for naming-issue you mean the file of deb/tar.gz? or inside the file?

inside. because deb is simplier way to install and tar.gz file need to be unpacked manually to corresponding folders. don’t know for which reason this is because system have mounted boot and root folders - why not make same structure in tar.gz file… or may be some script with these BPI2-BOOT BPI2-ROOT folders that rename files/folders to some old…