mirror of
https://github.com/tuxbox-neutrino/buildenv.git
synced 2025-08-27 15:33:01 +02:00
Compare commits
37 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1fd7cb62fc | ||
|
061053c7b5 | ||
|
d84f277098 | ||
|
2d26cc0775 | ||
|
116cc557dc | ||
|
1ff67985ec | ||
|
889b4b9746 | ||
|
0ecffb58dd | ||
|
1528ca7279 | ||
|
6bc2f1b7f9 | ||
|
48ec25e2e4 | ||
|
6d4ae33a0e | ||
|
7961947fa9 | ||
|
0c17141c15 | ||
|
1488d7f07a | ||
|
0acb4f2bcb | ||
|
2f12b0e953 | ||
|
b220b0804f | ||
|
3c9c730ef5 | ||
|
b85a65968f | ||
|
495bd574c1 | ||
|
fd2fec8550 | ||
|
3e510b0f91 | ||
|
e915e9a3af | ||
|
e207b2f214 | ||
|
bd4394002a | ||
|
dc119f2cab | ||
|
f058f2dc4f | ||
|
f610523694 | ||
|
a8123d868a | ||
|
1c8c28d6fe | ||
|
e5e068c9c6 | ||
|
5a6564cfa1 | ||
|
17c788f0b6 | ||
|
2528ed229f | ||
|
b4102b8629 | ||
|
f81a5a4f4c |
25
.github/scripts/translate.py
vendored
25
.github/scripts/translate.py
vendored
@@ -1,25 +0,0 @@
|
|||||||
from googletrans import Translator
|
|
||||||
|
|
||||||
def translate_readme(input_text, target_lang):
|
|
||||||
translator = Translator()
|
|
||||||
translated = translator.translate(input_text, dest=target_lang)
|
|
||||||
translated_text = translated.text
|
|
||||||
|
|
||||||
# add hint for automatically translation
|
|
||||||
translated_text = f"Note: This is an automatically translated file. Original content from [here](https://github.com/tuxbox-neutrino/buildenv/blob/3.2.4/README-de.md):\n\n{translated_text}"
|
|
||||||
|
|
||||||
# Use this workaround, because translater breaks some links and anchors
|
|
||||||
translated_text = translated_text.replace("[Build Image](#Build Image)", "[Build Image](#build-image)")
|
|
||||||
translated_text = translated_text.replace("devtool -reference.html", "devtool-reference.html")
|
|
||||||
translated_text = translated_text.replace("dev-manual -common-tasks.html", "dev-manual-common-tasks.html")
|
|
||||||
translated_text = translated_text.replace("Clone #1-Init-Script", "#1-clone-init-script")
|
|
||||||
|
|
||||||
return translated_text
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
input_text = open("README-de.md", "r").read()
|
|
||||||
target_lang = "en" # target language is english
|
|
||||||
translated_text = translate_readme(input_text, target_lang)
|
|
||||||
|
|
||||||
with open("README-en.md", "w") as outfile:
|
|
||||||
outfile.write(translated_text)
|
|
42
.github/workflows/readme.yml
vendored
42
.github/workflows/readme.yml
vendored
@@ -1,42 +0,0 @@
|
|||||||
name: Translate README
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 3.2.4
|
|
||||||
paths:
|
|
||||||
- 'README-de.md'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
translate:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install --upgrade googletrans==3.1.0a0
|
|
||||||
|
|
||||||
- name: Translate README
|
|
||||||
run: |
|
|
||||||
python .github/scripts/translate.py
|
|
||||||
|
|
||||||
- name: Commit and push translated README
|
|
||||||
run: |
|
|
||||||
git config --global user.email "actions@github.com"
|
|
||||||
git config --global user.name "GitHub Actions"
|
|
||||||
git add README-en.md
|
|
||||||
git commit -m "readme: Automatically translated README to English"
|
|
||||||
git push
|
|
||||||
|
|
84
.github/workflows/translateandtag.yml
vendored
Normal file
84
.github/workflows/translateandtag.yml
vendored
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
name: Translate README
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- 'README.md'
|
||||||
|
- 'README_de.md'
|
||||||
|
- 'init.sh'
|
||||||
|
- 'init.functions.sh'
|
||||||
|
- 'files/**'
|
||||||
|
- 'local.conf.common.inc.sample'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
translate:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: 3.8
|
||||||
|
|
||||||
|
- name: Install translate dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install --upgrade googletrans==3.1.0a0
|
||||||
|
curl -o translate-md.py https://raw.githubusercontent.com/dbt1/translate-md/refs/heads/master/translate-md.py
|
||||||
|
chmod 755 translate-md.py
|
||||||
|
|
||||||
|
- name: Prepare Git user data
|
||||||
|
run: |
|
||||||
|
git config --global user.email "dbt@novatux.de"
|
||||||
|
git config --global user.name "Thilo Graf"
|
||||||
|
|
||||||
|
- name: Verify translate-md.py download
|
||||||
|
run: |
|
||||||
|
if [ ! -f translate-md.py ]; then
|
||||||
|
echo "translate-md.py was not downloaded!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Translate README
|
||||||
|
run: |
|
||||||
|
cp README_de.md template.md
|
||||||
|
python translate-md.py --template-md template.md --output-dir . --prefix README_ --main-doc README.md -c translate-md-config.json -s de
|
||||||
|
rm template.md
|
||||||
|
|
||||||
|
- name: Commit and push translated README
|
||||||
|
run: |
|
||||||
|
git add README_de.md -f README_en.md
|
||||||
|
git commit -m "readme: Automatically translated README"
|
||||||
|
|
||||||
|
- name: Install tagit dependencies
|
||||||
|
run: |
|
||||||
|
pip install GitPython
|
||||||
|
curl -o tagit.py https://raw.githubusercontent.com/dbt1/tagit/master/tagit.py
|
||||||
|
curl -o tagit-config.json https://raw.githubusercontent.com/dbt1/tagit/master/tagit-config.json
|
||||||
|
chmod +x tagit.py
|
||||||
|
|
||||||
|
- name: Verify tagit.py download
|
||||||
|
run: |
|
||||||
|
if [ ! -f tagit.py ]; then
|
||||||
|
echo "tagit.py was not downloaded!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Tagging
|
||||||
|
run: |
|
||||||
|
python tagit.py -f README_de.md -f README_en.md --scheme-file tagit-config.json
|
||||||
|
|
||||||
|
- name: Commit and push version and tag changes
|
||||||
|
run: |
|
||||||
|
git add -A
|
||||||
|
git commit -m "Automatically updated tags [skip ci]" || echo "No changes to commit"
|
||||||
|
git push
|
||||||
|
git push --tags
|
5
.gitignore
vendored
5
.gitignore
vendored
@@ -18,3 +18,8 @@ local build increment
|
|||||||
*/poky
|
*/poky
|
||||||
poky-*
|
poky-*
|
||||||
|
|
||||||
|
venv
|
||||||
|
tagit.py
|
||||||
|
tagit-config.json
|
||||||
|
translate-md.py
|
||||||
|
|
||||||
|
213
README-de.md
213
README-de.md
@@ -1,213 +0,0 @@
|
|||||||
# Schnellstart Image-Erstellung #
|
|
||||||
|
|
||||||
- [Vorbereitung](#Vorbereitung)
|
|
||||||
- [Image bauen](#Image-bauen)
|
|
||||||
- [Aktualisierung](#Aktualisierung)
|
|
||||||
- [Arbeiten an Zielquellen](#Arbeiten-an-Zielquellen)
|
|
||||||
- [Übersicht über globale Konfigurationsdateien](#Übersicht-über-globale-Konfigurationsdateien)
|
|
||||||
|
|
||||||
## Vorbereitung
|
|
||||||
|
|
||||||
### Erforderliche Host-Pakete installieren (Debian 11)
|
|
||||||
Zur Verwendung mit anderen Distributionen siehe: [Yocto Project Quick Build](https://docs.yoctoproject.org/3.2.4/ref-manual/ref-system-requirements.html#supported-linux-distributions)
|
|
||||||
|
|
||||||
> :memo: **HINWEIS:** Bei Verwendung der Tuxbox-Builder-VM (welche nicht zwingend erforderlich ist), springe bitte zu [Schritt 1](#1-Init-Skript-klonen). Die Tuxbox-Builder-VM enthält bereits erforderliche Pakete. Details und Download von Tuxbox-Builder VM siehe: [Tuxbox-Builder](https://sourceforge.net/projects/n4k/files/Tuxbox-Builder)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential \
|
|
||||||
chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils \
|
|
||||||
iputils-ping python3-git python3-jinja2 libegl1-mesa pylint3 xterm subversion locales-all \
|
|
||||||
libxml2-utils ninja-build default-jre clisp libcapstone4 libsdl2-dev doxygen
|
|
||||||
```
|
|
||||||
> :memo: **HINWEIS:** Bei Debian 10 (buster) libcapstone3 verwenden.
|
|
||||||
|
|
||||||
#### Empfohlene Zusatzpakete zur grafischen Unterstützung und Analyse (z.B. mit Kdevelop, Meld):
|
|
||||||
```bash
|
|
||||||
apt-get install -y gitk git-gui meld cppcheck clazy kdevelop
|
|
||||||
```
|
|
||||||
|
|
||||||
### Optional: Falls kein konfiguriertes Git vorhanden ist, gib bitte Deine globalen Git-Benutzerdaten ein:
|
|
||||||
```bash
|
|
||||||
git config --global user.email "you@example.com"
|
|
||||||
git config --global user.user "Dein Name"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Image bauen
|
|
||||||
|
|
||||||
> :memo: **Hinweis:** Einige Pfade basieren auf Vorgaben, die vom Init-Script erzeugt werden. Einige Einträge werden als ```<Platzhalter>``` dargestellt, die entsprechend angepasst werden müssen.
|
|
||||||
|
|
||||||
> ### 1. Init-Skript klonen.
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/tuxbox-neutrino/buildenv.git
|
|
||||||
cd buildenv
|
|
||||||
```
|
|
||||||
|
|
||||||
> ### 2. Init-Skript ausführen
|
|
||||||
```bash
|
|
||||||
./init
|
|
||||||
cd poky-3.2.4
|
|
||||||
```
|
|
||||||
|
|
||||||
> ### 3. Liste möglicher Maschinentypen anzeigen
|
|
||||||
```bash
|
|
||||||
ls build
|
|
||||||
```
|
|
||||||
|
|
||||||
> ### 4. Umgebungsskript ausführen
|
|
||||||
```bash
|
|
||||||
. ./oe-init-build-env build/<Machine-Type aus der Liste von Schritt 3 hier eintragen>
|
|
||||||
```
|
|
||||||
|
|
||||||
> ### 5. Bauen
|
|
||||||
```bash
|
|
||||||
bitbake neutrino-image
|
|
||||||
```
|
|
||||||
|
|
||||||
Das kann eine Weile dauern. Einige Warnmeldungen können ignoriert werden. Fehlermeldungen, welche die Setscene-Tasks betreffen, sind kein Problem, aber Fehler während der Build- und Package-Tasks brechen den Prozess in den meißten Fällen ab. [Bitte melde in diesem Fall den Fehler oder sende Deine Lösung an uns](https://forum.tuxbox-neutrino.org/forum/viewforum.php?f=77). Hilfe ist sehr willkommen.
|
|
||||||
|
|
||||||
Wenn alles erledigt ist, sollte eine ähnliche Meldung wie diese erscheinen:
|
|
||||||
```bash
|
|
||||||
...
|
|
||||||
NOTE: Tasks Summary: Attempted 4568 tasks of which 4198 didn't need to be rerun and all succeeded.
|
|
||||||
...
|
|
||||||
```
|
|
||||||
**Das war's ...**
|
|
||||||
|
|
||||||
Erstellte Images und Pakete sind zu finden unter:
|
|
||||||
```
|
|
||||||
~/build/poky-3.2.4/build/<machine>/tmp/deploy
|
|
||||||
```
|
|
||||||
oder im dist-Verzeichnis:
|
|
||||||
```
|
|
||||||
~/build/dist/<Image-Version>/<machine>/
|
|
||||||
```
|
|
||||||
|
|
||||||
## Aktualisierung
|
|
||||||
> :memo: Manuelle Aktualisierungen für beliebeige Ziel-Quellen sind nicht erforderlich. Dies wird automatisch bei jedem aufgerufenen Ziel mit Bitbake durchgeführt. Dadurch werden auch immer erforderliche Abhängigkeiten aktualisiert. Wenn man die volle Kontrolle über bestimmte Ziel-Quellen haben möchte, siehe [Arbeiten an Zielquellen](#Arbeiten-an-Zielquellen)!
|
|
||||||
|
|
||||||
Falls [Schritte 1 bis 4](#3-Liste-möglicher-Maschinentypen-anzeigen) bereits ausgeführt wurden, ist nur Schritt 5 erforderlich:
|
|
||||||
|
|
||||||
### Update Image
|
|
||||||
```bash
|
|
||||||
bitbake neutrino-image
|
|
||||||
```
|
|
||||||
|
|
||||||
### Update Ziel
|
|
||||||
```bash
|
|
||||||
bitbake <target>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Meta-Layer-Repositories aktualisieren
|
|
||||||
Die erneute Ausführung des Init-Skripts aktualisiert die enthaltenen Meta-Layer auf den Stand der Remote-Repositories.
|
|
||||||
```bash
|
|
||||||
cd $HOME/build
|
|
||||||
./init
|
|
||||||
```
|
|
||||||
Die angestoßenen Update-Routinen des Init-scripts sollten nicht festgeschriebene Änderungen vorübergehend stashen bzw. rebasen lokale Commits auf die Remote-Änderungen. Konflikte muss man jedoch manuell auflösen. Natürlich kann man seine lokalen Meta-Layer für Meta-Neutrino- und Maschinen-Layer-Repositories manuell aktualisieren und modifizieren.
|
|
||||||
|
|
||||||
> :memo: **Hinweis:** Konfigurationsdateien bleiben unberührt. Neue oder geänderte Konfigurationsoptionen werden nicht berücksichtigt. Bitte überprüfe ggf. die Konfiguration.
|
|
||||||
|
|
||||||
## Arbeiten an Zielquellen
|
|
||||||
Wenn man die volle Kontrolle über die Ziel-Quellen haben möchte, sollten die Quellcodes in den Workspace verschoben werden. Siehe
|
|
||||||
[devtool](https://docs.yoctoproject.org/current/ref-manual/devtool-reference.html) und insbesondere [devtool modify](https://docs.yoctoproject.org/current/ref-manual/devtool-reference.html#modifying-an-existing-recipe).
|
|
||||||
|
|
||||||
## Konfiguration zurücksetzen
|
|
||||||
Wenn Du deine Maschinen-Konfigurationen zurücksetzen möchtest, benenne bitte das conf-Verzeichnis um (Löschen wird nicht empfohlen) und führe das Init-Skript erneut aus.
|
|
||||||
```bash
|
|
||||||
mv $HOME/build/poky-3.2.4/build/<machine>/conf $HOME/build/poky-3.2.4/build/<machine>/conf.01
|
|
||||||
cd $HOME/build
|
|
||||||
./init
|
|
||||||
```
|
|
||||||
|
|
||||||
## Neubau eines einzelnen Ziels erzwingen
|
|
||||||
In einigen Fällen kann es vorkommen, dass ein Target, warum auch immer, abbricht. Man sollte deswegen nicht in Panik verfallen und deswegen den tmp-Ordner und den sstate-cache löschen. Das kann man auch für jedes Target einzeln machen.
|
|
||||||
|
|
||||||
> :memo: Insbesondere defekte Archiv-URL's können zum Abbruch führen. Diese Fehler werden aber immer angezeigt und man kann die URL überprüfen. Oft liegt es nur an den Servern und funktioneren nach wenigen Minuten sogar wieder.
|
|
||||||
|
|
||||||
Um sicherzustellen, ob das betreffende Recipe auch tatsächlich ein Problem hat, macht es Sinn das betreffende Target komplett zu bereinigen und neu zu bauen. Um dies zu erzwingen, müssen alle erzeugten Paket-, Build- und Cachedaten bereinigt werden.
|
|
||||||
```bash
|
|
||||||
bitbake -c cleansstate <target>
|
|
||||||
```
|
|
||||||
anschließend neu bauen:
|
|
||||||
```bash
|
|
||||||
bitbake <target>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Vollständigen Imagebau erzwingen
|
|
||||||
Wenn Du einen kompletten Imagebau erzwingen möchtest, kann man das tmp-Verzeichnis löschen (oder umbenennen):
|
|
||||||
```bash
|
|
||||||
mv tmp tmp.01
|
|
||||||
bitbake neutrino-image
|
|
||||||
```
|
|
||||||
Wenn man den sstate-cache **nicht** gelöscht hat, sollte das Image in relativ kurzer Zeit fertig gebaut sein. Daher wird empfohlen, den sstate-cache beizubehalten. Das Verzeichnis wo sich der sstate-cache befindet, wird über die Variable ```${SSTATE_DIR}``` festgelegt und kann in der Konfiguration angepasst werden.
|
|
||||||
|
|
||||||
Dieses Verzeichnis ist ziemlich wertvoll und nur in seltenen Fällen ist es notwendig, dieses Verzeichnis zu löschen. Bitte beachte, dass der Build in diesem Fall sehr viel mehr Zeit in Anspruch nimmt.
|
|
||||||
> :bulb: Man kann Bitbake anweisen, keinen sstate-cache zu verwenden.
|
|
||||||
```bash
|
|
||||||
bitbake --no-setscene neutrino-image
|
|
||||||
```
|
|
||||||
oder
|
|
||||||
```bash
|
|
||||||
bitbake --skip-setscene neutrino-image
|
|
||||||
```
|
|
||||||
|
|
||||||
## Bei Bedarf anpassen
|
|
||||||
Es wird empfohlen, zum ersten Mal ohne Änderungen an den Konfigurationsdateien zu bauen, um einen Eindruck davon zu bekommen, wie der Build-Prozess funktioniert, und um die Ergebnisse zu sehen.
|
|
||||||
Die Einstellmöglichkeiten sind sehr umfangreich und für Einsteiger nicht wirklich überschaubar. Das Yoctoproject ist jedoch sehr
|
|
||||||
umfassend dokumentiert und bietet die beste Informationsquelle.
|
|
||||||
|
|
||||||
**Wichtig für Entwickler**: "[Arbeiten an Zielquellen](#Arbeiten-an-Zielquellen)"!
|
|
||||||
|
|
||||||
> :memo: **Bitte ändere nicht die Yocto-Recipes! Dies wird vom Yocto-Team nicht empfohlen, aber man kann zum Vervollständigen, Erweitern oder Überschreiben von Meta-Core-Recipes [.bbappend](https://docs.yoctoproject.org/3.2.4/dev-manual/dev-manual-common-tasks.html#using-bbappend-files-in-your-layer)-Dateien verwenden.**
|
|
||||||
|
|
||||||
### Übersicht über globale Konfigurationsdateien
|
|
||||||
Für die lokale Konfiguration werden diese Konfigurationsdateien innerhalb der Build-Verzeichnissen benötigt:
|
|
||||||
|
|
||||||
> $HOME/build/poky-3.2.4/build/```<machine>```/conf/local.conf
|
|
||||||
|
|
||||||
Diese generierte local.conf enthält nur wenige Zeilen, besitzt aber eine Zeile, die auf eine gemeinsame Konfigurationsdatei zeigt, die für alle Images und unterstützten Maschinentypen gültig ist und kann man mit eigenen Optionen füttern.
|
|
||||||
|
|
||||||
> $HOME/build/local.conf.common.inc
|
|
||||||
|
|
||||||
Diese **.inc** Datei wurde aus der geklonten Beispieldatei beim erstmaligen ausführen des init-Scripts erzeugt.
|
|
||||||
|
|
||||||
> local.conf.common.inc.sample
|
|
||||||
|
|
||||||
Diese Beispieldatei sollte unberührt bleiben, um mögliche Konflikte beim Aktualisieren des build-Repositories zu vermeiden und um zu sehen, was sich geändert haben könnte.
|
|
||||||
|
|
||||||
Nach einer Aktualisierung des build-Repositries könnten einige neue oder geänderte Optionen hinzugefügt oder entfernt worden sein, die nicht in die inkludierte Konfigurationsdatei übernommen werden. Diesen Fall sollte man in der eigenen Konfiguration berücksichtigen und falls erforderlich anpassen.
|
|
||||||
Natürlich kann man ```$HOME/Build/poky-3.2.4/build/<machine>/conf/local.conf``` mit eigenen Anforderungen ändern und als separate Konfigurationsdatei für einen Maschinentyp verwenden.
|
|
||||||
|
|
||||||
#### Musterkonfiguration für bblayers.conf:
|
|
||||||
> $HOME/build/poky-3.2.4/build/```<machine>```/conf/bblayers.conf
|
|
||||||
|
|
||||||
```bitbake
|
|
||||||
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
|
|
||||||
# changes incompatibly
|
|
||||||
POKY_BBLAYERS_CONF_VERSION = "2"
|
|
||||||
|
|
||||||
BBPATH = "${TOPDIR}"
|
|
||||||
BBFILES ?= ""
|
|
||||||
|
|
||||||
BBLAYERS ?= " \
|
|
||||||
/home/<username>build/poky-3.2.4/meta \
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-poky \
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-yocto-bsp \
|
|
||||||
"
|
|
||||||
BBLAYERS += " \
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-neutrino \
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-<machine-brand-or-bsp-name> \
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-openembedded/meta-oe \
|
|
||||||
"
|
|
||||||
BBLAYERS += " \
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-python2 \
|
|
||||||
"
|
|
||||||
BBLAYERS += " \
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-qt5 \
|
|
||||||
"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Mehr Informationen
|
|
||||||
Weitere Informationen zum Yocto Buildsystem:
|
|
||||||
|
|
||||||
* https://docs.yoctoproject.org/3.2.4/index.html
|
|
215
README-en.md
215
README-en.md
@@ -1,215 +0,0 @@
|
|||||||
Note: This is an automatically translated file. Original content from [here](https://github.com/tuxbox-neutrino/buildenv/blob/3.2.4/README-de.md):
|
|
||||||
|
|
||||||
# Quick start image creation #
|
|
||||||
|
|
||||||
- [Preparation](#Preparation)
|
|
||||||
- [Build Image](#build-image)
|
|
||||||
- [Update](#Update)
|
|
||||||
- [Working on Target Sources](#Working-on-Target-Sources)
|
|
||||||
- [Overview of global configuration files](#overview-of-global-configuration-files)
|
|
||||||
|
|
||||||
## Preparation
|
|
||||||
|
|
||||||
### Install required host packages (Debian 11)
|
|
||||||
For use with other distributions see: [Yocto Project Quick Build](https://docs.yoctoproject.org/3.2.4/ref-manual/ref-system-requirements.html#supported-linux-distributions)
|
|
||||||
|
|
||||||
> :memo: **NOTE:** If using the Tuxbox Builder VM (which is not mandatory), please skip to [Step 1](#1-clone-init-script). The Tuxbox Builder VM already contains required packages. Details and download of Tuxbox-Builder VM see: [Tuxbox-Builder](https://sourceforge.net/projects/n4k/files/Tuxbox-Builder)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential \
|
|
||||||
chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils \
|
|
||||||
iputils-ping python3-git python3-jinja2 libegl1-mesa pylint3 xterm subversion locales-all \
|
|
||||||
libxml2-utils ninja-build default-jre clisp libcapstone4 libsdl2-dev doxygen
|
|
||||||
```
|
|
||||||
> :memo: **NOTE:** On Debian 10 (buster) use libcapstone3.
|
|
||||||
|
|
||||||
#### Recommended additional packages for graphical support and analysis (e.g. with Kdevelop, Meld):
|
|
||||||
```bash
|
|
||||||
apt-get install -y gitk git-gui meld cppcheck clazy kdevelop
|
|
||||||
```
|
|
||||||
|
|
||||||
### Optional: If there is no configured Git, please enter your global Git user data:
|
|
||||||
```bash
|
|
||||||
git config --global user.email "you@example.com"
|
|
||||||
git config --global user.user "Your name"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Build image
|
|
||||||
|
|
||||||
> :memo: **Note:** Some paths are based on defaults generated by the init script. Some entries are displayed as ```<placeholder>```, which need to be adjusted accordingly.
|
|
||||||
|
|
||||||
> ### 1. Clone init script.
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/tuxbox-neutrino/buildenv.git
|
|
||||||
cd buildenv
|
|
||||||
```
|
|
||||||
|
|
||||||
> ### 2. Run init script
|
|
||||||
```bash
|
|
||||||
./init
|
|
||||||
cd poky-3.2.4
|
|
||||||
```
|
|
||||||
|
|
||||||
> ### 3. Show list of possible machine types
|
|
||||||
```bash
|
|
||||||
ls build
|
|
||||||
```
|
|
||||||
|
|
||||||
> ### 4. Run environment script
|
|
||||||
```bash
|
|
||||||
. ./oe-init-build-env build/<enter machine type from the list from step 3 here>
|
|
||||||
```
|
|
||||||
|
|
||||||
> ### 5. Build
|
|
||||||
```bash
|
|
||||||
bitbake neutrino image
|
|
||||||
```
|
|
||||||
|
|
||||||
This could take a while. Some warning messages can be ignored. Error messages affecting the setscene tasks are not a problem, but errors during the build and package tasks terminate the process in most cases. [In this case, please report the error or send your solution to us](https://forum.tuxbox-neutrino.org/forum/viewforum.php?f=77). Help is very welcome.
|
|
||||||
|
|
||||||
When everything is done, you should see a message similar to this:
|
|
||||||
```bash
|
|
||||||
...
|
|
||||||
NOTE: Tasks Summary: Attempted 4568 tasks of which 4198 didn't need to be rerun and all succeeded.
|
|
||||||
...
|
|
||||||
```
|
|
||||||
**That's it...**
|
|
||||||
|
|
||||||
Created images and packages can be found at:
|
|
||||||
```
|
|
||||||
~/build/poky-3.2.4/build/<machine>/tmp/deploy
|
|
||||||
```
|
|
||||||
or in the dist directory:
|
|
||||||
```
|
|
||||||
~/build/dist/<image version>/<machine>/
|
|
||||||
```
|
|
||||||
|
|
||||||
## Update
|
|
||||||
> :memo: Manual updates for arbitrary target sources are not required. This is done automatically for every target accessed using Bitbake. This means that required dependencies are always updated. If you want full control over specific target sources, see [Working on Target Sources](#Working-on-Target-Sources)!
|
|
||||||
|
|
||||||
If [Steps 1 to 4](View #3-list-of-possible-machine-types) have already been completed, only step 5 is required:
|
|
||||||
|
|
||||||
### Update image
|
|
||||||
```bash
|
|
||||||
bitbake neutrino image
|
|
||||||
```
|
|
||||||
|
|
||||||
### Update target
|
|
||||||
```bash
|
|
||||||
bitbake <target>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Update meta layer repositories
|
|
||||||
Re-executing the init script updates the included meta layers to the status of the remote repositories.
|
|
||||||
```bash
|
|
||||||
cd $HOME/build
|
|
||||||
./init
|
|
||||||
```
|
|
||||||
The triggered update routines of the init script should temporarily stash uncommitted changes or rebase local commits to the remote changes. However, conflicts must be resolved manually. Of course, you can manually update and modify your local meta layers for meta neutrino and machine layer repositories.
|
|
||||||
|
|
||||||
> :memo: **Note:** Configuration files remain untouched. New or changed configuration options are not taken into account. Please check the configuration if necessary.
|
|
||||||
|
|
||||||
## Working on target sources
|
|
||||||
If you want to have full control over the target sources, the source codes should be moved to the workspace. Please refer
|
|
||||||
[devtool](https://docs.yoctoproject.org/current/ref-manual/devtool-reference.html) and especially [devtool modify](https://docs.yoctoproject.org/current/ref-manual/devtool-reference.html#modifying-an-existing-recipe).
|
|
||||||
|
|
||||||
## Reset configuration
|
|
||||||
If you want to reset your machine configurations, please rename the conf directory (deletion is not recommended) and run the init script again.
|
|
||||||
```bash
|
|
||||||
mv $HOME/build/poky-3.2.4/build/<machine>/conf $HOME/build/poky-3.2.4/build/<machine>/conf.01
|
|
||||||
cd $HOME/build
|
|
||||||
./init
|
|
||||||
```
|
|
||||||
|
|
||||||
## Force rebuild of a single target
|
|
||||||
In some cases it can happen that a target breaks off for whatever reason. You shouldn't panic and delete the tmp folder and the sstate cache. You can also do this for each target individually.
|
|
||||||
|
|
||||||
> :memo: In particular, broken archive URLs can lead to termination. However, these errors are always displayed and you can check the URL. Often it's just the servers and they even work again after a few minutes.
|
|
||||||
|
|
||||||
To make sure whether the recipe in question actually has a problem, it makes sense to completely clean up the target in question and rebuild it. To enforce this, all generated package, build and cache data must be cleaned up.
|
|
||||||
```bash
|
|
||||||
bitbake -c cleansstate <target>
|
|
||||||
```
|
|
||||||
then rebuild:
|
|
||||||
```bash
|
|
||||||
bitbake <target>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Force full image build
|
|
||||||
If you want to force a complete image build, you can delete (or rename) the tmp directory:
|
|
||||||
```bash
|
|
||||||
mv tmp tmp.01
|
|
||||||
bitbake neutrino image
|
|
||||||
```
|
|
||||||
If you have **not** cleared the sstate cache, the image should be built in a relatively short time. Therefore, it is recommended to keep the sstate cache. The directory where the sstate cache is located is determined via the variable ```${SSTATE_DIR}``` and can be adjusted in the configuration.
|
|
||||||
|
|
||||||
This directory is quite valuable and only in rare cases is it necessary to delete this directory. Please note that the build will take much longer in this case.
|
|
||||||
> :bulb: You can tell Bitbake not to use sstate cache.
|
|
||||||
```bash
|
|
||||||
bitbake --no-setscene neutrino-image
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
bitbake --skip-setscene neutrino-image
|
|
||||||
```
|
|
||||||
|
|
||||||
## Adjust if necessary
|
|
||||||
It is recommended to build for the first time without making any changes to the configuration files to get an idea of how the build process works and to see the results.
|
|
||||||
The setting options are very extensive and not really manageable for beginners. However, the Yoctoproject is very
|
|
||||||
comprehensively documented and provides the best source of information.
|
|
||||||
|
|
||||||
**Important for developers**: "[Working on Target Sources](#Working-on-Target-Sources)"!
|
|
||||||
|
|
||||||
> :memo: **Please do not change the Yocto recipes! This is not recommended by the Yocto team, but you can use [.bbappend](https://docs.yoctoproject.org/3.2.4/dev-manual/dev-manual-common-tasks.html#using-bbappend-files-in-your-layer) files.**
|
|
||||||
|
|
||||||
### Overview of global configuration files
|
|
||||||
For local configuration, these configuration files are required within the build directories:
|
|
||||||
|
|
||||||
> $HOME/build/poky-3.2.4/build/```<machine>```/conf/local.conf
|
|
||||||
|
|
||||||
This generated local.conf only contains a few lines, but has a line that points to a common configuration file that is valid for all images and supported machine types and can be fed with your own options.
|
|
||||||
|
|
||||||
> $HOME/build/local.conf.common.inc
|
|
||||||
|
|
||||||
This **.inc** file was created from the cloned example file when running the init script for the first time.
|
|
||||||
|
|
||||||
> local.conf.common.inc.sample
|
|
||||||
|
|
||||||
This example file should be left untouched to avoid possible conflicts when updating the build repository and to see what might have changed.
|
|
||||||
|
|
||||||
After an update to the build repository, some new or changed options may have been added or removed that are not reflected in the included configuration file. You should take this case into account in your own configuration and adapt it if necessary.
|
|
||||||
Of course, you can modify ```$HOME/Build/poky-3.2.4/build/<machine>/conf/local.conf``` with your own requirements and use it as a separate configuration file for a machine type.
|
|
||||||
|
|
||||||
#### Sample configuration for bblayers.conf:
|
|
||||||
> $HOME/build/poky-3.2.4/build/```<machine>```/conf/bblayers.conf
|
|
||||||
|
|
||||||
```bitbake
|
|
||||||
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
|
|
||||||
# changes incompatibly
|
|
||||||
POKY_BBLAYERS_CONF_VERSION = "2"
|
|
||||||
|
|
||||||
BBPATH = "${TOPDIR}"
|
|
||||||
BBFILES ?= ""
|
|
||||||
|
|
||||||
BBLAYERS ?= " \
|
|
||||||
/home/<username>build/poky-3.2.4/meta \
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-poky \
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-yocto-bsp \
|
|
||||||
"
|
|
||||||
BBLAYERS += "\
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-neutrino \
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-<machine-brand-or-bsp-name> \
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-openembedded/meta-oe \
|
|
||||||
"
|
|
||||||
BBLAYERS += "\
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-python2 \
|
|
||||||
"
|
|
||||||
BBLAYERS += "\
|
|
||||||
/home/<username>/build/poky-3.2.4/meta-qt5 \
|
|
||||||
"
|
|
||||||
```
|
|
||||||
|
|
||||||
## More information
|
|
||||||
Further information about the Yocto build system:
|
|
||||||
|
|
||||||
* https://docs.yoctoproject.org/3.2.4/index.html
|
|
12
README.md
12
README.md
@@ -1,7 +1,9 @@
|
|||||||
|
# Documentation
|
||||||
|
|
||||||
## Localized `README.md`'s
|
This document is available in the following languages:
|
||||||
|
|
||||||
| Language |
|
<!-- LANGUAGE_LINKS_START -->
|
||||||
| -------------------------- |
|
[🇩🇪 German](README_de.md) | [🇬🇧 English](README_en.md)
|
||||||
| [English](README-en.md) |
|
<!-- LANGUAGE_LINKS_END -->
|
||||||
| [German](README-de.md) |
|
|
||||||
|
Please choose your preferred language by clicking on the links above.
|
367
README_de.md
Normal file
367
README_de.md
Normal file
@@ -0,0 +1,367 @@
|
|||||||
|
<!-- LANGUAGE_LINKS_START -->
|
||||||
|
<span style="color: grey;">🇩🇪 German</span> | [🇬🇧 English](README_en.md)
|
||||||
|
<!-- LANGUAGE_LINKS_END -->
|
||||||
|
|
||||||
|
Dieses Skript dient als Werkzeug zur Vereinfachung der Erstellung einer Umgebung für Entwicklung und des Build-Prozesses für Images die mit Neutrino als Benutzeroberfläche auf unterschiedlichen Hardware-Plattformen laufen. Es automatisiert einige Schritte, die für die Einrichtung einer konsistenten und funktionalen Entwicklungs- und Build-Umgebung erforderlich sind, indem es die notwendigen Abhängigkeiten und grundlegende Konfigurationen sowie Meta-Layer voreinrichtet und benutzerdefinierte Einstellungen ermöglicht. Das Skript zielt darauf ab, eine Grundlage zu bieten, auf der man aufbauen und experimentieren kann, um eigene angepasste Versionen von Tuxbox-Neutrino Images zu erstellen, zu aktualisieren und zu pflegen.
|
||||||
|
|
||||||
|
- [1. Vorbereitung](#1-vorbereitung)
|
||||||
|
- [1.1 Erforderliche Host-Pakete installieren](#11-erforderliche-host-pakete-installieren)
|
||||||
|
- [1.1.1 Empfohlene Zusatzpakete zur grafischen Unterstützung und Analyse](#111-empfohlene-zusatzpakete-zur-grafischen-unterstützung-und-analyse)
|
||||||
|
- [1.2 Git vorbereiten (falls erforderlich)](#12-git-vorbereiten-falls-erforderlich)
|
||||||
|
- [1.3 Init-Skript klonen](#13-init-skript-klonen)
|
||||||
|
- [1.4 Init-Skript ausführen](#14-init-skript-ausführen)
|
||||||
|
- [1.5 Struktur der Buildumgebung](#15-struktur-der-buildumgebung)
|
||||||
|
- [2. Image bauen](#2-image-bauen)
|
||||||
|
- [2.1 Box wählen](#21-box-wählen)
|
||||||
|
- [2.2 Starte Umgebungsskript](#22-starte-umgebungsskript)
|
||||||
|
- [2.3 Image erstellen](#23-image-erstellen)
|
||||||
|
- [3. Aktualisierung](#3-aktualisierung)
|
||||||
|
- [3.1 Image aktualisieren](#31-image-aktualisieren)
|
||||||
|
- [3.2 Paket aktualisieren](#32-paket-aktualisieren)
|
||||||
|
- [3.3 Meta-Layer-Repositorys aktualisieren](#33-meta-layer-repositorys-aktualisieren)
|
||||||
|
- [4. Eigene Anpassungen](#4-eigene-anpassungen)
|
||||||
|
- [4.1 Konfiguration](#41-konfiguration)
|
||||||
|
- [4.1.1 Konfigurationsdateien](#411-konfigurationsdateien)
|
||||||
|
- [4.1.2 bblayers.conf](#412-bblayersconf)
|
||||||
|
- [4.1.3 Konfiguration zurücksetzen](#413-konfiguration-zurücksetzen)
|
||||||
|
- [4.3 Recipes](#43-recipes)
|
||||||
|
- [4.4 Pakete](#44-pakete)
|
||||||
|
- [4.4.1 Quellcode im Workspace bearbeiten (Beispiel)](#441-quellcode-im-workspace-bearbeiten-beispiel)
|
||||||
|
- [5. Neubau eines einzelnen Pakets erzwingen](#5-neubau-eines-einzelnen-pakets-erzwingen)
|
||||||
|
- [6. Vollständigen Imagebau erzwingen](#6-vollständigen-imagebau-erzwingen)
|
||||||
|
- [7. Lizenz](#7-lizenz)
|
||||||
|
- [8. Weiterführende Informationen](#8-weiterführende-informationen)
|
||||||
|
|
||||||
|
## 1. Vorbereitung
|
||||||
|
|
||||||
|
Empfohlen sei an dieser Stelle, den dafür vorgesehenen Docker-Container zu verwenden, da damit schon wesentliche Schritte erledigt sind, um mit möglichst wenig Anpassungen an seinem System, loslegen zu können. [siehe docker-buildenv](https://github.com/tuxbox-neutrino/docker-buildenv). In diesem Fall kann man gleich [mit der Initialisierung](#14-init-skript-ausführen) beginnen.
|
||||||
|
|
||||||
|
**HINWEIS:** [docker-buildenv](https://github.com/tuxbox-neutrino/docker-buildenv) löst die [Tuxbox-Builder](https://sourceforge.net/projects/n4k/files/Tuxbox-Builder)-VM komplett ab. Deren Wartung wird nicht mehr weitergeführt.
|
||||||
|
|
||||||
|
Hier angegebene Pfade basieren auf Vorgaben, die vom Init-Script erzeugt werden. Einige Einträge werden als ```<Platzhalter>``` dargestellt, die lokal angepasst werden müssen. [Siehe Schema](#14-init-skript-ausführen)
|
||||||
|
|
||||||
|
### 1.1 Erforderliche Host-Pakete installieren
|
||||||
|
|
||||||
|
**Hinweis:** Bei Verwendung anderer Distributionen siehe: [Yocto Project Quick Build](https://docs.yoctoproject.org/3.2.4/ref-manual/ref-system-requirements.html#supported-linux-distributions)
|
||||||
|
|
||||||
|
Debian 11
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential \
|
||||||
|
chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils \
|
||||||
|
iputils-ping python3-git python3-jinja2 libegl1-mesa pylint3 xterm subversion locales-all \
|
||||||
|
libxml2-utils ninja-build default-jre clisp libcapstone4 libsdl2-dev doxygen
|
||||||
|
```
|
||||||
|
|
||||||
|
Debian 12
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt-get install -y gawk wget git diffstat unzip texinfo gcc-multilib build-essential \
|
||||||
|
chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping \
|
||||||
|
python3-git python3-jinja2 libegl1-mesa pylint3 xterm subversion locales-all libxml2-utils \
|
||||||
|
ninja-build default-jre clisp libcapstone4 libsdl2-dev doxygen
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 1.1.1 Empfohlene Zusatzpakete zur grafischen Unterstützung und Analyse
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt-get install -y gitk git-gui meld cppcheck clazy kdevelop
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.2 Git vorbereiten (falls erforderlich)
|
||||||
|
|
||||||
|
Das init-Script verwendet Git zum Klonen der Meta-Layer Repositorys. Wenn noch kein konfiguriertes Git vorhanden ist, lege bitte Deine globalen Git-Benutzerdaten an, andernfalls wird während das Script durchläuft, unnötig darauf hingewiesen.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git config --global user.email "you@example.com"
|
||||||
|
git config --global user.name "Dein Name"
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.3 Init-Skript klonen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/tuxbox-neutrino/buildenv.git && cd buildenv
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.4 Init-Skript ausführen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./init && cd poky-3.2.4
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.5 Struktur der Buildumgebung
|
||||||
|
|
||||||
|
Nach [Schritt 1.4](#14-init-skript-ausführen) sollte etwa diese Struktur angelegt worden sein:
|
||||||
|
|
||||||
|
```
|
||||||
|
.buildenv
|
||||||
|
├── dist <-- Freigabeordner für http-Server (falls eingerichtet) http://localhost, http://localhost:8080 , benötigt für IPK-Feeds und Images
|
||||||
|
│ └── {DISTRO_VERSION} <-- hier liegen die erzeugten Images und Pakete (Symlinks zeigen auf die Deploy-Verzeichnisse innerhalb der Build-Unterverzeichnisse)
|
||||||
|
:
|
||||||
|
├── init.sh <-- init-Script
|
||||||
|
├── local.conf.common.inc <-- globale Benutzerkonfiguration, ist in die benutzerdefinierte Konfiguration inkluiert
|
||||||
|
:
|
||||||
|
├── log <-- Ordner für Logs, enthält Logs für jede Ausführung des Init-Scripts
|
||||||
|
:
|
||||||
|
└── poky-{DISTRO_VERSION} <-- Nach Schritt 1.4 befindest Du dich hier. Hier befindet sich der Buildsystem-Kern und die Meta-Layer
|
||||||
|
│
|
||||||
|
:
|
||||||
|
└── build <-- Hier liegen die Build-Unterverzeichnisse, nach Schritt 2.2 befindest Du dich in einem dieser Build-Unterverzeichnisse
|
||||||
|
├── <machine x> <-- Build-Unterverzeichnis für Maschinentyp x
|
||||||
|
│ ├── conf <-- Ordner für Layer und benutzerdefinierte Konfiguration
|
||||||
|
│ │ └── bblayers.conf <-- Konfigurationsdatei für eingebundene Meta-Layer
|
||||||
|
│ │ └── local.conf <-- benutzerdefinierte Konfiguration für einen Maschinentyp
|
||||||
|
│ :
|
||||||
|
│ ├── (tmp) <-- Arbeitsverzeichnis, wird beim Bauen automatisch angelegt
|
||||||
|
│ └── (workspace) <-- Workspace, wird beim Ausführen von devtool angelegt
|
||||||
|
:
|
||||||
|
└── <machine y> <-- weiteres Build-Unterverzeichnis für Maschinentyp y
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2. Image bauen
|
||||||
|
|
||||||
|
Stelle sicher, dass Du dich wie im [Schema](#15-struktur-der-buildumgebung) gezeigt hier befindest:
|
||||||
|
|
||||||
|
```
|
||||||
|
poky-{DISTRO_VERSION}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.1 Box wählen
|
||||||
|
|
||||||
|
Liste verfügbarer Geräte anzeigen lassen:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ls build
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.2 Starte Umgebungsskript
|
||||||
|
|
||||||
|
Führe das Umgebungsskript für die aus der Liste gewünschte Box einmalig aus! Du gelangst dann automatisch in das passende Build-Unterverzeichnis.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
. ./oe-init-build-env build/<machine>
|
||||||
|
```
|
||||||
|
|
||||||
|
Solange man sich ab jetzt mit der erzeugten Umgebung innerhalb der geöffneten Shell im gewünschten Build-Unterverzeichnis befindet, muss man dieses Script nicht noch einmal ausführen und kannst [Schritt 2.3 ](#23-image-erstellen) Images oder beliebige Pakete bauen.
|
||||||
|
|
||||||
|
**Hinweis:** Du kannst auch weitere Shells und damit Buildumgebungen für weitere Boxtypen parallel dazu anlegen und je nach Bedarf auf das entsprechende Terminal wechseln und auch parallel bauen lassen, sofern es dein System hergibt.
|
||||||
|
|
||||||
|
### 2.3 Image erstellen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake neutrino-image
|
||||||
|
```
|
||||||
|
|
||||||
|
Das kann eine Weile dauern. Einige Warnmeldungen können ignoriert werden. Fehlermeldungen, welche die Setscene-Tasks betreffen, sind kein Problem, aber Fehler während der Build- und Package-Tasks brechen den Prozess in den meisten Fällen ab. [Bitte melde in diesem Fall den Fehler oder teile Deine Lösung](https://forum.tuxbox-neutrino.org/forum/viewforum.php?f=77). Hilfe ist sehr willkommen.
|
||||||
|
|
||||||
|
Wenn alles erledigt ist, sollte eine ähnliche Meldung wie diese erscheinen:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
"NOTE: Tasks Summary: Attempted 4568 tasks of which 4198 didn't need to be rerun and all succeeded."
|
||||||
|
```
|
||||||
|
|
||||||
|
<span style="color: green;">Das war's ...</span>
|
||||||
|
|
||||||
|
Ergebnisse findest Du unter:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
buildenv/poky-{DISTRO_VERSION}/build/<machine>/tmp/deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
oder im Freigabe-Verzeichnis:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
buildenv/dist/<Image-Version>/<machine>/
|
||||||
|
```
|
||||||
|
|
||||||
|
Falls ein Webserver eingerichtet ist, der auf das Freigabe-Verzeichnis zeigt:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
http://localhost/{DISTRO_VERSION} oder mit Portnummer http://localhost:8080/{DISTRO_VERSION}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 3. Aktualisierung
|
||||||
|
|
||||||
|
Manuelle Aktualisierungen der Pakete sind nicht erforderlich. Dies wird automatisch bei jedem aufgerufenen Target mit Bitbake durchgeführt. Das gilt auch für mögliche Abhängigkeiten. Wenn man die volle Kontrolle über bestimmte Paket-Quellen haben möchte, kann man sich diese für jedes Paket im dafür vorgesehenen Workspace ablegen, siehe [4.4 Pakete](#44-pakete).
|
||||||
|
Sollten keine Aktualisierungen notwendig sein, werden die Builds automatisch übersprungen.
|
||||||
|
|
||||||
|
### 3.1 Image aktualisieren
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake neutrino-image
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.2 Paket aktualisieren
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake <package>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.3 Meta-Layer-Repositorys aktualisieren
|
||||||
|
|
||||||
|
Die Ausführung des Init-Skripts mit dem ```--update``` Parameter aktualisiert die enthaltenen Meta-Layer auf den Stand der Remote-Repositorys.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./init --update
|
||||||
|
```
|
||||||
|
|
||||||
|
Falls Du an den Meta-Layern Änderungen vorgenommen hast, sollten angestoßene Update-Routinen des Init-scripts nicht festgeschriebene Änderungen vorübergehend stashen bzw. auf das lokale Repository rebasen. Natürlich kann man seine lokalen Meta-Layer für Meta-Neutrino- und Maschinen-Layer-Repositorys manuell aktualisieren. Konflikte muss man jedoch immer manuell auflösen.
|
||||||
|
|
||||||
|
**Hinweis:** Konfigurationsdateien bleiben im Wesentlichen unberührt, aber mögliche Variablennamen werden migriert. Neue oder geänderte Einstellungen werden nicht geändert. Bitte überprüfe evtl. die Konfiguration.
|
||||||
|
|
||||||
|
## 4. Eigene Anpassungen
|
||||||
|
|
||||||
|
### 4.1 Konfiguration
|
||||||
|
|
||||||
|
Es wird empfohlen, zum ersten Mal ohne geänderte Konfigurationsdateien zu bauen, um einen Eindruck davon zu bekommen, wie der Build-Prozess funktioniert und um die Ergebnisse möglichst schnell zu sehen.
|
||||||
|
Die Einstellmöglichkeiten sind sehr umfangreich und für Einsteiger nicht wirklich überschaubar. OpenEmbedded insbesondere das Yocto-Project ist jedoch sehr
|
||||||
|
umfassend dokumentiert und bietet die beste Informationsquelle.
|
||||||
|
|
||||||
|
#### 4.1.1 Konfigurationsdateien
|
||||||
|
|
||||||
|
> ~/buildenv/poky-3.2.4/build/```<machine>```/conf/local.conf
|
||||||
|
|
||||||
|
Diese Datei befindet sich im Buildverzeichnis des jeweiligen Maschinentyps und ist die eigentliche benutzerdefinierte Konfigurationsdatei, welche ursprünglich vom Buildsystem dafür vorgesehen ist. Diese local.conf enthält in dieser Umgebung jedoch nur nur wenige Zeilen und inkludiert eine globale Konfiguration. Diese Datei ist **nur** für den von ihr unterstützten Maschinentyp gültig. Hier kann man deshalb ergänzende Einträge vornhemen, die entsprechend nur für den Maschinentyp vorgesehen sind. [Siehe auch Schema](#14-init-skript-ausführen)
|
||||||
|
|
||||||
|
> ~/buildenv/local.conf.common.inc
|
||||||
|
|
||||||
|
Diese Datei enthält Einstellungen, die für alle Maschinentypen zutreffen und wird bei erstmaligen ausführen des Init-Scripts aus der Vorlage ```~/buildenv/local.conf.common.inc.sample``` erzeugt.
|
||||||
|
|
||||||
|
Die vom Buildsystem vorgesehene ```./build/<machine>/conf/local.conf``` könnte man zwar so wie es ursprügliche vom Buildsystem vorgesehen ist als primäre Konfigurationsdatei für jeden Maschinentyp separat verwenden, aber das würde den Wartungsaufwand unnötig erhöhen. Deshalb ist ```~/buildenv/local.conf.common.inc``` nur in ```./build/<machine>/conf/local.conf``` inkludiert,
|
||||||
|
|
||||||
|
**Hinweis zu** ```~/buildenv/local.conf.common.inc.sample```**:** Dies ist nur eine Vorlage und sollte unberührt bleiben, um mögliche Konflikte beim Aktualisieren des Build-Script-Repositorys zu vermeiden und um zu sehen, was sich geändert haben könnte.
|
||||||
|
|
||||||
|
Nach einer Aktualisierung des Build-Script-Repositorys könnten neue oder geänderte Optionen hinzugefügt oder entfernt worden sein, die nicht in die inkludierte Konfigurationsdatei übernommen werden. Diesen Fall sollte man in der eigenen Konfiguration berücksichtigen und falls erforderlich prüfen und anpassen.
|
||||||
|
|
||||||
|
#### 4.1.2 bblayers.conf
|
||||||
|
|
||||||
|
> ~/buildenv/poky-3.2.4/build/```<machine>```/conf/bblayers.conf
|
||||||
|
|
||||||
|
Diese Datei wird normalerweise beim erstmaligen ausführen des Init-Skripts angepasst und braucht in der Regel nur angepasst zu werden, wenn man Layer hinzufügen, entfernen oder ersetzen möchte.
|
||||||
|
|
||||||
|
#### 4.1.3 Konfiguration zurücksetzen
|
||||||
|
|
||||||
|
Wenn Du deine Maschinen-Konfigurationen zurücksetzen möchtest, benenne bitte das conf-Verzeichnis um (Löschen wird nicht empfohlen) und führe das Init-Skript erneut aus.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
~/mv ~/buildenv/poky-3.2.4/build/<machine>/conf ~/buildenv/poky-3.2.4/build/<machine>/conf.01
|
||||||
|
~/cd ~/buildenv
|
||||||
|
~/./init
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.3 Recipes
|
||||||
|
|
||||||
|
**Sofern man nicht direkt an der Entwicklung der Poky-Ebenen beiteiligt ist, ändere nichts an den offiziellen Poky-Ebenen (Meta-Layer)! Dies wird vom Yocto-Projekt ausdrücklich nicht empfohlen, da man Gefahr läuft, bei Aktualisierungen, seine gesamte Arbeit zu verlieren und Inkompatibilitäten oder Konflikte schafft, die nur schwer zu warten sein können. Die übliche Vorgehensweise, um vorhandene offizielle Rezepte zu vervollständigen, zu erweitern oder zu überschreiben, ist die [Verwendung von .bbappend](https://docs.yoctoproject.org/3.2.4/dev-manual/dev-manual-common-tasks.html#using-bbappend-files-in-your-layer)-Dateien.**
|
||||||
|
|
||||||
|
Alternativ, allerdings auch nicht wirklich empfehlenswert, könnte man Kopien von offiziellen Reciepes in seine eigenen Meta-Layer übernehmen und anpassen, da diese dann in der Regel vom Buildsystem bevorzugt werden. In solch einem Fall ist man allerdings selbst dafür verantwortlich, diese Recipes aktuell zu halten, was den Wartungsaufwand allerdings unnötig erhöhen kann.
|
||||||
|
|
||||||
|
Für Rezepte aus den eigenen Meta-Layern wie z.B. meta-neutrino oder den Maschinen-Layern, gilt das prinzipiell genauso. Wer aber [aktiv an den Recipes mitarbeiten](https://docs.yoctoproject.org/current/ref-manual/devtool-reference.html#modifying-an-existing-recipe) möchte, kann dies gerne tun.
|
||||||
|
|
||||||
|
### 4.4 Pakete
|
||||||
|
|
||||||
|
Wenn man die volle Kontrolle über einen Paket-Quellcode haben möchte, um z.B. etwas zu fixen oder aktiv zu entwickeln, sollte der Quellcode an dem man arbeiten möchte in den Workspace verschoben werden. Siehe: [Beispiel für Neutrino](#441-quellcode-im-workspace-bearbeiten-beispiel)
|
||||||
|
|
||||||
|
Siehe [devtool](https://docs.yoctoproject.org/current/ref-manual/devtool-reference.html) und insbesondere [devtool modify](https://docs.yoctoproject.org/current/ref-manual/devtool-reference.html#modifying-an-existing-recipe). Im Workspace hat man die Garantie, dass der Quellcode nicht vom Buildsystem angefasst wird. Beachtet man das nicht, kann es z.B. vorkommen, dass geänderter Quellcode immer wieder gelöscht oder modifiziert wird. Eigene Anpassungen können daher verloren gehen oder inkompatibel werden. In der lokalen Standardkonfiguration ist [rm_work](https://docs.yoctoproject.org/ref-manual/classes.html#ref-classes-rm-work) aktiviert, was dafür sorgt, dass nach jedem abgeschlossenem Bau eines Pakets, das jeweilige Arbeitsverzeichnis aufgeräumt wird, so dass ausser einigen Logs nichts übrig bleiben wird.
|
||||||
|
|
||||||
|
#### 4.4.1 Quellcode im Workspace bearbeiten (Beispiel)
|
||||||
|
|
||||||
|
Hier wird beispielhaft Neutrino verwendet, aber diese Vorgehensweise trifft im Wesentlichen auf alle anderen Pakete zu.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
~/buildenv/poky-3.2.4/build/hd61$ devtool modify neutrino
|
||||||
|
NOTE: Starting bitbake server...54cf81d24c147d888c"
|
||||||
|
...
|
||||||
|
workspace = "3.2.4:13143ea85a1ab7703825c0673128c05845b96cb5"
|
||||||
|
|
||||||
|
Initialising tasks: 100% |###################################################################################################################################################################################################| Time: 0:00:01
|
||||||
|
Sstate summary: Wanted 0 Found 0 Missed 0 Current 10 (0% match, 100% complete)
|
||||||
|
NOTE: Executing Tasks
|
||||||
|
NOTE: Tasks Summary: Attempted 83 tasks of which 80 didn't need to be rerun and all succeeded.
|
||||||
|
INFO: Adding local source files to srctree...
|
||||||
|
INFO: Source tree extracted to /home/<user>/buildenv/poky-3.2.4/build/hd61/workspace/sources/neutrino
|
||||||
|
INFO: Recipe neutrino-mp now set up to build from /home/<user>/buildenv/poky-3.2.4/build/hd61/workspace/sources/neutrino
|
||||||
|
```
|
||||||
|
|
||||||
|
Unter ```/buildenv/poky-3.2.4/build/hd61/workspace/sources/neutrino``` befindet sich jetzt der Quellcode für Neutrino. Dort kann man dann daran arbeiten. Das bedeutet, dass das Buildsystem nicht mehr von sich aus vom Remote Git-Repo die Neutrino-Quellen klont bzw. automatisch aktalisiert, sondern ab jetzt nur noch die lokalen Quellen innerhalb des Workspace nutzt, die man selbst verwalten muss. Dabei handelt es sich um ein von devtool angelegtes Git-Repo, in welches man an das Original-Remote-Repository einbinden kann, sofern dies nicht bereits der Fall ist.
|
||||||
|
|
||||||
|
Führt man jetzt das aus...
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake neutrino
|
||||||
|
```
|
||||||
|
|
||||||
|
...wird Neutrino ab sofort nur noch vom lokalen Repo im Workspace gebaut werden:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
NOTE: Started PRServer with DBfile: /home/<user>/buildenv/poky-3.2.4/build/hd61/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 34211, PID: 56838
|
||||||
|
...
|
||||||
|
workspace = "3.2.4:13143ea85a1ab7703825c0673128c05845b96cb5"
|
||||||
|
|
||||||
|
Initialising tasks: 100% |###################################################################################################################################################################################################| Time: 0:00:01
|
||||||
|
Sstate summary: Wanted 122 Found 116 Missed 6 Current 818 (95% match, 99% complete)
|
||||||
|
NOTE: Executing Tasks
|
||||||
|
NOTE: neutrino-mp: compiling from external source tree /home/<user>/buildenv/poky-3.2.4/build/hd61/workspace/sources/neutrino
|
||||||
|
NOTE: Tasks Summary: Attempted 2756 tasks of which 2741 didn't need to be rerun and all succeeded.
|
||||||
|
```
|
||||||
|
|
||||||
|
**Hinweis!** Im speziellen Fall von Neutrino, ist es ratsam nicht nur dessen Quellcode, sondern auch die zugehörige ```libstb-hal``` in den Workspace zu übertragen.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
devtool modify libstb-hal
|
||||||
|
```
|
||||||
|
|
||||||
|
## 5. Neubau eines einzelnen Pakets erzwingen
|
||||||
|
|
||||||
|
In einigen Fällen kann es vorkommen, dass ein Target, warum auch immer, abbricht. Man sollte deshalb aber keinesfalls in Panik verfallen und deswegen den Arbeitsordner und den teueren sstate-cache löschen. Bereinigungen kann man für jedes Target einzeln vornehmen, ohne ein ansonsten funktionierendes System platt zu machen.
|
||||||
|
|
||||||
|
Insbesondere defekte Archiv-URLs können zum Abbruch führen. Diese Fehler werden aber immer angezeigt und man kann die URL überprüfen. Oft liegt es nur an den Servern und funktionieren nach wenigen Minuten sogar wieder.
|
||||||
|
|
||||||
|
Um sicherzustellen, ob das betreffende Recipe auch tatsächlich ein Problem hat, macht es Sinn das betreffende Target komplett zu bereinigen und neu zu bauen. Um dies zu erreichen, müssen alle zugehörigen Paket-, Build- und Cachedaten bereinigt werden.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake -c cleansstate <target>
|
||||||
|
|
||||||
|
```
|
||||||
|
anschließend neu bauen:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake <target>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 6. Vollständigen Imagebau erzwingen
|
||||||
|
|
||||||
|
Das Init-Skript stellt dafür die Option `--reset` zur Verfügung.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./init --reset
|
||||||
|
# Follow instructions
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Manuell erreichst Du das ebenfalls, indem man das tmp-Verzeichnis im jeweiligem Build-Unterverzeichnis manuell umbenennt. Löschen kann man es nachträglich, wenn man Speicherplatz freigeben will oder sich sicher ist, dass man das Verzeichnis nicht mehr braucht:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mv tmp tmp.01
|
||||||
|
```
|
||||||
|
|
||||||
|
Anschließend das Image neu bauen lassen:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake neutrino-image
|
||||||
|
```
|
||||||
|
|
||||||
|
Wenn man den Cache **nicht** gelöscht hat, sollte das Image in relativ kurzer Zeit fertig gebaut sein. Gerade deshalb wird empfohlen, den Cache beizubehalten. Das Verzeichnis wo sich der Cache befindet, wird über die Variable ```${SSTATE_DIR}``` festgelegt und kann in der Konfiguration angepasst werden.
|
||||||
|
|
||||||
|
Dieses Verzeichnis ist ziemlich wertvoll und nur in seltenen Fällen ist es notwendig, dieses Verzeichnis zu löschen. Bitte beachte, dass der Buildvorgang nach dem Löschen des Cache sehr viel mehr Zeit in Anspruch nimmt.
|
||||||
|
|
||||||
|
## 7. Lizenz
|
||||||
|
|
||||||
|
```
|
||||||
|
MIT License
|
||||||
|
```
|
||||||
|
|
||||||
|
## 8. Weiterführende Informationen
|
||||||
|
|
||||||
|
Weitere Informationen zum Yocto Buildsystem:
|
||||||
|
|
||||||
|
* https://docs.yoctoproject.org
|
374
README_en.md
Normal file
374
README_en.md
Normal file
@@ -0,0 +1,374 @@
|
|||||||
|
<!-- LANGUAGE_LINKS_START -->
|
||||||
|
[🇩🇪 German](README_de.md) | <span style="color: grey;">🇬🇧 English</span>
|
||||||
|
<!-- LANGUAGE_LINKS_END -->
|
||||||
|
|
||||||
|
This script serves as a tool to simplify setting up a development environment and the build process for images that run with Neutrino as the user interface on various hardware platforms. It automates several steps required to establish a consistent and functional development and build environment by preconfiguring necessary dependencies, basic configurations, and meta-layers, while allowing for custom settings. The script aims to provide a foundation on which you can build and experiment to create, update, and maintain your own customized versions of Tuxbox-Neutrino images.
|
||||||
|
|
||||||
|
* [1. Preparation](#1-preparation)
|
||||||
|
|
||||||
|
* [1.1 Install Required Host Packages](#11-install-required-host-packages)
|
||||||
|
|
||||||
|
* [1.1.1 Recommended Additional Packages for Graphical Support and Analysis](#111-recommended-additional-packages-for-graphical-support-and-analysis)
|
||||||
|
* [1.2 Prepare Git (if necessary)](#12-prepare-git-if-necessary)
|
||||||
|
* [1.3 Clone Init Script](#13-clone-init-script)
|
||||||
|
* [1.4 Run Init Script](#14-run-init-script)
|
||||||
|
* [1.5 Build Environment Structure](#15-build-environment-structure)
|
||||||
|
* [2. Building an Image](#2-building-an-image)
|
||||||
|
|
||||||
|
* [2.1 Choose a Box](#21-choose-a-box)
|
||||||
|
* [2.2 Start the Environment Script](#22-start-the-environment-script)
|
||||||
|
* [2.3 Create the Image](#23-create-the-image)
|
||||||
|
* [3. Updates](#3-updates)
|
||||||
|
|
||||||
|
* [3.1 Update Image](#31-update-image)
|
||||||
|
* [3.2 Update Package](#32-update-package)
|
||||||
|
* [3.3 Update Meta-Layer Repositories](#33-update-meta-layer-repositories)
|
||||||
|
* [4. Customizations](#4-customizations)
|
||||||
|
|
||||||
|
* [4.1 Configuration](#41-configuration)
|
||||||
|
|
||||||
|
* [4.1.1 Configuration Files](#411-configuration-files)
|
||||||
|
* [4.1.2 bblayers.conf](#412-bblayersconf)
|
||||||
|
* [4.1.3 Resetting Configuration](#413-resetting-configuration)
|
||||||
|
* [4.3 Recipes](#43-recipes)
|
||||||
|
* [4.4 Packages](#44-packages)
|
||||||
|
|
||||||
|
* [4.4.1 Editing Source Code in the Workspace (Example)](#441-editing-source-code-in-the-workspace-example)
|
||||||
|
* [5. Forcing a Rebuild of a Single Package](#5-forcing-a-rebuild-of-a-single-package)
|
||||||
|
* [6. Forcing a Full Image Rebuild](#6-forcing-a-full-image-rebuild)
|
||||||
|
* [7. License](#7-license)
|
||||||
|
* [8. Further Information](#8-further-information)
|
||||||
|
|
||||||
|
## 1. Preparation
|
||||||
|
|
||||||
|
At this point, it is recommended to use the provided Docker container, as it already covers essential steps needed to get started with minimal changes to your system. [See docker-buildenv](https://github.com/tuxbox-neutrino/docker-buildenv). In this case, you can jump straight to [running the initialization](#14-run-init-script).
|
||||||
|
|
||||||
|
**NOTE:** [docker-buildenv](https://github.com/tuxbox-neutrino/docker-buildenv) fully replaces the [Tuxbox-Builder](https://sourceforge.net/projects/n4k/files/Tuxbox-Builder) VM, which is no longer maintained.
|
||||||
|
|
||||||
|
The paths shown here are based on those generated by the init script. Some entries appear as `<placeholder>` and need to be adjusted locally. [See schema](#14-run-init-script).
|
||||||
|
|
||||||
|
### 1.1 Install Required Host Packages
|
||||||
|
|
||||||
|
**Note:** If you are using other distributions, see: [Yocto Project Quick Build](https://docs.yoctoproject.org/3.2.4/ref-manual/ref-system-requirements.html#supported-linux-distributions)
|
||||||
|
|
||||||
|
**Debian 11**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential \
|
||||||
|
chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils \
|
||||||
|
iputils-ping python3-git python3-jinja2 libegl1-mesa pylint3 xterm subversion locales-all \
|
||||||
|
libxml2-utils ninja-build default-jre clisp libcapstone4 libsdl2-dev doxygen
|
||||||
|
```
|
||||||
|
|
||||||
|
**Debian 12**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt-get install -y gawk wget git diffstat unzip texinfo gcc-multilib build-essential \
|
||||||
|
chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping \
|
||||||
|
python3-git python3-jinja2 libegl1-mesa pylint3 xterm subversion locales-all libxml2-utils \
|
||||||
|
ninja-build default-jre clisp libcapstone4 libsdl2-dev doxygen
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 1.1.1 Recommended Additional Packages for Graphical Support and Analysis
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt-get install -y gitk git-gui meld cppcheck clazy kdevelop
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.2 Prepare Git (if necessary)
|
||||||
|
|
||||||
|
The init script uses Git to clone the meta-layer repositories. If you don’t have Git configured yet, please set up your global Git user data; otherwise, you’ll get unnecessary warnings while the script runs.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git config --global user.email "you@example.com"
|
||||||
|
git config --global user.name "Your Name"
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.3 Clone Init Script
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/tuxbox-neutrino/buildenv.git && cd buildenv
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.4 Run Init Script
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./init && cd poky-3.2.4
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1.5 Build Environment Structure
|
||||||
|
|
||||||
|
After [step 1.4](#14-run-init-script), you should see a structure similar to this:
|
||||||
|
|
||||||
|
```
|
||||||
|
.buildenv
|
||||||
|
├── dist <-- Shared folder for HTTP server (if set up) http://localhost, http://localhost:8080, needed for IPK feeds and images
|
||||||
|
│ └── {DISTRO_VERSION} <-- Contains generated images and packages (symlinks to the deploy dirs inside build subdirectories)
|
||||||
|
:
|
||||||
|
├── init.sh <-- init script
|
||||||
|
├── local.conf.common.inc <-- global user configuration, included in custom config
|
||||||
|
:
|
||||||
|
├── log <-- folder for logs, contains logs for each init script run
|
||||||
|
:
|
||||||
|
└── poky-{DISTRO_VERSION} <-- After step 1.4 you’ll be here. Contains the build system core and meta-layers
|
||||||
|
│
|
||||||
|
:
|
||||||
|
└── build <-- Build subdirectories; after step 2.2 you’ll be inside one of these
|
||||||
|
├── <machine x> <-- Build dir for machine type x
|
||||||
|
│ ├── conf <-- Folder for layers and custom config
|
||||||
|
│ │ └── bblayers.conf <-- Config for included meta-layers
|
||||||
|
│ │ └── local.conf <-- Custom config for one machine type
|
||||||
|
│ :
|
||||||
|
│ ├── (tmp) <-- Work dir, auto-created during build
|
||||||
|
│ └── (workspace) <-- Workspace, created when running devtool
|
||||||
|
:
|
||||||
|
└── <machine y> <-- Another build dir for machine type y
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2. Building an Image
|
||||||
|
|
||||||
|
Make sure you are in the directory shown in the [schema](#15-build-environment-structure):
|
||||||
|
|
||||||
|
```
|
||||||
|
poky-{DISTRO_VERSION}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.1 Choose a Box
|
||||||
|
|
||||||
|
List available devices:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ls build
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.2 Start the Environment Script
|
||||||
|
|
||||||
|
Run the environment script for the desired box from the list once! You will be placed into the corresponding build subdirectory.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
. ./oe-init-build-env build/<machine>
|
||||||
|
```
|
||||||
|
|
||||||
|
From now on, as long as you remain in the generated environment within the open shell in the chosen build subdirectory, you don’t need to re-run this script and can go straight to [step 2.3](#23-create-the-image) to build images or any packages.
|
||||||
|
|
||||||
|
**Note:** You can also open additional shells and thus create parallel build environments for other box types, switching to the appropriate terminal as needed and even building in parallel, provided your system can handle it.
|
||||||
|
|
||||||
|
### 2.3 Create the Image
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake neutrino-image
|
||||||
|
```
|
||||||
|
|
||||||
|
This can take a while. Some warnings can be ignored. Errors related to setscene tasks are usually harmless, but build and package task errors typically abort the process. [Please report the error or share your solution](https://forum.tuxbox-neutrino.org/forum/viewforum.php?f=77). Help is always welcome.
|
||||||
|
|
||||||
|
When done, you should see a message like this:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
NOTE: Tasks Summary: Attempted 4568 tasks of which 4198 didn't need to be rerun and all succeeded.
|
||||||
|
```
|
||||||
|
|
||||||
|
<span style="color: green;">That’s it...</span>
|
||||||
|
|
||||||
|
Results can be found under:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
buildenv/poky-{DISTRO_VERSION}/build/<machine>/tmp/deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
or in the shared directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
buildenv/dist/<Image-Version>/<machine>/
|
||||||
|
```
|
||||||
|
|
||||||
|
If you have a web server pointing to the shared directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
http://localhost/{DISTRO_VERSION} or with port number http://localhost:8080/{DISTRO_VERSION}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 3. Updates
|
||||||
|
|
||||||
|
Manual package updates are not required. These are handled automatically on every bitbake invocation, including dependencies. If you want full control over certain package sources, you can place them in the workspace for each package; see [4.4 Packages](#44-packages).
|
||||||
|
|
||||||
|
If no updates are needed, builds are skipped automatically.
|
||||||
|
|
||||||
|
### 3.1 Update Image
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake neutrino-image
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.2 Update Package
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake <package>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.3 Update Meta-Layer Repositories
|
||||||
|
|
||||||
|
Running the init script with the `--update` parameter updates the included meta-layers to the state of their remote repositories.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./init --update
|
||||||
|
```
|
||||||
|
|
||||||
|
If you have made changes to the meta-layers, the init script’s update routines should temporarily stash or rebase unstashed changes on the local repositories. Of course, you can manually update your local meta-layers for meta-neutrino and machine-layer repos, but you must resolve any conflicts manually.
|
||||||
|
|
||||||
|
**Note:** Configuration files remain mostly untouched, but variable names may be migrated. New or changed settings are not auto-updated. Please review your configuration if necessary.
|
||||||
|
|
||||||
|
## 4. Customizations
|
||||||
|
|
||||||
|
### 4.1 Configuration
|
||||||
|
|
||||||
|
It is recommended to build for the first time without modified configuration files to get a feel for the build process and see results quickly. The configuration options are extensive and not easy for beginners to grasp. However, OpenEmbedded and the Yocto Project are thoroughly documented and provide the best information source.
|
||||||
|
|
||||||
|
#### 4.1.1 Configuration Files
|
||||||
|
|
||||||
|
> \~/buildenv/poky-3.2.4/build/`<machine>`/conf/local.conf
|
||||||
|
|
||||||
|
This file, located in the build directory for each machine type, is the actual user configuration file intended by the build system. In this environment, it contains only a few lines and includes a global configuration. This file is **only** valid for its specific machine type. You can add entries here that apply only to that machine type. [See schema](#14-run-init-script)
|
||||||
|
|
||||||
|
> \~/buildenv/local.conf.common.inc
|
||||||
|
|
||||||
|
This file holds settings that apply to all machine types and is generated from the template `~/buildenv/local.conf.common.inc.sample` on the first run of the init script.
|
||||||
|
|
||||||
|
Although you could use the build system’s intended `./build/<machine>/conf/local.conf` as the primary config file for each machine separately, this would increase maintenance overhead. Hence, `~/buildenv/local.conf.common.inc` is only included in `./build/<machine>/conf/local.conf`.
|
||||||
|
|
||||||
|
**Note on** `~/buildenv/local.conf.common.inc.sample`**:** This is a template and should remain untouched to avoid conflicts when updating the build-script repository and to see what has changed.
|
||||||
|
|
||||||
|
After updating the build-script repository, new or changed options may have been added or removed and not merged into your included config file. You should consider these cases and review and adjust your configuration if necessary.
|
||||||
|
|
||||||
|
#### 4.1.2 bblayers.conf
|
||||||
|
|
||||||
|
> \~/buildenv/poky-3.2.4/build/`<machine>`/conf/bblayers.conf
|
||||||
|
|
||||||
|
This file is usually adjusted on the first run of the init script and typically only needs changes when you want to add, remove, or replace layers.
|
||||||
|
|
||||||
|
#### 4.1.3 Resetting Configuration
|
||||||
|
|
||||||
|
If you want to reset your machine configurations, rename (rather than delete) the conf directory and rerun the init script.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mv ~/buildenv/poky-3.2.4/build/<machine>/conf ~/buildenv/poky-3.2.4/build/<machine>/conf.backup
|
||||||
|
cd ~/buildenv
|
||||||
|
./init
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.3 Recipes
|
||||||
|
|
||||||
|
**Unless you are directly contributing to Poky layers, do not modify the official Poky layers (meta-layers)!** The Yocto Project strongly discourages this practice, as you risk losing your work during updates and creating hard-to-maintain conflicts.
|
||||||
|
|
||||||
|
The usual way to extend or override existing recipes is with `.bbappend` files. [Learn more](https://docs.yoctoproject.org/3.2.4/dev-manual/dev-manual-common-tasks.html#using-bbappend-files-in-your-layer).
|
||||||
|
|
||||||
|
Alternatively (though also not recommended), you could copy official recipes into your own meta-layers and modify them, in which case you are responsible for keeping them up to date, increasing maintenance overhead.
|
||||||
|
|
||||||
|
The same principle applies to your own meta-layers like meta-neutrino or machine layers. If you want to actively work on recipes, feel free to [contribute](https://docs.yoctoproject.org/current/ref-manual/devtool-reference.html#modifying-an-existing-recipe).
|
||||||
|
|
||||||
|
### 4.4 Packages
|
||||||
|
|
||||||
|
If you want full control over a package’s source code (e.g., to fix or actively develop something), move the source you want to work on into the workspace. See the Neutrino example below.
|
||||||
|
|
||||||
|
See [devtool](https://docs.yoctoproject.org/current/ref-manual/devtool-reference.html) and especially [devtool modify](https://docs.yoctoproject.org/current/ref-manual/devtool-reference.html#modifying-an-existing-recipe). In the workspace, you’re guaranteed that the build system won’t touch the source. If you ignore this, you might find your changes repeatedly cleaned or overridden, losing or rendering them incompatible. In the default local config, [rm\_work](https://docs.yoctoproject.org/ref-manual/classes.html#ref-classes-rm-work) is enabled, which cleans each package’s work directory after build, leaving only logs.
|
||||||
|
|
||||||
|
#### 4.4.1 Editing Source Code in the Workspace (Example)
|
||||||
|
|
||||||
|
This example uses Neutrino, but the procedure applies to most packages.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
~/buildenv/poky-3.2.4/build/hd61$ devtool modify neutrino
|
||||||
|
NOTE: Starting bitbake server...54cf81d24c147d888c"
|
||||||
|
...
|
||||||
|
workspace = "3.2.4:13143ea85a1ab7703825c0673128c05845b96cb5"
|
||||||
|
|
||||||
|
Initialising tasks: 100% |########################################################################################################| Time: 0:00:01
|
||||||
|
Sstate summary: Wanted 0 Found 0 Missed 0 Current 10 (0% match, 100% complete)
|
||||||
|
NOTE: Executing Tasks
|
||||||
|
NOTE: Tasks Summary: Attempted 83 tasks of which 80 didn't need to be rerun and all succeeded.
|
||||||
|
INFO: Adding local source files to srctree...
|
||||||
|
INFO: Source tree extracted to /home/<user>/buildenv/poky-3.2.4/build/hd61/workspace/sources/neutrino
|
||||||
|
INFO: Recipe neutrino-mp now set up to build from /home/<user>/buildenv/poky-3.2.4/build/hd61/workspace/sources/neutrino
|
||||||
|
```
|
||||||
|
|
||||||
|
The Neutrino source code is now in `/buildenv/poky-3.2.4/build/hd61/workspace/sources/neutrino`. You can work on it there. From now on, the build system will not clone Neutrino from the remote Git repo but will use only your local workspace sources, managed by you.
|
||||||
|
|
||||||
|
When you run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake neutrino
|
||||||
|
```
|
||||||
|
|
||||||
|
... Neutrino will build from the local workspace repo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
NOTE: Started PRServer with DBfile: /home/<user>/buildenv/poky-3.2.4/build/hd61/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 34211, PID: 56838
|
||||||
|
...
|
||||||
|
workspace = "3.2.4:13143ea85a1ab7703825c0673128c05845b96cb5"
|
||||||
|
|
||||||
|
Initialising tasks: 100% |########################################################################################################| Time: 0:00:01
|
||||||
|
Sstate summary: Wanted 122 Found 116 Missed 6 Current 818 (95% match, 99% complete)
|
||||||
|
NOTE: Executing Tasks
|
||||||
|
NOTE: neutrino-mp: compiling from external source tree /home/<user>/buildenv/poky-3.2.4/build/hd61/workspace/sources/neutrino
|
||||||
|
NOTE: Tasks Summary: Attempted 2756 tasks of which 2741 didn't need to be rerun and all succeeded.
|
||||||
|
```
|
||||||
|
|
||||||
|
**Tip:** For Neutrino, it’s also recommended to transfer the associated `libstb-hal` to the workspace:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
devtool modify libstb-hal
|
||||||
|
```
|
||||||
|
|
||||||
|
## 5. Forcing a Rebuild of a Single Package
|
||||||
|
|
||||||
|
Sometimes a target fails for unknown reasons. Avoid panicking and wiping your workspace or sstate cache. You can clean up a specific target without breaking everything else.
|
||||||
|
|
||||||
|
Broken archive URLs often cause failures. These errors are shown, and you can verify the URL. They often resolve after a few minutes.
|
||||||
|
|
||||||
|
To ensure a recipe actually has an issue, clean and rebuild the entire target’s data:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake -c cleansstate <target>
|
||||||
|
```
|
||||||
|
|
||||||
|
Then rebuild:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake <target>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 6. Forcing a Full Image Rebuild
|
||||||
|
|
||||||
|
The init script provides the `--reset` option:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./init --reset
|
||||||
|
# Follow instructions
|
||||||
|
```
|
||||||
|
|
||||||
|
Manually, rename the tmp directory in the respective build subdirectory. You can delete it later to free space if you’re sure you don’t need it:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mv tmp tmp.backup
|
||||||
|
```
|
||||||
|
|
||||||
|
Then rebuild the image:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bitbake neutrino-image
|
||||||
|
```
|
||||||
|
|
||||||
|
If you haven’t deleted the cache, the image should finish relatively quickly. That’s why retaining the cache is recommended. The cache directory is defined by `${SSTATE_DIR}` and can be customized in the configuration.
|
||||||
|
|
||||||
|
This directory is valuable, and deleting it is rarely needed. Note that builds take much longer after deleting the cache.
|
||||||
|
|
||||||
|
## 7. License
|
||||||
|
|
||||||
|
```
|
||||||
|
MIT License
|
||||||
|
```
|
||||||
|
|
||||||
|
## 8. Further Information
|
||||||
|
|
||||||
|
More information on the Yocto build system:
|
||||||
|
|
||||||
|
* [https://docs.yoctoproject.org](https://docs.yoctoproject.org)
|
@@ -1,53 +1,75 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# function for checking of valid machine(s)
|
## Function to replace the echo command
|
||||||
function is_valid_machine ()
|
function my_echo() {
|
||||||
{
|
local no_term_output="$1"
|
||||||
ISM=$1
|
# Clean up text
|
||||||
for M in $MACHINES ; do
|
if [ "$no_term_output" == "true" ]; then
|
||||||
if [ "$ISM" == "$M" ] || [ "$MACHINE" == "all" ]; then
|
shift
|
||||||
echo true
|
fi
|
||||||
return 1
|
local cleaned_output
|
||||||
|
cleaned_output=$(echo -e "${@}" | sed -r "s/\x1B\[[0-9;]*[a-zA-Z]//g")
|
||||||
|
# Write to log
|
||||||
|
echo "[ $(date '+%Y-%m-%d %H:%M:%S') ] - ${cleaned_output}" >> "$LOGFILE"
|
||||||
|
# Show on terminal
|
||||||
|
if [[ "$no_term_output" != "true" && -t 1 ]]; then
|
||||||
|
echo -e "${@}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
## Function to check if a machine is valid
|
||||||
|
# Returns 0 if valid, 1 if not.
|
||||||
|
function is_valid_machine() {
|
||||||
|
local machine_to_check="$1"
|
||||||
|
for m in $MACHINES; do
|
||||||
|
if [[ "$machine_to_check" == "$m" || "$MACHINE" == "all" ]]; then
|
||||||
|
return 0 # valid
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo false
|
return 1 # not valid
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function do_exec() {
|
function do_exec() {
|
||||||
DEX_ARG1=$1
|
local cmd="$1"
|
||||||
DEX_ARG2=$2
|
local exit_behavior="$2"
|
||||||
DEX_ARG3=$3
|
local show_output="$3"
|
||||||
# rm -f $TMP_LOGFILE
|
local log_text
|
||||||
echo "[`date '+%Y%m%d_%H%M%S'`] EXEC: $DEX_ARG1" >> $LOGFILE
|
local cmd_exit_status
|
||||||
if [ "$DEX_ARG3" == "show_output" ]; then
|
|
||||||
$DEX_ARG1
|
my_echo true "[EXEC] $cmd"
|
||||||
|
|
||||||
|
# Execute the command
|
||||||
|
if [[ "$show_output" == "show_output" ]]; then
|
||||||
|
eval $cmd 2>> "$TMP_LOGFILE"
|
||||||
else
|
else
|
||||||
$DEX_ARG1 > /dev/null 2>> $TMP_LOGFILE
|
eval $cmd > /dev/null 2>> "$TMP_LOGFILE"
|
||||||
fi
|
fi
|
||||||
# echo -e "DEX_ARG1 [$DEX_ARG1] DEX_ARG2 [$DEX_ARG2] DEX_ARG3 [$DEX_ARG3]"
|
|
||||||
if test -f $TMP_LOGFILE; then
|
cmd_exit_status=${PIPESTATUS[0]} # Get exit status of the first command in the last pipe
|
||||||
LOGTEXT=`cat $TMP_LOGFILE`
|
|
||||||
echo > $TMP_LOGFILE
|
if [[ -f "$TMP_LOGFILE" ]]; then
|
||||||
|
log_text=$(cat "$TMP_LOGFILE")
|
||||||
|
: > "$TMP_LOGFILE" # Clear TMP_LOGFILE after reading
|
||||||
fi
|
fi
|
||||||
if [ $? != 0 ]; then
|
|
||||||
if [ "$DEX_ARG2" != "no_exit" ]; then
|
if [[ $cmd_exit_status -ne 0 ]]; then
|
||||||
if [ "$LOGTEXT" != "" ]; then
|
if [[ "$exit_behavior" != "no_exit" ]]; then
|
||||||
echo -e "\033[31;1mERROR:\t\033[0m $LOGTEXT"
|
if [[ -n "$log_text" ]]; then
|
||||||
echo "ERROR: $LOGTEXT" >> $LOGFILE
|
my_echo -e "\033[31;1mERROR:\033[0m $log_text"
|
||||||
|
my_echo "ERROR: $log_text" >> "$LOGFILE"
|
||||||
fi
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
if [ "$LOGTEXT" != "" ]; then
|
if [[ -n "$log_text" ]]; then
|
||||||
echo -e "\033[37;1mNOTE:\t\033[0m $LOGTEXT"
|
my_echo -e "\033[37;1mNOTE:\033[0m $log_text"
|
||||||
echo "NOTE: $LOGTEXT" >> $LOGFILE
|
my_echo "NOTE: $log_text" >> "$LOGFILE"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_metaname () {
|
function get_metaname() {
|
||||||
TMP_NAME=$1
|
local TMP_NAME="$1"
|
||||||
|
|
||||||
if [ "$TMP_NAME" == "hd51" ] || [ "$TMP_NAME" == "bre2ze4k" ] || [ "$TMP_NAME" == "mutant51" ] || [ "$TMP_NAME" == "ax51" ]; then
|
if [ "$TMP_NAME" == "hd51" ] || [ "$TMP_NAME" == "bre2ze4k" ] || [ "$TMP_NAME" == "mutant51" ] || [ "$TMP_NAME" == "ax51" ]; then
|
||||||
META_NAME="gfutures"
|
META_NAME="gfutures"
|
||||||
@@ -60,274 +82,382 @@ function get_metaname () {
|
|||||||
elif [ "$TMP_NAME" == "e4hdultra" ]; then
|
elif [ "$TMP_NAME" == "e4hdultra" ]; then
|
||||||
META_NAME="ceryon"
|
META_NAME="ceryon"
|
||||||
else
|
else
|
||||||
META_NAME=$TMP_NAME
|
META_NAME="$TMP_NAME"
|
||||||
fi
|
fi
|
||||||
echo "$META_NAME"
|
echo "$META_NAME"
|
||||||
}
|
}
|
||||||
|
|
||||||
# clone or update required branch for required meta-<layer>
|
## Function to apply a patch using git apply with check and commit
|
||||||
function clone_meta () {
|
# Parameters:
|
||||||
|
# $1: target_git_path (Path to the Git repository)
|
||||||
|
# $2: patch_file (Name of the patch file located in $FILES_DIR)
|
||||||
|
# $3: layer_name (Name of the layer, only for log output)
|
||||||
|
function apply_patch() {
|
||||||
|
local target_git_path="$1"
|
||||||
|
local patch_file="$2"
|
||||||
|
local layer_name="$3"
|
||||||
|
|
||||||
LAYER_NAME=$1
|
my_echo -e "Applying patch: $patch_file"
|
||||||
BRANCH_NAME=$2
|
|
||||||
LAYER_GIT_URL=$3
|
|
||||||
BRANCH_HASH=$4
|
|
||||||
TARGET_GIT_PATH=$5
|
|
||||||
PATCH_LIST=$6
|
|
||||||
|
|
||||||
#echo -e "Parameters= $LAYER_NAME $BRANCH_NAME $LAYER_GIT_URL $BRANCH_HASH $TARGET_GIT_PATH $PATCH_LIST"
|
# Check if the patch has already been applied by testing it in reverse
|
||||||
|
if git -C "$target_git_path" apply --reverse --check "$FILES_DIR/$patch_file" > /dev/null 2>&1; then
|
||||||
|
my_echo -e "\033[33;1mPatch $patch_file already applied to $layer_name; skipping.\033[0m"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
TMP_LAYER_BRANCH=$BRANCH_NAME
|
# Check if the patch can be applied cleanly
|
||||||
|
if do_exec "git -C \"$target_git_path\" apply --check \"$FILES_DIR/$patch_file\""; then
|
||||||
if test ! -d $TARGET_GIT_PATH/.git; then
|
if do_exec "git -C \"$target_git_path\" apply \"$FILES_DIR/$patch_file\""; then
|
||||||
echo -e "\033[35;1mclone branch $BRANCH_NAME from $LAYER_GIT_URL\033[0m"
|
# After successfully applying the patch: add changes and commit
|
||||||
do_exec "git clone -b $BRANCH_NAME $LAYER_GIT_URL $TARGET_GIT_PATH" ' ' 'show_output'
|
do_exec "git -C \"$target_git_path\" add -A"
|
||||||
do_exec "git -C $TARGET_GIT_PATH checkout $BRANCH_HASH -b $IMAGE_VERSION"
|
do_exec "git -C \"$target_git_path\" commit -m \"Apply patch $patch_file\""
|
||||||
do_exec "git -C $TARGET_GIT_PATH pull -r origin $BRANCH_NAME" ' ' 'show_output'
|
|
||||||
echo -e "\033[35;1mpatching $TARGET_GIT_PATH.\033[0m"
|
|
||||||
for PF in $PATCH_LIST ; do
|
|
||||||
PATCH_FILE="$FILES_DIR/$PF"
|
|
||||||
echo -e "apply: $PATCH_FILE"
|
|
||||||
do_exec "git -C $TARGET_GIT_PATH am $PATCH_FILE" ' ' 'show_output'
|
|
||||||
done
|
|
||||||
else
|
else
|
||||||
TMP_LAYER_BRANCH=`git -C $TARGET_GIT_PATH rev-parse --abbrev-ref HEAD`
|
my_echo -e "\033[31;1mFailed to apply patch $patch_file to $layer_name using git apply\033[0m"
|
||||||
echo -e "\033[35;1mupdate $TARGET_GIT_PATH $TMP_LAYER_BRANCH\033[0m"
|
return 1
|
||||||
do_exec "git -C $TARGET_GIT_PATH stash" 'no_exit'
|
|
||||||
|
|
||||||
if [ "$TMP_LAYER_BRANCH" != "$BRANCH_NAME" ]; then
|
|
||||||
echo -e "switch from branch $TMP_LAYER_BRANCH to branch $BRANCH_NAME..."
|
|
||||||
do_exec "git -C $TARGET_GIT_PATH checkout $BRANCH_NAME"
|
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
#echo -e "\033[35;1mUPDATE:\033[0m\nupdate $LAYER_NAME from (branch $BRANCH_NAME) $LAYER_GIT_URL ..."
|
my_echo -e "\033[33;1mSkipping patch $patch_file: cannot be applied cleanly.\033[0m"
|
||||||
do_exec "git -C $TARGET_GIT_PATH pull -r origin $BRANCH_NAME" ' ' 'show_output'
|
|
||||||
|
|
||||||
if [ "$TMP_LAYER_BRANCH" != "$BRANCH_NAME" ]; then
|
|
||||||
echo -e "\033[35;1mswitch back to branch $TMP_LAYER_BRANCH\033[0m"
|
|
||||||
do_exec "git -C $TARGET_GIT_PATH checkout $TMP_LAYER_BRANCH"
|
|
||||||
echo -e "\033[35;1mrebase branch $BRANCH_NAME into branch $TMP_LAYER_BRANCH\033[0m"
|
|
||||||
do_exec "git -C $TARGET_GIT_PATH rebase $BRANCH_NAME" ' ' 'show_output'
|
|
||||||
fi
|
|
||||||
|
|
||||||
do_exec "git -C $TARGET_GIT_PATH stash pop" 'no_exit'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# clone/update required branch from tuxbox bsp layers
|
## Clone or update required branch for a meta-layer
|
||||||
function is_required_machine_layer ()
|
function fetch_meta() {
|
||||||
{
|
local layer_name="$1"
|
||||||
HIM1=$1
|
local branch_name="$2"
|
||||||
for M in $HIM1 ; do
|
local layer_git_url="$3"
|
||||||
if [ "$M" == "$MACHINE" ]; then
|
local branch_hash="$4"
|
||||||
echo true
|
local target_git_path="$5"
|
||||||
|
local patch_list="$6"
|
||||||
|
|
||||||
|
if [[ "$GIT_SSH_KEYFILE" != "" ]]; then
|
||||||
|
export GIT_SSH_COMMAND="$SSH -i \"$GIT_SSH_KEYFILE\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -d "$target_git_path/.git" ]]; then
|
||||||
|
my_echo -e "Clone branch $branch_name from $layer_git_url into $target_git_path"
|
||||||
|
if do_exec "git clone -b \"$branch_name\" \"$layer_git_url\" \"$target_git_path\""; then
|
||||||
|
# Only perform checkout if branch_hash is not empty
|
||||||
|
if [ -n "$branch_hash" ]; then
|
||||||
|
do_exec "git -C \"$target_git_path\" checkout \"$branch_hash\" -b \"$IMAGE_VERSION\""
|
||||||
|
fi
|
||||||
|
do_exec "git -C \"$target_git_path\" pull -r origin \"$branch_name\""
|
||||||
|
else
|
||||||
|
my_echo -e "\033[31;1mError cloning $layer_name from $layer_git_url\033[0m"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
## Patching
|
||||||
|
if [[ -n "$patch_list" ]]; then
|
||||||
|
for patch_file in $patch_list; do
|
||||||
|
if ! apply_patch "$target_git_path" "$patch_file" "$layer_name"; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo false
|
fi
|
||||||
|
else
|
||||||
|
if [[ $DO_UPDATE == "$true" ]]; then
|
||||||
|
my_echo -e "Update $target_git_path on branch $branch_name"
|
||||||
|
if [[ $(git -C "$target_git_path" stash list) ]]; then
|
||||||
|
my_echo -e "Stashing changes in $target_git_path"
|
||||||
|
do_exec "git -C \"$target_git_path\" stash push --include-untracked"
|
||||||
|
local stash_applied=true
|
||||||
|
fi
|
||||||
|
do_exec "git -C \"$target_git_path\" checkout \"$branch_name\"" || do_exec "git -C \"$target_git_path\" checkout -b \"$branch_name\""
|
||||||
|
do_exec "git -C \"$target_git_path\" pull -r origin \"$branch_name\""
|
||||||
|
## Patching
|
||||||
|
if [[ -n "$patch_list" ]]; then
|
||||||
|
for patch_file in $patch_list; do
|
||||||
|
if ! apply_patch "$target_git_path" "$patch_file" "$layer_name"; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
if [[ "$stash_applied" == true ]]; then
|
||||||
|
if do_exec "git -C \"$target_git_path\" stash pop"; then
|
||||||
|
my_echo -e "Stash applied successfully."
|
||||||
|
else
|
||||||
|
my_echo -e "\033[33;1mNote: Stash could not be applied. Manual intervention required.\033[0m"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# get matching machine type from machine build id
|
## Clone/update required branch from tuxbox bsp layers
|
||||||
|
# Returns 0 if machine is required, 1 if not.
|
||||||
|
function is_required_machine_layer() {
|
||||||
|
local machine_list="$1"
|
||||||
|
for m in $machine_list; do
|
||||||
|
if [[ "$m" == "$MACHINE" ]]; then
|
||||||
|
return 0 # required
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
return 1 # not required
|
||||||
|
}
|
||||||
|
|
||||||
|
## Get matching machine type from machine build id
|
||||||
function get_real_machine_type() {
|
function get_real_machine_type() {
|
||||||
MACHINE_TYPE=$1
|
local MACHINE_TYPE="$1"
|
||||||
if [ "$MACHINE_TYPE" == "mutant51" ] || [ "$MACHINE_TYPE" == "ax51" ] || [ "$MACHINE_TYPE" == "hd51" ]; then
|
if [ "$MACHINE_TYPE" == "mutant51" ] || [ "$MACHINE_TYPE" == "ax51" ] || [ "$MACHINE_TYPE" == "hd51" ]; then
|
||||||
RMT_RES="hd51"
|
echo "hd51"
|
||||||
elif [ "$MACHINE_TYPE" == "hd60" ] || [ "$MACHINE_TYPE" == "ax60" ]; then
|
elif [ "$MACHINE_TYPE" == "hd60" ] || [ "$MACHINE_TYPE" == "ax60" ]; then
|
||||||
RMT_RES="hd60"
|
echo "hd60"
|
||||||
elif [ "$MACHINE_TYPE" == "hd61" ] || [ "$MACHINE_TYPE" == "ax61" ]; then
|
elif [ "$MACHINE_TYPE" == "hd61" ] || [ "$MACHINE_TYPE" == "ax61" ]; then
|
||||||
RMT_RES="hd61"
|
echo "hd61"
|
||||||
elif [ "$MACHINE_TYPE" == "zgemmah7" ] || [ "$MACHINE_TYPE" == "h7" ]; then
|
elif [ "$MACHINE_TYPE" == "zgemmah7" ] || [ "$MACHINE_TYPE" == "h7" ]; then
|
||||||
RMT_RES="h7"
|
echo "h7"
|
||||||
else
|
else
|
||||||
RMT_RES=$MACHINE_TYPE
|
echo "$MACHINE_TYPE"
|
||||||
fi
|
fi
|
||||||
echo $RMT_RES
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# get matching machine build id from machine type
|
## Get matching machine build id from machine type
|
||||||
function get_real_machine_id() {
|
function get_real_machine_id() {
|
||||||
MACHINEBUILD=$1
|
local MACHINEBUILD="$1"
|
||||||
if [ "$MACHINEBUILD" == "hd51" ]; then
|
if [ "$MACHINEBUILD" == "hd51" ]; then
|
||||||
RMI_RES="ax51"
|
echo "ax51"
|
||||||
elif [ "$MACHINEBUILD" == "hd60" ]; then
|
elif [ "$MACHINEBUILD" == "hd60" ]; then
|
||||||
RMI_RES="ax60"
|
echo "ax60"
|
||||||
elif [ "$MACHINEBUILD" == "hd61" ]; then
|
elif [ "$MACHINEBUILD" == "hd61" ]; then
|
||||||
RMI_RES="ax61"
|
echo "ax61"
|
||||||
elif [ "$MACHINEBUILD" == "h7" ]; then
|
elif [ "$MACHINEBUILD" == "h7" ]; then
|
||||||
RMI_RES="zgemmah7"
|
echo "zgemmah7"
|
||||||
else
|
else
|
||||||
RMI_RES=$MACHINEBUILD
|
echo "$MACHINEBUILD"
|
||||||
fi
|
fi
|
||||||
echo $RMI_RES
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# function to create file enrties into a file, already existing entry will be ignored
|
## Function to add an entry to a file if it doesn't already exist.
|
||||||
function set_file_entry () {
|
## Returns 0 if entry was added, 1 if it already existed.
|
||||||
FILE_NAME=$1
|
function set_file_entry() {
|
||||||
FILE_SEARCH_ENTRY=$2
|
local FILE_NAME="$1"
|
||||||
FILE_NEW_ENTRY=$3
|
local FILE_SEARCH_ENTRY="$2"
|
||||||
if test ! -f $FILE_NAME; then
|
local FILE_NEW_ENTRY="$3"
|
||||||
echo $FILE_NEW_ENTRY > $FILE_NAME
|
if [ ! -f "$FILE_NAME" ]; then
|
||||||
return 1
|
echo "$FILE_NEW_ENTRY" > "$FILE_NAME"
|
||||||
else
|
|
||||||
OLD_CONTENT=`cat $FILE_NAME`
|
|
||||||
HAS_ENTRY=`grep -c -w $FILE_SEARCH_ENTRY $FILE_NAME`
|
|
||||||
if [ "$HAS_ENTRY" == "0" ] ; then
|
|
||||||
echo $FILE_NEW_ENTRY >> $FILE_NAME
|
|
||||||
fi
|
|
||||||
NEW_CONTENT=`cat $FILE_NAME`
|
|
||||||
if [ "$OLD_CONTENT" == "$NEW_CONTENT" ] ; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
return 0
|
return 0
|
||||||
|
else
|
||||||
|
if grep -q -w "$FILE_SEARCH_ENTRY" "$FILE_NAME"; then
|
||||||
|
return 1 # entry exists
|
||||||
|
else
|
||||||
|
echo "$FILE_NEW_ENTRY" >> "$FILE_NAME"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# function to create configuration for box types
|
## Function to create configuration for box types
|
||||||
function create_local_config () {
|
function create_local_config() {
|
||||||
CLC_ARG1=$1
|
local machine="$1"
|
||||||
|
|
||||||
if [ "$CLC_ARG1" != "all" ]; then
|
if [ "$machine" != "all" ]; then
|
||||||
|
MACHINE_BUILD_DIR="$BUILD_ROOT/$machine"
|
||||||
|
do_exec "mkdir -p \"$BUILD_ROOT\""
|
||||||
|
|
||||||
MACHINE_BUILD_DIR=$BUILD_ROOT/$CLC_ARG1
|
BACKUP_CONFIG_DIR="$BACKUP_PATH/$machine/conf"
|
||||||
do_exec "mkdir -p $BUILD_ROOT"
|
do_exec "mkdir -p \"$BACKUP_CONFIG_DIR\""
|
||||||
|
|
||||||
BACKUP_CONFIG_DIR="$BACKUP_PATH/$CLC_ARG1/conf"
|
LOCAL_CONFIG_FILE_PATH="$MACHINE_BUILD_DIR/conf/local.conf"
|
||||||
do_exec "mkdir -p $BACKUP_CONFIG_DIR"
|
|
||||||
|
|
||||||
LOCAL_CONFIG_FILE_PATH=$MACHINE_BUILD_DIR/conf/local.conf
|
if [ -d "$BUILD_ROOT_DIR/$machine" ]; then
|
||||||
|
if [ ! -L "$BUILD_ROOT_DIR/$machine" ]; then
|
||||||
if test -d $BUILD_ROOT_DIR/$CLC_ARG1; then
|
my_echo -e "\033[37;1m\tcreate compatible symlinks directory for $machine environment ...\033[0m"
|
||||||
if test ! -L $BUILD_ROOT_DIR/$CLC_ARG1; then
|
do_exec "mv \"$BUILD_ROOT_DIR/$machine\" \"$BUILD_ROOT\""
|
||||||
# generate build/config symlinks for compatibility
|
do_exec "ln -s \"$MACHINE_BUILD_DIR\" \"$BUILD_ROOT_DIR/$machine\""
|
||||||
echo -e "\033[37;1m\tcreate compatible symlinks directory for $CLC_ARG1 environment ...\033[0m"
|
|
||||||
do_exec "mv -v $BUILD_ROOT_DIR/$CLC_ARG1 $BUILD_ROOT"
|
|
||||||
do_exec "ln -sv $MACHINE_BUILD_DIR $BUILD_ROOT_DIR/$CLC_ARG1"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# generate default config
|
if [ ! -d "$MACHINE_BUILD_DIR/conf" ]; then
|
||||||
if test ! -d $MACHINE_BUILD_DIR/conf; then
|
my_echo -e "\033[37;1m\tcreating build directory for $machine environment ...\033[0m"
|
||||||
echo -e "\033[37;1m\tcreating build directory for $CLC_ARG1 environment ...\033[0m"
|
do_exec "cd \"$BUILD_ROOT_DIR\""
|
||||||
do_exec "cd $BUILD_ROOT_DIR"
|
do_exec ". ./oe-init-build-env \"$MACHINE_BUILD_DIR\""
|
||||||
do_exec ". ./oe-init-build-env $MACHINE_BUILD_DIR"
|
if [ -f "$LOCAL_CONFIG_FILE_PATH" ] && [ ! -f "$LOCAL_CONFIG_FILE_PATH.origin" ]; then
|
||||||
# we need a clean config file
|
do_exec "mv \"$LOCAL_CONFIG_FILE_PATH\" \"$LOCAL_CONFIG_FILE_PATH.origin\""
|
||||||
if test -f $LOCAL_CONFIG_FILE_PATH & test ! -f $LOCAL_CONFIG_FILE_PATH.origin; then
|
|
||||||
# so we save the origin local.conf
|
|
||||||
do_exec "mv -v $LOCAL_CONFIG_FILE_PATH $LOCAL_CONFIG_FILE_PATH.origin"
|
|
||||||
fi
|
fi
|
||||||
do_exec "cd $BASEPATH"
|
do_exec "cd \"$BASEPATH\""
|
||||||
echo "[Desktop Entry]" > $BUILD_ROOT/.directory
|
echo "[Desktop Entry]" > "$BUILD_ROOT/.directory"
|
||||||
echo "Icon=folder-green" >> $BUILD_ROOT/.directory
|
echo "Icon=folder-green" >> "$BUILD_ROOT/.directory"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# modify or upgrade config files inside conf directory
|
if [ -f "$LOCAL_CONFIG_FILE_INC_PATH" ]; then
|
||||||
LOCAL_CONFIG_FILE_INC_PATH=$BASEPATH/local.conf.common.inc
|
if [ -f "$LOCAL_CONFIG_FILE_PATH" ]; then
|
||||||
if test -f $LOCAL_CONFIG_FILE_INC_PATH; then
|
HASHSTAMP=$(MD5SUM "$LOCAL_CONFIG_FILE_PATH")
|
||||||
|
do_exec "cp \"$LOCAL_CONFIG_FILE_PATH\" \"$BACKUP_CONFIG_DIR/local.conf.$HASHSTAMP.$BACKUP_SUFFIX\""
|
||||||
|
my_echo "migrate settings within $LOCAL_CONFIG_FILE_INC_PATH..."
|
||||||
|
do_exec "sed -i -e 's|http://archiv.tuxbox-neutrino.org|https://n4k.sourceforge.io|g' \"$LOCAL_CONFIG_FILE_INC_PATH\""
|
||||||
|
do_exec "sed -i -e 's|https://archiv.tuxbox-neutrino.org|https://n4k.sourceforge.io|g' \"$LOCAL_CONFIG_FILE_INC_PATH\""
|
||||||
|
do_exec "sed -i -e 's|http://archiv.tuxbox-neutrino.org/sources|https://n4k.sourceforge.io/sources|g' \"$LOCAL_CONFIG_FILE_INC_PATH\""
|
||||||
|
do_exec "sed -i -e 's|https://archiv.tuxbox-neutrino.org/sources|https://n4k.sourceforge.io/sources|g' \"$LOCAL_CONFIG_FILE_INC_PATH\""
|
||||||
|
do_exec "sed -i -e 's|http://sstate.tuxbox-neutrino.org|https://n4k.sourceforge.io|g' \"$LOCAL_CONFIG_FILE_INC_PATH\""
|
||||||
|
do_exec "sed -i -e 's|https://sstate.tuxbox-neutrino.org|https://n4k.sourceforge.io|g' \"$LOCAL_CONFIG_FILE_INC_PATH\""
|
||||||
|
do_exec "sed -i -e 's|archiv.tuxbox-neutrino.org|n4k.sourceforge.io|g' \"$LOCAL_CONFIG_FILE_INC_PATH\""
|
||||||
|
do_exec "sed -i -e 's|sstate.tuxbox-neutrino.org|n4k.sourceforge.io|g' \"$LOCAL_CONFIG_FILE_INC_PATH\""
|
||||||
|
|
||||||
if test -f $LOCAL_CONFIG_FILE_PATH; then
|
my_echo "migrate settings within $LOCAL_CONFIG_FILE_PATH"
|
||||||
HASHSTAMP=`MD5SUM $LOCAL_CONFIG_FILE_PATH`
|
do_exec "sed -i -e 's|http://archiv.tuxbox-neutrino.org|https://n4k.sourceforge.io|g' \"$LOCAL_CONFIG_FILE_PATH\""
|
||||||
do_exec "cp -v $LOCAL_CONFIG_FILE_PATH $BACKUP_CONFIG_DIR/local.conf.$HASHSTAMP.$BACKUP_SUFFIX"
|
do_exec "sed -i -e 's|https://archiv.tuxbox-neutrino.org|https://n4k.sourceforge.io|g' \"$LOCAL_CONFIG_FILE_PATH\""
|
||||||
|
do_exec "sed -i -e 's|http://archiv.tuxbox-neutrino.org/sources|https://n4k.sourceforge.io/sources|g' \"$LOCAL_CONFIG_FILE_PATH\""
|
||||||
|
do_exec "sed -i -e 's|https://archiv.tuxbox-neutrino.org/sources|https://n4k.sourceforge.io/sources|g' \"$LOCAL_CONFIG_FILE_PATH\""
|
||||||
|
do_exec "sed -i -e 's|http://sstate.tuxbox-neutrino.org|https://n4k.sourceforge.io|g' \"$LOCAL_CONFIG_FILE_PATH\""
|
||||||
|
do_exec "sed -i -e 's|https://sstate.tuxbox-neutrino.org|https://n4k.sourceforge.io|g' \"$LOCAL_CONFIG_FILE_PATH\""
|
||||||
|
do_exec "sed -i -e 's|archiv.tuxbox-neutrino.org|n4k.sourceforge.io|g' \"$LOCAL_CONFIG_FILE_PATH\""
|
||||||
|
do_exec "sed -i -e 's|sstate.tuxbox-neutrino.org|n4k.sourceforge.io|g' \"$LOCAL_CONFIG_FILE_PATH\""
|
||||||
|
|
||||||
# migrate settings after server switch
|
search_line="#UPDATE_SERVER_URL = \"http:\/\/@hostname@\""
|
||||||
echo -e "migrate settings within $LOCAL_CONFIG_FILE_INC_PATH..."
|
add_line="UPDATE_SERVER_URL = \"http://$HTTP_ADDRESS\""
|
||||||
sed -i -e 's|http://archiv.tuxbox-neutrino.org|https://n4k.sourceforge.io|' $LOCAL_CONFIG_FILE_INC_PATH
|
if ! grep -qF -- "$add_line" "$LOCAL_CONFIG_FILE_INC_PATH"; then
|
||||||
sed -i -e 's|https://archiv.tuxbox-neutrino.org|https://n4k.sourceforge.io|' $LOCAL_CONFIG_FILE_INC_PATH
|
sed -i -e "/$search_line/a $add_line" "$LOCAL_CONFIG_FILE_INC_PATH"
|
||||||
|
fi
|
||||||
sed -i -e 's|http://archiv.tuxbox-neutrino.org/sources|https://n4k.sourceforge.io/sources|' $LOCAL_CONFIG_FILE_INC_PATH
|
|
||||||
sed -i -e 's|https://archiv.tuxbox-neutrino.org/sources|https://n4k.sourceforge.io/sources|' $LOCAL_CONFIG_FILE_INC_PATH
|
|
||||||
|
|
||||||
sed -i -e 's|http://sstate.tuxbox-neutrino.org|https://n4k.sourceforge.io|' $LOCAL_CONFIG_FILE_INC_PATH
|
|
||||||
sed -i -e 's|https://sstate.tuxbox-neutrino.org|https://n4k.sourceforge.io|' $LOCAL_CONFIG_FILE_INC_PATH
|
|
||||||
|
|
||||||
sed -i -e 's|archiv.tuxbox-neutrino.org|n4k.sourceforge.io|' $LOCAL_CONFIG_FILE_INC_PATH
|
|
||||||
sed -i -e 's|sstate.tuxbox-neutrino.org|n4k.sourceforge.io|' $LOCAL_CONFIG_FILE_INC_PATH
|
|
||||||
|
|
||||||
echo -e "migrate settings within $LOCAL_CONFIG_FILE_PATH"
|
|
||||||
sed -i -e 's|http://archiv.tuxbox-neutrino.org|https://n4k.sourceforge.io|' $LOCAL_CONFIG_FILE_PATH
|
|
||||||
sed -i -e 's|https://archiv.tuxbox-neutrino.org|https://n4k.sourceforge.io|' $LOCAL_CONFIG_FILE_PATH
|
|
||||||
|
|
||||||
sed -i -e 's|http://archiv.tuxbox-neutrino.org/sources|https://n4k.sourceforge.io/sources|' $LOCAL_CONFIG_FILE_PATH
|
|
||||||
sed -i -e 's|https://archiv.tuxbox-neutrino.org/sources|https://n4k.sourceforge.io/sources|' $LOCAL_CONFIG_FILE_PATH
|
|
||||||
|
|
||||||
sed -i -e 's|http://sstate.tuxbox-neutrino.org|https://n4k.sourceforge.io|' $LOCAL_CONFIG_FILE_PATH
|
|
||||||
sed -i -e 's|https://sstate.tuxbox-neutrino.org|https://n4k.sourceforge.io|' $LOCAL_CONFIG_FILE_PATH
|
|
||||||
|
|
||||||
sed -i -e 's|archiv.tuxbox-neutrino.org|n4k.sourceforge.io|' $LOCAL_CONFIG_FILE_PATH
|
|
||||||
sed -i -e 's|sstate.tuxbox-neutrino.org|n4k.sourceforge.io|' $LOCAL_CONFIG_FILE_PATH
|
|
||||||
|
|
||||||
echo -e "\033[32;1mdone ...\033[0m\n"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add init note
|
set_file_entry "$LOCAL_CONFIG_FILE_PATH" "generated" "# auto generated entries by init script"
|
||||||
set_file_entry $LOCAL_CONFIG_FILE_PATH "generated" "# auto generated entries by init script"
|
|
||||||
|
|
||||||
# add line 1, include for local.conf.common.inc
|
set_file_entry "$LOCAL_CONFIG_FILE_PATH" "$BASEPATH/local.conf.common.inc" "include $BASEPATH/local.conf.common.inc"
|
||||||
set_file_entry $LOCAL_CONFIG_FILE_PATH "$BASEPATH/local.conf.common.inc" "include $BASEPATH/local.conf.common.inc"
|
|
||||||
|
|
||||||
# add line 2, machine type
|
M_TYPE='MACHINE = "'$(get_real_machine_type "$machine")'"'
|
||||||
M_TYPE='MACHINE = "'`get_real_machine_type $CLC_ARG1`'"'
|
if set_file_entry "$LOCAL_CONFIG_FILE_PATH" "MACHINE" "$M_TYPE"; then
|
||||||
if set_file_entry $LOCAL_CONFIG_FILE_PATH "MACHINE" "$M_TYPE" == 1; then
|
my_echo -e "\t\033[37;1m$LOCAL_CONFIG_FILE_PATH has been upgraded with entry: $M_TYPE \033[0m"
|
||||||
echo -e "\t\033[37;1m$LOCAL_CONFIG_FILE_PATH has been upgraded with entry: $M_TYPE \033[0m"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add line 3, machine build
|
M_ID='MACHINEBUILD = "'$(get_real_machine_id "$machine")'"'
|
||||||
M_ID='MACHINEBUILD = "'`get_real_machine_id $CLC_ARG1`'"'
|
if set_file_entry "$LOCAL_CONFIG_FILE_PATH" "MACHINEBUILD" "$M_ID"; then
|
||||||
if set_file_entry $LOCAL_CONFIG_FILE_PATH "MACHINEBUILD" "$M_ID" == 1; then
|
my_echo -e "\t\033[37;1m$LOCAL_CONFIG_FILE_PATH has been upgraded with entry: $M_ID \033[0m"
|
||||||
echo -e "\t\033[37;1m$LOCAL_CONFIG_FILE_PATH has been upgraded with entry: $M_ID \033[0m"
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo -e "\033[31;1mERROR:\033[0m:\ttemplate $BASEPATH/local.conf.common.inc not found..."
|
my_echo -e "\033[31;1mERROR:\033[0m:\ttemplate $BASEPATH/local.conf.common.inc not found..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BBLAYER_CONF_FILE="$MACHINE_BUILD_DIR/conf/bblayers.conf"
|
BBLAYER_CONF_FILE="$MACHINE_BUILD_DIR/conf/bblayers.conf"
|
||||||
|
|
||||||
# craete backup for bblayer.conf
|
if [ -f "$BBLAYER_CONF_FILE" ]; then
|
||||||
if test -f $BBLAYER_CONF_FILE; then
|
HASHSTAMP=$(MD5SUM "$BBLAYER_CONF_FILE")
|
||||||
HASHSTAMP=`MD5SUM $BBLAYER_CONF_FILE`
|
do_exec "cp \"$BBLAYER_CONF_FILE\" \"$BACKUP_CONFIG_DIR/bblayer.conf.$HASHSTAMP.$BACKUP_SUFFIX\""
|
||||||
do_exec "cp -v $BBLAYER_CONF_FILE $BACKUP_CONFIG_DIR/bblayer.conf.$HASHSTAMP.$BACKUP_SUFFIX"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
META_MACHINE_LAYER=meta-`get_metaname $CLC_ARG1`
|
META_MACHINE_LAYER="meta-$(get_metaname "$machine")"
|
||||||
|
|
||||||
# add layer entries into bblayer.conf
|
set_file_entry "$BBLAYER_CONF_FILE" "generated" "# auto generated entries by init script"
|
||||||
set_file_entry $BBLAYER_CONF_FILE "generated" '# auto generated entries by init script'
|
|
||||||
LAYER_LIST=" $TUXBOX_LAYER_NAME $META_MACHINE_LAYER $OE_LAYER_NAME/meta-oe $OE_LAYER_NAME/meta-networking $PYTHON2_LAYER_NAME $QT5_LAYER_NAME "
|
if [[ -z "$PYTHON2_SRCREV" ]]; then
|
||||||
for LL in $LAYER_LIST ; do
|
PYTHON2_LAYER_NAME=""
|
||||||
if set_file_entry $BBLAYER_CONF_FILE $LL 'BBLAYERS += " '$BUILD_ROOT_DIR'/'$LL' "' == 1;then
|
fi
|
||||||
echo -e "\t\033[37;1m$BBLAYER_CONF_FILE has been upgraded with entry: $LL... \033[0m"
|
|
||||||
|
LAYER_LIST="$TUXBOX_LAYER_NAME $META_MACHINE_LAYER $OE_LAYER_NAME/meta-oe $OE_LAYER_NAME/meta-networking $PYTHON2_LAYER_NAME $QT5_LAYER_NAME"
|
||||||
|
for LL in $LAYER_LIST; do
|
||||||
|
if set_file_entry "$BBLAYER_CONF_FILE" "$LL" "BBLAYERS += \"${BUILD_ROOT_DIR}/${LL}\""; then
|
||||||
|
my_echo -e "\t\033[37;1m$BBLAYER_CONF_FILE has been upgraded with entry: $LL... \033[0m"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# function create local dist directory to prepare for web access
|
## Function to create local dist directory to prepare for web access
|
||||||
function create_dist_tree () {
|
function create_dist_tree() {
|
||||||
|
DIST_BASEDIR="$DIST_DIR/$IMAGE_VERSION"
|
||||||
# create dist dir
|
if [ ! -d "$DIST_BASEDIR" ]; then
|
||||||
DIST_BASEDIR="$BASEPATH/dist/$IMAGE_VERSION"
|
my_echo -e "\033[37;1mcreate dist directory:\033[0m $DIST_BASEDIR"
|
||||||
if test ! -d "$DIST_BASEDIR"; then
|
do_exec "mkdir -p \"$DIST_BASEDIR\""
|
||||||
echo -e "\033[37;1mcreate dist directory:\033[0m $DIST_BASEDIR"
|
|
||||||
do_exec "mkdir -p $DIST_BASEDIR"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create link sources
|
DIST_LIST=$(ls "$BUILD_ROOT")
|
||||||
DIST_LIST=`ls $BUILD_ROOT`
|
for DL in $DIST_LIST; do
|
||||||
for DL in $DIST_LIST ; do
|
|
||||||
DEPLOY_DIR="$BUILD_ROOT/$DL/tmp/deploy"
|
DEPLOY_DIR="$BUILD_ROOT/$DL/tmp/deploy"
|
||||||
do_exec "ln -sfv $DEPLOY_DIR $DIST_BASEDIR/$DL"
|
do_exec "ln -sf \"$DEPLOY_DIR\" \"$DIST_BASEDIR/$DL\""
|
||||||
if test -L "$DIST_BASEDIR/$DL/deploy"; then
|
if [ -L "$DIST_BASEDIR/$DL/deploy" ]; then
|
||||||
do_exec "unlink -v $DIST_BASEDIR/$DL/deploy"
|
do_exec "unlink \"$DIST_BASEDIR/$DL/deploy\""
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function MD5SUM () {
|
function MD5SUM() {
|
||||||
MD5SUM_FILE=$1
|
local MD5SUM_FILE="$1"
|
||||||
MD5STAMP=`md5sum $MD5SUM_FILE |cut -f 1 -d " "`
|
md5sum "$MD5SUM_FILE" | cut -f 1 -d " "
|
||||||
echo $MD5STAMP
|
}
|
||||||
|
|
||||||
|
## Function for selecting items with a custom entry
|
||||||
|
function do_select() {
|
||||||
|
local items="$1"
|
||||||
|
SELECTION=""
|
||||||
|
local user_input
|
||||||
|
local valid_selection=0
|
||||||
|
|
||||||
|
IFS=' ' read -r -a items_array <<< "$items"
|
||||||
|
|
||||||
|
echo "Please select one or more entries (numbers separated by spaces):"
|
||||||
|
local i=1
|
||||||
|
for item in "${items_array[@]}"; do
|
||||||
|
printf "[%2d] %s\n" "$i" "$item"
|
||||||
|
((i++))
|
||||||
|
done
|
||||||
|
printf "\n[%2d] %s\n" "$i" "Enter custom"
|
||||||
|
|
||||||
|
printf "\nEnter the numbers of the entries or [$i] for custom entry: "
|
||||||
|
read -r user_input
|
||||||
|
|
||||||
|
for choice in $user_input; do
|
||||||
|
if [[ "$choice" =~ ^[0-9]+$ ]]; then
|
||||||
|
if [ "$choice" -ge 1 ] && [ "$choice" -lt "$i" ]; then
|
||||||
|
SELECTION+="${items_array[$choice-1]} "
|
||||||
|
valid_selection=1
|
||||||
|
elif [ "$choice" -eq "$i" ]; then
|
||||||
|
echo "Enter your custom entry:"
|
||||||
|
read -r custom_entry
|
||||||
|
SELECTION+="$custom_entry "
|
||||||
|
valid_selection=1
|
||||||
|
else
|
||||||
|
my_echo "Invalid selection: $choice"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
my_echo "Invalid selection: $choice"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$valid_selection" -eq 0 ]; then
|
||||||
|
my_echo "No valid selection made. Process aborted."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
SELECTION=$(echo "$SELECTION" | sed 's/ $//')
|
||||||
|
my_echo "Selected entries: $SELECTION"
|
||||||
|
}
|
||||||
|
|
||||||
|
## Reset the build. Folders are renamed for safety.
|
||||||
|
function do_reset() {
|
||||||
|
do_select "$MACHINES"
|
||||||
|
local selected_machines="$SELECTION"
|
||||||
|
|
||||||
|
if [ -z "$selected_machines" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
local start_directory="$BUILD_ROOT_DIR"
|
||||||
|
local rename_success=0
|
||||||
|
|
||||||
|
IFS=' ' read -r -a machines_array <<< "$selected_machines"
|
||||||
|
for machine in "${machines_array[@]}"; do
|
||||||
|
my_echo "Reset is being carried out for: $machine"
|
||||||
|
readarray -t found_dirs < <(find "$start_directory" -type f -name "saved_tmpdir")
|
||||||
|
for dir in "${found_dirs[@]}"; do
|
||||||
|
tmp_dir_path=$(cat "$dir")
|
||||||
|
if [[ -d "$tmp_dir_path" && "$tmp_dir_path" == *"/$machine/tmp"* ]]; then
|
||||||
|
local timestamp
|
||||||
|
timestamp=$(date '+%Y%m%d_%H%M%S')
|
||||||
|
do_exec "mv \"$tmp_dir_path\" \"${tmp_dir_path%/*}/tmp_${timestamp}\""
|
||||||
|
my_echo "Folder $tmp_dir_path was renamed to ${tmp_dir_path%/*}/tmp_${timestamp}."
|
||||||
|
rename_success=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$rename_success" -eq 0 ]; then
|
||||||
|
my_echo "\033[33mNo reset could be performed.\033[0m"
|
||||||
|
else
|
||||||
|
my_echo "Reset succeeded."
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
454
init.sh
454
init.sh
@@ -2,16 +2,50 @@
|
|||||||
source init.functions.sh
|
source init.functions.sh
|
||||||
#set -x
|
#set -x
|
||||||
|
|
||||||
|
## Comatible and default image version
|
||||||
|
DEFAULT_IMAGE_VERSION="3.2.4"
|
||||||
|
COMPATIBLE_IMAGE_VERSIONS="$DEFAULT_IMAGE_VERSION 3.2"
|
||||||
|
IMAGE_VERSION="$DEFAULT_IMAGE_VERSION"
|
||||||
|
|
||||||
|
## global vars
|
||||||
BASEPATH=$(pwd)
|
BASEPATH=$(pwd)
|
||||||
TIMESTAMP=$(date '+%Y%m%d_%H%M%S')
|
SSH=$(which ssh)
|
||||||
|
GIT_SSH_KEYFILE=""
|
||||||
# only current version
|
true="1"
|
||||||
# IMAGE_VERSION=$(git -C $BASEPATH rev-parse --abbrev-ref HEAD)
|
false="0"
|
||||||
IMAGE_VERSION="3.2.4"
|
DO_UPDATE=$false
|
||||||
|
DO_RESET=$false
|
||||||
FILES_DIR="$BASEPATH/files"
|
FILES_DIR="$BASEPATH/files"
|
||||||
|
UPDATE_SERVER_URL="http://localhost"
|
||||||
|
DIST_DIR="$BASEPATH/dist"
|
||||||
|
USER_CALL="$0 $@"
|
||||||
|
|
||||||
# identical listings
|
## Basename of this script
|
||||||
|
NAME=$(basename $0)
|
||||||
|
|
||||||
|
## Timestamp for logging
|
||||||
|
TIMESTAMP=$(date '+%Y%m%d_%H%M%S')
|
||||||
|
## Logfile
|
||||||
|
LOG_PATH=$BASEPATH/log
|
||||||
|
mkdir -p $LOG_PATH
|
||||||
|
TMP_LOGFILE="$LOG_PATH/.$0-tmp.log"
|
||||||
|
rm -f $TMP_LOGFILE
|
||||||
|
LOGFILE_NAME="$NAME"_"$TIMESTAMP.log"
|
||||||
|
LOGFILE=$LOG_PATH/$LOGFILE_NAME
|
||||||
|
LOGFILE_LINK=$LOG_PATH/$NAME.log
|
||||||
|
LOCAL_CONFIG_FILE_INC_PATH=$BASEPATH/local.conf.common.inc
|
||||||
|
echo "" > $LOGFILE
|
||||||
|
ln -sf $LOGFILE $LOGFILE_LINK
|
||||||
|
my_echo "true" "$USER_CALL"
|
||||||
|
|
||||||
|
## Current build env script version
|
||||||
|
BUILD_ENV_VERSION=$(git -C $BASEPATH describe --tags 2>/dev/null)
|
||||||
|
if [ -z "$BUILD_ENV_VERSION" ]; then
|
||||||
|
BUILD_ENV_VERSION="unknown"
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Machines
|
||||||
|
# Identical listings
|
||||||
MACHINES_IDENTICAL_HD51="hd51 ax51 mutant51"
|
MACHINES_IDENTICAL_HD51="hd51 ax51 mutant51"
|
||||||
MACHINES_IDENTICAL_H7="h7 zgemmah7"
|
MACHINES_IDENTICAL_H7="h7 zgemmah7"
|
||||||
MACHINES_IDENTICAL_HD60="hd60 ax60" #TODO: move into gfutures
|
MACHINES_IDENTICAL_HD60="hd60 ax60" #TODO: move into gfutures
|
||||||
@@ -24,226 +58,308 @@ MACHINES_HISI="$MACHINES_IDENTICAL_HD60 $MACHINES_IDENTICAL_HD61"
|
|||||||
# airdigital listing
|
# airdigital listing
|
||||||
MACHINES_AIRDIGITAL="$MACHINES_IDENTICAL_H7"
|
MACHINES_AIRDIGITAL="$MACHINES_IDENTICAL_H7"
|
||||||
# edision listing
|
# edision listing
|
||||||
#MACHINES_EDISION="osmio4k osmio4kplus"
|
MACHINES_EDISION="osmio4k osmio4kplus"
|
||||||
# ceryon listing
|
# ceryon listing
|
||||||
MACHINES_CERYON="e4hdultra"
|
MACHINES_CERYON="e4hdultra"
|
||||||
|
|
||||||
# valid machine list
|
# valid machine list
|
||||||
MACHINES="$MACHINES_GFUTURES $MACHINES_HISI $MACHINES_AIRDIGITAL $MACHINES_EDISION $MACHINES_CERYON"
|
MACHINES="$MACHINES_GFUTURES $MACHINES_HISI $MACHINES_AIRDIGITAL $MACHINES_EDISION $MACHINES_CERYON"
|
||||||
|
|
||||||
HINT_SYNTAX='\033[37;1mUsage '$0' <machine>\033[0m'
|
MACHINE="all" # default for MACHINE, if not set
|
||||||
HINT_MACHINES="<$MACHINES>, <all> or keep empty < >"
|
HINT_MACHINES="Select a valid machine type (empty means <all> as default) <$MACHINES>"
|
||||||
HINT_IMAGE_VERSIONS="$IMAGE_VERSION"
|
|
||||||
|
|
||||||
LOG_PATH=$BASEPATH/log
|
|
||||||
mkdir -p $LOG_PATH
|
|
||||||
|
|
||||||
|
## Backups
|
||||||
BACKUP_PATH=$BASEPATH/backups
|
BACKUP_PATH=$BASEPATH/backups
|
||||||
mkdir -p $BACKUP_PATH
|
mkdir -p $BACKUP_PATH
|
||||||
|
BACKUP_SUFFIX=bak
|
||||||
|
|
||||||
LOGFILE_NAME="$0_$TIMESTAMP.log"
|
# meta-neutrino project URL:
|
||||||
LOGFILE=$LOG_PATH/$LOGFILE_NAME
|
PROJECT_URL="https://github.com/tuxbox-neutrino"
|
||||||
TMP_LOGFILE=$LOG_PATH/.tmp.log
|
|
||||||
touch $LOGFILE
|
|
||||||
|
|
||||||
LOGFILE_LINK=$BASEPATH/$0.log
|
## Help
|
||||||
|
show_help() {
|
||||||
|
if [[ $LANG == de_* ]]; then
|
||||||
|
echo "Dieses Skript initialisiert und aktualisiert die Entwicklungsumgebung für den Bau von Images und Paketen für verschiedene Maschinenkonfigurationen."
|
||||||
|
echo "Es klont und aktualisiert Meta-Layer aus vorgegebenen Repositories, bereitet die Build-Umgebung vor und unterstützt die Konfiguration für spezifische Maschinentypen."
|
||||||
|
else
|
||||||
|
echo "This script initializes and updates the development environment for building images and packages for various machine configurations."
|
||||||
|
echo "It clones and updates meta-layers from specified repositories, prepares the build environment, and supports configuration for specific machine types."
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
echo "Usage: $0 [OPTIONS]..."
|
||||||
|
echo ""
|
||||||
|
echo "Options:"
|
||||||
|
echo " -m, --machine $HINT_MACHINES"
|
||||||
|
echo " --update-url URL (IP, hostname or domain, optional with portnumber) to define the update server address for $LOCAL_CONFIG_FILE_INC_PATH, default: $UPDATE_SERVER_URL"
|
||||||
|
echo " --dist-dir Directory where to find the deployed images and packages, default: $DIST_DIR"
|
||||||
|
echo " -p, --project-url Project-URL where to find project meta layers,"
|
||||||
|
echo " e.g. for read and write access: git@github.com:tuxbox-neutrino, default = $PROJECT_URL"
|
||||||
|
echo " --image-version Sets the required image version to build, possible versions are: $COMPATIBLE_IMAGE_VERSIONS, default = $DEFAULT_IMAGE_VERSION"
|
||||||
|
echo " -u, --update Update your project meta layers"
|
||||||
|
echo " -r, --reset Resets the tmp dir within the build directory, $BASEPATH/poky-x.x.x/build/<machine>/tmp. The /tmp directory will be not deleted but renamed"
|
||||||
|
echo " -i, --id-rsa-file Path to your preferred id rsa file, default: users id rsa file, e.g. $HOME/.ssh/id_rsa"
|
||||||
|
echo ""
|
||||||
|
echo " -h, --help Show this help"
|
||||||
|
echo " --version Show version information for buildenv script"
|
||||||
|
}
|
||||||
|
|
||||||
rm -f $TMP_LOGFILE
|
## Processing command line arguments
|
||||||
rm -f $LOGFILE_LINK
|
TEMP=$(getopt -o rup:m:i:h --long reset,update-url:,dist-dir:,update,project-url:,machine:,id-rsa-file,image-version:,help,version -n 'init' -- "$@")
|
||||||
ln -sf $LOGFILE $LOGFILE_LINK
|
if [ $? != 0 ] ; then
|
||||||
|
my_echo "Error while process arguments" >&2
|
||||||
|
show_help
|
||||||
# set passed parameters
|
|
||||||
if [ "$1" == "" ]; then
|
|
||||||
MACHINE="all"
|
|
||||||
else
|
|
||||||
MACHINE=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $(is_valid_machine "$MACHINE") == false ]; then
|
|
||||||
echo -e "\033[31;1mERROR:\tNo valid machine defined.\033[0m\n\t$HINT_SYNTAX.
|
|
||||||
\tKeep parameter <machine> empty to initialize all possible machine types or set your favorite machine.
|
|
||||||
\tPossible types are:
|
|
||||||
\t\033[37;1m$HINT_MACHINES\033[0m\n"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "##########################################################################################"
|
# Note the quotes around `$TEMP`: they are essential!
|
||||||
echo -e "\033[37;1mInitialze build environment:\nversion: $IMAGE_VERSION\nmachine: $MACHINE\033[0m"
|
eval set -- "$TEMP"
|
||||||
echo -e "##########################################################################################\n"
|
|
||||||
|
|
||||||
|
# Extract arguments.
|
||||||
|
while true ; do
|
||||||
|
case "$1" in
|
||||||
|
-p|--project-url)
|
||||||
|
PROJECT_URL="$2"; shift 2 ;;
|
||||||
|
-m|--machine)
|
||||||
|
MACHINE="$2"; shift 2 ;;
|
||||||
|
-i|--id-rsa-file)
|
||||||
|
GIT_SSH_KEYFILE="$2"; shift 2 ;;
|
||||||
|
--update-url)
|
||||||
|
UPDATE_SERVER_URL="$2"; shift 2 ;;
|
||||||
|
--dist-dir)
|
||||||
|
DIST_DIR="$2"; shift 2 ;;
|
||||||
|
-u|--update)
|
||||||
|
DO_UPDATE="$true"; shift ;;
|
||||||
|
-r|--reset)
|
||||||
|
DO_RESET="$true"; shift ;;
|
||||||
|
--image-version)
|
||||||
|
IMAGE_VERSION="$2"; shift 2 ;;
|
||||||
|
-h|--help)
|
||||||
|
show_help
|
||||||
|
exit 0 ;;
|
||||||
|
--version)
|
||||||
|
echo "$BUILD_ENV_VERSION"
|
||||||
|
exit 0 ;;
|
||||||
|
--) shift ; break ;;
|
||||||
|
*) echo "Internal Error!" ; exit 1 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
BACKUP_SUFFIX=bak
|
## Validate the chosen image version
|
||||||
|
if [[ ! " $COMPATIBLE_IMAGE_VERSIONS " =~ " $IMAGE_VERSION " ]]; then
|
||||||
|
my_echo "\033[31;1mError: Invalid image version specified '$IMAGE_VERSION'. Available versions are: [$COMPATIBLE_IMAGE_VERSIONS]\033[0m"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
YOCTO_GIT_URL=https://git.yoctoproject.org/git/poky
|
## Layer sources
|
||||||
POKY=poky
|
YOCTO_GIT_URL="https://github.com/yoctoproject/poky.git"
|
||||||
POKY_NAME=$IMAGE_VERSION
|
POKY="$(basename $YOCTO_GIT_URL .git)"
|
||||||
BUILD_ROOT_DIR=$BASEPATH/$POKY-$IMAGE_VERSION
|
POKY_NAME="$IMAGE_VERSION" #TODO
|
||||||
BUILD_ROOT=$BUILD_ROOT_DIR/build
|
BUILD_ROOT_DIR="$BASEPATH/$POKY-$IMAGE_VERSION"
|
||||||
|
BUILD_ROOT="$BUILD_ROOT_DIR/build"
|
||||||
|
|
||||||
OE_LAYER_NAME=meta-openembedded
|
OE_LAYER_NAME=meta-openembedded
|
||||||
OE_LAYER_GIT_URL=https://git.openembedded.org/meta-openembedded
|
OE_LAYER_GIT_URL=https://github.com/openembedded/meta-openembedded.git
|
||||||
OE_LAYER_PATCH_LIST="0001-openembedded-disable-meta-python.patch 0002-openembedded-disable-openembedded-layer-meta-phyton.patch"
|
OE_LAYER_PATCH_LIST=""
|
||||||
|
|
||||||
OE_CORE_LAYER_NAME=openembedded-core
|
OE_CORE_LAYER_NAME=openembedded-core
|
||||||
OE_CORE_LAYER_GIT_URL=https://github.com/openembedded/openembedded-core.git
|
OE_CORE_LAYER_GIT_URL=https://github.com/openembedded/openembedded-core.git
|
||||||
|
|
||||||
TUXBOX_LAYER_NAME=meta-neutrino
|
## Preset required branches and revs based on the selected image version
|
||||||
TUXBOX_LAYER_GIT_URL=https://github.com/Tuxbox-Project
|
case "$IMAGE_VERSION" in
|
||||||
|
"3.2"|"3.2.4")
|
||||||
|
COMPATIBLE_TAG="$IMAGE_VERSION"
|
||||||
|
COMPATIBLE_BRANCH="gatesgarth"
|
||||||
|
YOCTO_SRCREV="bc71ec0"
|
||||||
|
PYTHON2_SRCREV="27d2aeb"
|
||||||
|
OE_SRCREV="f3f7a5f"
|
||||||
|
OE_LAYER_PATCH_LIST="0001-openembedded-disable-meta-python.patch 0002-openembedded-disable-openembedded-layer-meta-phyton.patch"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
my_echo "\033[31;1mError: No valid configuration for the specified image version '$IMAGE_VERSION'.\033[0m"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
TUXBOX_BSP_LAYER_GIT_URL=$TUXBOX_LAYER_GIT_URL
|
# Check machine type
|
||||||
|
if [ "$(is_valid_machine "$MACHINE")" = "false" ]; then
|
||||||
|
my_echo "\033[31;1mNo valid machine defined.\033[0m"
|
||||||
|
my_echo "$HINT_MACHINES"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
AIRDIGITAL_LAYER_NAME=meta-airdigital
|
my_echo "------------------------------------------------------------------------------------------"
|
||||||
AIRDIGITAL_LAYER_GIT_URL=$TUXBOX_BSP_LAYER_GIT_URL/$AIRDIGITAL_LAYER_NAME
|
my_echo "Buildenv Version: \033[37;1m$BUILD_ENV_VERSION\033[0m "
|
||||||
|
my_echo "Image Version: \033[37;1m$IMAGE_VERSION\033[0m "
|
||||||
|
my_echo "Compatible OE-branch: \033[37;1m$COMPATIBLE_BRANCH\033[0m "
|
||||||
|
my_echo "Buildroot directory: \033[37;1m$BUILD_ROOT_DIR\033[0m "
|
||||||
|
my_echo "Update Server URL: \033[37;1m$UPDATE_SERVER_URL\033[0m "
|
||||||
|
my_echo "Dist directory: \033[37;1m$DIST_DIR\033[0m "
|
||||||
|
my_echo "Configured Machine(s): \033[37;1m$MACHINE\033[0m "
|
||||||
|
my_echo "Project Repository URL: \033[37;1m$PROJECT_URL\033[0m "
|
||||||
|
my_echo "SRCREV Yocto: \033[37;1m$YOCTO_SRCREV\033[0m "
|
||||||
|
my_echo "SRCREV OE: \033[37;1m$OE_SRCREV\033[0m "
|
||||||
|
my_echo "SRCREV Python2: \033[37;1m$PYTHON2_SRCREV\033[0m "
|
||||||
|
my_echo "------------------------------------------------------------------------------------------"
|
||||||
|
|
||||||
GFUTURES_LAYER_NAME=meta-gfutures
|
## reset build
|
||||||
GFUTURES_LAYER_GIT_URL=$TUXBOX_BSP_LAYER_GIT_URL/$GFUTURES_LAYER_NAME
|
if [[ $DO_RESET == "$true" ]]; then
|
||||||
|
do_reset "$MACHINES"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
EDISION_LAYER_NAME=meta-edision
|
## Fetch meta sources
|
||||||
EDISION_LAYER_GIT_URL=$TUXBOX_LAYER_GIT_URL/$EDISION_LAYER_NAME
|
# fetch required branch from yocto
|
||||||
|
fetch_meta "" $COMPATIBLE_BRANCH $YOCTO_GIT_URL $YOCTO_SRCREV $BUILD_ROOT_DIR
|
||||||
|
|
||||||
HISI_LAYER_NAME=meta-hisilicon #TODO: move into gfutures
|
# fetch required branch from openembedded
|
||||||
HISI_LAYER_GIT_URL=$TUXBOX_LAYER_GIT_URL/$HISI_LAYER_NAME
|
fetch_meta "" $COMPATIBLE_BRANCH $OE_LAYER_GIT_URL $OE_SRCREV $BUILD_ROOT_DIR/$OE_LAYER_NAME "$OE_LAYER_PATCH_LIST"
|
||||||
|
|
||||||
CERYON_LAYER_NAME=meta-ceryon
|
# fetch required branch of oe-core from openembedded
|
||||||
CERYON_LAYER_GIT_URL=$TUXBOX_BSP_LAYER_GIT_URL/$CERYON_LAYER_NAME
|
fetch_meta "" master $OE_CORE_LAYER_GIT_URL "" $BUILD_ROOT_DIR/$OE_CORE_LAYER_NAME
|
||||||
|
|
||||||
PYTHON2_LAYER_NAME=meta-python2
|
# fetch required branch for meta-python2
|
||||||
PYTHON2_LAYER_GIT_URL=https://git.openembedded.org/$PYTHON2_LAYER_NAME
|
if [[ -n "$PYTHON2_SRCREV" ]]; then
|
||||||
PYTHON2_PATCH_LIST="0001-local_conf_outcomment_line_15.patch"
|
PYTHON2_LAYER_NAME=meta-python2
|
||||||
|
PYTHON2_LAYER_GIT_URL=https://git.openembedded.org/$PYTHON2_LAYER_NAME
|
||||||
|
PYTHON2_PATCH_LIST="0001-local_conf_outcomment_line_15.patch"
|
||||||
|
fetch_meta "" $COMPATIBLE_BRANCH $PYTHON2_LAYER_GIT_URL $PYTHON2_SRCREV $BUILD_ROOT_DIR/$PYTHON2_LAYER_NAME "$PYTHON2_PATCH_LIST"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# fetch required branch for meta-qt5
|
||||||
QT5_LAYER_NAME=meta-qt5
|
QT5_LAYER_NAME=meta-qt5
|
||||||
QT5_LAYER_GIT_URL=https://github.com/meta-qt5/$QT5_LAYER_NAME
|
QT5_LAYER_GIT_URL=https://github.com/meta-qt5/$QT5_LAYER_NAME
|
||||||
|
fetch_meta "" $COMPATIBLE_BRANCH $QT5_LAYER_GIT_URL "" $BUILD_ROOT_DIR/$QT5_LAYER_NAME
|
||||||
|
|
||||||
|
# fetch required branch from meta-neutrino
|
||||||
|
TUXBOX_LAYER_NAME="meta-neutrino"
|
||||||
|
TUXBOX_LAYER_BRANCH="master"
|
||||||
|
TUXBOX_LAYER_SRCREV="ffc1b65ec3cfd2c6bbd339d3ce201d6b39abd527"
|
||||||
|
TUXBOX_LAYER_GIT_URL="${PROJECT_URL}/$TUXBOX_LAYER_NAME.git"
|
||||||
|
fetch_meta "" $TUXBOX_LAYER_BRANCH $TUXBOX_LAYER_GIT_URL "$TUXBOX_LAYER_SRCREV" $BUILD_ROOT_DIR/$TUXBOX_LAYER_NAME
|
||||||
|
safe_dir="$BUILD_ROOT_DIR/$TUXBOX_LAYER_NAME"
|
||||||
|
if ! git config --global --get safe.directory | grep -qxF "$safe_dir"; then
|
||||||
|
do_exec "git config --global --add safe.directory \"$safe_dir\""
|
||||||
|
fi
|
||||||
|
|
||||||
# set required branches
|
# fetch required branch from meta-airdigital
|
||||||
COMPATIBLE_BRANCH=gatesgarth
|
AIRDIGITAL_LAYER_NAME="meta-airdigital"
|
||||||
YOCTO_BRANCH_HASH=bc71ec0
|
AIRDIGITAL_LAYER_BRANCH="master"
|
||||||
PYTHON2_BRANCH_HASH=27d2aeb
|
AIRDIGITAL_LAYER_SRCREV="ac8f769e35f839bbcf9c38d2b2b98513be907ac1"
|
||||||
OE_BRANCH_HASH=f3f7a5f
|
AIRDIGITAL_LAYER_GIT_URL="$PROJECT_URL/$AIRDIGITAL_LAYER_NAME.git"
|
||||||
|
if [ "$MACHINE" == "all" ] || [ $(is_required_machine_layer "' $MACHINES_AIRDIGITAL '") == true ]; then
|
||||||
|
fetch_meta "" $AIRDIGITAL_LAYER_BRANCH $AIRDIGITAL_LAYER_GIT_URL "$AIRDIGITAL_LAYER_SRCREV" $BUILD_ROOT_DIR/$AIRDIGITAL_LAYER_NAME
|
||||||
|
fi
|
||||||
|
|
||||||
|
# fetch required branch from meta-gfutures
|
||||||
# clone/update required branch from yocto
|
GFUTURES_LAYER_NAME=meta-gfutures
|
||||||
clone_meta '' $COMPATIBLE_BRANCH $YOCTO_GIT_URL $YOCTO_BRANCH_HASH $BUILD_ROOT_DIR
|
GFUTURES_LAYER_BRANCH="master"
|
||||||
# for compatibility with old path structure
|
GFUTURES_LAYER_SRCREV="bfceb9d2f79a8403ce1bdf1ad14a1714f781fed3"
|
||||||
# ln -sf $BUILD_ROOT_DIR $BASEPATH/$POKY-$IMAGE_VERSION
|
GFUTURES_LAYER_GIT_URL="$PROJECT_URL/$GFUTURES_LAYER_NAME.git"
|
||||||
echo -e "\033[32;1mOK ...\033[0m\n"
|
|
||||||
|
|
||||||
# clone required branch from openembedded
|
|
||||||
clone_meta '' $COMPATIBLE_BRANCH $OE_LAYER_GIT_URL $OE_BRANCH_HASH $BUILD_ROOT_DIR/$OE_LAYER_NAME "$OE_LAYER_PATCH_LIST"
|
|
||||||
echo -e "\033[32;1mOK ...\033[0m\n"
|
|
||||||
clone_meta '' master $OE_CORE_LAYER_GIT_URL '' $BUILD_ROOT_DIR/$OE_CORE_LAYER_NAME
|
|
||||||
echo -e "\033[32;1mOK ...\033[0m\n"
|
|
||||||
|
|
||||||
# clone required branch for meta-python2
|
|
||||||
clone_meta '' $COMPATIBLE_BRANCH $PYTHON2_LAYER_GIT_URL $PYTHON2_BRANCH_HASH $BUILD_ROOT_DIR/$PYTHON2_LAYER_NAME "$PYTHON2_PATCH_LIST"
|
|
||||||
echo -e "\033[32;1mOK ...\033[0m\n"
|
|
||||||
|
|
||||||
# clone required branch for meta-qt5
|
|
||||||
clone_meta '' $COMPATIBLE_BRANCH $QT5_LAYER_GIT_URL '' $BUILD_ROOT_DIR/$QT5_LAYER_NAME
|
|
||||||
echo -e "\033[32;1mOK ...\033[0m\n"
|
|
||||||
|
|
||||||
# clone/update required branch from meta-neutrino
|
|
||||||
clone_meta '' $COMPATIBLE_BRANCH $TUXBOX_LAYER_GIT_URL/$TUXBOX_LAYER_NAME '' $BUILD_ROOT_DIR/$TUXBOX_LAYER_NAME
|
|
||||||
echo -e "\033[32;1mOK ...\033[0m\n"
|
|
||||||
|
|
||||||
|
|
||||||
# gfutures
|
|
||||||
if [ "$MACHINE" == "all" ] || [ $(is_required_machine_layer "' $MACHINES_GFUTURES '") == true ]; then
|
if [ "$MACHINE" == "all" ] || [ $(is_required_machine_layer "' $MACHINES_GFUTURES '") == true ]; then
|
||||||
# gfutures
|
# gfutures
|
||||||
clone_meta '' $COMPATIBLE_BRANCH $GFUTURES_LAYER_GIT_URL '' $BUILD_ROOT_DIR/$GFUTURES_LAYER_NAME
|
fetch_meta "" $GFUTURES_LAYER_BRANCH $GFUTURES_LAYER_GIT_URL "$GFUTURES_LAYER_SRCREV" $BUILD_ROOT_DIR/$GFUTURES_LAYER_NAME
|
||||||
echo -e "\033[32;1mOK ...\033[0m\n"
|
|
||||||
fi
|
fi
|
||||||
# airdigital
|
|
||||||
if [ "$MACHINE" == "all" ] || [ $(is_required_machine_layer "' $MACHINES_AIRDIGITAL '") == true ]; then
|
# fetch required branch from meta-ceryon
|
||||||
clone_meta '' $COMPATIBLE_BRANCH $AIRDIGITAL_LAYER_GIT_URL '' $BUILD_ROOT_DIR/$AIRDIGITAL_LAYER_NAME
|
CERYON_LAYER_NAME=meta-ceryon
|
||||||
echo -e "\033[32;1mOK ...\033[0m\n"
|
CERYON_LAYER_BRANCH="master"
|
||||||
fi
|
CERYON_LAYER_SRCREV="4a02145fc4c233b64f6110d166c46b59ebe73371"
|
||||||
# edision
|
CERYON_LAYER_GIT_URL="$PROJECT_URL/$CERYON_LAYER_NAME.git"
|
||||||
if [ "$MACHINE" == "all" ] || [ $(is_required_machine_layer "' $MACHINES_EDISION '") == true ]; then
|
|
||||||
clone_meta '' $COMPATIBLE_BRANCH $EDISION_LAYER_GIT_URL '' $BUILD_ROOT_DIR/$EDISION_LAYER_NAME
|
|
||||||
echo -e "\033[32;1mOK ...\033[0m\n"
|
|
||||||
fi
|
|
||||||
# hisilicon #TODO: move into gfutures
|
|
||||||
if [ "$MACHINE" == "all" ] || [ $(is_required_machine_layer "' $MACHINES_HISI '") == true; then
|
|
||||||
clone_meta '' $COMPATIBLE_BRANCH $HISI_LAYER_GIT_URL '' $BUILD_ROOT_DIR/$HISI_LAYER_NAME
|
|
||||||
echo -e "\033[32;1mOK ...\033[0m\n"
|
|
||||||
fi
|
|
||||||
# ceryon
|
|
||||||
if [ "$MACHINE" == "all" ] || [ $(is_required_machine_layer "' $MACHINES_CERYON '") == true ]; then
|
if [ "$MACHINE" == "all" ] || [ $(is_required_machine_layer "' $MACHINES_CERYON '") == true ]; then
|
||||||
clone_meta '' $COMPATIBLE_BRANCH $CERYON_LAYER_GIT_URL '' $BUILD_ROOT_DIR/$CERYON_LAYER_NAME
|
fetch_meta "" $CERYON_LAYER_BRANCH $CERYON_LAYER_GIT_URL "$CERYON_LAYER_SRCREV" $BUILD_ROOT_DIR/$CERYON_LAYER_NAME
|
||||||
echo -e "\033[32;1mOK ...\033[0m\n"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# fetch required branch from meta-hisilicon #TODO: move into gfutures
|
||||||
# create included config file from sample file
|
HISI_LAYER_NAME=meta-hisilicon #TODO: move into gfutures
|
||||||
if test ! -f $BASEPATH/local.conf.common.inc; then
|
HISI_LAYER_BRANCH="master"
|
||||||
echo -e "\033[37;1mCONFIG:\033[0m\tcreate $BASEPATH/local.conf.common.inc as include file for layer configuration ..."
|
HISI_LAYER_SRCREV="e85e1781704d96f5dfa0c554cf81d24c147d888c"
|
||||||
do_exec "cp -v $BASEPATH/local.conf.common.inc.sample $BASEPATH/local.conf.common.inc"
|
HISI_LAYER_GIT_URL="$PROJECT_URL/$HISI_LAYER_NAME.git"
|
||||||
|
if [ "$MACHINE" == "all" ] || [ $(is_required_machine_layer "' $MACHINES_HISI '") == true ]; then
|
||||||
|
fetch_meta "" $HISI_LAYER_BRANCH $HISI_LAYER_GIT_URL "$HISI_LAYER_SRCREV" $BUILD_ROOT_DIR/$HISI_LAYER_NAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# fetch required branch from meta-edision
|
||||||
|
EDISION_LAYER_NAME=meta-edision
|
||||||
|
EDISION_LAYER_BRANCH="master"
|
||||||
|
EDISION_LAYER_SRCREV="1b2c422d9218e86ca1cd9d20431d42e716b1d714"
|
||||||
|
EDISION_LAYER_GIT_URL="$PROJECT_URL/$EDISION_LAYER_NAME.git"
|
||||||
|
if [ "$MACHINE" == "all" ] || [ $(is_required_machine_layer "' $MACHINES_EDISION '") == true ]; then
|
||||||
|
fetch_meta '' $EDISION_LAYER_BRANCH $EDISION_LAYER_GIT_URL "$EDISION_LAYER_SRCREV" $BUILD_ROOT_DIR/$EDISION_LAYER_NAME
|
||||||
|
fi
|
||||||
|
|
||||||
# create configuration for machine
|
## Configure buildsystem
|
||||||
|
# Create included config file from sample file
|
||||||
|
if test ! -f $LOCAL_CONFIG_FILE_INC_PATH; then
|
||||||
|
my_echo "\033[37;1mCONFIG:\033[0mCreate $LOCAL_CONFIG_FILE_INC_PATH as include file for local layer configuration ..."
|
||||||
|
do_exec "cp -v $LOCAL_CONFIG_FILE_INC_PATH.sample $LOCAL_CONFIG_FILE_INC_PATH"
|
||||||
|
do_exec "sed -i -e 's|#UPDATE_SERVER_URL = \"http://@hostname@\"|UPDATE_SERVER_URL = \"${UPDATE_SERVER_URL}\"|' $LOCAL_CONFIG_FILE_INC_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create configuration for machine
|
||||||
|
my_echo "\033[37;1mCreate configurations ...\033[0m"
|
||||||
if [ "$MACHINE" == "all" ]; then
|
if [ "$MACHINE" == "all" ]; then
|
||||||
for M in $MACHINES ; do
|
for M in $MACHINES ; do
|
||||||
create_local_config $M;
|
create_local_config $M;
|
||||||
done
|
done
|
||||||
|
my_echo "\033[32;1mdone!\033[0m\n"
|
||||||
else
|
else
|
||||||
create_local_config $MACHINE;
|
create_local_config $MACHINE;
|
||||||
|
my_echo "\033[32;1mdone!\033[0m\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
## Create distribution structure
|
||||||
create_dist_tree;
|
create_dist_tree;
|
||||||
|
|
||||||
echo -e "\033[37;1mNOTE:\033[0m"
|
## Distribution directory inside httpd directory for online update
|
||||||
|
my_echo "\033[37;1mLocal setup for package online update.\033[0m"
|
||||||
|
my_echo "------------------------------------------------------------------------------------------------"
|
||||||
|
my_echo "If you want to use online update for your devices, please configure your webserver and use the"
|
||||||
|
my_echo "content of $DIST_DIR"
|
||||||
|
my_echo "as destination for your webserver (e.g. apache, nginx, lighttpd or what ever you want)"
|
||||||
|
my_echo ""
|
||||||
|
|
||||||
# check and create distribution directory inside html directory for online update
|
## Show results
|
||||||
if test ! -L /var/www/html/dist; then
|
my_echo "\033[32;1m\nSummary:\033[0m"
|
||||||
echo -e "\033[37;1m\tLocal setup for package online update.\033[0m"
|
my_echo "\033[32;1m------------------------------------------------------------------------------------------------\033[0m"
|
||||||
echo -e "\t############################################################################################"
|
my_echo ""
|
||||||
echo -e "\t/var/www/html/dist doesn't exists."
|
my_echo "\033[37;1mLocal environment setup was created\033[0m"
|
||||||
echo -e "\tIf you want to use online update, please configure your webserver and use dist content"
|
my_echo "------------------------------------------------------------------------------------------------"
|
||||||
echo -e "\t"
|
my_echo "On 1st call of $0 Your config was created at this file from the template sample file"
|
||||||
echo -e "\tAn easy way is to create a symlink to dist directory:"
|
my_echo ""
|
||||||
echo -e "\t"
|
my_echo "\033[37;1m\t$BASEPATH/local.conf.common.inc\033[0m"
|
||||||
echo -e "\t\t\033[37;1msudo ln -s $BASEPATH/dist /var/www/html/dist\033[0m"
|
my_echo ""
|
||||||
|
my_echo "If this file has already exists some entries could be migrated or added on this file."
|
||||||
|
my_echo "You should check $BASEPATH/local.conf.common.inc and modify it if required."
|
||||||
|
my_echo ""
|
||||||
|
my_echo "Unlike here: Please check this files for modifications or upgrades:"
|
||||||
|
my_echo ""
|
||||||
|
my_echo "\033[37;1m\t$BUILD_ROOT/<machine>/bblayer.conf\033[0m"
|
||||||
|
my_echo "\033[37;1m\t$BUILD_ROOT/<machine>/local.conf\033[0m"
|
||||||
|
|
||||||
fi
|
my_echo ""
|
||||||
echo -e "\t"
|
my_echo "\033[37;1mUpdating build evironment and meta-layers\033[0m"
|
||||||
echo -e "\033[37;1m\tLocal environment setup\033[0m"
|
my_echo "------------------------------------------------------------------------------------------------"
|
||||||
echo -e "\t############################################################################################"
|
my_echo ""
|
||||||
echo -e "\t$BASEPATH/local.conf.common.inc was created by the 1st call of $0 from"
|
my_echo "\033[37;1m\texecute: $0\033[0m \033[32;1m--update\033[0m"
|
||||||
echo -e "\t$BASEPATH/local.conf.common.inc.sample"
|
my_echo ""
|
||||||
echo -e "\tIf this file already exists nothing was changed on this file for your configuration."
|
my_echo "------------------------------------------------------------------------------------------------"
|
||||||
echo -e "\tYou should check $BASEPATH/local.conf.common.inc and modify this file if required."
|
|
||||||
echo -e "\t"
|
|
||||||
echo -e "\tUnlike here: Please check this files for modifications or upgrades:"
|
|
||||||
echo -e "\t"
|
|
||||||
echo -e "\t\t\033[37;1m$BUILD_ROOT/<machine>/bblayer.conf\033[0m"
|
|
||||||
echo -e "\t\t\033[37;1m$BUILD_ROOT/<machine>/local.conf\033[0m"
|
|
||||||
# echo -e "\t############################################################################################"
|
|
||||||
echo -e "\t"
|
|
||||||
echo -e "\033[37;1m\tStart build\033[0m"
|
|
||||||
echo -e "\t############################################################################################"
|
|
||||||
echo -e "\tNow you are ready to build your own images and packages."
|
|
||||||
echo -e "\tSelectable machines are:"
|
|
||||||
echo -e "\t"
|
|
||||||
echo -e "\t\t\033[37;1m$MACHINES\033[0m"
|
|
||||||
echo -e "\t"
|
|
||||||
echo -e "\t Select your favorite machine (or identical) and the next steps are:\033[37;1m"
|
|
||||||
echo -e "\t"
|
|
||||||
echo -e "\t\tcd $BUILD_ROOT_DIR"
|
|
||||||
echo -e "\t\t. ./oe-init-build-env build/<machine>"
|
|
||||||
echo -e "\t\tbitbake neutrino-image"
|
|
||||||
echo -e "\t\033[0m"
|
|
||||||
|
|
||||||
echo -e "\t"
|
my_echo "\033[32;1mDONE!\033[0m"
|
||||||
echo -e "\033[37;1m\tUpdating meta-layers\033[0m"
|
|
||||||
echo -e "\t############################################################################################"
|
my_echo ""
|
||||||
echo -e "\tExecute init script again."
|
my_echo "\033[37;1mStart build\033[0m"
|
||||||
echo -e "\t"
|
my_echo "------------------------------------------------------------------------------------------------"
|
||||||
echo -e "\tFor more informations and next steps take a look at the README.md!"
|
my_echo "Now you are ready to build your own images and packages."
|
||||||
echo -e "\t"
|
my_echo "Selectable machines are:"
|
||||||
echo -e "\033[32;1mDONE!\033[0m"
|
my_echo ""
|
||||||
|
my_echo "\033[37;1m\t$MACHINES\033[0m"
|
||||||
|
my_echo ""
|
||||||
|
my_echo "Select your favorite machine (or identical) and the next steps are:\033[37;1m"
|
||||||
|
my_echo ""
|
||||||
|
my_echo "\tcd $BUILD_ROOT_DIR && . ./oe-init-build-env build/<machine>"
|
||||||
|
my_echo "\tbitbake neutrino-image"
|
||||||
|
my_echo "\033[0m"
|
||||||
|
|
||||||
|
my_echo "For more information and next steps take a look at the README.md!"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@@ -242,15 +242,12 @@ DISTRO_TYPE = "beta"
|
|||||||
# where do find the buildsystem the distro type file (beta.txt, release.txt ...), this file contains list of image urls for download
|
# where do find the buildsystem the distro type file (beta.txt, release.txt ...), this file contains list of image urls for download
|
||||||
#RELEASE_TEXT_LOCATION_FILE = "${DEPLOY_DIR_IMAGE}/${DISTRO_TYPE}.txt"
|
#RELEASE_TEXT_LOCATION_FILE = "${DEPLOY_DIR_IMAGE}/${DISTRO_TYPE}.txt"
|
||||||
|
|
||||||
### Server URL which contains update and packages.
|
### Server URL which contains update and packages, must contain the content of the deployed images and packages
|
||||||
# Web server must be running and html content must point to the toplevel directory which contains the deployed images
|
# Web server must be running and html content must point to the toplevel directory which contains the deployed images
|
||||||
# NOTE: @hostname@ is only a placeholder and will be replaced with current hostname of your build host automatically. @hostname@ could be the current host IP too.
|
# NOTE: @hostname@ is only a placeholder and will be replaced with current hostname of your build host automatically. @hostname@ could be the current host IP too.
|
||||||
# or any other domain.tld. If required, replace @hostname@ with the host IP or Domain.
|
# or any other domain.tld. If required, replace @hostname@ with the host IP or Domain.
|
||||||
#UPDATE_SERVER_URL = "http://@hostname@"
|
#UPDATE_SERVER_URL = "http://@hostname@"
|
||||||
|
|
||||||
## URL to the dist directory, must contain the content of the deployed images and packages
|
|
||||||
#DIST_URL = "${UPDATE_SERVER_URL}/dist"
|
|
||||||
|
|
||||||
## URL to the images, must contain the content of the image dir and its a sub dir to specific machine build and image dir which contains machine images
|
## URL to the images, must contain the content of the image dir and its a sub dir to specific machine build and image dir which contains machine images
|
||||||
#IMAGE_LOCATION_URL = "${DIST_URL}/${DISTRO_VERSION}/${MACHINE}/images/${MACHINE}"
|
#IMAGE_LOCATION_URL = "${DIST_URL}/${DISTRO_VERSION}/${MACHINE}/images/${MACHINE}"
|
||||||
|
|
||||||
@@ -312,6 +309,7 @@ SHOUTCAST_DEV_KEY = ""
|
|||||||
# The WEATHER_DEV_KEY variable is not longer used for darksky keys
|
# The WEATHER_DEV_KEY variable is not longer used for darksky keys
|
||||||
# Currently used provider is: openweather map
|
# Currently used provider is: openweather map
|
||||||
WEATHER_DEV_KEY = ""
|
WEATHER_DEV_KEY = ""
|
||||||
|
WEATHER_API_VERSION = "3.0"
|
||||||
# NOTE: YouTube functionality of Neutrino was completely removed in 2022, this key has no effects anymore, but YouTube is usable further with plugins.
|
# NOTE: YouTube functionality of Neutrino was completely removed in 2022, this key has no effects anymore, but YouTube is usable further with plugins.
|
||||||
YT_DEV_KEY = ""
|
YT_DEV_KEY = ""
|
||||||
|
|
||||||
@@ -322,13 +320,21 @@ YT_DEV_KEY = ""
|
|||||||
# NOTE! --enable-testing Works only with FLAVOUR = "tuxbox".
|
# NOTE! --enable-testing Works only with FLAVOUR = "tuxbox".
|
||||||
# If you want to use a different FLAVOUR than 'tuxbox', keep these lines uncommented and
|
# If you want to use a different FLAVOUR than 'tuxbox', keep these lines uncommented and
|
||||||
# add them to your local.conf within your build directory.
|
# add them to your local.conf within your build directory.
|
||||||
#EXTRA_OECONF_append_pn-neutrino-mp += " \
|
#EXTRA_OECONF_append_pn-neutrino += " \
|
||||||
# --enable-testing \
|
# --enable-testing \
|
||||||
#"
|
#"
|
||||||
## Uncomment these lines to disable debug mode for Neutrino.
|
## Uncomment these lines to disable debug mode for Neutrino.
|
||||||
#EXTRA_OECONF_append_pn-neutrino-mp += " \
|
#EXTRA_OECONF_append_pn-neutrino += " \
|
||||||
# --without-debug \
|
# --without-debug \
|
||||||
#"
|
#"
|
||||||
|
## Uncomment these lines to enable API-management via Neutrino.
|
||||||
|
# EXTRA_OECONF_append_pn-neutrino += " \
|
||||||
|
# --enable-tmdb-key-manage \
|
||||||
|
# --enable-omdb-key-manage \
|
||||||
|
# --enable-youtube-key-manage \
|
||||||
|
# --enable-shoutcast-id-manage \
|
||||||
|
# --enable-weather-key-manage \
|
||||||
|
# "
|
||||||
|
|
||||||
### Extra build config options for gdb build
|
### Extra build config options for gdb build
|
||||||
#EXTRA_OECONF_append_pn-gdb = "--with-system-gdbinit=/etc/gdbinit"
|
#EXTRA_OECONF_append_pn-gdb = "--with-system-gdbinit=/etc/gdbinit"
|
||||||
|
10
translate-md-config.json
Normal file
10
translate-md-config.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"template_md": "template.md",
|
||||||
|
"output_dir": ".",
|
||||||
|
"prefix": "README_",
|
||||||
|
"main_doc": "README.md",
|
||||||
|
"target_languages": {
|
||||||
|
"de": ["German", "🇩🇪"],
|
||||||
|
"en": ["English", "🇬🇧"]
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user