Compare commits

...

9 Commits

Author SHA1 Message Date
wpetit 2d0d0d689d ci: install python3-distutils in docker environment
arcad/emissary-firmware/pipeline/pr-master There was a failure building this commit Details
2023-08-25 07:33:44 -06:00
wpetit 4b8b4c43c2 doc: refactor bpi hardware sheet
arcad/emissary-firmware/pipeline/pr-master There was a failure building this commit Details
2023-08-25 07:03:36 -06:00
lseys 46808786ce doc: add make download-emissary-release in doc
arcad/emissary-firmware/pipeline/pr-master There was a failure building this commit Details
2023-08-25 11:05:44 +02:00
lseys 54492c4f6c doc: create hardware-sheet for bananapi. doc use to discover hardware and install firmware on it only
arcad/emissary-firmware/pipeline/pr-master There was a failure building this commit Details
2023-08-22 12:30:59 +02:00
lseys d19d77c1a8 fix: clear default configuration by setting only requires
arcad/emissary-firmware/pipeline/pr-master There was a failure building this commit Details
2023-08-09 14:52:19 +02:00
lseys f8b76b167e fix: simplify firmware configuration. test => start, ssh access, emissary-agent, contact emissary server OK
arcad/emissary-firmware/pipeline/pr-master There was a failure building this commit Details
2023-08-08 11:57:27 +02:00
lseys d87c30bfcf remise en état du fichier n'ayant pas besoin d'être modifié!
arcad/emissary-firmware/pipeline/head There was a failure building this commit Details
arcad/emissary-firmware/pipeline/pr-master There was a failure building this commit Details
2023-08-07 17:10:48 +02:00
lseys 4a08d1daa7 feat(bpi-r3): default firmware ok. Lan ok, emissary install
arcad/emissary-firmware/pipeline/pr-master There was a failure building this commit Details
2023-08-07 14:42:39 +02:00
wpetit e6185af00b feat: add basic bananapi r3 target
arcad/emissary-firmware/pipeline/pr-master There was a failure building this commit Details
2023-07-31 13:26:47 -06:00
12 changed files with 192 additions and 6 deletions

View File

@ -15,8 +15,8 @@ BIN_DIR_NAME_SUFFIX ?=
IMAGEBUILDER_URL ?= https://downloads.openwrt.org/releases/$(OPENWRT_VERSION)/targets/$(OPENWRT_TARGET)/openwrt-imagebuilder-$(OPENWRT_VERSION)-$(OPENWRT_TARGET_DASHED).Linux-x86_64.tar.xz
IMAGEBUILDER_ARCHIVE_PATH := tmp/imagebuilder-$(OPENWRT_VERSION)-$(OPENWRT_TARGET_DASHED).tar.xz
IMAGEBUILDER_DIR_PATH := $(PWD)/imagebuilder/$(OPENWRT_VERSION)/$(OPENWRT_TARGET)
IMAGEBUILDER_ARCHIVE_PATH ?= tmp/imagebuilder-$(OPENWRT_VERSION)-$(OPENWRT_TARGET_DASHED).tar.xz
IMAGEBUILDER_DIR_PATH ?= $(PWD)/imagebuilder/$(OPENWRT_VERSION)/$(OPENWRT_TARGET)
IMAGEBUILDER_CUSTOM_PACKAGES_DIR_PATH := $(IMAGEBUILDER_DIR_PATH)/packages
IMAGEBUILDER_CUSTOM_FILES_DIR_PATH := $(IMAGEBUILDER_DIR_PATH)/files

View File

@ -8,8 +8,13 @@ install/ # Tâches Make d'installation spécifiques aux différentes cibles d
misc/ # Fichiers spécifiques aux différentes cibles de construction
targets/ # Tâches Make de définition des différentes cibles de construction
```
## Tutoriels
- [Premiers pas](./tutorials/first-steps.md)
- [Compiler un firmware](./tutorials/firmware-compilation.md)
- [Flasher une borne](./tutorials/device-flashing.md)
## Fiches matériel
- [Banana Pi](./hardware/bananapi.md)

133
doc/hardware/bananapi.md Normal file
View File

@ -0,0 +1,133 @@
# BananaPi
![banana-rpi3](./../img/bpi-r3-case.jpg)
## Caractéristiques
- MediaTek MT7986(Filogic 830) Quad core ARM Cortex A53
- Wifi 6 2.4G/5GMT7976C
- 2G DDR RAM
- 8G eMMC flash
- 128MB Nand flash
- 2x 2.5GbE network port
- 1x M.2 Key B USB inerface
- 1x M.2 KEY M PCIe inerface
- 1x USB2.0 interface
- 1x Wan port (gigabit)
- 4x LAN port (gigabit)
## Installation
Par défaut la borne est sans OS, donc impossible de flasher selon la méthode conventionnel.
bpi fournit un soft permettant de prendre un .img et de le mettre en place dans une carte SD.
### Installation bpi-tools
Il est conseillé d'installer pv auparavant pour plus de commodité. (disponibilité ubunut et manjaro validé)
```Shell
apt-get install pv
```
Installer bpi-tools sur votre machine, si vous ne pouvez accéder à l'url via curl, ce rendre sur le repo bpi-tools et le faire manuellement.
```Shell
curl -sL https://github.com/BPI-SINOVOIP/bpi-tools/raw/master/bpi-tools | sudo -E bash
```
### Installation firmware avec emissary
Dans notre exemple nous partons d'une image openwrt avec emissary nommé: ```openwrt-22.03.2-emissary-v2023.08.02-bec8917-bcm27xx-bcm2711-rpi-4-squashfs-factory.img```
1. télécharger l'image depuis la [forge cadoles](https://forge.cadoles.com/arcad/emissary-firmware/releases)
Une fois téléchargé vous avez un .gz.</br>
2. extraire : ```gunzip openwrt-**-emissary-***-****-**-**-rpi-4-squashfs-factory.img.gz```
3. Ce placer dans le dossier contenant le fichier .img
4. Brancher la SDcard à votre machine. Pour valider/vérifier son appelation vous pouvez utiliser ```dmesg``` et observer les dernières lignes. (en générale /dev/sda)
5. Valider le chemin d'accès à la SDcard ( /dev/sd...)
6. Lancer la copie sur SDcard avec bpi-copy.
```Shell
sudo bpi-copy openwrt-22.03.2-emissary-v2023.08.02-bec8917-bcm27xx-bcm2711-rpi-4-squashfs-factory.img /dev/sda
```
vous aurez un résultat ressemblant à :
```Shell
==============================================================
jeu. 03 août 2023 10:09:12 CEST
*** start COPY (blue led on ) .....
umount device: /dev/sda
umount /dev/sda1
umount /dev/sda2
==============================================================
IMGFILE=openwrt-22.03.2-emissary-v2023.08.02-bec8917-bcm27xx-bcm2711-rpi-4-squashfs-factory.img
==============================================================
img
8+1 enregistrements lus
8+1 enregistrements écrits
90475842 octets (90 MB, 86 MiB) copiés, 0,130052 s, 696 MB/s
86,3MiO 0:00:00 [ 648MiO/s] [ <=> ]
0+1381 enregistrements lus
0+1381 enregistrements écrits
*** end COPY (blue led off) .....
jeu. 03 août 2023 10:09:18 CEST
==============================================================
RUNTIME 0:6
OK!! You can remove the BOOTDISK /dev/sda now!!
```
Une fois finie, retirer la carte SD, vous pouvez dès à présent la placer dans votre boitier de destination.
Une fois la carte flashé, vérifier que le switch à tout ces jumpers vers le haut, (sélection du boot), insérer la carte SD, puis brancher la borne.
Vous pourrez vous brancher sur un port LAN du boitier qui délivrera du dhcp afin d'utiliser ssh pour y accéder.
### OS pour banana-bpi fournit par bpi
Installation d'openwrt fait pour bpi-r3, pour cela flasher une carte SD avec le fichier ```bananapi_bpi-r3-sdcard.img.gz``` fournit par openwrt [sur leur site page download](https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/). Sinon aller dans les téléchargement et ce rendre à l'emplacement suivant :
![img](./../img/bpi-r3-download.png)
### Flasher la carte avec le firware Openwrt de bpi
1. télécharger l'image depuis le liens précédent. Une fois téléchargé vous avez un .gz.</br>
2. extraire : ```gunzip bananapi_****.img.gz```
3. Ce placer dans le dossier contenant le fichier .img
4. Brancher la SDcard à votre machine. Pour valider/vérifier son appelation vous pouvez utiliser dmesg et observer les dernières lignes. (en générale sda)
5. Valider le chemin d'accès à la SDcard (souvent /dev/sd...)
6. Lancer la copie sur SDcard avec bpi-copy.
```Shell
sudo bpi-copy bananapi_bpi-r3-sdcard.img /dev/sda
```
Une fois la carte flashé, vérifier que le switch à tout ces jumpers vers le haut, (sélection du boot), insérer la carte SD, puis brancher la borne.
Votre carte réseau doit être paramétré ainsi :
- dans le réseau 192.168.1.0/24
- sur la passerelle 192.168.1.1
Brancher votre câble RJ45 sur le port VLAN1, et connectez vous en ssh.(temps de boot moins de 30 secondes)
```Shell
ssh root@192.168.1.1
```
pour la première connexion il n'y a pas de mot de passe.
## FAQ
### Comment sélectionner le boot système ?
Il y a un switch de quatre jumper à manipuler pour sélectionner le choix de boot. Par défaut ils sont tous en haut, définissant le boot sur la carte microSD.
![switch](./../img/bpi-r3-switch.png)
### Quels sont les noms des périphériques réseau ?
Par défaut les périphériques réseau sont ainsi disposé et nommé:
![Lan](./../img/bpi-r3-lan-pic.jpg)

BIN
doc/img/bpi-r3-case.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

BIN
doc/img/bpi-r3-download.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
doc/img/bpi-r3-lan-pic.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
doc/img/bpi-r3-switch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -16,6 +16,7 @@ make linksys-wrt1900ac
# ... ou pour le routeur Linksys WRT3200ACM
make linksys-wrt3200acm
```
## Créer une nouvelle cible de construction
Dans ce tutoriel, nous allons voir comment créer une nouvelle cible de construction pour un nouvel appareil, ici un [Banana Pi R3](https://wiki.banana-pi.org/Banana_Pi_BPI-R3).
@ -57,7 +58,15 @@ Dans ce tutoriel, nous allons voir comment créer une nouvelle cible de construc
- `EMISSARY_ARCH`: Architecture du binaire Emissary à déployer dans le firmware
- `OPENWRT_PROFILE`: "Profil" OpenWRT associé à l'appareil
3. Lancer la compilation du firmware
3. Préparation.
Lancer la commande suivante pour télécharger (ou mettre à jours) les bon tar.gz nécessaire à la construction du firmware. Si cette commande n'a pas été lancée au moins une fois, vous ne pourrez pas construire le/les firmware.
```shell
make download-emissary-release
```
4. Lancer la compilation du firmware
```shell
make bpi-r3

3
install/bananapi.mk Normal file
View File

@ -0,0 +1,3 @@
install-bpi-r3-network-config:
mkdir -p files/etc/config
cp misc/bpi-r3/uci/network files/etc/config/network

24
misc/bpi-r3/uci/network Normal file
View File

@ -0,0 +1,24 @@
config interface 'lan'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
list ports 'sfp2'
option ip6assign '60'
config interface 'wan'
option type 'bridge'
list ports 'eth1'
list ports 'wan'
option proto 'dhcp'
config device
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

View File

@ -8,7 +8,7 @@ ARG https_proxy=
# Install dev environment dependencies
RUN export DEBIAN_FRONTEND=noninteractive &&\
apt-get update -y &&\
apt-get install -y --no-install-recommends curl ca-certificates build-essential wget unzip tar git jq gawk python3 rsync file
apt-get install -y --no-install-recommends curl ca-certificates build-essential wget unzip tar git jq gawk python3 rsync file python3-distutils
# Add LetsEncrypt certificates
RUN curl -k https://forge.cadoles.com/Cadoles/Jenkins/raw/branch/master/resources/com/cadoles/common/add-letsencrypt-ca.sh | bash

12
targets/bananapi.mk Normal file
View File

@ -0,0 +1,12 @@
all: bpi-r3
bpi-r3:
$(MAKE) \
OPENWRT_VERSION="snapshot" \
IMAGEBUILDER_URL=https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/openwrt-imagebuilder-mediatek-filogic.Linux-x86_64.tar.xz \
ADDITIONAL_INSTALL="install-bpi-r3-network-config" \
ADDITIONAL_OPENWRT_PACKAGES="block-mount kmod-fs-ext4 kmod-usb-storage kmod-usb2" \
OPENWRT_TARGET="mediatek/filogic" \
EMISSARY_ARCH="arm64" \
OPENWRT_PROFILE="bananapi_bpi-r3" \
build