Update example/add reqs, support for f32 and kernel 5.6+

This commit is contained in:
Josh Lay 2020-04-15 22:46:14 -05:00
parent ac58fa64a6
commit 9f5b50f6da
2 changed files with 42 additions and 33 deletions

View file

@ -1,52 +1,55 @@
### build_kernel ### build-kernel
This playbook is used to automatically build a kernel with an ACS overrides patch applied. Useful to isolate PCI-e devices to their own IOMMU group for VFIO passthrough. This playbook is used to automatically build a kernel with an ACS overrides patch applied. Useful to isolate PCI-e devices to their own IOMMU group for VFIO passthrough.
See this page for kernel configuration details: https://copr.fedorainfracloud.org/coprs/jlay/kernel-acspatch/ See this page for kernel configuration details: https://copr.fedorainfracloud.org/coprs/jlay/kernel-acspatch/
### Requirements
- Inventory with one host
- `hosts-local` provided as a sample inventory for localhost
- This host must be running Fedora (builds use mock)
### Example usage ### Example usage
``` ```
jlay@workstation:~/git/ansible/build_kernel$ ansible-playbook -i hosts playbook.yml $ ansible-playbook -i buildserver playbook.yml -b --ask-become-pass
BECOME password:
PLAY [buildservers] ****************************************************************************************************************************************** PLAY [buildservers] *******************************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************************** TASK [Gathering Facts] ****************************************************************************************************************************************
ok: [delta.jlay.io] ok: [buildserver]
TASK [Ensure libselinux-python is installed] ****************************************************************************************************************************************** TASK [Ensure fedpkg is installed] *****************************************************************************************************************************
ok: [delta.jlay.io] changed: [buildserver]
TASK [Ensure fedpkg is installed] ****************************************************************************************************************************************** TASK [Find old mock chroots] **********************************************************************************************************************************
ok: [delta.jlay.io] ok: [buildserver]
TASK [Find old mock chroots] ****************************************************************************************************************************************** TASK [Clean old mock chroots] *********************************************************************************************************************************
ok: [delta.jlay.io]
TASK [Clean old mock chroots] ****************************************************************************************************************************************** TASK [Clean old build dir] ************************************************************************************************************************************
ok: [buildserver]
TASK [Clean old build dir] ****************************************************************************************************************************************** TASK [Clone f32 kernel to /tmp/f32_kernel] ********************************************************************************************************************
changed: [delta.jlay.io] changed: [buildserver]
TASK [Clone f29 kernel to /tmp/f29_kernel] ****************************************************************************************************************************************** TASK [Copy patch to build dir] ********************************************************************************************************************************
changed: [delta.jlay.io] changed: [buildserver]
TASK [Copy patch to build dir] ****************************************************************************************************************************************** TASK [Copy newpatch.sh on master branch, for 5.6 on f31] ******************************************************************************************************
changed: [delta.jlay.io] changed: [buildserver]
TASK [Apply patch and build kernel (logs in /tmp/f29_kernel/results_kernel/*)] ****************************************************************************************************************************************** TASK [Apply patch and build kernel (logs in /tmp/f32_kernel/results_kernel/*)] ********************************************************************************
changed: [delta.jlay.io] => (item=./scripts/newpatch.sh acso-4.18.patch) changed: [buildserver] => (item=./scripts/newpatch.sh acso-5.4.6.patch)
changed: [delta.jlay.io] => (item=/usr/bin/sed -i -e 's/%define buildid .*$/%define buildid .acspatch/' kernel.spec) changed: [buildserver] => (item=/usr/bin/sed -i -e 's/%define buildid .*$/%define buildid .acspatch/' kernel.spec)
changed: [delta.jlay.io] => (item=/usr/bin/make release) changed: [buildserver] => (item=/usr/bin/make release)
changed: [delta.jlay.io] => (item=fedpkg mockbuild) changed: [buildserver] => (item=fedpkg mockbuild)
TASK [Find RPMs in /tmp/f29_kernel/results_kernel/*/*/*.rpm] ****************************************************************************************************************************************** TASK [Find RPMs in /tmp/f32_kernel/results_kernel/*/*/*.rpm] **************************************************************************************************
ok: [delta.jlay.io] ok: [buildserver]
TASK [Copy RPMs to /tmp/ (local)] ****************************************************************************************************************************************** TASK [Copy RPMs to /tmp/ (local)] *****************************************************************************************************************************
ok: [delta.jlay.io] => (item={'uid': 0, 'woth': False, 'mtime': 1545900251.552329, 'inode': 1086935, 'isgid': False, 'size': 104419185, 'roth': True, 'isuid': False, 'isreg': True, 'pw_name': 'root', 'gid': 135, 'ischr': False, 'wusr': True, 'xoth': False, 'rusr': True, 'nlink': 1, 'issock': False, 'rgrp': True, 'gr_name': 'mock', 'path': '/tmp/f29_kernel/results_kernel/4.19.12/302.acspatch.fc29/kernel-4.19.12-302.acspatch.fc29.src.rpm', 'xusr': False, 'atime': 1545932715.7957838, 'isdir': False, 'ctime': 1545926304.4206192, 'isblk': False, 'xgrp': False, 'dev': 41, 'wgrp': False, 'isfifo': False, 'mode': '0644', 'islnk': False})
[...] [...]
PLAY RECAP ****************************************************************************************************************************************** PLAY RECAP ****************************************************************************************************************************************************
delta.jlay.io : ok=8 changed=4 unreachable=0 failed=0 buildserver : ok=10 changed=6 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
jlay@workstation:~/git/ansible/build_kernel$
``` ```

View file

@ -1,8 +1,8 @@
--- ---
- hosts: buildservers - hosts: buildservers
vars: vars:
fedora_version: f31 fedora_version: f32
patch_file: acso-5.4.6.patch # This patch has been modified to work on 5.4+ patch_file: acso-5.4.6.patch # This patch has been modified to work on 5.6+
run_epoch: "{{ ansible_date_time.epoch }}" run_epoch: "{{ ansible_date_time.epoch }}"
build_dir: /tmp/{{ fedora_version }}_kernel build_dir: /tmp/{{ fedora_version }}_kernel
tasks: tasks:
@ -40,6 +40,12 @@
copy: copy:
src: payload/{{ patch_file }} src: payload/{{ patch_file }}
dest: "{{ build_dir }}" dest: "{{ build_dir }}"
- 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 patch and build kernel (logs in {{ build_dir }}/results_kernel/*) - name: Apply patch and build kernel (logs in {{ build_dir }}/results_kernel/*)
command: "{{ item }} chdir={{ build_dir }}" command: "{{ item }} chdir={{ build_dir }}"
with_items: with_items: