70 lines
2.1 KiB
YAML
70 lines
2.1 KiB
YAML
---
|
|
- hosts: buildservers
|
|
become: true
|
|
vars:
|
|
fedora_version: f32
|
|
patch_files:
|
|
- acso-5.4.6.patch # This patch has been modified to work on 5.6+
|
|
- fsync-5.6.patch
|
|
run_epoch: "{{ ansible_date_time.epoch }}"
|
|
build_dir: /tmp/{{ fedora_version }}_kernel
|
|
tasks:
|
|
# - name: Ensure libselinux-python is installed - no longer required on f31+?
|
|
# dnf:
|
|
# name: libselinux-python
|
|
# state: present
|
|
# become: true
|
|
- name: Ensure fedpkg is installed
|
|
dnf:
|
|
name: fedpkg
|
|
state: present
|
|
- name: Find old mock chroots
|
|
find:
|
|
paths: /var/lib/mock/
|
|
patterns: "*"
|
|
file_type: directory
|
|
recurse: yes
|
|
register: chroots_to_delete
|
|
- name: Clean old mock chroots
|
|
file:
|
|
path: "{{ item.path }}"
|
|
state: absent
|
|
with_items: "{{ chroots_to_delete.files }}"
|
|
- name: Clean old build dir
|
|
file:
|
|
path: "{{ build_dir }}"
|
|
state: absent
|
|
- name: Clone {{ fedora_version }} kernel to {{ build_dir }}
|
|
shell: fedpkg clone -a -b {{ fedora_version }} kernel {{ build_dir }}
|
|
- name: Copy patch to build dir
|
|
copy:
|
|
src: "payload/{{ item }}"
|
|
dest: "{{ build_dir }}"
|
|
with_items: "{{ patch_files }}"
|
|
- name: Copy newpatch.sh on master branch, for 5.6 on f31
|
|
copy:
|
|
src: files/newpatch.sh
|
|
mode: 0775
|
|
dest: "{{ build_dir }}/scripts/"
|
|
when: (fedora_version in ['master', 'f32'])
|
|
- name: Apply patches
|
|
command: "./scripts/newpatch.sh {{ item }} chdir={{ build_dir }}"
|
|
with_items: "{{ patch_files }}"
|
|
- name: Build kernel (logs in {{ build_dir }}/results_kernel/*)
|
|
command: "{{ item }} chdir={{ build_dir }}"
|
|
with_items:
|
|
- /usr/bin/sed -i -e 's/%define buildid .*$/%define buildid .acsfsync/' kernel.spec
|
|
- /usr/bin/make release
|
|
- fedpkg mockbuild
|
|
- name: Find RPMs in {{ build_dir }}/results_kernel/*/*/*.rpm
|
|
find:
|
|
paths: "{{ build_dir }}/results_kernel/"
|
|
recurse: yes
|
|
patterns: '*.rpm'
|
|
register: rpms
|
|
- name: Copy RPMs to /tmp/ (local)
|
|
fetch:
|
|
src: "{{ item.path }}"
|
|
dest: /tmp/
|
|
flat: yes
|
|
with_items: "{{ rpms.files }}"
|