Skip to content

Commit 1cf13aa

Browse files
committed
readme: add README.md
1 parent 0dd3d0c commit 1cf13aa

File tree

1 file changed

+235
-0
lines changed

1 file changed

+235
-0
lines changed

README.md

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
# Kernel 6.18 for BananaPi R2/R64/R2Pro/R3/R4
2+
3+
![CI](https://github.com/frank-w/BPI-Router-Linux/workflows/CI/badge.svg?branch=6.18-main)
4+
5+
## Requirements
6+
7+
On a x86/x64-host you need cross compile tools for the armhf architecture (bison and flex-package are needed for kernels >=4.16):
8+
```sh
9+
#for r2
10+
sudo apt install gcc-arm-linux-gnueabihf libc6-armhf-cross u-boot-tools bc make ccache gcc libc6-dev libncurses5-dev libssl-dev bison flex
11+
#for r64 / r2pro / r3 (mini) / r4 (pro/lite)
12+
sudo apt install gcc-aarch64-linux-gnu u-boot-tools bc make gcc ccache libc6-dev libncurses5-dev libssl-dev bison flex
13+
```
14+
If you build it directly on the BananaPi-R2/R64 (not recommended) you do not need the crosscompile-packages gcc-arm-linux-gnueabihf/gcc-aarch64-linux-gnu and libc6-armhf-cross
15+
16+
## Issues
17+
18+
Ubuntu 22 seems not set update-alternatives for gcc, so build.sh will report crosscompiler is not installed
19+
20+
```sh
21+
for i in $(ls /usr/bin/arm-linux-gnueabihf-gcc-{8..12});do sudo update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc $i 50;done
22+
sudo update-alternatives --config arm-linux-gnueabihf-gcc
23+
24+
for i in $(ls /usr/bin/aarch64-linux-gnu-gcc-{8..12});do sudo update-alternatives --install /usr/bin/aarch64-linux-gnu-gcc aarch64-linux-gnu-gcc $i 50;done
25+
sudo update-alternatives --config aarch64-linux-gnu-gcc
26+
```
27+
### R2
28+
29+
internal wifi/bt does not work anymore on 6.0+ as there are internal changes in linux which break mt6625 driver
30+
31+
### R64
32+
* pcie-slot CN8 does not detect gen2-cards due to hardware-issue (missing capacitors)
33+
* some pcie-cards are not detected because of wrong memory-mapping of BAR0
34+
35+
### R2Pro
36+
* mic-switch not working (hw related)
37+
38+
### R3
39+
* vlan on left SFP not working (6.2 + Fix from Felix works)
40+
https://patchwork.kernel.org/project/linux-mediatek/list/?series=698421
41+
* some issues with some GPON and copper-SFP
42+
43+
### R4
44+
45+
* some issues with some GPON and copper-SFP, also my 1G H!Fibre does
46+
not work here, but 2.5G Copper does.
47+
R4 expects moddef0 to be low to power module, some modules pull moddef0 after they get power
48+
* wifi bad signal (noise issue)
49+
https://forum.banana-pi.org/t/bpi-r4-wifi-range/19418/182
50+
* R4Pro:
51+
* crash when putting a lanport up before the combo-port behind mxl switch
52+
* R4Lite:
53+
* emmc only works in 4bit mode with reduced speed
54+
55+
## Usage
56+
57+
if you want to build for other board than R2, change "board" in build.conf first
58+
59+
```sh
60+
./build.sh importconfig
61+
./build.sh config #to configure manually with menuconfig
62+
./build.sh
63+
```
64+
the option "pack" creates a tar.gz-file which contains folders "BPI-BOOT" (content of Boot-partition aka /boot) and BPI-ROOT (content for rootfs aka /). simply backup your existing kernel (uImage or bpi-rX.itb on /boot) and unpack the content of these 2 folders to your system
65+
66+
you can also install direct to sd-card which makes a backup of kernelfile, here you have to change your uEnv.txt if you use a new filename (by default it's containing kernelversion)
67+
68+
### Usage with docker
69+
70+
The Dockerfile in `utils/docker/` provides a build environment without installing the native compilers on the local system.
71+
72+
The local directory will be mounted into the docker container. All changes will also be present in the respository folder.
73+
74+
1. Build the docker container for building once:
75+
```sh
76+
sh ./utils/docker/build_container.sh
77+
```
78+
79+
Note: if you get this error: "Got permission denied while trying to connect to the Docker daemon socket at ..." you have to configure non-root
80+
https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
81+
```sh
82+
sudo usermod -aG docker $USER
83+
newgrp docker
84+
```
85+
1. Start and connect to the running docker container:
86+
```sh
87+
sh ./utils/docker/run.sh
88+
```
89+
1. Now you can use the commands from above:
90+
```sh
91+
./build.sh
92+
```
93+
1. Close the container with `exit` or `CTRL-D`.
94+
1. Your build artifacts from the build script will be in the folder `./SD/`
95+
96+
97+
If you want to clean up you can remove all containers (and the associated docker images) with:
98+
```sh
99+
docker rmi bpi-cross-compile:1 --force
100+
```
101+
## install kernel (debian/ubuntu images)
102+
103+
either on host-system (build maschine) and inserted sdcard:
104+
105+
```sh
106+
./build.sh install
107+
```
108+
109+
or in running system (first make backup of your current itb in /boot) by unpacking
110+
the tar.gz file created by pack option in build.sh
111+
112+
```sh
113+
kernelfile=bpi-r3_6.6.47-main.tar.gz
114+
sudo tar -xzf $kernelfile --strip-components=1 -C /boot/ BPI-BOOT
115+
echo "unpack kernel-modules to bpi-root loopdev..."
116+
sudo tar -xzf $kernelfile --strip-components=2 -C /lib/. BPI-ROOT/lib/
117+
```
118+
119+
## Branch details
120+
121+
Kernel upstream + BPI-R2 / R64
122+
* <a href="https://github.com/frank-w/BPI-Router-Linux/tree/4.9-main">4.9-main</a>
123+
* <a href="https://github.com/frank-w/BPI-Router-Linux/tree/4.14-main">4.14-main</a>
124+
* <a href="https://github.com/frank-w/BPI-Router-Linux/tree/4.19-main">4.19-main</a> | <a href="https://github.com/frank-w/BPI-R2-4.14/tree/4.19-r64-main">4.19-r64-main</a>
125+
* <a href="https://github.com/frank-w/BPI-Router-Linux/tree/5.4-main">5.4-main</a>
126+
* <a href="https://github.com/frank-w/BPI-Router-Linux/tree/5.10-main">5.10-main</a>
127+
* <a href="https://github.com/frank-w/BPI-Router-Linux/tree/5.15-main">5.15-main</a>
128+
* <a href="https://github.com/frank-w/BPI-Router-Linux/tree/6.1-main">6.1-main</a>
129+
* <a href="https://github.com/frank-w/BPI-Router-Linux/tree/6.6-main">6.6-main</a>
130+
* <a href="https://github.com/frank-w/BPI-Router-Linux/tree/6.12-main">6.12-main</a>
131+
* 6.18-main
132+
133+
## Kernel versions
134+
135+
Kernel features by version
136+
137+
R2/R64:
138+
139+
| Feature | 4.4 | 4.9 | 4.14 | 4.19 | 5.4 | 5.10 | 5.15 | 6.1 | 6.6 | 6.12 |
140+
|--------------------| --- | --- | --- | --- | --- | ---- | ---- | --- | --- | --- |
141+
| PCIe | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
142+
| SATA | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
143+
| 2 GMAC | Y | Y | Y | Y | N | N | N | Y | Y | |
144+
| DSA | N | Y | Y | Y | Y | Y | Y | Y | Y | Y |
145+
| USB | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
146+
| VLAN (dsa) | | | Y | N | Y | Y | Y | Y | Y | Y |
147+
| VLAN-aware Bridge | | | N | Y | Y | Y | Y | Y | Y | Y |
148+
| HW NAT (R2) | | Y | Y | | | N | Y | Y | Y | Y |
149+
| HW QOS (R2) | | Y | ? | | | N | N | | | |
150+
| Crypto | Y | Y | Y | | Y | | | | | |
151+
| WIFI (internal) | | Y | Y | Y | Y | Y | Y | N | N | N |
152+
| BT | N | N | Y | Y | Y | Y | Y | N | N | N |
153+
| VIDEO (R2 only) | Y | N | Y | Y | Y | Y | Y | Y | Y | |
154+
| ACPI (R2) | ? | N | Y | Y | Y | | | Y | N | |
155+
| IR (R2) | ? | N | N | N | Y | Y | ? | Y | Y | |
156+
| WIFI (R64) | N | N | N | N | Y | Y | Y | Y | Y | |
157+
| BT (R64) | N | N | N | N | Y | Y | Y | Y | Y | |
158+
| Other options |--|--|--|--|--|--|--|--|--|
159+
| OpenVPN | ? | Y | Y | Y | Y | Y | Y | Y | Y | Y |
160+
| iptables (R2) | ? | Y | Y | Y | Y | Y | Y | Y | Y | Y |
161+
| nftables (R2) | ? | N | N | Y | Y | Y | Y | Y | Y | Y |
162+
| LXC / Docker (R2) | ? | ? | Y | Y | Y | Y | Y | Y | Y | Y |
163+
164+
Symbols:
165+
166+
|Symbol|Meaning|
167+
|------|-------|
168+
| ? |Unsure |
169+
| () |Testing|
170+
171+
(Testing in separate branch wlan/hdmi/hwnat/hwqos)
172+
173+
* WIFI/BT on R2 needs WMT-tools called before
174+
* HW-NAT only works between LAN and WAN (bridge unclear, wifi not supported)
175+
* HW-QoS is merged into 4.14-main, but we do not know how to test it
176+
* ACPI-feature means System is powered off, not only halted (power-consumption ~0.2W, no reboot on reset), reboot-problem on R2 with soldered power-switch (see https://github.com/frank-w/BPI-R2-4.14/issues/35). Power-off is also initiated by pressing the power-switch, on R64 not currently not available
177+
* VIDEO is hdmi-output (X-server/framebuffer-console)...here some resolutions are not supported by vendor-driver. R64 does not have HDMI
178+
179+
180+
kernel 4.4 / uboot 2014-04: https://github.com/frank-w/BPI-R2-4.4
181+
mainline-uboot: https://github.com/frank-w/u-boot
182+
183+
R2Pro/R3/R4
184+
185+
| Feature | 6.1 | 6.6 | 6.12 | 6.18 |
186+
|--------------------| --- | --- | --- | --- |
187+
| USB | Y | Y | Y | Y |
188+
| PCIe | Y | Y | Y | Y |
189+
| SATA (r2pro) | Y | Y | Y | Y |
190+
| DSA | Y | Y | Y | Y |
191+
| 2 GMAC | Y | Y | Y | Y |
192+
| SFP (R3) | Y | Y | Y | Y |
193+
| VLAN | Y/P | Y/P | Y | Y |
194+
| HW NAT (R3) | Y | Y | Y | Y |
195+
| WIFI (r3 internal) | Y | Y | Y | Y |
196+
| VIDEO (R2pro only) | Y | Y | Y | Y |
197+
| IR (R2pro) | ? | ? | ? | Y |
198+
| R3mini support | N | Y | Y | Y |
199+
| R4 support | N | N | Y | Y |
200+
| R4 Pro support | N | N | N | Y |
201+
| R4 Lite support | N | N | N | Y |
202+
203+
P=partial (vlan on r3 only works on dsa-ports, not on left SFP)
204+
205+
## Images
206+
207+
Latest images are created by my BPI-Router-Images repo
208+
https://github.com/frank-w/BPI-Router-Images
209+
210+
and stored on my gdrive
211+
https://drive.google.com/drive/folders/1A5S7_82Bg4EYxjzdQ5FKyBw9Qi2C3uK-?usp=drive_link
212+
213+
discussion in bpi forum:
214+
https://forum.banana-pi.org/t/debian-ubuntu-image-creation/15826
215+
216+
more information:
217+
https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r4:start#debian_ubuntu_image_building
218+
219+
## Links
220+
221+
* BPI-R2: http://www.banana-pi.org/r2.html
222+
* BPI-R64: http://www.banana-pi.org/r64.html
223+
* BPI-R2Pro: https://wiki.banana-pi.org/Banana_Pi_BPI-R2_Pro
224+
* BPI-R3: https://wiki.banana-pi.org/Banana_Pi_BPI-R3
225+
* BPI-R4: https://wiki.banana-pi.org/Banana_Pi_BPI-R4
226+
* Kernel: https://www.kernel.org/ , Stable: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
227+
* linux-mediatek: https://patchwork.kernel.org/project/linux-mediatek/list/, Threaded: http://lists.infradead.org/pipermail/linux-mediatek/
228+
* Forum: https://forum.banana-pi.org/c/banana-router/62
229+
* Wiki: https://www.fw-web.de/dokuwiki/doku.php?id=en:start
230+
231+
License
232+
----
233+
GPL-2.0
234+
235+
*Free Software, Hell Yeah!*

0 commit comments

Comments
 (0)