aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Fan <alex.fan.q@gmail.com>2021-12-27 18:25:52 +1100
committerYixun Lan <dlan@gentoo.org>2021-12-29 14:25:01 +0800
commit55b1587fdd0b22ee7ee1ec48b77d832ffb2bdea1 (patch)
treef250cb31c05e788d3806e508cbf4cc4ba0a751c2
parentapp-emulation/kvmtool: initial import (diff)
downloadriscv-55b1587fdd0b22ee7ee1ec48b77d832ffb2bdea1.tar.gz
riscv-55b1587fdd0b22ee7ee1ec48b77d832ffb2bdea1.tar.bz2
riscv-55b1587fdd0b22ee7ee1ec48b77d832ffb2bdea1.zip
app-emulation/kvmtool: add riscv kernel version check
Signed-off-by: Yixun Lan <dlan@gentoo.org> Signed-off-by: Alex Fan <alex.fan.q@gmail.com>
-rw-r--r--app-emulation/kvmtool/kvmtool-9999.ebuild20
-rw-r--r--app-emulation/kvmtool/metadata.xml5
2 files changed, 19 insertions, 6 deletions
diff --git a/app-emulation/kvmtool/kvmtool-9999.ebuild b/app-emulation/kvmtool/kvmtool-9999.ebuild
index 964e836..b5f35de 100644
--- a/app-emulation/kvmtool/kvmtool-9999.ebuild
+++ b/app-emulation/kvmtool/kvmtool-9999.ebuild
@@ -1,5 +1,5 @@
+# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-# adapted from https://data.gpo.zugaina.org/defiance/app-emulation/kvmtool/kvmtool-9999.ebuild
EAPI=8
@@ -34,9 +34,17 @@ CONFIG_CHECK="
"
pkg_pretend() {
- if use kernel_linux && kernel_is lt 2 6 25; then
- eerror "This version of KVM requires a host kernel of 2.6.25 or higher."
- elif use kernel_linux; then
+ if use kernel_linux ; then
+ if kernel_is lt 2 6 25; then
+ eerror "This version of KVM requires a host kernel of 2.6.25 or higher."
+ fi
+ if use riscv && kernel_is lt 5 16; then
+ ewarn "RISC-V KVM official support landed in kernel 5.16,"
+ ewarn "and requires the hypervisor extension."
+ ewarn "Try out https://github.com/kvm-riscv/linux in qemu"
+ ewarn "if your kernel/hardware doesn't support it"
+ fi
+
if ! linux_config_exists; then
eerror "Unable to check your kernel for KVM support"
else
@@ -55,7 +63,7 @@ src_unpack() {
}
src_prepare() {
- eapply_user
+ default
sed -e 's/^CFLAGS\t:=/CFLAGS := $(CFLAGS)/' \
-e 's/^LDFLAGS\t:=/LDFLAGS := $(LDFLAGS)/' -i Makefile
}
@@ -66,6 +74,6 @@ src_compile() {
src_install() {
dobin lkvm vm || die
- dodoc COPYING README Documentation/virtio-console.txt || die
+ dodoc README Documentation/virtio-console.txt || die
doman Documentation/${PN}.1
}
diff --git a/app-emulation/kvmtool/metadata.xml b/app-emulation/kvmtool/metadata.xml
new file mode 100644
index 0000000..115e9d6
--- /dev/null
+++ b/app-emulation/kvmtool/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+</pkgmetadata>