From 4938943c58cf706423a4866c11fff1e5744b9c5b Mon Sep 17 00:00:00 2001 From: Mathieu Tarral Date: Thu, 18 Apr 2024 05:54:43 -0700 Subject: [PATCH] kernel: fix --- .github/workflows/CI.yml | 2 +- .../roles/kernel/tasks/install_kernel_CentOS.yml | 0 ...stall_kernel.yml => install_kernel_Ubuntu.yml} | 15 +++------------ deploy/intellabs/kafl/roles/kernel/tasks/main.yml | 8 ++++---- .../intellabs/kafl/roles/kernel/vars/CentOS.yml | 2 ++ .../intellabs/kafl/roles/kernel/vars/Ubuntu.yml | 6 ++++++ deploy/intellabs/kafl/roles/qemu/vars/Ubuntu.yml | 1 - 7 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 deploy/intellabs/kafl/roles/kernel/tasks/install_kernel_CentOS.yml rename deploy/intellabs/kafl/roles/kernel/tasks/{install_kernel.yml => install_kernel_Ubuntu.yml} (84%) create mode 100644 deploy/intellabs/kafl/roles/kernel/vars/CentOS.yml create mode 100644 deploy/intellabs/kafl/roles/kernel/vars/Ubuntu.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 278da4f5..e97927c7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -60,7 +60,7 @@ jobs: local: strategy: matrix: - image: ["ubuntu:22.04", "quay.io/centos/centos:stream9"] + image: ["ubuntu:22.04"] #, "quay.io/centos/centos:stream9"] runs-on: ubuntu-22.04 container: image: ${{ matrix.image }} diff --git a/deploy/intellabs/kafl/roles/kernel/tasks/install_kernel_CentOS.yml b/deploy/intellabs/kafl/roles/kernel/tasks/install_kernel_CentOS.yml new file mode 100644 index 00000000..e69de29b diff --git a/deploy/intellabs/kafl/roles/kernel/tasks/install_kernel.yml b/deploy/intellabs/kafl/roles/kernel/tasks/install_kernel_Ubuntu.yml similarity index 84% rename from deploy/intellabs/kafl/roles/kernel/tasks/install_kernel.yml rename to deploy/intellabs/kafl/roles/kernel/tasks/install_kernel_Ubuntu.yml index 8ad8a46a..b6ecc28a 100644 --- a/deploy/intellabs/kafl/roles/kernel/tasks/install_kernel.yml +++ b/deploy/intellabs/kafl/roles/kernel/tasks/install_kernel_Ubuntu.yml @@ -1,24 +1,15 @@ -- name: Install dependencies - ansible.builtin.package: - name: - - linux-base - - kmod - become: true - - name: Create temporary directory for downloaded packages ansible.builtin.tempfile: state: directory register: down_dir check_mode: false -- name: Download deb packages +- name: Download pre-built packages ansible.builtin.get_url: url: "{{ item }}" - dest: "{{ down_dir.path }}/{{ index }}.deb" + dest: "{{ down_dir.path }}/{{ item | basename }}" mode: 0644 - loop: "{{ kernel_deb_urls }}" - loop_control: - index_var: index + loop: "{{ kernel_urls }}" - name: Install kAFL kernel ansible.builtin.shell: dpkg -i "{{ down_dir.path }}"/*.deb diff --git a/deploy/intellabs/kafl/roles/kernel/tasks/main.yml b/deploy/intellabs/kafl/roles/kernel/tasks/main.yml index 7e6c0ed6..33d97012 100644 --- a/deploy/intellabs/kafl/roles/kernel/tasks/main.yml +++ b/deploy/intellabs/kafl/roles/kernel/tasks/main.yml @@ -1,11 +1,11 @@ +- include_vars: "{{ ansible_distribution }}.yml" + - name: Import pre_tasks ansible.builtin.import_tasks: pre_tasks.yml - name: Install required dependencies ansible.builtin.package: - name: - - build-essential - - dpkg + name: "{{ packages }}" become: true - name: Create temporary directory @@ -46,5 +46,5 @@ # check if hardware_check in skip-tags -> to force CI run - name: Install kernel if needed - ansible.builtin.import_tasks: install_kernel.yml + ansible.builtin.include_tasks: install_kernel_{{ ansible_distribution }}.yml when: "'update_grub' in ansible_run_tags or 'hardware_check' in ansible_skip_tags or support_test.rc != 0" diff --git a/deploy/intellabs/kafl/roles/kernel/vars/CentOS.yml b/deploy/intellabs/kafl/roles/kernel/vars/CentOS.yml new file mode 100644 index 00000000..0c3c8f88 --- /dev/null +++ b/deploy/intellabs/kafl/roles/kernel/vars/CentOS.yml @@ -0,0 +1,2 @@ +packages: +kernel_urls: \ No newline at end of file diff --git a/deploy/intellabs/kafl/roles/kernel/vars/Ubuntu.yml b/deploy/intellabs/kafl/roles/kernel/vars/Ubuntu.yml new file mode 100644 index 00000000..bf69e82a --- /dev/null +++ b/deploy/intellabs/kafl/roles/kernel/vars/Ubuntu.yml @@ -0,0 +1,6 @@ +packages: + - dpkg + - linux-base + - kmod +kernel_urls: + - https://github.com/IntelLabs/kafl.linux/releases/download/kvm-nyx-v6.0/linux-image-6.0.0-nyx+_6.0.0-nyx+-1_amd64.deb \ No newline at end of file diff --git a/deploy/intellabs/kafl/roles/qemu/vars/Ubuntu.yml b/deploy/intellabs/kafl/roles/qemu/vars/Ubuntu.yml index 19929f89..a49df816 100644 --- a/deploy/intellabs/kafl/roles/qemu/vars/Ubuntu.yml +++ b/deploy/intellabs/kafl/roles/qemu/vars/Ubuntu.yml @@ -1,6 +1,5 @@ packages: - pkg-config - - build-essential - libglib2.0-dev - libpixman-1-dev - libgtk-3-dev \ No newline at end of file