Skip to content

Commit

Permalink
Merge pull request #180 from KVM-VMI/fix/vagrant/kernel_build
Browse files Browse the repository at this point in the history
Fix vagrant build
  • Loading branch information
Wenzel authored Sep 19, 2024
2 parents e2c010f + 852ce47 commit b598db1
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 15 deletions.
8 changes: 4 additions & 4 deletions vagrant/ansible/playbook_2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
DEBUG: 1
become: false

- name: run kvm self-tests
command: ./tools/testing/selftests/kvm/x86_64/kvmi_test
args:
chdir: "{{ root_dir }}/kvm"
# - name: run kvm self-tests
# command: ./tools/testing/selftests/kvm/x86_64/kvmi_test
# args:
# chdir: "{{ root_dir }}/kvm"

roles:
- remote
Expand Down
4 changes: 4 additions & 0 deletions vagrant/ansible/roles/kvm/tasks/install_normal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
command: "make -j{{ ansible_processor_vcpus }} bzImage"
args:
chdir: "{{ root_dir }}/kvm"
environment:
EXTRA_CFLAGS: "-Wno-error=use-after-free"
become: false

- name: build modules
command: "make -j{{ ansible_processor_vcpus }} modules"
args:
chdir: "{{ root_dir }}/kvm"
environment:
EXTRA_CFLAGS: "-Wno-error=use-after-free"
become: false

- name: install modules
Expand Down
2 changes: 2 additions & 0 deletions vagrant/ansible/roles/kvm/tasks/libkvmi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
name: "{{ item }}"
with_items:
- uuid-dev
- autoconf
- libtool

- name: bootstrap libkvmi
command: ./bootstrap
Expand Down
13 changes: 9 additions & 4 deletions vagrant/ansible/roles/kvm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- bison
- libelf-dev
- libssl-dev
- pahole

# because of Windows filesystem restrictions, the KVM repo cannot be checked out on Windows
# it contains some files like
Expand Down Expand Up @@ -56,12 +57,16 @@
# -> !TRANSPARENT_HUGEPAGE
- { switch: "--disable", option: "TRANSPARENT_HUGEPAGE" }
- { switch: "--enable", option: "REMOTE_MAPPING" }
# fix: arch/x86/entry/thunk_64.o: warning: objtool: missing symbol table
- { switch: "--enable", option: "PREEMPT" }
# fix: error: call to '__compiletime_assert_653' in drivers/net/ethernet/netronome/nfp/bpf/jit.c
- { switch: "--disable", option: "NET_VENDOR_NETRONOME" }

- name: append -kvmi to kernel version string
lineinfile:
dest: "{{ root_dir }}/kvm/Makefile"
regexp: '^EXTRAVERSION ='
line: 'EXTRAVERSION = -kvmi'
regexp: "^EXTRAVERSION ="
line: "EXTRAVERSION = -kvmi"
become: false

- name: set default config to new options
Expand All @@ -81,8 +86,8 @@
- name: set kvmi kernel as default
lineinfile:
dest: /etc/default/grub
regexp: '^GRUB_DEFAULT'
line: 'GRUB_DEFAULT="1>0"'
regexp: "^GRUB_DEFAULT"
line: 'GRUB_DEFAULT="1>6"'

- name: update GRUB configuration
command: update-grub
Expand Down
2 changes: 1 addition & 1 deletion vagrant/ansible/roles/libvmi/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- libvirt-dev
- bison
- flex
- python-dev
- python3-dev
- libjson-c-dev

- name: create build directory
Expand Down
2 changes: 1 addition & 1 deletion vagrant/ansible/roles/qemu/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- libseccomp-dev

- name: configure QEMU
command: ./configure --target-list=x86_64-softmmu --enable-spice --enable-seccomp --prefix=/usr/local
command: ./configure --target-list=x86_64-softmmu --enable-spice --enable-seccomp --prefix=/usr/local --disable-werror
args:
chdir: "{{ root_dir }}/qemu"
become: false
Expand Down
9 changes: 4 additions & 5 deletions vagrant/ansible/roles/vm/tasks/libvirt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
name: "{{ item }}"
with_items:
- libvirt-daemon-system
- python-libvirt
- python3-libvirt

# kvm group to access /dev/kvm, libvirt-qemu for rw on memory access socket
Expand All @@ -17,18 +16,18 @@
- name: include local config for libvirt-qemu apparmor profile
lineinfile:
path: /etc/apparmor.d/libvirt/TEMPLATE.qemu
line: '#include <local/libvirt-qemu>'
insertafter: '#include <abstractions/libvirt-qemu>'
line: "#include <local/libvirt-qemu>"
insertafter: "#include <abstractions/libvirt-qemu>"

- name: add local QEMU apparmor profile for libvirtd
lineinfile:
path: /etc/apparmor.d/local/usr.sbin.libvirtd
line: '/usr/local/bin/qemu-system-x86_64 PUx,'
line: "/usr/local/bin/qemu-system-x86_64 PUx,"

- name: add local QEMU apparmor profile for libvirt-qemu
lineinfile:
path: /etc/apparmor.d/local/libvirt-qemu
line: '/usr/local/bin/qemu-system-x86_64 PUx,'
line: "/usr/local/bin/qemu-system-x86_64 PUx,"
create: yes

- name: reload apparmor
Expand Down

0 comments on commit b598db1

Please sign in to comment.