[gentoo-commits] proj/riscv:master commit in: app-emulation/kvmtool/

2022-09-05 Thread Yixun Lan
commit: 7bcdf60177d90ae6176b7ca8ebd0afc2a8ed8659
Author: Yixun Lan  gentoo  org>
AuthorDate: Tue Sep  6 02:03:55 2022 +
Commit: Yixun Lan  gentoo  org>
CommitDate: Tue Sep  6 02:03:55 2022 +
URL:https://gitweb.gentoo.org/proj/riscv.git/commit/?id=7bcdf601

app-emulation/kvmtool: switch official repo

Signed-off-by: Yixun Lan  gentoo.org>

 app-emulation/kvmtool/kvmtool-.ebuild | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/app-emulation/kvmtool/kvmtool-.ebuild 
b/app-emulation/kvmtool/kvmtool-.ebuild
index b5f35de..90c16c9 100644
--- a/app-emulation/kvmtool/kvmtool-.ebuild
+++ b/app-emulation/kvmtool/kvmtool-.ebuild
@@ -3,6 +3,7 @@
 
 EAPI=8
 
+EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git;
 inherit git-r3 linux-info
 
 DESCRIPTION="A lightweight tool for hosting KVM guests"
@@ -41,8 +42,6 @@ pkg_pretend() {
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
@@ -53,15 +52,6 @@ pkg_pretend() {
fi
 }
 
-src_unpack() {
-   if use riscv ; then
-   EGIT_REPO_URI="https://github.com/kvm-riscv/kvmtool.git;
-   else
-   
EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git;
-   fi
-   git-r3_src_unpack
-}
-
 src_prepare() {
default
sed -e 's/^CFLAGS\t:=/CFLAGS := $(CFLAGS)/' \



[gentoo-commits] proj/riscv:master commit in: app-emulation/kvmtool/

2021-12-28 Thread Yixun Lan
commit: 55b1587fdd0b22ee7ee1ec48b77d832ffb2bdea1
Author: Alex Fan  gmail  com>
AuthorDate: Mon Dec 27 07:25:52 2021 +
Commit: Yixun Lan  gentoo  org>
CommitDate: Wed Dec 29 06:25:01 2021 +
URL:https://gitweb.gentoo.org/proj/riscv.git/commit/?id=55b1587f

app-emulation/kvmtool: add riscv kernel version check

Signed-off-by: Yixun Lan  gentoo.org>
Signed-off-by: Alex Fan  gmail.com>

 app-emulation/kvmtool/kvmtool-.ebuild | 20 ++--
 app-emulation/kvmtool/metadata.xml|  5 +
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/app-emulation/kvmtool/kvmtool-.ebuild 
b/app-emulation/kvmtool/kvmtool-.ebuild
index 964e836..b5f35de 100644
--- a/app-emulation/kvmtool/kvmtool-.ebuild
+++ b/app-emulation/kvmtool/kvmtool-.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-.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 000..115e9d6
--- /dev/null
+++ b/app-emulation/kvmtool/metadata.xml
@@ -0,0 +1,5 @@
+
+https://www.gentoo.org/dtd/metadata.dtd;>
+
+   
+



[gentoo-commits] proj/riscv:master commit in: app-emulation/kvmtool/

2021-12-28 Thread Yixun Lan
commit: b8071d60cbe3bac9f737fc3cefc649c47dbc2494
Author: Alex Fan  gmail  com>
AuthorDate: Mon Dec 27 07:04:51 2021 +
Commit: Yixun Lan  gentoo  org>
CommitDate: Wed Dec 29 06:24:56 2021 +
URL:https://gitweb.gentoo.org/proj/riscv.git/commit/?id=b8071d60

app-emulation/kvmtool: initial import

Signed-off-by: Yixun Lan  gentoo.org>
Signed-off-by: Alex Fan  gmail.com>

 app-emulation/kvmtool/kvmtool-.ebuild | 71 +++
 1 file changed, 71 insertions(+)

diff --git a/app-emulation/kvmtool/kvmtool-.ebuild 
b/app-emulation/kvmtool/kvmtool-.ebuild
new file mode 100644
index 000..964e836
--- /dev/null
+++ b/app-emulation/kvmtool/kvmtool-.ebuild
@@ -0,0 +1,71 @@
+# Distributed under the terms of the GNU General Public License v2
+# adapted from 
https://data.gpo.zugaina.org/defiance/app-emulation/kvmtool/kvmtool-.ebuild
+
+EAPI=8
+
+inherit git-r3 linux-info
+
+DESCRIPTION="A lightweight tool for hosting KVM guests"
+HOMEPAGE="https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/;
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+DEPEND="riscv? ( sys-apps/dtc )"
+BDEPEND="${DEPEND}"
+RDEPEND="${DEPEND}"
+
+function ctarget() {
+   CTARGET="${ARCH}"
+   use amd64 && CTARGET='x86_64'
+   echo $CTARGET
+}
+
+CONFIG_CHECK="
+   SERIAL_8250 SERIAL_8250_CONSOLE
+   VIRTIO VIRTIO_PCI
+   VIRTIO_RING VIRTIO_PCI
+   VIRTIO_BLK VIRTIO_NET
+   ~VIRTIO_BALLOON
+   ~VIRTIO_CONSOLE
+   ~HW_RANDOM_VIRTIO
+   ~FB_VESA
+"
+
+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 ! linux_config_exists; then
+   eerror "Unable to check your kernel for KVM support"
+   else
+   check_extra_config
+   fi
+   fi
+}
+
+src_unpack() {
+   if use riscv ; then
+   EGIT_REPO_URI="https://github.com/kvm-riscv/kvmtool.git;
+   else
+   
EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git;
+   fi
+   git-r3_src_unpack
+}
+
+src_prepare() {
+   eapply_user
+   sed -e 's/^CFLAGS\t:=/CFLAGS := $(CFLAGS)/' \
+   -e 's/^LDFLAGS\t:=/LDFLAGS := $(LDFLAGS)/' -i Makefile
+}
+
+src_compile() {
+   V=1 ARCH=$(ctarget) emake
+}
+
+src_install() {
+   dobin lkvm vm || die
+   dodoc COPYING README Documentation/virtio-console.txt || die
+   doman Documentation/${PN}.1
+}