+++ p4d - Installation by source (working for most linux plattforms) und p4d-Paket erstellen +++ https://github.com/horchi/linux-p4d#installation-by-source-working-for-most-linux-plattforms ================================================== >>> EINMALIG - Vorbereitung manuelle Installation <<< ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *** Raspberry Pi updaten *** sudo apt update && sudo apt upgrade -y sudo apt full-upgrade -y ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *** EINMALIG - Installation libwebsockets *** (Stand 24.04.2022) # CMake installieren, wenn noch nicht vorhanden sudo apt install cmake -y # Version prüfen cmake --version # libwebsockets-Repository klonen und im Ordner /usr/src/ ablegen cd /usr/src/ ls -lh # Falls Verzeichnis vorhanden, zuerst löschen sudo rm -d -r /usr/src/libwebsockets ls -lh sudo git clone https://libwebsockets.org/repo/libwebsockets ls -lh # libwebsockets zusammenbauen und installieren cd /usr/src/libwebsockets # optional, in 'main' scheinen immer die neuesten Fixes drin zu sein, bis sie dann nach 'master' kommen. #git checkout main sudo mkdir build cd build sudo cmake .. sudo make sudo make install ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *** EINMALIG - Installation MariaDB *** (Stand 24.04.2022) # MariaDB installieren sudo apt install mariadb-server # MariaDB root-Kennwort vergeben # MariaDB fragt unter Raspberry Pi OS bei der Installation leider # nicht nach einem Kennwort für den Benutzer root. # Dieses muss man erst setzen. Dies geht wie folgt. # https://canox.net/2017/08/passwort-fuer-den-root-benutzer-von-mariadb-setzen/ # MariaDB Secure Konfiguration # https://mariadb.com/kb/en/library/mysql_secure_installation/ sudo mysql_secure_installation #Enter current password for root (enter for none): #OK, successfully used password, moving on... # #Setting the root password or using the unix_socket ensures that nobody #can log into the MariaDB root user without the proper authorisation.# # #You already have your root account protected, so you can safely answer 'n'. # #Switch to unix_socket authentication [Y/n] n #... skipping. # #You already have your root account protected, so you can safely answer 'n'. # #Change the root password? [Y/n] n #... skipping. # #By default, a MariaDB installation has an anonymous user, allowing anyone #to log into MariaDB without having to have a user account created for #them. This is intended only for testing, and to make the installation #go a bit smoother. You should remove them before moving into a #production environment. # #Remove anonymous users? [Y/n] y #... Success! # #Normally, root should only be allowed to connect from 'localhost'. This #ensures that someone cannot guess at the root password from the network. # #Disallow root login remotely? [Y/n] y #... Success! # #By default, MariaDB comes with a database named 'test' that anyone can #access. This is also intended only for testing, and should be removed #before moving into a production environment. # #Remove test database and access to it? [Y/n] y #- Dropping test database... # ... Success! # - Removing privileges on test database... # ... Success! # #Reloading the privilege tables will ensure that all changes made so far #will take effect immediately. # #Reload privilege tables now? [Y/n] y #... Success! # #Cleaning up... # #All done! If you've completed all of the above steps, your MariaDB #installation should now be secure. # #Thanks for using MariaDB! ~~~~~~~~~~~~~~~~~~~~~~~~~ # Setup lokale Datenbank sudo mysql -u root -Dmysql -p #Enter password: MariaDB [mysql]> CREATE DATABASE p4 charset utf8; MariaDB [mysql]> CREATE USER 'p4'@'localhost' IDENTIFIED BY 'p4'; MariaDB [mysql]> GRANT ALL PRIVILEGES ON p4.* TO 'p4'@'localhost' IDENTIFIED BY 'p4'; MariaDB [mysql]> flush privileges; MariaDB [mysql]> exit ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *** EINMALIG - Installation Mosquitto *** (Stand 24.04.2022) sudo apt install mosquitto mosquitto-clients -y ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ================================================== >>> Manuelle Installation - Durchführung <<< ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *** Raspberry Pi updaten *** sudo apt update && sudo apt upgrade -y sudo apt full-upgrade -y ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *** EINMALIG - Build-Abhängigkeiten installieren *** (Stand 24.04.2022) # Build-Abhängigkeiten installieren sudo apt install build-essential pkg-config libssl-dev libjansson-dev libcurl4-openssl-dev libmariadb-dev uuid-dev libcap-dev ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *** Installation p4d Daemon *** (Stand 24.04.2022) # p4d-Repository klonen und im Ordner /usr/src/ ablegen cd /usr/src/ ls -lh sudo git clone https://github.com/horchi/linux-p4d ls -lh # p4d zusammenbauen und installieren cd /usr/src/linux-p4d sudo make clean all # p4d installieren, nur falls notwendig! # ACHTUNG!!! # Wenn danach ein p4d-Paket gebaut wird, "make install" NICHT ausführen! # p4d wird später mit dem gebauten Paket installiert. #sudo make install ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *** Erster Start des p4d Daemon *** (Stand 24.04.2022) # ACHTUNG!!! # Wenn vorher "make install" NICHT ausgeführt wurde, # dann wird dieser Block nicht benötigt! # p4d wird später mit dem gebauten Paket gestartet. # p4d starten #sudo systemctl start p4d # Status p4d prüfen # it should now 'enabled' and in state 'running'! #sudo systemctl status p4d # Syslog auf p4d-Fehler prüfen #grep "p4d:" /var/log/syslog ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ================================================== >>> Paket für p4d bauen <<< https://www.holzheizer-forum.de/forum/thread/50090-fr%C3%B6ling-announce-p4d-visualisierung-und-einstellung-der-s-3200-via-com1/?postID=196199#post196199 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *** EINMALIG - Ordner für die gebauten Pakete anlegen *** (Stand 24.04.2022) # Ordner für die gebauten Pakete anlegen sudo mkdir /root/debs sudo ls -lh /root ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *** Paket für p4d erstellen *** (Stand 24.04.2022) # In den p4d Quellcode Ordner wechseln cd /usr/src/linux-p4d ls -lh # Wichtig! # Anpassung für Raspberry Pi OS (64-bit) notwendig! # In ../contrib/DEBIAN/control steht aktuell "Architecture: armhf" (ohne ") # Muss ersetzt werden durch "Architecture: arm64" (ohne ") # ...Entweder manuell ersetzen #sudo nano /usr/src/linux-p4d/contrib/DEBIAN/control # ...Oder automatisch ersetzen sudo sed -i 's/Architecture: armhf/Architecture: arm64/g' /usr/src/linux-p4d/contrib/DEBIAN/control # Paket erstellen sudo make build-deb # Erstelltes p4d-Paket anzeigen sudo ls -lh /root/debs #Ergebnis# #insgesamt 6,4M #drwxr-xr-x 6 root root 4,0K 12. Mär 17:33 p4d-0.9.36 #-rw-r--r-- 1 root root 6,4M 12. Mär 17:33 p4d-0.9.36.deb ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *** p4d mit dem gebauten Paket installieren *** (Stand 24.04.2022) # p4d-Paket installieren # Versionsnummer siehe vorigen Punkt sudo apt install /root/debs/p4d-0.9.36.deb ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *** p4d Dienst und Log prüfen *** (Stand 24.04.2022) # Dienst p4d – Status anzeigen sudo systemctl status p4d.service # Log-Datei /var/log/p4d.log anzeigen, 100 alte Daten ausgeben tail -n 100 /var/log/p4d.log ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ================================================== # ### Ab hier TEST ### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $ sudo find / -name mariadb ls -lh /etc/init.d/mariadb sudo rm /etc/init.d/mariadb ls -lh /etc/logrotate.d/mariadb sudo rm /etc/logrotate.d/mariadb ls -lh /usr/bin/mariadb $ sudo find / -name mysql ls -lh /etc/mysql sudo rm /etc/mysql/debian.cnf sudo rm -d -r /etc/mysql/mariadb.conf.d ls -lh /usr/bin/mysql ls -lh /usr/lib/mysql ls -lh /usr/share/mysql ls -lh /usr/share/bash-completion/completions/mysql ls -lh /var/lib/mysql sudo rm -d -r /var/lib/mysql/ ls -lh /var/lib/mysql/mysql ls -lh /var/log/mysql sudo rm -d -r /var/log/mysql ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pi@raspi01:~ $ sudo systemctl status mariadb.service ● mariadb.service - MariaDB 10.5.12 database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sun 2022-02-27 13:13:26 CET; 1min 34s ago Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 1211 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS) Process: 1212 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process: 1214 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && syst> Process: 1261 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE) Main PID: 1261 (code=exited, status=1/FAILURE) Status: "MariaDB server is down" CPU: 486ms Feb 27 13:13:26 raspi01 mariadbd[1261]: 2022-02-27 13:13:26 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error Feb 27 13:13:26 raspi01 mariadbd[1261]: 2022-02-27 13:13:26 0 [Note] InnoDB: Starting shutdown... Feb 27 13:13:26 raspi01 mariadbd[1261]: 2022-02-27 13:13:26 0 [ERROR] Plugin 'InnoDB' init function returned error. Feb 27 13:13:26 raspi01 mariadbd[1261]: 2022-02-27 13:13:26 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. Feb 27 13:13:26 raspi01 mariadbd[1261]: 2022-02-27 13:13:26 0 [Note] Plugin 'FEEDBACK' is disabled. Feb 27 13:13:26 raspi01 mariadbd[1261]: 2022-02-27 13:13:26 0 [ERROR] Unknown/unsupported storage engine: InnoDB Feb 27 13:13:26 raspi01 mariadbd[1261]: 2022-02-27 13:13:26 0 [ERROR] Aborting Feb 27 13:13:26 raspi01 systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE Feb 27 13:13:26 raspi01 systemd[1]: mariadb.service: Failed with result 'exit-code'. Feb 27 13:13:26 raspi01 systemd[1]: Failed to start MariaDB 10.5.12 database server. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ARCHITECTURE=$(dpkg --print-architecture) echo $ARCHITECTURE if [[ ${ARCHITECTURE} = "armhf" ]] then # Hier die Anpassung für Raspberry Pi OS (32-bit). # In ../contrib/DEBIAN/control den Parameter "Architecture: armhf" eintragen (ohne ") # Oder eigene Datei ../contrib/DEBIAN/control.armhf echo ARCHITECTURE=$ARCHITECTURE fi if [[ ${ARCHITECTURE} = "arm64" ]] then # Hier die Anpassung für Raspberry Pi OS (64-bit). # In ../contrib/DEBIAN/control den Parameter "Architecture: arm64" eintragen (ohne ") # Oder eigene Datei ../contrib/DEBIAN/control.arm64 echo ARCHITECTURE=$ARCHITECTURE fi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ================================================== # ### Ab hier mit Kommentar ### ==================================================