diff options
| author | Manuel Bentele | 2021-09-30 13:59:29 +0200 |
|---|---|---|
| committer | Manuel Bentele | 2021-10-12 13:12:55 +0200 |
| commit | 88308bbee7027c5b840a30f9d91b188ad803de1f (patch) | |
| tree | 488d96387d4833f5f1d9e2770678a8627e39b574 /core/modules/libvirt-src | |
| parent | [kernel-vanilla] Add dwarves, required for CONFIG_DEBUG_INFO_BTF (diff) | |
| download | mltk-88308bbee7027c5b840a30f9d91b188ad803de1f.tar.gz mltk-88308bbee7027c5b840a30f9d91b188ad803de1f.tar.xz mltk-88308bbee7027c5b840a30f9d91b188ad803de1f.zip | |
[libvirt-src] Add module for libvirt source build
Diffstat (limited to 'core/modules/libvirt-src')
| -rw-r--r-- | core/modules/libvirt-src/module.build | 64 | ||||
| -rw-r--r-- | core/modules/libvirt-src/module.conf | 8 | ||||
| -rw-r--r-- | core/modules/libvirt-src/module.conf.ubuntu | 63 |
3 files changed, 135 insertions, 0 deletions
diff --git a/core/modules/libvirt-src/module.build b/core/modules/libvirt-src/module.build new file mode 100644 index 00000000..05537489 --- /dev/null +++ b/core/modules/libvirt-src/module.build @@ -0,0 +1,64 @@ +#!/bin/bash + +LIBVIRT_QEMU_USR="libvirt-qemu" +LIBVIRT_QEMU_GRP="kvm" +LIBVIRT_PTHR_GRP="libvirt-passthrough" + +module_init() { + groupadd --system "${LIBVIRT_QEMU_GRP}" + groupadd --system "${LIBVIRT_QEMU_USR}" + groupadd --system "${LIBVIRT_PTHR_GRP}" + useradd --gid "${LIBVIRT_QEMU_GRP}" --groups "${LIBVIRT_QEMU_USR},${LIBVIRT_PTHR_GRP}" --system \ + --no-create-home --home-dir "/var/lib/libvirt" "${LIBVIRT_QEMU_USR}" +} + +fetch_source() { + autoclone + git -C "${MODULE_WORK_DIR}/src/libvirt" submodule update --init || perror "Failed to init and update submodules!" +} + +build() { + local SRCDIR="${MODULE_WORK_DIR}/src/libvirt" + local DSTDIR="${MODULE_BUILD_DIR}" + cde "${SRCDIR}" + + # install meson (>= 0.54.0) since packaged version is too old + pip3 install "meson>=0.54.0" + + meson build \ + --prefix="/usr" \ + --sysconfdir="/etc" \ + --libexecdir="/usr/libexec" \ + --localstatedir="/var" \ + -Dsystem=true \ + -Dtests=disabled \ + -Ddocs=disabled \ + -Dwireshark_dissector=disabled \ + -Dstorage_dir=enabled \ + -Dstorage_disk=enabled \ + -Dstorage_lvm=enabled \ + -Ddriver_qemu=enabled \ + -Dqemu_user="${LIBVIRT_QEMU_USR}" \ + -Dqemu_group="${LIBVIRT_QEMU_GRP}" \ + -Ddriver_vbox=enabled \ + -Ddriver_vmware=enabled \ + -Ddriver_remote=enabled || perror "'meson' failed." + ninja -v -C build || perror "'ninja' failed." + DESTDIR="${DSTDIR}" ninja -v -C build install || perror "'ninja install' failed." + + # delete default libvirt network + rm "${DSTDIR}/etc/libvirt/qemu/networks/autostart/default.xml" + rm "${DSTDIR}/etc/libvirt/qemu/networks/default.xml" + + # delete installed test and documentation files + rm -rf "${DSTDIR}/usr/include/libvirt" + rm -rf "${DSTDIR}/usr/share/augeas" + rm -rf "${DSTDIR}/usr/share/doc/libvirt" + + # delete empty run folder to prevent mltk from stopping + rm -rf "${DSTDIR}/var/run" +} + +post_copy() { + : +} diff --git a/core/modules/libvirt-src/module.conf b/core/modules/libvirt-src/module.conf new file mode 100644 index 00000000..32c95e48 --- /dev/null +++ b/core/modules/libvirt-src/module.conf @@ -0,0 +1,8 @@ +#!/bin/bash + +REQUIRED_GIT=" + https://gitlab.com/libvirt/libvirt.git||v7.7.0 +" + +# copy everything since there is a clean installation done by 'ninja install' +REQUIRED_DIRECTORIES="/" diff --git a/core/modules/libvirt-src/module.conf.ubuntu b/core/modules/libvirt-src/module.conf.ubuntu new file mode 100644 index 00000000..11c11507 --- /dev/null +++ b/core/modules/libvirt-src/module.conf.ubuntu @@ -0,0 +1,63 @@ +#!/bin/bash +REQUIRED_INSTALLED_PACKAGES=" + gcc + python3 + python3-pip + ninja-build + bash-completion + debhelper + dh-apparmor + libxml2-dev + libncurses5-dev + libreadline-dev + zlib1g-dev + libgcrypt20-dev + libgnutls28-dev + libsasl2-dev + libxen-dev + lvm2 + open-iscsi + libparted-dev + parted + libdevmapper-dev + uuid-dev + libudev-dev + libattr1-dev + libpciaccess-dev + kmod + policykit-1 + libcurl4-gnutls-dev + libpolkit-gobject-1-dev + libcap-ng-dev + libnl-3-dev + libnl-route-3-dev + libyajl-dev + libpcap0.8-dev + libnuma-dev + numad + radvd + libsanlock-dev + libaudit-dev + libselinux1-dev + libapparmor-dev + libdbus-1-dev + nfs-common + systemtap-sdt-dev + xsltproc + zfsutils-linux + libzfslinux-dev + po-debconf + librbd-dev + librados-dev + libglusterfs-dev + libfuse-dev + augeas-tools + libxml2-utils + dnsmasq-base + openssh-client + netcat-openbsd + iptables + libtirpc-dev + genxdr + python3-docutils +" |
