generated from gaoyang3513/SDK_RK3288
[Mod] First commit
This commit is contained in:
1
package/libvirt/90-kvm.rules
Normal file
1
package/libvirt/90-kvm.rules
Normal file
@ -0,0 +1 @@
|
||||
KERNEL=="kvm", OWNER="root", GROUP="kvm", MODE="0660"
|
||||
98
package/libvirt/Config.in
Normal file
98
package/libvirt/Config.in
Normal file
@ -0,0 +1,98 @@
|
||||
config BR2_PACKAGE_LIBVIRT_ARCH_SUPPORTS
|
||||
bool
|
||||
default y if BR2_aarch64
|
||||
default y if BR2_i386
|
||||
default y if BR2_x86_64
|
||||
depends on BR2_USE_MMU # fork()
|
||||
|
||||
comment "libvirt needs udev /dev management, a toolchain w/ threads, dynamic library, wchar, kernel headers >= 3.12 (4.11 for AArch64)"
|
||||
depends on BR2_PACKAGE_LIBVIRT_ARCH_SUPPORTS
|
||||
depends on !BR2_PACKAGE_HAS_UDEV || BR2_STATIC_LIBS || \
|
||||
!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR || \
|
||||
!(BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12 && \
|
||||
(BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11 || !BR2_aarch64))
|
||||
|
||||
config BR2_PACKAGE_LIBVIRT
|
||||
bool "libvirt"
|
||||
depends on BR2_PACKAGE_LIBVIRT_ARCH_SUPPORTS
|
||||
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
|
||||
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11 || !BR2_aarch64
|
||||
depends on BR2_PACKAGE_HAS_UDEV
|
||||
depends on !BR2_STATIC_LIBS
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
depends on BR2_USE_WCHAR
|
||||
select BR2_PACKAGE_GNUTLS
|
||||
# configure: You must install the pciaccess module to build with udev
|
||||
select BR2_PACKAGE_LIBPCIACCESS
|
||||
select BR2_PACKAGE_LIBGLIB2
|
||||
select BR2_PACKAGE_LIBTIRPC
|
||||
select BR2_PACKAGE_LIBXML2
|
||||
select BR2_PACKAGE_ZLIB
|
||||
# run-time dependencies
|
||||
select BR2_PACKAGE_CGROUPFS_MOUNT if !BR2_INIT_SYSTEMD
|
||||
help
|
||||
Libvirt is collection of software that provides a convenient
|
||||
way to manage virtual machines and other virtualization
|
||||
functionality, such as storage and network interface
|
||||
management. These software pieces include an API library, a
|
||||
daemon (libvirtd), and a command line utility (virsh).
|
||||
|
||||
https://libvirt.org/
|
||||
|
||||
if BR2_PACKAGE_LIBVIRT
|
||||
|
||||
config BR2_PACKAGE_LIBVIRT_DAEMON
|
||||
bool "libvirtd"
|
||||
default y
|
||||
depends on BR2_INSTALL_LIBSTDCPP # nmap
|
||||
select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
|
||||
select BR2_PACKAGE_DNSMASQ
|
||||
select BR2_PACKAGE_EBTABLES
|
||||
select BR2_PACKAGE_IPTABLES
|
||||
select BR2_PACKAGE_IPROUTE2
|
||||
# These are required because there is no way to unequivocally select a modern netcat
|
||||
select BR2_PACKAGE_NMAP if !BR2_PACKAGE_NETCAT_OPENBSD
|
||||
select BR2_PACKAGE_NMAP_NCAT if !BR2_PACKAGE_NETCAT_OPENBSD
|
||||
select BR2_PACKAGE_RADVD
|
||||
help
|
||||
Build the libvirt daemon (libvirtd) otherwise build only the
|
||||
utility programs.
|
||||
|
||||
comment "libvirtd needs a toolchain w/ C++"
|
||||
depends on !BR2_INSTALL_LIBSTDCPP
|
||||
|
||||
# Stateful drivers are useful only when building the daemon.
|
||||
if BR2_PACKAGE_LIBVIRT_DAEMON
|
||||
|
||||
config BR2_PACKAGE_LIBVIRT_QEMU
|
||||
bool "qemu"
|
||||
depends on BR2_PACKAGE_LIBSECCOMP_ARCH_SUPPORTS # libseccomp
|
||||
depends on BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # qemu
|
||||
select BR2_PACKAGE_HWDATA # libpciaccess
|
||||
select BR2_PACKAGE_HWDATA_PCI_IDS # libpciaccess
|
||||
select BR2_PACKAGE_LIBSECCOMP
|
||||
select BR2_PACKAGE_QEMU
|
||||
select BR2_PACKAGE_QEMU_SYSTEM if BR2_PACKAGE_QEMU_CUSTOM_TARGETS = ""
|
||||
select BR2_PACKAGE_YAJL
|
||||
help
|
||||
QEMU/KVM support
|
||||
|
||||
comment "qemu needs a toolchain with gcc >= 8"
|
||||
depends on BR2_PACKAGE_LIBSECCOMP_ARCH_SUPPORTS
|
||||
depends on BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET
|
||||
depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_8
|
||||
|
||||
config BR2_PACKAGE_LIBVIRT_LXC
|
||||
bool "lxc"
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # lxc
|
||||
select BR2_PACKAGE_LXC
|
||||
help
|
||||
Linux Container support
|
||||
|
||||
comment "lxc needs a toolchain w/ gcc >= 4.7"
|
||||
depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
65
package/libvirt/S91virtlogd
Normal file
65
package/libvirt/S91virtlogd
Normal file
@ -0,0 +1,65 @@
|
||||
#!/bin/sh
|
||||
|
||||
DAEMON="virtlogd"
|
||||
EXECFILE="/usr/sbin/$DAEMON"
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
VIRTLOGD_ARGS=""
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
start() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -S -q -p "$PIDFILE" -x "$EXECFILE" \
|
||||
-- -d $VIRTLOGD_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
start-stop-daemon -K -q -p "$PIDFILE" -x "$EXECFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
# On receipt of SIGUSR1 virtlogd will re-exec() its binary, while maintaining
|
||||
# all current logs and clients. This allows for live upgrades of the virtlogd
|
||||
# service.
|
||||
reload() {
|
||||
printf 'Reloading %s: ' "$DAEMON"
|
||||
start-stop-daemon -K -s USR1 -q -p "$PIDFILE" -x "$EXECFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
132
package/libvirt/S92libvirtd
Normal file
132
package/libvirt/S92libvirtd
Normal file
@ -0,0 +1,132 @@
|
||||
#!/bin/sh
|
||||
|
||||
DAEMON="libvirtd"
|
||||
EXECFILE="/usr/sbin/$DAEMON"
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
LIBVIRTD_ARGS=""
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
trap 'rm -f "$TMP_MODULE_LIST" "$TMP_PIDFILE_LIST"' EXIT
|
||||
|
||||
is_alive() {
|
||||
[ -e "$1" ] \
|
||||
&& exe="/proc/$(cat "$1" 2>/dev/null)/exe" \
|
||||
&& [ -s "$exe" ] \
|
||||
&& [ "$(readlink -f "$exe")" = "$2" ]
|
||||
}
|
||||
|
||||
load_modules() {
|
||||
printf 'Loading kernel modules: '
|
||||
kver="$(uname -r)"
|
||||
TMP_MODULE_LIST="$(mktemp -q)" || {
|
||||
echo 'FAIL creating temporary modules list'
|
||||
exit 1
|
||||
}
|
||||
[ -d "/lib/modules/$kver/kernel/drivers/net" ] && \
|
||||
find "/lib/modules/$kver/kernel/drivers/net" \
|
||||
-name "tun.ko*" >> "$TMP_MODULE_LIST"
|
||||
[ -d "/lib/modules/$kver/kernel/drivers/vhost" ] && \
|
||||
find "/lib/modules/$kver/kernel/drivers/vhost" \
|
||||
-name "vhost?net.ko*" >> "$TMP_MODULE_LIST"
|
||||
[ -d "/lib/modules/$kver/kernel/drivers/net" ] && \
|
||||
find "/lib/modules/$kver/kernel/drivers/vfio" \
|
||||
-name "*.ko*" >> "$TMP_MODULE_LIST"
|
||||
while read -r f; do
|
||||
m="$(basename "${f%.ko*}")"
|
||||
if modprobe -q "$m"; then
|
||||
printf '%s ' "$m"
|
||||
else
|
||||
echo "FAIL on $m"
|
||||
exit 1
|
||||
fi
|
||||
done < "$TMP_MODULE_LIST"
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
#
|
||||
# If libvirtd dies it leves behind one stale dnsmasq per virtual network that
|
||||
# must be killed before starting libvirtd again.
|
||||
#
|
||||
rm_stale_dnsmasq() {
|
||||
[ -d /var/run/libvirt/network ] || return 0
|
||||
TMP_PIDFILE_LIST="$(mktemp -q)" || {
|
||||
echo "Could not create temporary pidfile list"
|
||||
exit 1
|
||||
}
|
||||
find /var/run/libvirt/network -name '*.pid' > "$TMP_PIDFILE_LIST"
|
||||
while read -r pidfile; do
|
||||
if is_alive "$pidfile" /usr/sbin/dnsmasq; then
|
||||
start-stop-daemon -K -q -p "$pidfile" -x /usr/sbin/dnsmasq
|
||||
status=$?
|
||||
if [ "$status" -ne 0 ]; then
|
||||
echo "Could not stop stale dnsmasq daemons"
|
||||
exit 1
|
||||
fi
|
||||
rm -f "$pidfile"
|
||||
fi
|
||||
done < "$TMP_PIDFILE_LIST"
|
||||
}
|
||||
|
||||
start() {
|
||||
if is_alive "$PIDFILE" "$EXECFILE"; then
|
||||
# libvirtd is already running. Leave it alone.
|
||||
printf 'Starting %s: FAIL\n' "$DAEMON"
|
||||
return 1
|
||||
fi
|
||||
rm_stale_dnsmasq
|
||||
load_modules
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -S -q -p "$PIDFILE" -x "$EXECFILE" \
|
||||
-- -d $LIBVIRTD_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
start-stop-daemon -K -q -p "$PIDFILE" -x "$EXECFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm_stale_dnsmasq
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
# On receipt of SIGHUP libvirtd will reload its configuration.
|
||||
reload() {
|
||||
printf 'Reloading %s: ' "$DAEMON"
|
||||
start-stop-daemon -K -s HUP -q -p "$PIDFILE" -x "$EXECFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
3
package/libvirt/libvirt.hash
Normal file
3
package/libvirt/libvirt.hash
Normal file
@ -0,0 +1,3 @@
|
||||
# locally computed
|
||||
sha256 cb318014af097327928c6e3d72922e3be02a3e6401247b2aa52d9ab8e0b480f9 libvirt-7.10.0.tar.xz
|
||||
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
|
||||
322
package/libvirt/libvirt.mk
Normal file
322
package/libvirt/libvirt.mk
Normal file
@ -0,0 +1,322 @@
|
||||
################################################################################
|
||||
#
|
||||
# libvirt
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LIBVIRT_VERSION = 7.10.0
|
||||
LIBVIRT_SITE = https://libvirt.org/sources
|
||||
LIBVIRT_SOURCE = libvirt-$(LIBVIRT_VERSION).tar.xz
|
||||
LIBVIRT_LICENSE = LGPL-2.1+
|
||||
LIBVIRT_LICENSE_FILES = COPYING
|
||||
LIBVIRT_CPE_ID_VENDOR = redhat
|
||||
LIBVIRT_INSTALL_STAGING = YES
|
||||
LIBVIRT_DEPENDENCIES = \
|
||||
host-libxslt \
|
||||
host-nfs-utils \
|
||||
host-pkgconf \
|
||||
host-python-docutils \
|
||||
gnutls \
|
||||
libglib2 \
|
||||
libpciaccess \
|
||||
libtirpc \
|
||||
libxml2 \
|
||||
udev \
|
||||
zlib \
|
||||
$(TARGET_NLS_DEPENDENCIES)
|
||||
|
||||
LIBVIRT_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)
|
||||
|
||||
LIBVIRT_CONF_ENV += \
|
||||
CFLAGS="$(TARGET_CFLAGS) `$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`" \
|
||||
LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`"
|
||||
|
||||
LIBVIRT_CONF_OPTS = \
|
||||
-Drpath=disabled \
|
||||
-Dapparmor=disabled \
|
||||
-Ddocs=disabled \
|
||||
-Ddriver_bhyve=disabled \
|
||||
-Ddriver_ch=disabled \
|
||||
-Ddriver_esx=disabled \
|
||||
-Ddriver_hyperv=disabled \
|
||||
-Ddriver_libxl=disabled \
|
||||
-Ddriver_openvz=disabled \
|
||||
-Ddriver_remote=enabled \
|
||||
-Ddriver_secrets=enabled \
|
||||
-Ddriver_test=disabled \
|
||||
-Ddriver_vbox=disabled \
|
||||
-Ddriver_vmware=disabled \
|
||||
-Ddriver_vz=disabled \
|
||||
-Ddtrace=disabled \
|
||||
-Dexpensive_tests=disabled \
|
||||
-Dfirewalld=disabled \
|
||||
-Dfirewalld_zone=disabled \
|
||||
-Dglusterfs=disabled \
|
||||
-Dhost_validate=enabled \
|
||||
-Dinit_script=$(if $(BR2_INIT_SYSTEMD),systemd,none) \
|
||||
-Dlogin_shell=disabled \
|
||||
-Dnetcf=disabled \
|
||||
-Dnls=$(if $(BR2_SYSTEM_ENABLE_NLS),enabled,disabled) \
|
||||
-Dnumad=disabled \
|
||||
-Dopenwsman=disabled \
|
||||
-Dpciaccess=enabled \
|
||||
-Dpm_utils=disabled \
|
||||
-Dsanlock=disabled \
|
||||
-Dsasl=disabled \
|
||||
-Dsecdriver_apparmor=disabled \
|
||||
-Dstorage_iscsi=disabled \
|
||||
-Dstorage_iscsi_direct=disabled \
|
||||
-Dstorage_mpath=disabled \
|
||||
-Dsysctl_config=enabled \
|
||||
-Dtest_coverage=false \
|
||||
-Dtests=disabled \
|
||||
-Dudev=enabled \
|
||||
-Dwireshark_dissector=disabled
|
||||
|
||||
# warning_level should only drive the level of warnings during the
|
||||
# compilation of C code. However, libvirt misuses that to also
|
||||
# enable SSP when warning_level == 2
|
||||
# Force warning_level=1 to disable SSP, and let our toolchain wrapper
|
||||
# handle it.
|
||||
LIBVIRT_CONF_OPTS += -Dwarning_level=1
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ATTR),y)
|
||||
LIBVIRT_CONF_OPTS += -Dattr=enabled
|
||||
LIBVIRT_DEPENDENCIES += attr
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dattr=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_AUDIT),y)
|
||||
LIBVIRT_CONF_OPTS += -Daudit=enabled
|
||||
LIBVIRT_DEPENDENCIES += audit
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Daudit=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_BASH_COMPLETION),y)
|
||||
LIBVIRT_CONF_OPTS += -Dbash_completion=enabled
|
||||
LIBVIRT_DEPENDENCIES += bash-completion
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dbash_completion=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),y)
|
||||
LIBVIRT_CONF_OPTS += -Dblkid=enabled
|
||||
LIBVIRT_DEPENDENCIES += util-linux
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dblkid=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBCAP_NG),y)
|
||||
LIBVIRT_CONF_OPTS += -Dcapng=enabled
|
||||
LIBVIRT_DEPENDENCIES += libcap-ng
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dcapng=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBCURL),y)
|
||||
LIBVIRT_CONF_OPTS += -Dcurl=enabled
|
||||
LIBVIRT_DEPENDENCIES += libcurl
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dcurl=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBFUSE),y)
|
||||
LIBVIRT_CONF_OPTS += -Dfuse=enabled
|
||||
LIBVIRT_DEPENDENCIES += libfuse
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dfuse=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBISCSI),y)
|
||||
LIBVIRT_CONF_OPTS += -Dlibiscsi=enabled
|
||||
LIBVIRT_DEPENDENCIES += libiscsi
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dlibiscsi=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBNL),y)
|
||||
LIBVIRT_CONF_OPTS += -Dlibnl=enabled
|
||||
LIBVIRT_DEPENDENCIES += libnl
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dlibnl=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBPCAP),y)
|
||||
LIBVIRT_CONF_OPTS += -Dlibpcap=enabled
|
||||
LIBVIRT_DEPENDENCIES += libpcap
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dlibpcap=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_NUMACTL),y)
|
||||
LIBVIRT_CONF_OPTS += -Dnumactl=enabled
|
||||
LIBVIRT_DEPENDENCIES += numactl
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dnumactl=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_POLKIT),y)
|
||||
LIBVIRT_CONF_OPTS += -Dpolkit=enabled
|
||||
LIBVIRT_DEPENDENCIES += polkit
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dpolkit=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_READLINE),y)
|
||||
LIBVIRT_CONF_OPTS += -Dreadline=enabled
|
||||
LIBVIRT_DEPENDENCIES += readline
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dreadline=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
|
||||
LIBVIRT_CONF_OPTS += -Dselinux=enabled -Dsecdriver_selinux=enabled \
|
||||
-Dselinux_mount=/sys/fs/selinux
|
||||
LIBVIRT_DEPENDENCIES += libselinux
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dselinux=disabled -Dsecdriver_selinux=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LVM2_STANDARD_INSTALL),y)
|
||||
LIBVIRT_CONF_OPTS += -Dstorage_lvm=enabled
|
||||
LIBVIRT_DEPENDENCIES += host-lvm2 lvm2
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dstorage_lvm=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_YAJL),y)
|
||||
LIBVIRT_CONF_OPTS += -Dyajl=enabled
|
||||
LIBVIRT_DEPENDENCIES += yajl
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dyajl=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBVIRT_DAEMON),y)
|
||||
# Network is used by daemon, only
|
||||
LIBVIRT_CONF_OPTS += \
|
||||
-Ddriver_interface=enabled \
|
||||
-Ddriver_libvirtd=enabled \
|
||||
-Ddriver_network=enabled
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBSSH),y)
|
||||
LIBVIRT_CONF_OPTS += -Dlibssh=enabled
|
||||
LIBVIRT_DEPENDENCIES += libssh
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dlibssh=disabled
|
||||
endif
|
||||
|
||||
# Can't build nss plugin without network or yajl
|
||||
ifeq ($(BR2_PACKAGE_LIBNSS)$(BR2_PACKAGE_YAJL),yy)
|
||||
LIBVIRT_CONF_OPTS += -Dnss=enabled
|
||||
LIBVIRT_DEPENDENCIES += libnss
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dnss=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBSSH2),y)
|
||||
LIBVIRT_CONF_OPTS += -Dlibssh2=enabled
|
||||
LIBVIRT_DEPENDENCIES += libssh2
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dlibssh2=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBVIRT_LXC),y)
|
||||
LIBVIRT_CONF_OPTS += -Dlogin_shell=enabled -Ddriver_lxc=enabled
|
||||
LIBVIRT_DEPENDENCIES += lxc
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Dlogin_shell=disabled -Ddriver_lxc=disabled
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBVIRT_QEMU),y)
|
||||
LIBVIRT_CONF_OPTS += -Ddriver_qemu=enabled -Dqemu_user=qemu -Dqemu_group=kvm
|
||||
else
|
||||
LIBVIRT_CONF_OPTS += -Ddriver_qemu=disabled -Dqemu_user=no -Dqemu_group=no
|
||||
endif
|
||||
|
||||
else # BR2_PACKAGE_LIBVIRT_DAEMON
|
||||
|
||||
LIBVIRT_CONF_OPTS += \
|
||||
-Ddriver_interface=disabled \
|
||||
-Ddriver_libvirtd=disabled \
|
||||
-Ddriver_network=disabled
|
||||
|
||||
endif
|
||||
|
||||
define LIBVIRT_INSTALL_UDEV_RULES
|
||||
$(INSTALL) -D -m 644 package/libvirt/90-kvm.rules \
|
||||
$(TARGET_DIR)/etc/udev/rules.d/90-kvm.rules
|
||||
endef
|
||||
LIBVIRT_POST_INSTALL_TARGET_HOOKS += LIBVIRT_INSTALL_UDEV_RULES
|
||||
|
||||
# Adjust directory ownerships and permissions. Notice /var/log is a symlink to
|
||||
# /tmp in the default sysvinit skeleton, so some directories may disappear at
|
||||
# run-time. Set the permissions anyway, since they are valid for the default
|
||||
# systemd skeleton.
|
||||
define LIBVIRT_PERMISSIONS
|
||||
/etc/libvirt d 700 root root - - - - -
|
||||
/etc/libvirt/nwfilter d 700 root root - - - - -
|
||||
/var/lib/libvirt d 755 root root - - - - -
|
||||
/var/lib/libvirt/boot d 711 root root - - - - -
|
||||
/var/lib/libvirt/dnsmasq d 755 root root - - - - -
|
||||
/var/lib/libvirt/filesystems d 711 root root - - - - -
|
||||
/var/lib/libvirt/images d 711 root root - - - - -
|
||||
/var/lib/libvirt/network d 700 root root - - - - -
|
||||
/var/lib/libvirt/qemu d 751 qemu kvm - - - - -
|
||||
/var/lib/libvirt/qemu/autostart d 700 root root - - - - -
|
||||
/var/lib/libvirt/qemu/networks d 700 root root - - - - -
|
||||
/var/lib/libvirt/qemu/networks/autostart d 700 root root - - - - -
|
||||
/var/lib/libvirt/qemu/channel d 755 qemu kvm - - - - -
|
||||
/var/lib/libvirt/qemu/channel/target d 755 qemu kvm - - - - -
|
||||
/var/lib/libvirt/qemu/dump d 755 qemu kvm - - - - -
|
||||
/var/lib/libvirt/qemu/nvram d 755 qemu kvm - - - - -
|
||||
/var/lib/libvirt/qemu/save d 755 qemu kvm - - - - -
|
||||
/var/lib/libvirt/qemu/snapshot d 755 qemu kvm - - - - -
|
||||
/var/lib/libvirt/secrets d 700 root root - - - - -
|
||||
/var/lib/libvirt/storage d 755 root root - - - - -
|
||||
/var/lib/libvirt/storage/autostart d 755 root root - - - - -
|
||||
/var/cache/libvirt d 711 root root - - - - -
|
||||
/var/cache/libvirt/lxc d 750 root root - - - - -
|
||||
/var/cache/libvirt/qemu d 750 qemu kvm - - - - -
|
||||
/var/cache/libvirt/qemu/capabilities d 755 root root - - - - -
|
||||
/var/log/libvirt d 700 root root - - - - -
|
||||
/var/log/libvirt/lxc d 750 root root - - - - -
|
||||
/var/log/libvirt/qemu d 750 root root - - - - -
|
||||
/var/log/swtpm d 755 root root - - - - -
|
||||
/var/log/swtpm/libvirt d 755 root root - - - - -
|
||||
/var/log/swtpm/libvirt/qemu d 711 root root - - - - -
|
||||
endef
|
||||
|
||||
# libvirt may need to create persistent files (e.g. VM definitions) in these
|
||||
# directories. Move them to /var/lib because /etc may be on a read-only or
|
||||
# volatile (initramfs) filesystem. We could tweak the code to change these
|
||||
# paths but the patch would be large and would break compatibility with
|
||||
# ordinary installations and with the documentation.
|
||||
define LIBVIRT_CREATE_SYMLINKS
|
||||
$(INSTALL) -m 700 -d $(TARGET_DIR)/etc/libvirt
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/var/lib/libvirt
|
||||
$(INSTALL) -m 751 -d $(TARGET_DIR)/var/lib/libvirt/qemu
|
||||
$(INSTALL) -m 700 -d $(TARGET_DIR)/var/lib/libvirt/secrets
|
||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/var/lib/libvirt/storage
|
||||
ln -s -f ../../var/lib/libvirt/qemu $(TARGET_DIR)/etc/libvirt/
|
||||
ln -s -f ../../var/lib/libvirt/secrets $(TARGET_DIR)/etc/libvirt/
|
||||
ln -s -f ../../var/lib/libvirt/storage $(TARGET_DIR)/etc/libvirt/
|
||||
endef
|
||||
|
||||
LIBVIRT_PRE_INSTALL_TARGET_HOOKS += LIBVIRT_CREATE_SYMLINKS
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBVIRT_QEMU),y)
|
||||
define LIBVIRT_USERS
|
||||
qemu -1 kvm -1 * - - - Libvirt qemu/kvm daemon
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBVIRT_DAEMON),y)
|
||||
define LIBVIRT_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -D -m 0755 package/libvirt/S91virtlogd $(TARGET_DIR)/etc/init.d/S91virtlogd
|
||||
$(INSTALL) -D -m 0755 package/libvirt/S92libvirtd $(TARGET_DIR)/etc/init.d/S92libvirtd
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(meson-package))
|
||||
Reference in New Issue
Block a user