From 7dd4c118c88ab5cbb62d29513632b84e597f50ee Mon Sep 17 00:00:00 2001 From: Cyrille Nofficial Date: Sun, 2 Jan 2022 17:26:47 +0100 Subject: [PATCH] os: use arm64 image --- ansible/group_vars/all/ansible.yml | 1 + ansible/host_vars/diabolo.local/main.yml | 1 + ansible/roles/base/tasks/main.yml | 2 +- ansible/roles/base/templates/config.txt | 9 ++++++--- ansible/roles/docker/tasks/docker.yml | 2 +- ansible/roles/rabbitmq/tasks/main.yml | 5 ++++- bootstrap/build_sdcard.sh | 13 ++++++++----- 7 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 ansible/group_vars/all/ansible.yml create mode 100644 ansible/host_vars/diabolo.local/main.yml diff --git a/ansible/group_vars/all/ansible.yml b/ansible/group_vars/all/ansible.yml new file mode 100644 index 0000000..d35f30e --- /dev/null +++ b/ansible/group_vars/all/ansible.yml @@ -0,0 +1 @@ +ansible_python_interpreter: auto diff --git a/ansible/host_vars/diabolo.local/main.yml b/ansible/host_vars/diabolo.local/main.yml new file mode 100644 index 0000000..ba45169 --- /dev/null +++ b/ansible/host_vars/diabolo.local/main.yml @@ -0,0 +1 @@ +arch: arm64 \ No newline at end of file diff --git a/ansible/roles/base/tasks/main.yml b/ansible/roles/base/tasks/main.yml index 7331321..17bb4a8 100644 --- a/ansible/roles/base/tasks/main.yml +++ b/ansible/roles/base/tasks/main.yml @@ -33,7 +33,7 @@ - git - python3 - python3-pip - - python-apt + - python3-apt state: present update_cache: yes diff --git a/ansible/roles/base/templates/config.txt b/ansible/roles/base/templates/config.txt index 31b1dd4..e3c3976 100755 --- a/ansible/roles/base/templates/config.txt +++ b/ansible/roles/base/templates/config.txt @@ -61,12 +61,13 @@ dtparam=audio=on [pi4] # Enable DRM VC4 V3D driver on top of the dispmanx display stack -dtoverlay=vc4-fkms-v3d +dtoverlay=vc4-kms-v3d +arm_64bit=1 max_framebuffers=2 -dtoverlay=uart2 +dtoverlay=uart3 [all] -#dtoverlay=vc4-fkms-v3d +#dtoverlay=vc4-kms-v3d # Disable bluetooth in order to enable serial TTL dtoverlay=pi3-disable-bt @@ -74,3 +75,5 @@ dtoverlay=pi3-disable-bt # Enable camera start_x=1 gpu_mem=256 + +dtoverlay=w1-gpio diff --git a/ansible/roles/docker/tasks/docker.yml b/ansible/roles/docker/tasks/docker.yml index 40a19cd..2d8ce6c 100644 --- a/ansible/roles/docker/tasks/docker.yml +++ b/ansible/roles/docker/tasks/docker.yml @@ -14,7 +14,7 @@ - name: Install docker-ce apt: name: - - python-pip + - python3-pip - docker-ce - xfsprogs state: present diff --git a/ansible/roles/rabbitmq/tasks/main.yml b/ansible/roles/rabbitmq/tasks/main.yml index 91bc2d8..f0f9cb1 100644 --- a/ansible/roles/rabbitmq/tasks/main.yml +++ b/ansible/roles/rabbitmq/tasks/main.yml @@ -1,13 +1,16 @@ --- - name: Install ansible dependencies apt: - name: "python-requests" + name: "python3-requests" state: present - name: Install rabbitmq package apt: name: rabbitmq-server state: present + with_items: + - rabbitmq-server + - python3-requests - name: Enables rabbitmq plugins rabbitmq_plugin: diff --git a/bootstrap/build_sdcard.sh b/bootstrap/build_sdcard.sh index a816d61..91b12fb 100755 --- a/bootstrap/build_sdcard.sh +++ b/bootstrap/build_sdcard.sh @@ -13,12 +13,14 @@ WIFI_SECRET_FILE=".secret" # For debug ADD_TTL_SUPPORT_FOR_DEBUG=1 +IMAGE_BASE=https://downloads.raspberrypi.org/raspios_lite_arm64_latest + ########### End Configuration ############ mkdir -p build if [ ! -f build/raspbian.zip ] then - wget -O build/raspbian.zip https://downloads.raspberrypi.org/raspbian_lite_latest + wget -O build/raspbian.zip ${IMAGE_BASE} cd build unzip raspbian.zip cd .. @@ -46,6 +48,11 @@ then echo "dtoverlay=pi3-disable-bt" | sudo tee -a build/mnt/config.txt > /dev/null fi +echo "Copy wifi configuration" +source ${WIFI_SECRET_FILE} +eval "echo \"$(cat wpa_supplicant.conf)\"" | sudo tee build/mnt/wpa_supplicant.conf > /dev/null +sudo chmod 600 build/mnt/wpa_supplicant.conf + echo "Umount boot partition" sudo umount build/mnt @@ -66,10 +73,6 @@ sudo cp ../ansible/roles/base/files/authorized_keys build/mnt/home/pi/.ssh/ sudo chmod 600 build/mnt/home/pi/.ssh/authorized_keys sudo chown -R 1000:1000 build/mnt/home/pi -echo "Copy wifi configuration" -source ${WIFI_SECRET_FILE} -eval "echo \"$(cat wpa_supplicant.conf)\"" | sudo tee build/mnt/etc/wpa_supplicant/wpa_supplicant.conf > /dev/null -sudo chmod 600 build/mnt/etc/wpa_supplicant/wpa_supplicant.conf echo "Umount sdcard"