Gentoo Archives: gentoo-commits

From: Yixun Lan <dlan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/riscv:master commit in: app-emulation/kvmtool/
Date: Wed, 29 Dec 2021 06:25:23
Message-Id: 1640759101.55b1587fdd0b22ee7ee1ec48b77d832ffb2bdea1.dlan@gentoo
1 commit: 55b1587fdd0b22ee7ee1ec48b77d832ffb2bdea1
2 Author: Alex Fan <alex.fan.q <AT> gmail <DOT> com>
3 AuthorDate: Mon Dec 27 07:25:52 2021 +0000
4 Commit: Yixun Lan <dlan <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 29 06:25:01 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/riscv.git/commit/?id=55b1587f
7
8 app-emulation/kvmtool: add riscv kernel version check
9
10 Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>
11 Signed-off-by: Alex Fan <alex.fan.q <AT> gmail.com>
12
13 app-emulation/kvmtool/kvmtool-9999.ebuild | 20 ++++++++++++++------
14 app-emulation/kvmtool/metadata.xml | 5 +++++
15 2 files changed, 19 insertions(+), 6 deletions(-)
16
17 diff --git a/app-emulation/kvmtool/kvmtool-9999.ebuild b/app-emulation/kvmtool/kvmtool-9999.ebuild
18 index 964e836..b5f35de 100644
19 --- a/app-emulation/kvmtool/kvmtool-9999.ebuild
20 +++ b/app-emulation/kvmtool/kvmtool-9999.ebuild
21 @@ -1,5 +1,5 @@
22 +# Copyright 2021 Gentoo Authors
23 # Distributed under the terms of the GNU General Public License v2
24 -# adapted from https://data.gpo.zugaina.org/defiance/app-emulation/kvmtool/kvmtool-9999.ebuild
25
26 EAPI=8
27
28 @@ -34,9 +34,17 @@ CONFIG_CHECK="
29 "
30
31 pkg_pretend() {
32 - if use kernel_linux && kernel_is lt 2 6 25; then
33 - eerror "This version of KVM requires a host kernel of 2.6.25 or higher."
34 - elif use kernel_linux; then
35 + if use kernel_linux ; then
36 + if kernel_is lt 2 6 25; then
37 + eerror "This version of KVM requires a host kernel of 2.6.25 or higher."
38 + fi
39 + if use riscv && kernel_is lt 5 16; then
40 + ewarn "RISC-V KVM official support landed in kernel 5.16,"
41 + ewarn "and requires the hypervisor extension."
42 + ewarn "Try out https://github.com/kvm-riscv/linux in qemu"
43 + ewarn "if your kernel/hardware doesn't support it"
44 + fi
45 +
46 if ! linux_config_exists; then
47 eerror "Unable to check your kernel for KVM support"
48 else
49 @@ -55,7 +63,7 @@ src_unpack() {
50 }
51
52 src_prepare() {
53 - eapply_user
54 + default
55 sed -e 's/^CFLAGS\t:=/CFLAGS := $(CFLAGS)/' \
56 -e 's/^LDFLAGS\t:=/LDFLAGS := $(LDFLAGS)/' -i Makefile
57 }
58 @@ -66,6 +74,6 @@ src_compile() {
59
60 src_install() {
61 dobin lkvm vm || die
62 - dodoc COPYING README Documentation/virtio-console.txt || die
63 + dodoc README Documentation/virtio-console.txt || die
64 doman Documentation/${PN}.1
65 }
66
67 diff --git a/app-emulation/kvmtool/metadata.xml b/app-emulation/kvmtool/metadata.xml
68 new file mode 100644
69 index 0000000..115e9d6
70 --- /dev/null
71 +++ b/app-emulation/kvmtool/metadata.xml
72 @@ -0,0 +1,5 @@
73 +<?xml version="1.0" encoding="UTF-8"?>
74 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
75 +<pkgmetadata>
76 + <!-- maintainer-needed -->
77 +</pkgmetadata>