#24 Procédure installation RPi

Open
opened 3 years ago by maxime-alves · 3 comments

Création d’une VM

Création d'une VM
maxime-alves commented 3 years ago
Collaborator
LVM:
lvcreate -L 2G -n rpi_buster vg1
dd if=./2020-05-27-raspios-buster-lite-armhf.img of=/dev/vg1/rpi_buster bs=4M

QEMU:
dd if=./2020-05-27-raspios-buster-lite-armhf.img of=/dev/vg1/rpi_buster bs=4M
qemu-img resize /tmp/rpi.img +1G


utiliser raspi-config pour agrandir l'image à la taille du device

setup la keymap, la langue, etc...

activer le login ssh root et le service

installer les paquets :

apt install git sqlite3 python3-pip python3-click \
python3-requests python3-netifaces python3-serial

mkdir /var/lib/pyheatpump
echo 'pip3 install --upgrade git+https://git.yannweb.net/maxime-alves/pyHeatpump.git' > /var/lib/pyheatpump/pyheatpump_upgrade.sh
chmod +x /var/lib/pyheatpump/pyheatpump_upgrade.sh
/var/lib/pyheatpump/pyheatpump_upgrade.sh

sqlite3 -init /var/lib/pyheatpump/pyheatpump.sql /var/lib/pyheatpump/pyheatpump.sqlite3

cat << EOF > /var/lib/pyheatpump/pyheatpump.ini
[heatpump]
database = /var/lib/pyheatpump/pyheatpump.sqlite3

[supervisor]
scheme = https
host = supervision.gteo.fr
port = 8081
post_path = /Symfony/web/app_dev.php/boardws/insert
get_path = /Symfony/web/app_dev.php/boardws/orders
interval = 60
heatpump_id = 42

[api]
host = 0.0.0.0
port = 80
EOF

cd /etc/systemd/system
ln -s /var/lib/pyheatpump/pyheatpump_api.service
ln -s /var/lib/pyheatpump/pyheatpump_fetch.service
ln -s /var/lib/pyheatpump/pyheatpump_fetch.timer

systemctl daemon-reload
systemctl enable pyheatpump_api.service pyheatpump_fetch.timer pyheatpump_supervise.timer
``` LVM: lvcreate -L 2G -n rpi_buster vg1 dd if=./2020-05-27-raspios-buster-lite-armhf.img of=/dev/vg1/rpi_buster bs=4M QEMU: dd if=./2020-05-27-raspios-buster-lite-armhf.img of=/dev/vg1/rpi_buster bs=4M qemu-img resize /tmp/rpi.img +1G utiliser raspi-config pour agrandir l'image à la taille du device setup la keymap, la langue, etc... activer le login ssh root et le service installer les paquets : apt install git sqlite3 python3-pip python3-click \ python3-requests python3-netifaces python3-serial mkdir /var/lib/pyheatpump echo 'pip3 install --upgrade git+https://git.yannweb.net/maxime-alves/pyHeatpump.git' > /var/lib/pyheatpump/pyheatpump_upgrade.sh chmod +x /var/lib/pyheatpump/pyheatpump_upgrade.sh /var/lib/pyheatpump/pyheatpump_upgrade.sh sqlite3 -init /var/lib/pyheatpump/pyheatpump.sql /var/lib/pyheatpump/pyheatpump.sqlite3 cat << EOF > /var/lib/pyheatpump/pyheatpump.ini [heatpump] database = /var/lib/pyheatpump/pyheatpump.sqlite3 [supervisor] scheme = https host = supervision.gteo.fr port = 8081 post_path = /Symfony/web/app_dev.php/boardws/insert get_path = /Symfony/web/app_dev.php/boardws/orders interval = 60 heatpump_id = 42 [api] host = 0.0.0.0 port = 80 EOF cd /etc/systemd/system ln -s /var/lib/pyheatpump/pyheatpump_api.service ln -s /var/lib/pyheatpump/pyheatpump_fetch.service ln -s /var/lib/pyheatpump/pyheatpump_fetch.timer systemctl daemon-reload systemctl enable pyheatpump_api.service pyheatpump_fetch.timer pyheatpump_supervise.timer ```
maxime-alves commented 3 years ago
Collaborator

Script de lancement de VM

IMG=$1
echo "Mount $IMG"
qemu-system-arm \
   -kernel /mnt/glarg/rpi/rpi-20200922/kernel-qemu-5.4.51-buster \
   -dtb /mnt/glarg/rpi/rpi-20200922/versatile-pb-buster-5.4.51.dtb \
   -m 256 -M versatilepb -cpu arm1176 \
   -serial stdio \
   -append "rw console=ttyAMA0 root=/dev/vda2 panic=1 loglevel=8" \
   -drive "file=$IMG,if=none,index=0,media=disk,format=raw,id=disk0" \
  -device "virtio-blk-pci,drive=disk0,disable-modern=on,disable-legacy=off" \
   -no-reboot
Script de lancement de VM ``` IMG=$1 echo "Mount $IMG" qemu-system-arm \ -kernel /mnt/glarg/rpi/rpi-20200922/kernel-qemu-5.4.51-buster \ -dtb /mnt/glarg/rpi/rpi-20200922/versatile-pb-buster-5.4.51.dtb \ -m 256 -M versatilepb -cpu arm1176 \ -serial stdio \ -append "rw console=ttyAMA0 root=/dev/vda2 panic=1 loglevel=8" \ -drive "file=$IMG,if=none,index=0,media=disk,format=raw,id=disk0" \ -device "virtio-blk-pci,drive=disk0,disable-modern=on,disable-legacy=off" \ -no-reboot ```
maxime-alves changed title from Procédure installation to Procédure installation RPi 3 years ago
nas commented 3 years ago
Owner

Les commit suivant décrivent le staging dev : sa doc, son installation, et le script de lancement de la VM :

Les commit suivant décrivent le staging dev : sa doc, son installation, et le script de lancement de la VM : - ada78c1a9e - 0b465b7de7 - 47d911b828 - 885a52fffc79b57b3df4ef0bc7e0d617501b7b56
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.