User Tools

Site Tools


prive:rpi-dietpi

DietPi sur Raspberry Pi (configuration automatisée)

Introduction

Cet article présente comment mettre en œuvre une configuration automatisée à l'aide de DietPi sur un Raspberry Pi 4.

DietPi est un système d'exploitation léger basé sur Debian. DietPi est configuré à l'aide d'un fichier de configuration. Là, les paramètres système peuvent être configurés. DietPi configurera ensuite le système lors de la première exécution en utilisant ces paramètres. Il est également possible de lancer automatiquement une instance Chromium sur une URL spécifique après le démarrage.

Le panneau numérique est implémenté à l'aide de Vue.js et d'un simple slider Bootstrap qui parcourt les images. Il est servi sur une URL accessible au public.

Liste des applications DietPi

Le tableau suivant collecte des informations qui peuvent être utilisé pour une installation automatisée : dietpi-software install <id>

  • ID: ID interne de DietPi-Software
  • Title: nom du logiciel
  • Version: La version que DietPi-Software installe actuellement
  • Source: liens de téléchargement/source pour vérifier les versions actuelles, le cas échéant
  • Reinstall: si/sur quelle version DietPi-Update réinstallera ce titre de logiciel
  • Install Methode: par ex. APT, APT (dépôt personnalisé), DPKG (en dehors du dépôt), téléchargement binaire, build source
  • Update Methode: (pertinente pour les installations sans package uniquement) par ex. Mise à jour de l'interface utilisateur/CLI interne, mise à jour externe, retélécharger/installer
  • Reinstall: par ex. Écraser, fusionner, sauvegarder la configuration/données, ignorer, demander à l'utilisateur
ID Title Install method Version Source Update method Reinstall
0 OpenSSH Client APT
1 Samba Client APT
2 Folding@Home DEB latest 7.6 https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/ manual 6.31
3 MC APT
4 Vifm APT
5 ALSA APT
6 X.Org X server APT
7 FFmpeg APT
8 Java JDK APT
9 Node.js Installer > tarball latest https://github.com/MichaIng/nodejs-linux-installer
10 iftop APT
11 IPTraf APT
12 Iperf APT
13 MTR-Tiny APT
14 nLoad APT
15 tcpdump APT
16 Build-Essentials APT
17 Git APT
18 Emacs APT
19 Jed APT
20 Vim APT
21 Vim-Tiny APT
22 QuiteRSS APT
23 LXDE APT
24 MATE APT
25 Xfce APT
26 GNUstep APT
27 TasmoAdmin tarball master https://github.com/reloxx13/TasmoAdmin internal skip
28 TigerVNC Server APT 6.9
29 XRDP APT 6.8
30 NoMachine DEB (self-hosted) 7.6.2 https://www.nomachine.com/download reinstall
31 Kodi APT 6.1
32 ympd Own build 1.2.3 https://github.com/notandy/ympd/releases 6.12
33 Airsonic Binary latest https://api.github.com/repos/airsonic/airsonic/releases/latest 6.12
35 Logitech Media Server DEB latest 8.2 http://downloads.slimdevices.com/ 6.5
36 Squeezelite DEB (own build) 1.9.9 https://github.com/ralph-irving/squeezelite reinstall 6.31
37 Shairport Sync DEB (own build) 3.3.8 https://github.com/mikebrady/shairport-sync/releases reinstall 6.2
38 FreshRSS tarball master https://github.com/FreshRSS/FreshRSS reinstall
39 ReadyMedia APT 6.12
40 Ampache tarball master https://github.com/ampache/ampache reinstall
41 Emby Server DEB latest https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest
42 Plex Media Server APT (official repo) https://www.plex.tv/media-server-downloads/ 6.23
43 Murmur APT
44 Transmission APT
45 Deluge APT 6.22
46 qBittorrent APT
47 ownCloud tarball latest https://download.owncloud.org/community/ internal 6.23
48 Pydio tarball latest https://download.pydio.com/pub/core/ci/ 6.23
49 Gogs tarball (ARMv6: own zip) ARMv6: 0.9.141 https://github.com/gogits/gogs/releases
50 Syncthing tarball latest https://api.github.com/repos/syncthing/syncthing/releases/latest 6.27
51 OpenTyrian Binary (own build) 2.1 https://github.com/opentyrian/opentyrian/releases
52 Cuberite tarball latest
53 MineOS Git clone https://github.com/hexparrot/mineos-node
54 phpBB tarball 3.3.5 https://www.phpbb.com/downloads/ web UI
55 Wordpress tarball latest https://wordpress.org/download/
56 Single File PHP Gallery 7z (self-hosted) 4.7.1 https://www.sye.dk/sfpg/
57 BaiKal tarball master https://github.com/fruux/Baikal
58 OpenBazaar Go get
59 RPi Cam Web Interface tarball master https://github.com/silvanmelchior/RPi_Cam_Web_Interface/ 6.3
60 hostapd APT
61 Tor Hotspot APT
62 Box86 Source build latest https://api.github.com/repos/ptitSeb/box86/tags
63 LinuxDash tarball master https://github.com/afaqurk/linux-dash
64 phpSysInfo tarball master https://github.com/phpsysinfo/phpsysinfo
65 Netdata Stretch: DEB (own build) Stretch: 1.11.1 https://github.com/firehol/netdata/releases 6.2
66 RPi-Monitor DEB 2.12-r0 https://github.com/XavierBerger/RPi-Monitor-deb/tree/master/packages
67 Firefox APT
68 Remot3.it DEB latest https://api.github.com/repos/remoteit/installer/releases/latest reinstall
69 RPi.GPIO APT
70 WiringPi Source build master RPi: https://github.com/WiringPi/WiringPi Odroids: https://github.com/hardkernel/wiringPi
71 WebIOPi tarball master https://github.com/Freenove/WebIOPi
72 I2C APT
73 Fail2Ban APT 6.1
74 InfluxDB APT (official repo) https://repos.influxdata.com/debian/
75 LASP META
76 LAMP META
77 Grafana APT (official repo) ARMv6: DEB (official) ARMv6: 8.1.2 https://grafana.com/grafana/download 6.27
78 LESP META
79 LEMP META
80 Ubooquity Binary latest https://vaemendis.net/ubooquity/static2/download
81 LLSP META
82 LLMP META
83 Apache2 APT
84 Lighttpd APT
85 Nginx APT
86 Roon Extension Manager Installer
87 SQLite APT
88 MariaDB APT
89 PHP APT (Stretch: sury.org) 6.23
90 phpMyAdmin tarball latest https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest 6.27
91 Redis APT
92 Certbot APT
93 Pi-hole Installer http://install.pi-hole.net pihole -up
94 ProFTPD APT
95 vsftpd APT
96 Samba Server APT 6.2
97 OpenVPN APT
98 HAProxy Source build 2.5.0 https://www.haproxy.org/download/ reinstall 6.29
100 PiJuice APT
101 Logrotate APT
102 Rsyslog APT
103 DietPi-RAMlog Internal
104 Dropbear APT
105 OpenSSH Server APT
106 Lidarr tarball latest https://api.github.com/repos/Lidarr/Lidarr/releases 6.18
107 rTorrent tar (official) latest https://api.github.com/repos/Novik/ruTorrent/releases/latest
108 Amiberry 7z (own builds) 4.1.4 https://github.com/midwan/amiberry/releases reinstall 6.33
109 NFS Server APT
110 NFS Client APT
111 UrBackup Server DEB latest https://hndl.urbackup.org/Server/latest/ 6.4
112 DXX-Rebirth 7z (own build) 0.58.1 https://github.com/dxx-rebirth/dxx-rebirth
113 Chromium APT 6.19
114 Nextcloud tarball latest https://download.nextcloud.com/server/releases/ 6.23
115 Webmin APT (official repo) https://download.webmin.com/download/repository 6.26
116 Medusa tarball master https://github.com/pymedusa/Medusa 6.12
117 PiVPN Installer https://install.pivpn.io
118 Mopidy APT (official repo) https://docs.mopidy.com/en/latest/installation/debian/ 6.5
119 CAVA DEB (own build) 0.6.1 Odroid C2: 0.4.2 https://github.com/karlstav/cava/releases 6.9
120 RealVNC Server APT 6.9
121 Roon Bridge tarball http://kb.roonlabs.com/LinuxInstall 6.18
122 Node-RED NPM
123 Mosquitto APT 6.33
124 NAA Daemon DEB latest https://www.signalyst.eu/bins/naa/linux/ 6.2
125 Synapse pip
126 AdGuard Home tarball latest https://github.com/AdguardTeam/AdGuardHome/releases
127 Neovim APT
128 MPD Own build Buster: APT 0.20.23 (Stretch) https://www.musicpd.org/download/mpd/stable/ 6.2
129 O!MPD tarball master 6.25
130 Python 3 pip Installer latest https://bootstrap.pypa.io/get-pip.py
131 Blynk Server Binary latest https://api.github.com/repos/blynkkk/blynk-server/releases/latest 6.2
132 Aria2 APT 6.26
133 YaCy tarball latest https://yacy.net/download_installation/
134 Docker-Compose pip
135 IceCast APT
136 MotionEye pip
137 mjpg-streamer Source build master https://github.com/jacksonliam/mjpg-streamer
138 VirtualHere Binary https://virtualhere.com/usb_server_software
139 SABnzbd tarball master https://github.com/sabnzbd/sabnzbd/releases 6.23
140 Domoticz tarball stable https://www.domoticz.com/downloads/
141 Spotify Connect Web tarball Alpha 0.0.4 https://github.com/Fornoth/spotify-connect-web/releases
143 Koel tarball latest https://github.com/phanan/koel/releases 6.12
144 Sonarr APT (official) ARMv8: tarball (official) http://apt.sonarr.tv/dists/develop/ http://download.sonarr.tv/v2/develop/mono/ 6.18
145 Radarr tarball latest https://api.github.com/repos/Radarr/Radarr/releases/latest web UI updater 3.34
146 Tautulli Git clone master https://github.com/Tautulli/Tautulli 6.33
147 Jackett tarball latest https://api.github.com/repos/Jackett/Jackett/releases/latest 6.27
148 myMPD Installer master https://github.com/jcorporation/myMPD 6.25
149 NZBGet Installer https://nzbget.net/download/nzbget-latest-bin-linux.run 6.12
150 Mono APT (official repo) https://download.mono-project.com/repo/debian/
151 Nvidia APT
152 Avahi-Daemon APT
153 OctoPrint pip 6.34
154 Roon Server tarball https://help.roonlabs.com/portal/en/kb/articles/linux-install#Downloads 6.12
155 HTPC Manager Git clone master2 https://github.com/HTPC-Manager/HTPC-Manager
156 Steam APT ARM: DPKG (self-hosted) ARM: 1.0.0.68-1 ARM: https://packages.debian.org/bullseye/steam
157 Home Assistant pip (Python v3.9.9) 6.27
158 Minio Binary latest https://dl.minio.io/server/minio/release/ reinstall
159 Allo dietpi.com archive 13.2 reinstall 6.29
160 Allo update dietpi.com archive 13.2 reinstall 6.29
161 FuguHub Installer https://fuguhub.com/download.lsp
162 Docker Installer > APT (official) https://download.docker.com/linux/debian/dists/
163 GMediaRender Own build 0.0.8 https://github.com/hzeller/gmrender-resurrect/releases 6.27
164 Nukkit Binary last stable https://ci.nukkitx.com/job/NukkitX/job/Nukkit/job/master/lastStableBuild/artifact/target/nukkit-1.0-SNAPSHOT.jar
165 Gitea Binary latest https://api.github.com/repos/go-gitea/gitea/releases/latest 6.25
166 PI-SPC Internal (?) 6.8
167 Raspotify APT (official repo) https://dtcooper.github.io/raspotify/#hard-installation
168 Nextcloud Talk Nextcloud store apps.nextcloud.com
169 Google AIY Git clone https://github.com/google/aiyprojects-raspbian
170 UnRAR APT, Raspbian: self-hosted
171 frp tarball https://github.com/fatedier/frp/blob/dev/README.md
172 WireGuard APT (Bullseye repo)
173 LXQt APT
174 GIMP APT
175 Xfce4 Power APT
176 Mycroft AI Git clone master https://github.com/MycroftAI/mycroft-core.git
177 Firefox Sync Server tarball fixed commit https://github.com/mozilla-services/syncserver
178 Jellyfin APT (official repo) https://repo.jellyfin.org/debian/
179 Komga jar latest https://api.github.com/repos/gotson/komga/releases/latest
180 Bazarr Git clone master https://github.com/morpheus65535/bazarr.git
181 PaperMC jar lastest https://papermc.io/ci/
182 Unbound APT
183 vaultwarden tarball latest https://api.github.com/repos/dani-garcia/vaultwarden/releases/latest 7.2
184 Tor Relay APT
185 Portainer docker run
186 IPFS Node binary latest https://dist.ipfs.io/go-ipfs
187 CUPS APT
188 Go tarball latest https://golang.org/dl
189 VSCodium APT
190 Beets APT https://beets.io/
191 Snapcast Server DEB https://github.com/badaix/snapcast
192 Snapcast Client DEB https://github.com/badaix/snapcast
193 K3s Installer https://k3s.io
194 PostgreSQL APT
195 youtube-dl binary latest https://yt-dl.org/downloads/latest/youtube-dl
196 Java JRE APT
197 Box64 source build latest https://github.com/ptitSeb/box64/releases
198 File Browser tarball latest https://github.com/filebrowser/filebrowser/releases
199 Spotifyd binary latest https://github.com/Spotifyd/spotifyd/releases
200 DietPi-Dashboard binary latest https://github.com/ravenclaw900/DietPi-Dashboard/releases reinstall

Configuration

On peut ajuster le fichier de configuration standard Raspberry Pi aux besoins. Dans la plupart des cas, on voudra désactiver l'overscan à l'aide de disable_overscan=1 et désactiver l'écran de démarrage avec disable_splash=1.

Si on utilise un Raspberry Pi 4, on peut également définir le pilote graphique en définissant : dtoverlay=vc4-kms-v3d.

L'ancien pilote vc4-fkms-v3d (driver Broadcom VideoCore 4 présent dans Raspberry Pi) ne sera plus pris en charge à l'avenir. Il s'appuie fortement sur des éléments spécifiques aux ordinateurs Pi et non directement pris en charge par Linux. Le nouveau pilote vc4-kms-v3d introduit avec Bullseye est a privilégié, mais comme il est nouveau, il y aura des ajustements nécessaires (en particulier pour les personnes qui dépendaient des anciens pilotes et logiciels fkms).

Lorsque le nouveau pilote fonctionne mal utiliser: dtoverlay=vc4-fkms-v3d

Créer un fichier dietpi-wifi.txt pour spécifier un réseau WiFi, auquel le Pi pourra se connecter automatiquement:

# - Entrée 0
# WiFi SSID (sensible à la casse)
aWIFI_SSID[0]='Mon Wifi'
# Options de clé : si aucune clé (ouverte), laisser ce champ vide
aWIFI_KEY[0]=''
# Options disponibles : NONE (pas de clé/ouvert) | WPA-PSK | WEP | WPA-EAP (puis utiliser les paramètres ci-dessous)
aWIFI_KEYMGR[0]='WPA-PSK'

La configuration la plus importante se fait dans le fichier dietpi.txt. Ici, on peut définir une adresse IP statique, définir un serveur SSH à lancer pour la maintenance et configurer le Pi pour qu'il attende un réseau avec CONFIG_BOOT_WAIT_FOR_NETWORK=2. Pour activer la configuration automatique, définir AUTO_SETUP_AUTOMATED=1, AUTO_SETUP_AUTOSTART_LOGIN_USER=root et AUTO_SETUP_INSTALL_SOFTWARE_ID=113 (le 113 indique à DietPi d'installer Chrome). Chromium sera automatiquement lancé en mode kiosque en définissant AUTO_SETUP_AUTOSTART_TARGET_INDEX=11.

Configurer ensuite Chrome. Par exemple.:

SOFTWARE_CHROMIUM_RES_X=1920
SOFTWARE_CHROMIUM_RES_Y=1080
SOFTWARE_CHROMIUM_AUTOSTART_URL=https://google.de

Script d'automatisation personnalisé

On peut également définir un script qui s'exécute une fois lors de l'installation. Ceci est utile si on souhaite transmettre des arguments personnalisés à l'exécutable chromium et gérer d'autres logiques telles que l'extinction automatique de l'affichage pendant la nuit.

Pour pouvoir utiliser un script personnalisé, définir AUTO_SETUP_AUTOSTART_TARGET_INDEX=7 et AUTO_SETUP_CUSTOM_SCRIPT_EXEC=0.

Créer ensuite un nouveau script shell appelé Automation_Custom_Script.sh.

Ajouter ce qui suit à ce script pour exécuter automatiquement un script au démarrage :

echo -e "if [[ \"$(tty)\" = \"/dev/tty1\" ]]; then
  . /root/startup.sh
fi
" > /root/.bashrc

echo -e "# turn off screensaver
xset -dpms
xset s off
xset s noblank

# Résolution à utiliser pour le mode kiosque, devrait idéalement correspondre à la résolution actuelle du systèmeRES_X=$(grep -m1 '^[[:blank:]]*SOFTWARE_CHROMIUM_RES_X=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
RES_Y=$(grep -m1 '^[[:blank:]]*SOFTWARE_CHROMIUM_RES_Y=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')

# URL
URL=$(grep -m1 '^[[:blank:]]*SOFTWARE_CHROMIUM_AUTOSTART_URL=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')

# arguments Chromiom
CHROMIUM_OPTS=\" --no-sandbox --homepage \$URL --app --start-fullscreen --check-for-update-interval=604800 --window-size=\$RES_X,\$RES_Y --app-window-size=\$RES_X,\$RES_Y --window-position=0,0 --incognito --noerrdialogs --disable-infobars \"

# Chrome binaire
FP_CHROMIUM=\"$(command -v chromium-browser)\"

xinit \$FP_CHROMIUM \$CHROMIUM_OPTS -- -nocursor
" > /root/startup.sh

Ces commandes créeront également le script de démarrage personnalisé, qui désactivera l'économiseur d'écran et exécutera Chromium sur l'URL spécifiée dans le fichier dietpi.txt comme auparavant. Les arguments chromium lanceront chromium en mode d'application plein écran et bloqueront l'affichage de tous les messages.

Éteindre l'écran pendant la nuit

Pour éteindre l'écran à certaines heures, ajouter et ajuster les éléments suivants à Automation_Custom_Script.sh :

echo "0 1 * * * root DISPLAY=:0 xset dpms force off
55 7 * * * root DISPLAY=:0 xset dpms force on
" >> /etc/crontab

Installation

Pour installer DietPi le Raspberry Pi :

  • Télécharger l'image DietPi https://dietpi.com/downloads/images/DietPi_RPi-ARMv8-Bullseye.7z
    • Décompresser l'image
    • Insérer la carte SD
    • Utiliser l'une des méthodes décrites ici pour graver l'image sur la carte SD.
    • Mettre les fichiers config.txt, dietpi.txt, dietpi-wifi.txt(modifié pour ajuster les informations d'identification WiFi) et Automation_Custom_Script.sh dans le dossier racine (/) sur la carte SD.
    • Éjecter la carte SD en toute sécurité et la placer dans le Raspberry Pi
    • Brancher tous vos câbles dans le Raspberry Pi (en s'assurant que le câble d'alimentation est le dernier).
    • Laisser la configuration s'exécuter. On doit interagir une fois et accepter les conditions du logiciel en appuyant sur Entrée. Le site Web devrait s'ouvrir une fois la configuration terminée.

    Deskpi Pro est un kit matériel pour convertir une Raspberry PI 4 standard à partir d'un SBC nu, avec un stockage limité, en un mini PC complet avec un bouton d'alimentation, un refroidissement, de meilleurs ports et un Mass Storage via SATA USB3 ou M.2.
    Pour l'installer sur DietPi 64bit il faut installer git en premier apt-get update && apt-get -y install git puis procéder ainsi:

    cd ~
    git clone https://github.com/DeskPi-Team/deskpi.git
    cd ~/deskpi/
    ./install.s

prive/rpi-dietpi.txt · Last modified: 2025/02/19 10:59 by 127.0.0.1