Skip to content

Commit

Permalink
imagebuilder: support snapshot APK package feed
Browse files Browse the repository at this point in the history
  • Loading branch information
pktpls committed Nov 21, 2024
1 parent 11f5539 commit 5e42269
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 4 deletions.
1 change: 1 addition & 0 deletions group_vars/version_snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
feed_version: snapshot
imagebuilder_filename: "openwrt-imagebuilder-{{ target | replace('/', '-') }}.Linux-x86_64.tar.zst"
feed: "https://firmware.berlin.freifunk.net/feed/{{ feed_version }}/packages/{{ instr_set }}/falter/packages.adb"
4 changes: 4 additions & 0 deletions roles/cfg_openwrt/files/falter.snapshot.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-----BEGIN PUBLIC KEY-----
MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEE1NSmLpdMjXJpDQki9ziqW3Ve0aIX99t
uAc1Yn5TexwhBhHsGxUxICHS63pDXYj9xg1AZHlvbEnFrBNrsdjJQQ==
-----END PUBLIC KEY-----
49 changes: 45 additions & 4 deletions roles/cfg_openwrt/tasks/imagebuilder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,67 @@
instr_set: "{{ instr_set_result.stdout_lines | first }}"
when: 'instr_set is not defined and feed_version is defined'

- name: Insert falter feed
- name: Insert falter OPKG feed
lineinfile:
path: "{{ build_dir }}/repositories.conf"
line: "{{ feed }}"
when: 'feed_version is defined'
when: 'feed_version is defined and openwrt_version != "snapshot"'

- name: Add falter feed key
- name: Add falter OPKG feed key
copy:
src: "files/packagefeed_master.pub"
dest: "{{ build_dir }}/keys/61a078a38408e710" # matches fingerprint
mode: "preserve"
when: 'feed_version is defined'

- name: Disable Signature verification if required
- name: Disable OPKG signature verification if required
lineinfile:
path: "{{ build_dir }}/repositories.conf"
line: "option check_signature"
state: "absent"
when: 'imagebuilder_disable_signature_check is defined and imagebuilder_disable_signature_check'

- name: Add falter APK feed
lineinfile:
path: "{{ build_dir }}/repositories"
line: "{{ feed }}"
when: 'feed_version is defined and openwrt_version == "snapshot"'

- name: Add falter APK feed to image
lineinfile:
path: "{{ configs_dir }}/etc/apk/repositories.d/falter.list"
line: "{{ feed }}"
create: true
when: 'feed_version is defined and openwrt_version == "snapshot"'

- name: Add falter APK feed key
copy:
src: "files/falter.snapshot.pem"
dest: "{{ build_dir }}/keys/"
mode: "preserve"
when: 'feed_version is defined and openwrt_version == "snapshot"'

- name: Add falter APK feed key to image
copy:
src: "files/falter.snapshot.pem"
dest: "{{ configs_dir }}/etc/apk/keys/"
mode: "preserve"
when: 'feed_version is defined and openwrt_version == "snapshot"'

- name: Add custom APK feed key
copy:
src: "{{ feed_key }}"
dest: "{{ build_dir }}/keys/falter.custom.pem"
mode: "preserve"
when: 'feed_version is defined and openwrt_version == "snapshot" and feed_key is defined'

- name: Add custom APK feed key to image
copy:
src: "{{ feed_key }}"
dest: "{{ configs_dir }}/etc/apk/keys/falter.custom.pem"
mode: "preserve"
when: 'feed_version is defined and openwrt_version == "snapshot" and feed_key is defined'

- name: Override compat_version check to bbb-configs exclusive value 9.9
lineinfile:
path: "{{ build_dir }}/include/image-commands.mk"
Expand Down

0 comments on commit 5e42269

Please sign in to comment.