From c50d41c72d4e379c2ae5cd90958d36ac2f6ba5c6 Mon Sep 17 00:00:00 2001 From: Packet Please Date: Thu, 14 Nov 2024 05:56:14 +0100 Subject: [PATCH] imagebuilder: use APK feed on snapshot --- roles/cfg_openwrt/files/falter.snapshot.pem | 4 ++++ roles/cfg_openwrt/tasks/imagebuilder.yml | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 roles/cfg_openwrt/files/falter.snapshot.pem diff --git a/roles/cfg_openwrt/files/falter.snapshot.pem b/roles/cfg_openwrt/files/falter.snapshot.pem new file mode 100644 index 000000000..cbede47b4 --- /dev/null +++ b/roles/cfg_openwrt/files/falter.snapshot.pem @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEE1NSmLpdMjXJpDQki9ziqW3Ve0aIX99t +uAc1Yn5TexwhBhHsGxUxICHS63pDXYj9xg1AZHlvbEnFrBNrsdjJQQ== +-----END PUBLIC KEY----- diff --git a/roles/cfg_openwrt/tasks/imagebuilder.yml b/roles/cfg_openwrt/tasks/imagebuilder.yml index 238725c58..231f7d206 100644 --- a/roles/cfg_openwrt/tasks/imagebuilder.yml +++ b/roles/cfg_openwrt/tasks/imagebuilder.yml @@ -72,24 +72,37 @@ 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 | replace('__INSTR_SET__', instr_set) | replace('__FEED_VERSION__', feed_version) }}" - when: 'feed_version is defined' + when: 'feed_version is defined and openwrt_version != "snapshot"' + +- name: Insert falter apk feed + lineinfile: + path: "{{ build_dir }}/repositories" + line: "{{ feed | replace('__INSTR_SET__', instr_set) | replace('__FEED_VERSION__', feed_version) }}" + when: 'feed_version is defined and openwrt_version == "snapshot"' - name: Define Key-Dir stat: path: "{{ build_dir }}/keys/" register: keydir -- 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 and keydir.stat.exists' +- name: Add falter apk feed key + copy: + src: "files/falter.snapshot.pem" + dest: "{{ build_dir }}/keys/" + mode: "preserve" + when: 'feed_version is defined and keydir.stat.exists' + - name: Disable Signature verification if required lineinfile: path: "{{ build_dir }}/repositories.conf"