Skip to contentSkip to conversation

Introducing Xvisor

PATCH New Eric Le Bihan 3 participants 6 messages Sep 13, 2016 – Sep 17, 2016

lore
Share & tools
lore
#0 lore raw

v2 cover Introducing Xvisor

This small series introduces Xvisor, an open-source type-1 hypervisor.

As it uses a kconfig clone named openconf, a patch to the kconfig-package infrastructure is also provided, in order to support it.

v1->v2:

- change $(2)_KCONFIG_DOTCONFIG to be relative to package source directory.
- clarify comments about creation of .config directory hierarchy.
- clean-up xvisor Config.in.

Eric Le Bihan (2):
pkg-kconfig: support alternative .config location
xvisor: new package

 package/Config.in                                  |  1 +
 package/pkg-kconfig.mk                             | 14 +++--
 .../0001-Makefile-Fix-oldconfig-make-target.patch  | 30 +++++++++
 .../xvisor/0002-openconf-do-not-check-stdin.patch  | 58 +++++++++++++++++
 package/xvisor/Config.in                           | 58 +++++++++++++++++
 package/xvisor/xvisor.hash                         |  2 +
 package/xvisor/xvisor.mk                           | 72 ++++++++++++++++++++++
 7 files changed, 229 insertions(+), 6 deletions(-)
 create mode 100644 package/xvisor/0001-Makefile-Fix-oldconfig-make-target.patch
 create mode 100644 package/xvisor/0002-openconf-do-not-check-stdin.patch
 create mode 100644 package/xvisor/Config.in
 create mode 100644 package/xvisor/xvisor.hash
 create mode 100644 package/xvisor/xvisor.mk

--
2.4.11

#1 lore raw

PATCH v2 1/2 pkg-kconfig: support alternative .config location

Kconfig clones, such as openconf used by xvisor [1], do not look for .config at the root of the build directory, but in a subdirectory (e.g. build/openconf).

This patch introduces a new Makefile variable named $(2)_KCONFIG_DOTCONFIG, which contains the path to .config relative to the source directory of the package. It defaults to .config and can be overridden in the package Makefile.

It also creates the full directory hierarchy where the .config file is stored, in case it does not exist (e.g. in xvisor).

This allows the use of the kconfig-package infrastructure with packages relying on such clones.

[1] https://github.com/xvisor/xvisor/tree/master/tools/openconf

---
 package/pkg-kconfig.mk | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
package/pkg-kconfig.mk +8 -6
index b0f5178..ad5bbfc 100644
@@ -36,6 +36,7 @@ $(2)_KCONFIG_EDITORS ?= menuconfig
 $(2)_KCONFIG_OPTS ?=
 $(2)_KCONFIG_FIXUP_CMDS ?=
 $(2)_KCONFIG_FRAGMENT_FILES ?=
+$(2)_KCONFIG_DOTCONFIG ?= .config
 
 # The config file as well as the fragments could be in-tree, so before
 # depending on them the package should be extracted (and patched) first.
@@ -91,9 +92,10 @@ endef
 # fragments are merged together to .config, after the package has been patched.
 # Since the file could be a defconfig file it needs to be expanded to a
 # full .config first.
-$$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES)
+$$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG): $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES)
 	$$(Q)$$(if $$($(2)_KCONFIG_DEFCONFIG), \
 		$$($(2)_KCONFIG_MAKE) $$($(2)_KCONFIG_DEFCONFIG), \
+		mkdir -p $$(@D); \
 		cp $$($(2)_KCONFIG_FILE) $$(@))
 	$$(Q)support/kconfig/merge_config.sh -m -O $$(@D) \
 		$$(@) $$($(2)_KCONFIG_FRAGMENT_FILES)
@@ -102,7 +104,7 @@ $$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES)
 # If _KCONFIG_FILE or _KCONFIG_FRAGMENT_FILES exists, this dependency is
 # already implied, but if we only have a _KCONFIG_DEFCONFIG we have to add
 # it explicitly. It doesn't hurt to always have it though.
-$$($(2)_DIR)/.config: | $(1)-patch
+$$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG): | $(1)-patch
 
 # In order to get a usable, consistent configuration, some fixup may be needed.
 # The exact rules are specified by the package .mk file.
@@ -112,7 +114,7 @@ define $(2)_FIXUP_DOT_CONFIG
 	$$(Q)touch $$($(2)_DIR)/.stamp_kconfig_fixup_done
 endef
 
-$$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config
+$$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG)
 	$$($(2)_FIXUP_DOT_CONFIG)
 
 # Before running configure, the configuration file should be present and fixed
@@ -202,8 +204,8 @@ $(1)-update-config: $(1)-check-configuration-done
 		echo "Unable to perform $(1)-update-config when fragment files are set"; exit 1)
 	@$$(if $$($(2)_KCONFIG_DEFCONFIG), \
 		echo "Unable to perform $(1)-update-config when using a defconfig rule"; exit 1)
-	cp -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
-	touch --reference $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
+	cp -f $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG) $$($(2)_KCONFIG_FILE)
+	touch --reference $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG) $$($(2)_KCONFIG_FILE)
 
 # Note: make sure the timestamp of the stored configuration is not newer than
 # the .config to avoid a useless rebuild. Note that, contrary to
@@ -215,7 +217,7 @@ $(1)-update-defconfig: $(1)-savedefconfig
 	@$$(if $$($(2)_KCONFIG_DEFCONFIG), \
 		echo "Unable to perform $(1)-update-defconfig when using a defconfig rule"; exit 1)
 	cp -f $$($(2)_DIR)/defconfig $$($(2)_KCONFIG_FILE)
-	touch --reference $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
+	touch --reference $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG) $$($(2)_KCONFIG_FILE)
 
 endif # package enabled
 
Signature · 1 line
2.4.11
#2 lore raw

PATCH v2 1/2 pkg-kconfig: support alternative .config location

?ric, All,

On 2016-09-13 21:45 +0200, Eric Le Bihan spake thusly:

Quoted 27 lines

Kconfig clones, such as openconf used by xvisor [1], do not look for .config at the root of the build directory, but in a subdirectory (e.g. build/openconf).

This patch introduces a new Makefile variable named $(2)_KCONFIG_DOTCONFIG, which contains the path to .config relative to the source directory of the package. It defaults to .config and can be overridden in the package Makefile.

It also creates the full directory hierarchy where the .config file is stored, in case it does not exist (e.g. in xvisor).

This allows the use of the kconfig-package infrastructure with packages relying on such clones.

[1] https://github.com/xvisor/xvisor/tree/master/tools/openconf

---
 package/pkg-kconfig.mk | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
package/pkg-kconfig.mk +0 -0
index b0f5178..ad5bbfc 100644

package/pkg-kconfig.mk $(2)_KCONFIG_EDITORS ?= menuconfig · line 39

Quoted 4 lines
package/pkg-kconfig.mk +1 -0
@@ -36,6 +36,7 @@ $(2)_KCONFIG_EDITORS ?= menuconfig
 $(2)_KCONFIG_OPTS ?=
 $(2)_KCONFIG_FIXUP_CMDS ?=
 $(2)_KCONFIG_FRAGMENT_FILES ?=
+$(2)_KCONFIG_DOTCONFIG ?= .config

By the way, explanations in the manual for this new variable would be nice. Well, it would even be mandatory. ;-) Make it another patch (we usually add the documentation in a separate, following patch).

Maybe something like:

*FOO_KCONFIG_DOTCONFIG* is the path (with filename) of the +.config+ file, relative to the package source tree. The default, +.config+, should be well suited for all packages that use the standard kconfig infrastructure as inherited from the Linux kernel; some packages use a derivative of kconfig that use a different location.

Otherwise:

But see a small comment, below...

package/pkg-kconfig.mk endef · line 99

Quoted 12 lines
package/pkg-kconfig.mk +2 -1
 # The config file as well as the fragments could be in-tree, so before
 # depending on them the package should be extracted (and patched) first.
@@ -91,9 +92,10 @@ endef
 # fragments are merged together to .config, after the package has been patched.
 # Since the file could be a defconfig file it needs to be expanded to a
 # full .config first.
-$$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES)
+$$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG): $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES)
 	$$(Q)$$(if $$($(2)_KCONFIG_DEFCONFIG), \
 		$$($(2)_KCONFIG_MAKE) $$($(2)_KCONFIG_DEFCONFIG), \
+		mkdir -p $$(@D); \
 		cp $$($(2)_KCONFIG_FILE) $$(@))

I knw the 'cp' was already there, and that you added the 'mkdir'. However, when we need to copy a file for which it may be necessary to create the parent directory, usinf "install" ( $(INSTALL) in Buildroot) can do both at the same time:

    $(INSTALL) -m 0644 -D $$($(2)_KCONFIG_FILE) $$(@)

(but don't forget the closing parenthesis, to close the '$(if'.)

Regards,
Yann E. MORIN.

Quoted 47 lines
package/pkg-kconfig.mk +5 -5
 	$$(Q)support/kconfig/merge_config.sh -m -O $$(@D) \
 		$$(@) $$($(2)_KCONFIG_FRAGMENT_FILES)
@@ -102,7 +104,7 @@ $$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES)
 # If _KCONFIG_FILE or _KCONFIG_FRAGMENT_FILES exists, this dependency is
 # already implied, but if we only have a _KCONFIG_DEFCONFIG we have to add
 # it explicitly. It doesn't hurt to always have it though.
-$$($(2)_DIR)/.config: | $(1)-patch
+$$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG): | $(1)-patch
 
 # In order to get a usable, consistent configuration, some fixup may be needed.
 # The exact rules are specified by the package .mk file.
@@ -112,7 +114,7 @@ define $(2)_FIXUP_DOT_CONFIG
 	$$(Q)touch $$($(2)_DIR)/.stamp_kconfig_fixup_done
 endef
 
-$$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config
+$$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG)
 	$$($(2)_FIXUP_DOT_CONFIG)
 
 # Before running configure, the configuration file should be present and fixed
@@ -202,8 +204,8 @@ $(1)-update-config: $(1)-check-configuration-done
 		echo "Unable to perform $(1)-update-config when fragment files are set"; exit 1)
 	@$$(if $$($(2)_KCONFIG_DEFCONFIG), \
 		echo "Unable to perform $(1)-update-config when using a defconfig rule"; exit 1)
-	cp -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
-	touch --reference $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
+	cp -f $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG) $$($(2)_KCONFIG_FILE)
+	touch --reference $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG) $$($(2)_KCONFIG_FILE)
 
 # Note: make sure the timestamp of the stored configuration is not newer than
 # the .config to avoid a useless rebuild. Note that, contrary to
@@ -215,7 +217,7 @@ $(1)-update-defconfig: $(1)-savedefconfig
 	@$$(if $$($(2)_KCONFIG_DEFCONFIG), \
 		echo "Unable to perform $(1)-update-defconfig when using a defconfig rule"; exit 1)
 	cp -f $$($(2)_DIR)/defconfig $$($(2)_KCONFIG_FILE)
-	touch --reference $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
+	touch --reference $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG) $$($(2)_KCONFIG_FILE)
 
 endif # package enabled
 
Signature · 6 lines
2.4.11

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH v2 1/2 pkg-kconfig: support alternative .config location

In reply to Eric Le Bihan

Hello,

Quoted 15 lines · Eric Le Bihan

Kconfig clones, such as openconf used by xvisor [1], do not look for .config at the root of the build directory, but in a subdirectory (e.g. build/openconf).

This patch introduces a new Makefile variable named $(2)_KCONFIG_DOTCONFIG, which contains the path to .config relative to the source directory of the package. It defaults to .config and can be overridden in the package Makefile.

It also creates the full directory hierarchy where the .config file is stored, in case it does not exist (e.g. in xvisor).

This allows the use of the kconfig-package infrastructure with packages relying on such clones.

Quoted 6 lines

[1] https://github.com/xvisor/xvisor/tree/master/tools/openconf

---
 package/pkg-kconfig.mk | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

I've applied after changing the mkdir+cp combination to a call to install -D, as suggested by Yann.

I've also added a follow-up commit that documents this new variable.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH v2 2/2 xvisor: new package

In reply to Eric Le Bihan

This new package provides Xvisor, an open-source type-1 hypervisor, which aims at providing a monolithic, light-weight, portable, and flexible virtualization solution.

---
 package/Config.in                                  |  1 +
 .../0001-Makefile-Fix-oldconfig-make-target.patch  | 30 +++++++++
 .../xvisor/0002-openconf-do-not-check-stdin.patch  | 58 +++++++++++++++++
 package/xvisor/Config.in                           | 58 +++++++++++++++++
 package/xvisor/xvisor.hash                         |  2 +
 package/xvisor/xvisor.mk                           | 72 ++++++++++++++++++++++
 6 files changed, 221 insertions(+)
 create mode 100644 package/xvisor/0001-Makefile-Fix-oldconfig-make-target.patch
 create mode 100644 package/xvisor/0002-openconf-do-not-check-stdin.patch
 create mode 100644 package/xvisor/Config.in
 create mode 100644 package/xvisor/xvisor.hash
 create mode 100644 package/xvisor/xvisor.mk
package/Config.in +1 -0
index 332f05d..d571b89 100644
@@ -1732,6 +1732,7 @@ menu "System tools"
 	source "package/unscd/Config.in"
 	source "package/util-linux/Config.in"
 	source "package/xen/Config.in"
+	source "package/xvisor/Config.in"
 endmenu
 
 menu "Text editors and viewers"
package/xvisor/0001-Makefile-Fix-oldconfig-make-target.patch new file +30 -0
new file mode 100644
index 0000000..f056625
@@ -0,0 +1,30 @@
+From 99bbdc042ee4c92a13edcfeaf336aa755a199d0f Mon Sep 17 00:00:00 2001
+From: Anup Patel <[email protected]>
+Date: Sun, 11 Sep 2016 19:53:40 +0530
+Subject: [PATCH] Makefile: Fix oldconfig make target
+
+Use "-s" instead of "-o" option of "openconf/conf" tool because
+the "-o" option does not generate all required openconf files.
+
+Signed-off-by: Anup Patel <[email protected]>
+Signed-off-by: Eric Le Bihan <[email protected]>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 149a682..e05e801 100644
+--- a/Makefile
++++ b/Makefile
+@@ -434,7 +434,7 @@ menuconfig:
+ oldconfig:
+ 	$(V)mkdir -p $(OPENCONF_TMPDIR)
+ 	$(V)$(MAKE) -C tools/openconf oldconfig
+-	./tools/openconf/conf -o $(OPENCONF_INPUT)
++	./tools/openconf/conf -s $(OPENCONF_INPUT)
+ 
+ # Rule for "make savedefconfig"
+ .PHONY: savedefconfig
+-- 
+2.4.11
+
package/xvisor/0002-openconf-do-not-check-stdin.patch new file +58 -0

58 lines not on this page · raw message

package/xvisor/Config.in new file +58 -0

58 lines not on this page · raw message

package/xvisor/xvisor.hash new file +2 -0
new file mode 100644
index 0000000..13335be
@@ -0,0 +1,2 @@
+# Locally generated
+sha256 9347080c3481fb8586d196dd51a580a57084bfea1bc425e89f7fa0da7170708a xvisor-0.2.8.tar.gz
package/xvisor/xvisor.mk new file +72 -0

72 lines not on this page · raw message

Signature · 1 line
2.4.11
#5 lore raw

PATCH v2 2/2 xvisor: new package

Hello,

Quoted 5 lines · Eric Le Bihan

This new package provides Xvisor, an open-source type-1 hypervisor, which aims at providing a monolithic, light-weight, portable, and flexible virtualization solution.

I've applied, after doing a few changes, see below.

Quoted 6 lines
package/xvisor/xvisor.mk new file +0 -0
new file mode 100644
index 0000000..0e7b995

package/xvisor/xvisor.mk line 9

Quoted 9 lines
package/xvisor/xvisor.mk new file +9 -0
@@ -0,0 +1,72 @@
+################################################################################
+#
+# xvisor
+#
+################################################################################
+
+XVISOR_VERSION = 0.2.8
+XVISOR_SITE = http://www.xhypervisor.org/tarball
+XVISOR_LICENSE = GPLv2

Licensing is GPLv2+, all files that I checked say "GPLv2 or later".

package/xvisor/xvisor.mk line 47

Quoted 2 lines
package/xvisor/xvisor.mk new file +2 -0
+define XVISOR_CREATE_UBOOT_IMAGE
+	$(HOST_DIR)/usr/bin/mkimage -A $(BR2_ARCH) -O linux -T kernel -C none \

I've used $(MKIMAGE) instead of $(HOST_DIR)/usr/bin/mkimage, and $(MKIMAGE_ARCH) instead of $(BR2_ARCH).

Applied with those changes.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com