[BPI-R2] Debian-image for bpi-r2

Hello everybody,

I’ve tested Jessie and Stretch. Both are booting and working. The Jessie image isn’t shipped with kernel modules (for example iptables). Also HDMI output doesn’t work (on both images).

Best regards, Daniel

2 Likes

Thank you, do you know,how to compile/modify kernel?

Here is a start (with config): https://github.com/BPI-SINOVOIP/BPI-R2-bsp

Any errors in log/serial console regatding hdmi?

Hello Frank,

sorry, my fault: HDMI is working. Only my 4k display can’t find the R2 as a valid source (even not in PIP with a smaller picture size).

Does anybody know how to change ethernet names? WAN port is eth1 and LAN ports are eth0.

If created an static MAC address mapping, based on this article: Static MAC-Address for Bananapi

cat /etc/udev/rules.d/69-static-mac.rules

# MAC address for eth0 / WAN

ACTION=="add", SUBSYSTEM=="net", ATTR{dev_id}=="0x0", ATTR{ifindex}=="6" RUN+="/sbin/ip link set dev %k address 26:bf:b5:59:15:d0"

# MAC address for eth1 / LAN

ACTION=="add", SUBSYSTEM=="net", ATTR{dev_id}=="0x0", ATTR{ifindex}=="5" RUN+="/sbin/ip link set dev %k address 26:bf:b5:59:15:d1"

The only way to identify the interfaces is, in my opinion, the value of ifindex:

ls -d /sys/class/net/eth? | while read _DEV ; do echo ${_DEV} ; udevadm info -a ${_DEV} | grep ifindex ; done

/sys/class/net/eth0

ATTR{ifindex}=="5"

/sys/class/net/eth1

ATTR{ifindex}=="6"

And switching the interface names…

cat /etc/udev/rules.d/70-persistent-net.rules

# static interface name for WAN

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="26:bf:b5:59:15:d0", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# static interface name for LAN

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="26:bf:b5:59:15:d1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

udev sets successfully the static MAC addresses but can’t switch names. Maybe the name eth1 is present when udev tries to change eth0 to eth1. So I decide to switch eth1 to wan0 and eth0 to lan0. After a restart the MACs are correct but not the names.

When I run udevadm test /sys/class/net/eth0 udev switched the device name from eth0 to lan0. Running udevadm test /sys/class/net/eth1 fails (see udev_eth1.txt (5,5 KB))

Any ideas?

@frank-w - Where do I find the jessie-lite image please ?

@AaronNGray: BPI-R2 all image download from google driver

@temp0r: device busy when udev tries to rename…only idea: you can add symlink with udev instead of renaming (adding symlink+ directive in persistent-net.rules in both lines) Normally only persistent-net.rules must be changed…

Okay I have :-

2017-05-04-debian-8-jessie-mate-desktop-preview-bpi-r2-sd-emmc.img

and

2017-09-13-debian-9-stretch-mate-desktop-preview-bpi-r2-sd-emmc.img 

working !

@frank-w @sinovoip where do I get source / scripts and a quick howto to build the Debian 9 stretch distro please ?

debian-9-stretch-mate is having problems with moving windows theres shadowing and delay so it looks like the GPU support is not working correctly.

Imho there is no such howto. You can try to bootstrap (debbootstrap) a debian 9 filesystem and replace the root-partition in jessie image with that. Then replace kernel+modules+uboot with selfcompiled from github. i think its easier to do that on a sdcard instead of image itself and dd an image from that if it is booting without errors

edit: i’ve found that site, there are some explainations: http://www.librecalc.com/en/blog/realiser-une-distribution-debian-personalisee-pour-arm9/ partition scheme seems not the same and debian is wheezy…but maybe a good start

https://forum-bpi.de/viewtopic.php?f=54&t=345 is also nice, but where to get the dtb for BPI-R2 (maybe its created with the build-script from the github)?

Being Open Source there should be open repositories for the efforts in Debian, Ubuntu, Kali, Fedora, and others !

I am willing to do documentation and testing. And I would like to get a proper installer for installing to SATA disks together.

@frank-w - thanks they are good leads, @sinovoip - but I think there should be open standard root image build systems for common development as this would speed things up no end. We should be able to link to a lot of packages from the standard Debian, Ubuntu, Kali, and Fedora armhf package repos.

But this can be dangerious unless overriding anything that might brick a board. I have avoided updating eMMc as thats prone to bricking a board.

I have both R2 amd M3 boards I need to get working fully with distros.

You can use this Image ‘2017-03-10-debian-8-jessie-lite-preview-bpi-r2-sd-emmc.img.zip’ and easily upgrade to Stretch.

thanks,good to hear,that there are no problems using the update/upgrade-progress from debian. It’s an option,but i don’t like upgrades between main releases. have you tried to replace the kernel from github?

As you can see - this is an old kernel 4.40.43. I’m just getting fresh 4.4.70.

I’ve updated debian jessie too. Where do you get this nice motd-script with ascii-art?

May something like that: https://oitibs.com/debian-jessie-dynamic-motd/

1 Like

I’ve got a booting debian stretch with debootstrap and uploaded instructions here: http://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:debian

Also an tar.gz on my gdrive is linked there…

Good Morning!

How to install debian BPI-R2 emmc. I’m starting in bananapi-r2, I’m confused how should I proceed.

Thankful,

Wanderley

http://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:storage#install_os_on_emmc

  1. change partitionconfig in uboot or with mmc-utils
  2. Flash preloader to boot0
  3. flash preloader+uboot to mmcblkx and create partitiontable
  4. install bootstrapped rootfs and change necessary things (network-config,fstab)
  5. Install kernel, modules and uenv.txt

Instead of steps 3-5 you can flash my stretch-image for emmc from my gdrive (https://drive.google.com/open?id=1oP7jy1KrrIOifvImo2nQ59wx3_9hHkgk)

I was using the historics you mentioned.

But with the image jessie-lite:

2017-03-10-debian-8-jessie-lite-preview-bpi-r2-sd-emmc.img

When it reboots it does not find emmc. Do you know if this image can recognize emmc?

When I use the ubuntu image, I get the boot normally. But I need to use debian clean (with few packages)

Thank you for your response.

How do you check for emmc? Kernel should create a mmcblk0 and mmcblk1…mmcblk1 should be emmc if using my kernel or official for r2 (in mainline it is mmcblk0). If you do not see boot0/1 partitionconfig is 0x0 and have to be changed. Your image do not have mmc-utils here you have to do it via uboot or add mmc-utils

for more help we need info about your steps and error-messages you’ve got

btw. my debian stretch is a minimal installation and you can/have to install what you need :wink:

I gave up jessie and recorded the stretch version. I used the following image:

bpi-r2_debian_stretch_4.14.13.img.gz

I recorded the SSD and then did the manual procedure that you reported:

“manual copy of OS”

And it worked correctly. Thank you very much!!

I am very interested in this solution. Are you reporting anything in production, such as firewall, proxy, dns?

Is there somewhere we share experiences?

You’ll find also firewall (iptables incl nat and routing) and simple dns-settings in my wiki…i don’t use a proxy

hi,

i’ve uploaded an updated version of my debian-image with kernel 4.14. also the emmc-mount-bug (system-boot hangs on trying to mount emmc-partitions) is fixed there. If using the old image comment out emmc-mounts in /etc/fstab with ‘#’

network-config:

wan: dhcp
lan0: 192.168.0.10/24
lan1+2: bridged with ip 192.168.40.1/24
lan3: only vlan 60 configured with ip 192.168.60.10/24

this image also uses upstream-uboot with my actual patches (v4-branch), without net-support (if you need tftp-boot flash old uboot)

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

filename: deb_stretch_4.14.80_SD.tar.gz (+md5)

1 Like