1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

handle firmware downgrade

This commit is contained in:
Jerry Vonau 2020-08-02 13:36:56 -05:00
parent bfd67f9713
commit f6c31f80ba
6 changed files with 87 additions and 0 deletions

View file

@ -0,0 +1,23 @@
# check the timestamps, might want to preserve the old ones
- name: Backup OS provided Firmware
copy:
src: "/lib/firmware/brcm/{{ item }}"
dest: "/lib/firmware/brcm/{{ item }}.orig"
with_items:
- brcmfmac43430-sdio.bin
- brcmfmac43455-sdio.bin
# grab the old firmware
- name: Retrieve older firmware
get_url:
url: "{{ item.url }}"
dest: "{{ item.dest }}"
with_items:
- { url: 'http://download.iiab.io/packages/brcmfmac43430-sdio.bin_2020-02-16_7.45.98.97' dest:/lib/firmware/brcm/brcmfmac43430-sdio.bin_iiab }
- { url: 'http://download.iiab.io/packages/brcmfmac43455-sdio.bin_2015-03-01_7.45.18.0_ub19.10.1' dest: '/lib/firmware/brcm/brcmfmac43455-sdio.bin_iiab' }
- name: "Add 'firmware_retrieved: True' to {{ iiab_state_file }}"
lineinfile:
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
regexp: '^RPi_firmware_retrieved'
line: 'RPi_firmware_retrieved: True'

View file

@ -0,0 +1,20 @@
- name: Include older RPi Firmware
include_tasks: install.yml
when: RPi_firmware_retrieved is undefined
- name: Install check-firmware service files
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
with_items:
- { src: 'fw-warn.sh', dest: '/usr/sbin/' mode: '0644' }
- { src: 'check-firmware.service', dest: '/etc/systemd/system/' mode: '0644'}
- { src: 'check-firmware.sh', dest: '/usr/sbin/' mode: '0755' }
- name: Enable and Start check-firmware.service
systemd:
name: check-firmware.service
state: reloaded
enabled: yes
status: started