public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/riscv:master commit in: app-emulation/kvmtool/
@ 2021-12-29  6:25 Yixun Lan
  0 siblings, 0 replies; 3+ messages in thread
From: Yixun Lan @ 2021-12-29  6:25 UTC (permalink / raw
  To: gentoo-commits

commit:     b8071d60cbe3bac9f737fc3cefc649c47dbc2494
Author:     Alex Fan <alex.fan.q <AT> gmail <DOT> com>
AuthorDate: Mon Dec 27 07:04:51 2021 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Wed Dec 29 06:24:56 2021 +0000
URL:        https://gitweb.gentoo.org/proj/riscv.git/commit/?id=b8071d60

app-emulation/kvmtool: initial import

Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>
Signed-off-by: Alex Fan <alex.fan.q <AT> gmail.com>

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

diff --git a/app-emulation/kvmtool/kvmtool-9999.ebuild b/app-emulation/kvmtool/kvmtool-9999.ebuild
new file mode 100644
index 0000000..964e836
--- /dev/null
+++ b/app-emulation/kvmtool/kvmtool-9999.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-9999.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
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/riscv:master commit in: app-emulation/kvmtool/
@ 2021-12-29  6:25 Yixun Lan
  0 siblings, 0 replies; 3+ messages in thread
From: Yixun Lan @ 2021-12-29  6:25 UTC (permalink / raw
  To: gentoo-commits

commit:     55b1587fdd0b22ee7ee1ec48b77d832ffb2bdea1
Author:     Alex Fan <alex.fan.q <AT> gmail <DOT> com>
AuthorDate: Mon Dec 27 07:25:52 2021 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Wed Dec 29 06:25:01 2021 +0000
URL:        https://gitweb.gentoo.org/proj/riscv.git/commit/?id=55b1587f

app-emulation/kvmtool: add riscv kernel version check

Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>
Signed-off-by: Alex Fan <alex.fan.q <AT> gmail.com>

 app-emulation/kvmtool/kvmtool-9999.ebuild | 20 ++++++++++++++------
 app-emulation/kvmtool/metadata.xml        |  5 +++++
 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>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/riscv:master commit in: app-emulation/kvmtool/
@ 2022-09-06  2:05 Yixun Lan
  0 siblings, 0 replies; 3+ messages in thread
From: Yixun Lan @ 2022-09-06  2:05 UTC (permalink / raw
  To: gentoo-commits

commit:     7bcdf60177d90ae6176b7ca8ebd0afc2a8ed8659
Author:     Yixun Lan <dlan <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  6 02:03:55 2022 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Tue Sep  6 02:03:55 2022 +0000
URL:        https://gitweb.gentoo.org/proj/riscv.git/commit/?id=7bcdf601

app-emulation/kvmtool: switch official repo

Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

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

diff --git a/app-emulation/kvmtool/kvmtool-9999.ebuild b/app-emulation/kvmtool/kvmtool-9999.ebuild
index b5f35de..90c16c9 100644
--- a/app-emulation/kvmtool/kvmtool-9999.ebuild
+++ b/app-emulation/kvmtool/kvmtool-9999.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)/' \


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-06  2:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-29  6:25 [gentoo-commits] proj/riscv:master commit in: app-emulation/kvmtool/ Yixun Lan
  -- strict thread matches above, loose matches on Subject: below --
2021-12-29  6:25 Yixun Lan
2022-09-06  2:05 Yixun Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox