diff --git a/README.md b/README.md index a3c36e9..a2b19b0 100644 --- a/README.md +++ b/README.md @@ -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. 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 ``` -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] ****************************************************************************************************************************************** -ok: [delta.jlay.io] +TASK [Gathering Facts] **************************************************************************************************************************************** +ok: [buildserver] -TASK [Ensure libselinux-python is installed] ****************************************************************************************************************************************** -ok: [delta.jlay.io] +TASK [Ensure fedpkg is installed] ***************************************************************************************************************************** +changed: [buildserver] -TASK [Ensure fedpkg is installed] ****************************************************************************************************************************************** -ok: [delta.jlay.io] +TASK [Find old mock chroots] ********************************************************************************************************************************** +ok: [buildserver] -TASK [Find old mock chroots] ****************************************************************************************************************************************** -ok: [delta.jlay.io] +TASK [Clean old mock chroots] ********************************************************************************************************************************* -TASK [Clean old mock chroots] ****************************************************************************************************************************************** +TASK [Clean old build dir] ************************************************************************************************************************************ +ok: [buildserver] -TASK [Clean old build dir] ****************************************************************************************************************************************** -changed: [delta.jlay.io] +TASK [Clone f32 kernel to /tmp/f32_kernel] ******************************************************************************************************************** +changed: [buildserver] -TASK [Clone f29 kernel to /tmp/f29_kernel] ****************************************************************************************************************************************** -changed: [delta.jlay.io] +TASK [Copy patch to build dir] ******************************************************************************************************************************** +changed: [buildserver] -TASK [Copy patch to build dir] ****************************************************************************************************************************************** -changed: [delta.jlay.io] +TASK [Copy newpatch.sh on master branch, for 5.6 on f31] ****************************************************************************************************** +changed: [buildserver] -TASK [Apply patch and build kernel (logs in /tmp/f29_kernel/results_kernel/*)] ****************************************************************************************************************************************** -changed: [delta.jlay.io] => (item=./scripts/newpatch.sh acso-4.18.patch) -changed: [delta.jlay.io] => (item=/usr/bin/sed -i -e 's/%define buildid .*$/%define buildid .acspatch/' kernel.spec) -changed: [delta.jlay.io] => (item=/usr/bin/make release) -changed: [delta.jlay.io] => (item=fedpkg mockbuild) +TASK [Apply patch and build kernel (logs in /tmp/f32_kernel/results_kernel/*)] ******************************************************************************** +changed: [buildserver] => (item=./scripts/newpatch.sh acso-5.4.6.patch) +changed: [buildserver] => (item=/usr/bin/sed -i -e 's/%define buildid .*$/%define buildid .acspatch/' kernel.spec) +changed: [buildserver] => (item=/usr/bin/make release) +changed: [buildserver] => (item=fedpkg mockbuild) -TASK [Find RPMs in /tmp/f29_kernel/results_kernel/*/*/*.rpm] ****************************************************************************************************************************************** -ok: [delta.jlay.io] +TASK [Find RPMs in /tmp/f32_kernel/results_kernel/*/*/*.rpm] ************************************************************************************************** +ok: [buildserver] -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}) +TASK [Copy RPMs to /tmp/ (local)] ***************************************************************************************************************************** [...] -PLAY RECAP ****************************************************************************************************************************************** -delta.jlay.io : ok=8 changed=4 unreachable=0 failed=0 - -jlay@workstation:~/git/ansible/build_kernel$ +PLAY RECAP **************************************************************************************************************************************************** +buildserver : ok=10 changed=6 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 ``` diff --git a/playbook.yml b/playbook.yml index f1e8f0d..67ee1bf 100644 --- a/playbook.yml +++ b/playbook.yml @@ -1,8 +1,8 @@ --- - hosts: buildservers vars: - fedora_version: f31 - patch_file: acso-5.4.6.patch # This patch has been modified to work on 5.4+ + fedora_version: f32 + patch_file: acso-5.4.6.patch # This patch has been modified to work on 5.6+ run_epoch: "{{ ansible_date_time.epoch }}" build_dir: /tmp/{{ fedora_version }}_kernel tasks: @@ -40,6 +40,12 @@ copy: src: payload/{{ patch_file }} 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/*) command: "{{ item }} chdir={{ build_dir }}" with_items: