Compare commits

...

49 Commits

Author SHA1 Message Date
bec89173c1 doc: add missing command
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-08-02 06:41:25 -06:00
6f646ce7b7 doc: add firmware compilation tutorial
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-07-31 13:25:47 -06:00
9d0064ccfb feat: use emissary v2023.6.25-42d49eb
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-06-25 17:51:13 +00:00
3b981873cc feat: use emissary v2023.6.23-4217850
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-06-23 16:42:43 +00:00
c7465dba27 feat: use emissary v2023.6.23-4a58847
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-06-23 12:46:15 +00:00
4a4232e358 feat: use emissary v2023.6.23-4255940
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-06-23 12:30:35 +00:00
250bf06367 feat: use emissary v2023.6.22-a5fbe3e
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-06-22 15:09:27 +00:00
3ca90a54a9 feat: use emissary v2023.6.22-8b5a97d
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-06-22 15:05:47 +00:00
58d1ffc9a2 feat: use emissary v2023.5.26-d73e027
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-05-26 13:56:56 +00:00
a7f3f2faea feat: use emissary v2023.5.25-054744e
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-05-25 19:27:45 +00:00
6d0e693fc4 feat: use emissary v2023.5.24-58ef3b0
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-05-24 08:19:36 +00:00
68a1de079e feat: use emissary v2023.5.24-e568092
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-05-24 08:01:26 +00:00
7f1472f21b feat: use emissary v2023.5.23-ece97ef
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-05-23 18:48:19 +00:00
291ad94b15 feat: use emissary v2023.5.23-4311cf6
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-05-23 12:53:02 +00:00
4b181ec9e1 feat: use emissary v2023.4.26-6a976c0
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-26 14:00:14 +00:00
81360c3fda feat(turris,omnia): re-enable disk resizing
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-26 15:55:13 +02:00
2cf46ed9a5 feat(turris,omnia): customize uci config
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-25 14:04:38 +02:00
df763ef49a feat(turris,omnia): add uci-defaults scripts 2023-04-25 14:04:38 +02:00
9e153e38cb feat: use emissary v2023.4.25-d188af8
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-25 11:57:47 +00:00
9214c097b3 feat: use emissary v2023.4.24-e975381
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-24 11:55:12 +00:00
2339bc3aa6 feat: use emissary v2023.4.24-0d03a70
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-24 10:27:28 +00:00
908a36896e feat: use emissary v2023.4.21-64ea0e0
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-21 18:09:10 +00:00
23452a06ff feat(rpi): default firmware ok
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-21 18:42:06 +02:00
83f97abcbd feat: use emissary v2023.4.21-541d30d
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-21 11:13:54 +00:00
d0f6e63007 feat: use emissary v2023.4.21-87a4509
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-21 10:51:10 +00:00
087f8a27a8 feat: use emissary v2023.4.20-fcd159c
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-20 17:32:21 +00:00
42c157a1e5 feat: use emissary v2023.4.20-ef3048b
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-20 10:26:56 +00:00
7b722293b7 feat: use emissary v2023.4.20-3d01cf0
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-20 09:04:43 +00:00
d37c10afae fix(turris,omnia): disable reboot after resize temporarily
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-17 11:57:46 +02:00
40d6d2df03 fix(turris,omnia): reboot after disk resize
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-14 17:37:19 +02:00
f70763aed7 feat: use emissary v2023.4.14-813f837
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-14 14:32:47 +00:00
475a807302 feat: use emissary v2023.4.13-ed35ee5
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 11:52:10 +00:00
4e075cbd8e feat: use emissary v2023.4.13-4b5bc0b
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 10:11:55 +00:00
ed52367837 feat: use emissary v2023.4.13-dee6218
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 09:39:49 +00:00
a6c32c5315 feat: use emissary v2023.4.13-76656e8
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 09:32:01 +00:00
a35c5563db feat: use emissary v2023.4.13-41b1619
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 09:08:54 +00:00
751f5398e1 feat: use emissary v2023.4.12-35d5ee8
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-12 09:13:52 +00:00
9b2c2e5cdc feat: use emissary v2023.4.11-2315ee7
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-11 13:14:45 +00:00
2aa581e3c0 feat: use emissary v2023.4.11-86a6d81
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-11 10:09:57 +00:00
fc7be554a3 feat: use emissary v2023.4.11-8fb86c6
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-11 09:17:18 +00:00
f6df7651da feat(turris,omnia): automatically resize partition at startup
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-07 11:38:36 +02:00
87b15c940f feat: use emissary v2023.4.6-12f8b3a
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-06 19:00:29 +00:00
30d48ce4aa feat: use emissary v2023.4.6-4cf53d9
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 17:28:39 +00:00
2f06b5fdcf feat: use emissary v2023.4.6-47c2546
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 16:29:28 +00:00
c3070d2922 feat: use emissary v2023.4.6-2117391
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 16:21:15 +00:00
38a0d35c7b feat: use emissary v2023.4.6-b213b8d
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 14:01:51 +00:00
9a48ff1a65 feat: use emissary v2023.4.6-9dcddc5
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 13:17:58 +00:00
e1ed8f9bd1 feat: use emissary v2023.4.6-253c93d
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 09:04:09 +00:00
cec076241a feat: use emissary v2023.4.6-d2f865c
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 08:47:39 +00:00
11 changed files with 202 additions and 10 deletions

View File

@ -1,5 +1,13 @@
# Documentation
## Structure du projet
```shell
doc/ # Documentation technique
install/ # Tâches Make d'installation spécifiques aux différentes cibles de construction
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)

View File

@ -1,16 +1,85 @@
# Compiler un firmware
> TODO
## Compiler un firmware préconfiguré
L'ensemble des cibles de construction préconfigurés sont disponibles dans le répertoire `targets/`.
Par exemple:
```shell
# Exemple: construire un firmware OpenWRT
# Télécharger localement les dernières archive du projet emissary
make download-emissary-release
# Pour le routeur Linksys WRT1200AC
# Puis...
# ... pour le routeur Linksys WRT1200AC
make linksys-wrt1200ac
# Pour le routeur Linksys WRT1900AC
# ... ou pour le routeur Linksys WRT1900AC
make linksys-wrt1900ac
# Pourt le router Linksys WRT3200ACM
# ... 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).
### Créer la nouvelle tâche Make
1. Dans le répertoire `targets/`, créer le fichier `bananapi.mk`
```shell
touch targets/bananapi.mk
```
2. Éditer le fichier `targets/bananapi.mk` pour créer la nouvelle tâche Make
```makefile
# On ajoute notre nouvelle tâche "bpi-r3" en dépendance de la tâche
# principale "all"
all: bpi-r3
# On créait une nouvelle tâche "bpi-r3" permettant de construire le
# firmware pour notre BananaPi 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="" \
OPENWRT_TARGET="mediatek/filogic" \
EMISSARY_ARCH="arm64" \
OPENWRT_PROFILE="bananapi_bpi-r3" \
build
```
**Explication des variables**
- `OPENWRT_VERSION`: Version d'OpenWRT à utiliser. _Normalement prédéfinie par le fichier `Makefile` principal mais ill est ici nécessaire de surcharger la variable car il n'existe à ce jour pas de version stable d'OpenWRT pour la BananaPi R3._
- `IMAGEBUILDER_URL`: URL à utiliser pour télécharger le "builder" OpenWRT. _Normalement prédéfinie par le fichier `Makefile` principal mais ill est ici nécessaire de surcharger la variable car il n'existe à ce jour pas de version stable d'OpenWRT pour la BananaPi R3._
- `ADDITIONAL_INSTALL`: Tâches Make d'installation supplémentaires à exécuter. Voir section suivante.
- `OPENWRT_TARGET`: "Cible" OpenWRT associée à l'appareil
- `EMISSARY_ARCH`: Architecture du binaire Emissary à déployer dans le firmware
- `OPENWRT_PROFILE`: "Profil" OpenWRT associé à l'appareil
3. Lancer la compilation du firmware
```shell
make bpi-r3
```
Les fichiers du firmware seront générés dans le répertoire `bin/snapshot/mediatek/filogic/bananapi_bpi-r3/`
> 🛈 **Comment trouver les valeurs des variables `OPENWRT_TARGET` et `OPENWRT_PROFILE` ?**
>
> Après avoir trouvé votre appareil sur la [liste de compatibilité d'OpenWRT](https://openwrt.org/toh/start), rechercher l'URL de téléchargement du fichier du firmware, qui devrait ressembler à `https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/openwrt-mediatek-filogic-bananapi_bpi-r3-sdcard.img.gz`.
>
> La valeur de `OPENWRT_TARGET` est la chaîne comprenant les 2 répertoires juste après `targets/`, ici `mediatek/filogic`.
>
> La valeur de `OPENWRT_PROFILE` est la chaîne comprise entre la cible OpenWRT et le type/extension dans le nom de fichier, ici `bananapi_bpi-r3`.
### Personnaliser votre firmware
Afin de personnaliser votre firmware, vous pouvez déclarer des nouvelles tâches Make dans le répertoire `install/` et ensuite les référencer dans la variable `ADDITIONAL_INSTALL`.
Vous pouvez prendre exemple sur le ficher `install/raspberrypi.mk` qui par exemple déploie des fichiers de configuration UCI par défaut ainsi que des scripts [`uci-defaults`](https://openwrt.org/docs/guide-developer/uci-defaults).

View File

@ -1 +1 @@
v2023.4.6-06b1235
v2023.6.25-42d49eb

7
install/raspberrypi.mk Normal file
View File

@ -0,0 +1,7 @@
install-rpi-network-config:
mkdir -p files/etc/config
cp misc/rpi/uci/network files/etc/config/network
install-rpi-uci-defaults:
mkdir -p files/etc/uci-defaults
cp misc/rpi/uci-defaults/* files/etc/uci-defaults/

3
install/turris-omnia.mk Normal file
View File

@ -0,0 +1,3 @@
install-turris-omnia-uci-defaults:
mkdir -p files/etc/uci-defaults
cp misc/turris/omnia/uci-defaults/* files/etc/uci-defaults/

View File

@ -0,0 +1,37 @@
#/bin/sh
set -e
main() {
# Update default firewall ruleset
uci add firewall rule
uci set firewall.@rule[-1].name='Allow SSH on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='22'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTP on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='80'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTPS on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='443'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit firewall
# Disable DNS-rebind protection
uci set dhcp.@dnsmasq[0].rebind_protection='0'
uci commit dhcp
reload_config
}
main

9
misc/rpi/uci/network Normal file
View File

@ -0,0 +1,9 @@
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'wan'
option ifname 'eth0'
option proto 'dhcp'

View File

@ -0,0 +1,37 @@
#/bin/sh
set -e
main() {
# Update default firewall ruleset
uci add firewall rule
uci set firewall.@rule[-1].name='Allow SSH on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='22'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTP on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='80'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTPS on WAN'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='443'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit firewall
# Disable DNS-rebind protection
uci set dhcp.@dnsmasq[0].rebind_protection='0'
uci commit dhcp
reload_config
}
main

View File

@ -0,0 +1,21 @@
#!/bin/sh
set -eo pipefail
block info
DISK=/dev/mmcblk0
PARTITION="${DISK}p2"
parted -s -a opt "$DISK" "resizepart 2 100%"
FS_SIZE="$(unsquashfs -s "$PARTITION" | grep -o 'Filesystem size [0-9]* bytes' | grep -o '[0-9][0-9]*')"
FS_OFFSET="$(expr '(' "$FS_SIZE" + 65535 ')' / 65536 '*' 65536)"
LOOP_DEVICE="$(losetup -f --show -o "$FS_OFFSET" "$PARTITION")"
e2fsck -y -f "$LOOP_DEVICE"
resize2fs "$LOOP_DEVICE"
rm -f /etc/uci-defaults/99-resize-disk.sh
reboot

View File

@ -2,7 +2,7 @@ all: rpi-4 rpi-3
rpi-4:
$(MAKE) \
ADDITIONAL_INSTALL="" \
ADDITIONAL_INSTALL="install-rpi-network-config install-rpi-uci-defaults" \
OPENWRT_TARGET="bcm27xx/bcm2711" \
EMISSARY_ARCH="arm64" \
OPENWRT_PROFILE="rpi-4" \
@ -10,7 +10,7 @@ rpi-4:
rpi-3:
$(MAKE) \
ADDITIONAL_INSTALL="" \
ADDITIONAL_INSTALL="install-rpi-network-config install-rpi-uci-defaults" \
OPENWRT_TARGET="bcm27xx/bcm2710" \
EMISSARY_ARCH="arm64" \
OPENWRT_PROFILE="rpi-3" \

View File

@ -4,7 +4,8 @@ turris: omnia
omnia:
$(MAKE) \
ADDITIONAL_INSTALL="" \
ADDITIONAL_INSTALL="install-turris-omnia-uci-defaults" \
ADDITIONAL_OPENWRT_PACKAGES="losetup squashfs-tools-unsquashfs resize2fs e2fsprogs parted block-mount" \
OPENWRT_TARGET="mvebu/cortexa9" \
EMISSARY_ARCH="armv7" \
OPENWRT_PROFILE="cznic_turris-omnia" \