All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system
@ 2016-05-04  7:47 Simon Maes
  2016-05-04  7:47 ` [Buildroot] [PATCH 2/6] qemu: make qemu and host-qemu packages' version (separately) configurable Simon Maes
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Simon Maes @ 2016-05-04  7:47 UTC (permalink / raw)
  To: buildroot

    Additional package configurations are:
    - Enable system or linux user-land emulation
    - Enable SDL frontend and FDT support
    - Enable Qemu debug
    - Disable stripped binary format

Signed-off-by: Simon Maes <simonn.maes@gmail.com>
---
 package/qemu/Config.in.host | 66 +++++++++++++++++++++++++++++++++++++++++++++
 package/qemu/qemu.mk        | 39 ++++++++++++++++++++++-----
 2 files changed, 99 insertions(+), 6 deletions(-)

diff --git a/package/qemu/Config.in.host b/package/qemu/Config.in.host
index c5c3f05..71f697e 100644
--- a/package/qemu/Config.in.host
+++ b/package/qemu/Config.in.host
@@ -15,3 +15,69 @@ config BR2_PACKAGE_HOST_QEMU
 	  This option builds a user emulator for your selected architecture.
 
 	  http://www.qemu.org
+
+if BR2_PACKAGE_HOST_QEMU
+
+#
+# Configuration selection
+#
+
+comment "Emulators selection"
+
+config BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE
+	bool "Enable systems emulation"
+	depends on !BR2_STATIC_LIBS # dtc
+	select BR2_PACKAGE_HOST_QEMU_FDT
+	help
+	  Say 'y' to build system emulators/virtualisers.
+	  When building the host-qemu package for system emulation,
+	  qemu will be configured to support the Target Architecture,
+	  configured in Buildroot
+
+config BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
+	bool "Enable Linux user-land emulation"
+	help
+	  Say 'y' to build Linux user-land emulators.
+
+config BR2_PACKAGE_HOST_QEMU_HAS_EMULS
+	def_bool y
+	depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE || \
+		BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
+
+if BR2_PACKAGE_HOST_QEMU_HAS_EMULS
+
+comment "Frontends"
+
+config BR2_PACKAGE_HOST_QEMU_SDL
+	bool "Enable SDL frontend"
+	select BR2_PACKAGE_SDL
+	help
+	  Say 'y' to enable the SDL frontend, that is, a graphical window
+	  presenting the VM's display.
+
+comment "Misc. features"
+
+config BR2_PACKAGE_HOST_QEMU_FDT
+	bool "Enable FDT"
+	depends on !BR2_STATIC_LIBS # dtc
+	select BR2_PACKAGE_DTC
+	help
+	  Say 'y' to have QEMU capable of constructing Device Trees,
+	  and passing them to the VMs.
+
+comment "FDT support needs a toolchain w/ dynamic library"
+	depends on BR2_STATIC_LIBS
+
+config BR2_PACKAGE_HOST_QEMU_DEBUG
+	bool "Enable debug"
+	help
+	  Say 'y' to enable build options for QEMU.
+
+config BR2_PACKAGE_HOST_QEMU_STRIP_BINARY
+	bool "Enable stripped binary format"
+	help
+	  Say 'y' to enable stripping of the QEMU binary.
+
+endif # BR2_PACKAGE_HOST_QEMU_HAS_EMULS
+
+endif # BR2_PACKAGE_HOST_QEMU
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index 522910e..0e99138 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -17,6 +17,8 @@ QEMU_LICENSE_FILES = COPYING COPYING.LIB
 # Host-qemu
 
 HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
+HOST_QEMU_SITE = $(QEMU_SITE)
+HOST_QEMU_SOURCE = $(QEMU_SOURCE)
 
 #       BR ARCH         qemu
 #       -------         ----
@@ -61,7 +63,6 @@ endif
 ifeq ($(HOST_QEMU_ARCH),sh4aeb)
 HOST_QEMU_ARCH = sh4eb
 endif
-HOST_QEMU_TARGETS = $(HOST_QEMU_ARCH)-linux-user
 
 ifeq ($(BR2_PACKAGE_HOST_QEMU),y)
 HOST_QEMU_HOST_SYSTEM_TYPE = $(shell uname -s)
@@ -69,10 +70,12 @@ ifneq ($(HOST_QEMU_HOST_SYSTEM_TYPE),Linux)
 $(error "qemu-user can only be used on Linux hosts")
 endif
 
-# kernel version as major*256 + minor
-HOST_QEMU_HOST_SYSTEM_VERSION = $(shell uname -r | awk -F. '{ print $$1 * 256 + $$2 }')
-HOST_QEMU_TARGET_SYSTEM_VERSION = $(shell echo $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) | awk -F. '{ print $$1 * 256 + $$2 }')
-HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge $(HOST_QEMU_TARGET_SYSTEM_VERSION) && echo OK)
+ifeq ($(BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE),y)
+HOST_QEMU_TARGETS += $(HOST_QEMU_ARCH)-softmmu
+HOST_QEMU_OPTS += --enable-system
+else
+HOST_QEMU_OPTS += --disable-system
+endif
 
 #
 # The principle of qemu-user is that it emulates the instructions of
@@ -84,11 +87,34 @@ HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge $(
 # built with kernel headers that are older or the same as the kernel
 # version running on the host machine.
 #
+
+ifeq ($(BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE),y)
+HOST_QEMU_TARGETS += $(HOST_QEMU_ARCH)-linux-user
+HOST_QEMU_OPTS += --enable-linux-user
+
+# kernel version as major*256 + minor
+HOST_QEMU_HOST_SYSTEM_VERSION = $(shell uname -r | awk -F. '{ print $$1 * 256 + $$2 }')
+HOST_QEMU_TARGET_SYSTEM_VERSION = $(shell echo $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) | awk -F. '{ print $$1 * 256 + $$2 }')
+HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge $(HOST_QEMU_TARGET_SYSTEM_VERSION) && echo OK)
+
 ifeq ($(BR_BUILDING),y)
 ifneq ($(HOST_QEMU_COMPARE_VERSION),OK)
 $(error "Refusing to build qemu-user: target Linux version newer than host's.")
 endif
+
+else
+HOST_QEMU_OPTS += --disable-linux-user
+endif
 endif
+
+ifeq ($(BR2_PACKAGE_HOST_QEMU_DEBUG),y)
+HOST_QEMU_OPTS += --enable-debug
+endif
+
+ifeq ($(BR2_PACKAGE_HOST_QEMU_STRIP_BINARY),n)
+HOST_QEMU_OPTS += --disable-strip
+endif
+
 endif
 
 define HOST_QEMU_CONFIGURE_CMDS
@@ -100,7 +126,8 @@ define HOST_QEMU_CONFIGURE_CMDS
 		--host-cc="$(HOSTCC)"                   \
 		--python=$(HOST_DIR)/usr/bin/python2    \
 		--extra-cflags="$(HOST_CFLAGS)"         \
-		--extra-ldflags="$(HOST_LDFLAGS)"
+		--extra-ldflags="$(HOST_LDFLAGS)"       \
+		$(HOST_QEMU_OPTS)
 endef
 
 define HOST_QEMU_BUILD_CMDS
-- 
2.6.2

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

* [Buildroot] [PATCH 2/6] qemu: make qemu and host-qemu packages' version (separately) configurable
  2016-05-04  7:47 [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system Simon Maes
@ 2016-05-04  7:47 ` Simon Maes
  2016-05-07 19:01   ` Arnout Vandecappelle
  2016-07-03 22:26   ` Thomas Petazzoni
  2016-05-04  7:47 ` [Buildroot] [PATCH 3/6] qemu: code cleanup - (mostly) wrapping lines at 80 characters Simon Maes
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 14+ messages in thread
From: Simon Maes @ 2016-05-04  7:47 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Simon Maes <simonn.maes@gmail.com>
---
 package/qemu/Config.in      |  8 ++++++++
 package/qemu/Config.in.host |  8 ++++++++
 package/qemu/qemu.mk        | 26 ++++++++++++++++++--------
 3 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/package/qemu/Config.in b/package/qemu/Config.in
index ea6b946..a16a65c 100644
--- a/package/qemu/Config.in
+++ b/package/qemu/Config.in
@@ -36,6 +36,14 @@ config BR2_PACKAGE_QEMU
 
 if BR2_PACKAGE_QEMU
 
+config BR2_PACKAGE_QEMU_VERSION
+	string "qemu version"
+	default "2.5.0"
+	help
+	  QEMU version to use target qemu
+	  Sometimes the latest version is broken for some specific
+	  architecture or target machine
+
 comment "Emulators selection"
 
 config BR2_PACKAGE_QEMU_CUSTOM_TARGETS
diff --git a/package/qemu/Config.in.host b/package/qemu/Config.in.host
index 71f697e..c86768f 100644
--- a/package/qemu/Config.in.host
+++ b/package/qemu/Config.in.host
@@ -18,6 +18,14 @@ config BR2_PACKAGE_HOST_QEMU
 
 if BR2_PACKAGE_HOST_QEMU
 
+config BR2_PACKAGE_HOST_QEMU_VERSION
+	string "host qemu version"
+	default "2.5.0"
+	help
+	  QEMU version to use for host qemu
+	  Sometimes the latest version is broken for some specific
+	  architecture or target machine
+
 #
 # Configuration selection
 #
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index 0e99138..151060b 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -4,18 +4,19 @@
 #
 ################################################################################
 
-QEMU_VERSION = 2.5.1
-QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.bz2
-QEMU_SITE = http://wiki.qemu.org/download
-QEMU_LICENSE = GPLv2, LGPLv2.1, MIT, BSD-3c, BSD-2c, Others/BSD-1c
-QEMU_LICENSE_FILES = COPYING COPYING.LIB
-#??NOTE: there is no top-level license file for non-(L)GPL licenses;
-#       the non-(L)GPL license texts are specified in the affected
-#       individual source files.
 
 #-------------------------------------------------------------
 # Host-qemu
 
+HOST_QEMU_VERSION = $(call qstrip,$(BR2_PACKAGE_HOST_QEMU_VERSION))
+HOST_QEMU_SOURCE = qemu-$(HOST_QEMU_VERSION).tar.bz2
+HOST_QEMU_SITE = http://wiki.qemu.org/download
+HOST_QEMU_LICENSE = GPLv2, LGPLv2.1, MIT, BSD-3c, BSD-2c, Others/BSD-1c
+HOST_QEMU_LICENSE_FILES = COPYING COPYING.LIB
+#??NOTE: there is no top-level license file for non-(L)GPL licenses;
+#       the non-(L)GPL license texts are specified in the affected
+#       individual source files.
+
 HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
 HOST_QEMU_SITE = $(QEMU_SITE)
 HOST_QEMU_SOURCE = $(QEMU_SOURCE)
@@ -146,6 +147,15 @@ QEMU_USER = $(HOST_DIR)/usr/bin/qemu-$(HOST_QEMU_ARCH)
 #-------------------------------------------------------------
 # Target-qemu
 
+QEMU_VERSION = $(call qstrip,$(BR2_PACKAGE_QEMU_VERSION))
+QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.bz2
+QEMU_SITE = http://wiki.qemu.org/download
+QEMU_LICENSE = GPLv2, LGPLv2.1, MIT, BSD-3c, BSD-2c, Others/BSD-1c
+QEMU_LICENSE_FILES = COPYING COPYING.LIB
+#??NOTE: there is no top-level license file for non-(L)GPL licenses;
+#       the non-(L)GPL license texts are specified in the affected
+#       individual source files.
+
 QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman
 
 # Need the LIBS variable because librt and libm are
-- 
2.6.2

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

* [Buildroot] [PATCH 3/6] qemu: code cleanup - (mostly) wrapping lines at 80 characters
  2016-05-04  7:47 [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system Simon Maes
  2016-05-04  7:47 ` [Buildroot] [PATCH 2/6] qemu: make qemu and host-qemu packages' version (separately) configurable Simon Maes
@ 2016-05-04  7:47 ` Simon Maes
  2016-07-03 22:28   ` Thomas Petazzoni
  2016-05-04  7:47 ` [Buildroot] [PATCH 4/6] qemu: add qemu-system-run make target Simon Maes
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Simon Maes @ 2016-05-04  7:47 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Simon Maes <simonn.maes@gmail.com>
---
 package/qemu/Config.in |  6 ++++--
 package/qemu/qemu.mk   | 49 ++++++++++++++++++++++++++++---------------------
 2 files changed, 32 insertions(+), 23 deletions(-)

diff --git a/package/qemu/Config.in b/package/qemu/Config.in
index a16a65c..9447e11 100644
--- a/package/qemu/Config.in
+++ b/package/qemu/Config.in
@@ -86,7 +86,9 @@ endif # BR2_PACKAGE_QEMU_CUSTOM_TARGETS == ""
 
 config BR2_PACKAGE_QEMU_HAS_EMULS
 	def_bool y
-	depends on BR2_PACKAGE_QEMU_SYSTEM || BR2_PACKAGE_QEMU_LINUX_USER || BR2_PACKAGE_QEMU_CUSTOM_TARGETS != ""
+	depends on BR2_PACKAGE_QEMU_SYSTEM ||     \
+			BR2_PACKAGE_QEMU_LINUX_USER ||    \
+			BR2_PACKAGE_QEMU_CUSTOM_TARGETS != ""
 
 if BR2_PACKAGE_QEMU_HAS_EMULS
 
@@ -106,7 +108,7 @@ config BR2_PACKAGE_QEMU_FDT
 	depends on !BR2_STATIC_LIBS # dtc
 	select BR2_PACKAGE_DTC
 	help
-	  Say 'y' here to have QEMU capable of constructing Device Trees,
+	  Say 'y' to have QEMU capable of constructing Device Trees,
 	  and passing them to the VMs.
 
 comment "FDT support needs a toolchain w/ dynamic library"
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index 151060b..1910dbd 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -17,7 +17,8 @@ HOST_QEMU_LICENSE_FILES = COPYING COPYING.LIB
 #       the non-(L)GPL license texts are specified in the affected
 #       individual source files.
 
-HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
+HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 \
+						 host-pixman
 HOST_QEMU_SITE = $(QEMU_SITE)
 HOST_QEMU_SOURCE = $(QEMU_SOURCE)
 
@@ -94,9 +95,15 @@ HOST_QEMU_TARGETS += $(HOST_QEMU_ARCH)-linux-user
 HOST_QEMU_OPTS += --enable-linux-user
 
 # kernel version as major*256 + minor
-HOST_QEMU_HOST_SYSTEM_VERSION = $(shell uname -r | awk -F. '{ print $$1 * 256 + $$2 }')
-HOST_QEMU_TARGET_SYSTEM_VERSION = $(shell echo $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) | awk -F. '{ print $$1 * 256 + $$2 }')
-HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge $(HOST_QEMU_TARGET_SYSTEM_VERSION) && echo OK)
+HOST_QEMU_HOST_SYSTEM_VERSION = $(shell uname -r | awk -F. \
+								'{ print $$1 * 256 + $$2 }')
+
+HOST_QEMU_TARGET_SYSTEM_VERSION = $(shell \
+								echo $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) \
+								| awk -F. '{ print $$1 * 256 + $$2 }')
+
+HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge \
+							$(HOST_QEMU_TARGET_SYSTEM_VERSION) && echo OK)
 
 ifeq ($(BR_BUILDING),y)
 ifneq ($(HOST_QEMU_COMPARE_VERSION),OK)
@@ -120,14 +127,14 @@ endif
 
 define HOST_QEMU_CONFIGURE_CMDS
 	cd $(@D); $(HOST_CONFIGURE_OPTS) ./configure    \
-		--target-list="$(HOST_QEMU_TARGETS)"    \
-		--prefix="$(HOST_DIR)/usr"              \
-		--interp-prefix=$(STAGING_DIR)          \
-		--cc="$(HOSTCC)"                        \
-		--host-cc="$(HOSTCC)"                   \
-		--python=$(HOST_DIR)/usr/bin/python2    \
-		--extra-cflags="$(HOST_CFLAGS)"         \
-		--extra-ldflags="$(HOST_LDFLAGS)"       \
+		--target-list="$(HOST_QEMU_TARGETS)"        \
+		--prefix="$(HOST_DIR)/usr"                  \
+		--interp-prefix=$(STAGING_DIR)              \
+		--cc="$(HOSTCC)"                            \
+		--host-cc="$(HOSTCC)"                       \
+		--python=$(HOST_DIR)/usr/bin/python2        \
+		--extra-cflags="$(HOST_CFLAGS)"             \
+		--extra-ldflags="$(HOST_LDFLAGS)"           \
 		$(HOST_QEMU_OPTS)
 endef
 
@@ -211,12 +218,12 @@ QEMU_OPTS += --disable-fdt
 endif
 
 define QEMU_CONFIGURE_CMDS
-	( cd $(@D);                                     \
-		LIBS='$(QEMU_LIBS)'                     \
-		$(TARGET_CONFIGURE_OPTS)                \
-		$(TARGET_CONFIGURE_ARGS)                \
-		$(QEMU_VARS)                            \
-		./configure                             \
+	cd $(@D);                               \
+		LIBS='$(QEMU_LIBS)'                 \
+		$(TARGET_CONFIGURE_OPTS)            \
+		$(TARGET_CONFIGURE_ARGS)            \
+		$(QEMU_VARS)                        \
+		./configure                         \
 			--prefix=/usr                   \
 			--cross-prefix=$(TARGET_CROSS)  \
 			--with-system-pixman            \
@@ -246,8 +253,7 @@ define QEMU_CONFIGURE_CMDS
 			--disable-seccomp               \
 			--disable-sparse                \
 			--disable-tools                 \
-			$(QEMU_OPTS)                    \
-	)
+			$(QEMU_OPTS)
 endef
 
 define QEMU_BUILD_CMDS
@@ -255,7 +261,8 @@ define QEMU_BUILD_CMDS
 endef
 
 define QEMU_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(QEMU_MAKE_ENV) DESTDIR=$(TARGET_DIR) install
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(QEMU_MAKE_ENV) \
+			DESTDIR=$(TARGET_DIR) install
 endef
 
 $(eval $(generic-package))
-- 
2.6.2

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

* [Buildroot] [PATCH 4/6] qemu: add qemu-system-run make target
  2016-05-04  7:47 [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system Simon Maes
  2016-05-04  7:47 ` [Buildroot] [PATCH 2/6] qemu: make qemu and host-qemu packages' version (separately) configurable Simon Maes
  2016-05-04  7:47 ` [Buildroot] [PATCH 3/6] qemu: code cleanup - (mostly) wrapping lines at 80 characters Simon Maes
@ 2016-05-04  7:47 ` Simon Maes
  2016-07-03 22:29   ` Thomas Petazzoni
  2016-05-04  7:47 ` [Buildroot] [PATCH 5/6] vde2: enable building host package Simon Maes
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Simon Maes @ 2016-05-04  7:47 UTC (permalink / raw)
  To: buildroot

Additional configuration for qemu package:
- Save qemu commandline arguments to run qemu directly using
 'make qemu-system-run'.

Signed-off-by: Simon Maes <simonn.maes@gmail.com>
---
 package/qemu/Config.in.host | 7 +++++++
 package/qemu/qemu.mk        | 9 +++++++++
 2 files changed, 16 insertions(+)

diff --git a/package/qemu/Config.in.host b/package/qemu/Config.in.host
index c86768f..8c07e71 100644
--- a/package/qemu/Config.in.host
+++ b/package/qemu/Config.in.host
@@ -88,4 +88,11 @@ config BR2_PACKAGE_HOST_QEMU_STRIP_BINARY
 
 endif # BR2_PACKAGE_HOST_QEMU_HAS_EMULS
 
+config BR2_PACKAGE_HOST_QEMU_SYSTEM_ARGS
+	string "qemu-system command arguments"
+	depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE
+	help
+	  Arguments to be used for your target host-qemu-system to run
+	  via "make qemu-system-run".
+
 endif # BR2_PACKAGE_HOST_QEMU
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index 1910dbd..4de32b9 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -151,6 +151,15 @@ $(eval $(host-generic-package))
 # variable used by other packages
 QEMU_USER = $(HOST_DIR)/usr/bin/qemu-$(HOST_QEMU_ARCH)
 
+ifeq ($(BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE),y)
+QEMU_SYSTEM = $(HOST_DIR)/usr/bin/qemu-system-$(HOST_QEMU_ARCH)
+
+.PHONY: qemu-system-run
+qemu-system-run:
+	$(QEMU_SYSTEM) $(call qstrip,$(BR2_PACKAGE_HOST_QEMU_SYSTEM_ARGS))
+endif
+
+
 #-------------------------------------------------------------
 # Target-qemu
 
-- 
2.6.2

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

* [Buildroot] [PATCH 5/6] vde2: enable building host package
  2016-05-04  7:47 [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system Simon Maes
                   ` (2 preceding siblings ...)
  2016-05-04  7:47 ` [Buildroot] [PATCH 4/6] qemu: add qemu-system-run make target Simon Maes
@ 2016-05-04  7:47 ` Simon Maes
  2016-07-03 22:30   ` Thomas Petazzoni
  2016-05-04  7:47 ` [Buildroot] [PATCH 6/6] qemu: add support for vde2 Simon Maes
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Simon Maes @ 2016-05-04  7:47 UTC (permalink / raw)
  To: buildroot

In preparation of enabling vde2 support in host-qemu package.

Signed-off-by: Simon Maes <simonn.maes@gmail.com>
---
 package/vde2/vde2.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/vde2/vde2.mk b/package/vde2/vde2.mk
index bad758d..13fecd3 100644
--- a/package/vde2/vde2.mk
+++ b/package/vde2/vde2.mk
@@ -38,3 +38,4 @@ VDE2_CONF_OPTS = \
 VDE2_MAKE = $(MAKE1)
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
-- 
2.6.2

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

* [Buildroot] [PATCH 6/6] qemu: add support for vde2
  2016-05-04  7:47 [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system Simon Maes
                   ` (3 preceding siblings ...)
  2016-05-04  7:47 ` [Buildroot] [PATCH 5/6] vde2: enable building host package Simon Maes
@ 2016-05-04  7:47 ` Simon Maes
  2016-07-03 22:31   ` Thomas Petazzoni
  2016-05-04 22:34 ` [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system Arnout Vandecappelle
  2016-07-03 22:25 ` Thomas Petazzoni
  6 siblings, 1 reply; 14+ messages in thread
From: Simon Maes @ 2016-05-04  7:47 UTC (permalink / raw)
  To: buildroot

Additional configuration for qemu package:
- Enable VDE2 support for qemu

Signed-off-by: Simon Maes <simonn.maes@gmail.com>
---
 package/qemu/Config.in.host | 8 ++++++++
 package/qemu/qemu.mk        | 5 +++++
 2 files changed, 13 insertions(+)

diff --git a/package/qemu/Config.in.host b/package/qemu/Config.in.host
index 8c07e71..13f13c1 100644
--- a/package/qemu/Config.in.host
+++ b/package/qemu/Config.in.host
@@ -86,6 +86,14 @@ config BR2_PACKAGE_HOST_QEMU_STRIP_BINARY
 	help
 	  Say 'y' to enable stripping of the QEMU binary.
 
+config BR2_PACKAGE_HOST_QEMU_VDE2
+	bool "Enable VDE2 Support"
+	help
+	  Say 'y' to enable VDE2 build options for QEMU.
+	  VDE2 stands for Virtual Distributed Ethernet and can be
+	  used to create virtual switches to "plug" both physical
+	  and virtual machines in them.
+
 endif # BR2_PACKAGE_HOST_QEMU_HAS_EMULS
 
 config BR2_PACKAGE_HOST_QEMU_SYSTEM_ARGS
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index 4de32b9..79f15e1 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -123,6 +123,11 @@ ifeq ($(BR2_PACKAGE_HOST_QEMU_STRIP_BINARY),n)
 HOST_QEMU_OPTS += --disable-strip
 endif
 
+ifeq ($(BR2_PACKAGE_HOST_QEMU_VDE2),y)
+HOST_QEMU_OPTS += --enable-vde
+HOST_QEMU_DEPENDENCIES += host-vde2
+endif
+
 endif
 
 define HOST_QEMU_CONFIGURE_CMDS
-- 
2.6.2

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

* [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system
  2016-05-04  7:47 [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system Simon Maes
                   ` (4 preceding siblings ...)
  2016-05-04  7:47 ` [Buildroot] [PATCH 6/6] qemu: add support for vde2 Simon Maes
@ 2016-05-04 22:34 ` Arnout Vandecappelle
  2016-07-03 22:25 ` Thomas Petazzoni
  6 siblings, 0 replies; 14+ messages in thread
From: Arnout Vandecappelle @ 2016-05-04 22:34 UTC (permalink / raw)
  To: buildroot

  Hi Simon,

  Thanks for working on this! You clearly understood the feedback that Thomas 
gave to Gustavo's original patches.

  I have a lot of feedback, mainly simplifying things a little.

On 05/04/16 09:47, Simon Maes wrote:
>     Additional package configurations are:

  Not very important, but we don't usually indent commit messages like this. 
When you do "git log", an additional 4 spaces will be added so then it becomes 
really deep...

>     - Enable system or linux user-land emulation
>     - Enable SDL frontend and FDT support
>     - Enable Qemu debug
>     - Disable stripped binary format

  Sounds to me like this could be split up into more patches. But in fact I 
think all of the optional things can be removed (i.e. made non-optional).

>
> Signed-off-by: Simon Maes <simonn.maes@gmail.com>
> ---
>  package/qemu/Config.in.host | 66 +++++++++++++++++++++++++++++++++++++++++++++
>  package/qemu/qemu.mk        | 39 ++++++++++++++++++++++-----
>  2 files changed, 99 insertions(+), 6 deletions(-)
>
> diff --git a/package/qemu/Config.in.host b/package/qemu/Config.in.host
> index c5c3f05..71f697e 100644
> --- a/package/qemu/Config.in.host
> +++ b/package/qemu/Config.in.host
> @@ -15,3 +15,69 @@ config BR2_PACKAGE_HOST_QEMU
>  	  This option builds a user emulator for your selected architecture.
>
>  	  http://www.qemu.org
> +
> +if BR2_PACKAGE_HOST_QEMU
> +
> +#
> +# Configuration selection
> +#
> +
> +comment "Emulators selection"
> +
> +config BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE
> +	bool "Enable systems emulation"
> +	depends on !BR2_STATIC_LIBS # dtc
> +	select BR2_PACKAGE_HOST_QEMU_FDT
> +	help
> +	  Say 'y' to build system emulators/virtualisers.
> +	  When building the host-qemu package for system emulation,
> +	  qemu will be configured to support the Target Architecture,
> +	  configured in Buildroot

  Why does that second sentence come here? Isn't that just true for all qemu 
builds? In fact, something similar is already in the general host-qemu help text.

> +
> +config BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
> +	bool "Enable Linux user-land emulation"
> +	help
> +	  Say 'y' to build Linux user-land emulators.

  Generally we try to stay compatible with existing configurations, so this 
should default to y - otherwise, when you have host-qemu selected before this 
patch, and you do a 'make menuconfig' and just save, you will neither system 
mode nor user mode selected.

  But in fact, it's silly to have neither. For target qemu, we can specify which 
targets to build, but for host it's only system or user. And if neither of them 
is selected, we're actually not going to build anything.

  So to avoid that, you can give this:

	default y if !BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE

  Alternatively, in BR2_PACKAGE_HOST_QEMU itself, you can add

	select BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE if !BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE

which makes sure that one of them is always selected.

> +
> +config BR2_PACKAGE_HOST_QEMU_HAS_EMULS
> +	def_bool y
> +	depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE || \
> +		BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE

  This should always be true.

> +
> +if BR2_PACKAGE_HOST_QEMU_HAS_EMULS
> +
> +comment "Frontends"
> +
> +config BR2_PACKAGE_HOST_QEMU_SDL
> +	bool "Enable SDL frontend"
> +	select BR2_PACKAGE_SDL

  This makes no sense. The target SDL package has nothing to do with host-qemu. 
Anyway, there isn't much point in building host-sdl either, because it doesn't 
have X11 support so most users can't do anything useful with it.

  I think we should just rely on system-installed devel packages for SDL and 
autodetection by configure. So add to the help text that you need libsdl1.2-dev 
(or whatever it is you need) to get graphical support.


> +	help
> +	  Say 'y' to enable the SDL frontend, that is, a graphical window
> +	  presenting the VM's display.
> +
> +comment "Misc. features"
> +
> +config BR2_PACKAGE_HOST_QEMU_FDT
> +	bool "Enable FDT"
> +	depends on !BR2_STATIC_LIBS # dtc
> +	select BR2_PACKAGE_DTC

  Again, target dtc has nothing to do with host-qemu. And again, I think it's OK 
to always build dtc support in host-qemu.

> +	help
> +	  Say 'y' to have QEMU capable of constructing Device Trees,
> +	  and passing them to the VMs.
> +
> +comment "FDT support needs a toolchain w/ dynamic library"
> +	depends on BR2_STATIC_LIBS
> +
> +config BR2_PACKAGE_HOST_QEMU_DEBUG
> +	bool "Enable debug"
> +	help
> +	  Say 'y' to enable build options for QEMU.

  build options? I guess debug options?

> +
> +config BR2_PACKAGE_HOST_QEMU_STRIP_BINARY
> +	bool "Enable stripped binary format"
> +	help
> +	  Say 'y' to enable stripping of the QEMU binary.

  I don't see how this is useful for host-qemu.

> +
> +endif # BR2_PACKAGE_HOST_QEMU_HAS_EMULS
> +
> +endif # BR2_PACKAGE_HOST_QEMU
> diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
> index 522910e..0e99138 100644
> --- a/package/qemu/qemu.mk
> +++ b/package/qemu/qemu.mk
> @@ -17,6 +17,8 @@ QEMU_LICENSE_FILES = COPYING COPYING.LIB
>  # Host-qemu
>
>  HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
> +HOST_QEMU_SITE = $(QEMU_SITE)
> +HOST_QEMU_SOURCE = $(QEMU_SOURCE)

  This doesn't belong here, it's only relevant when the version of host and 
target qemu can be selected independently.

>
>  #       BR ARCH         qemu
>  #       -------         ----
> @@ -61,7 +63,6 @@ endif
>  ifeq ($(HOST_QEMU_ARCH),sh4aeb)
>  HOST_QEMU_ARCH = sh4eb
>  endif
> -HOST_QEMU_TARGETS = $(HOST_QEMU_ARCH)-linux-user
>
>  ifeq ($(BR2_PACKAGE_HOST_QEMU),y)

  Since you're anyway moving things around: this condition (and the system check 
immediately below) would be better placed together with the BR_BUILDING check 
below. And it would be better to do that in a separate patch BTW.

>  HOST_QEMU_HOST_SYSTEM_TYPE = $(shell uname -s)
> @@ -69,10 +70,12 @@ ifneq ($(HOST_QEMU_HOST_SYSTEM_TYPE),Linux)
>  $(error "qemu-user can only be used on Linux hosts")
>  endif
>
> -# kernel version as major*256 + minor
> -HOST_QEMU_HOST_SYSTEM_VERSION = $(shell uname -r | awk -F. '{ print $$1 * 256 + $$2 }')
> -HOST_QEMU_TARGET_SYSTEM_VERSION = $(shell echo $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) | awk -F. '{ print $$1 * 256 + $$2 }')
> -HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge $(HOST_QEMU_TARGET_SYSTEM_VERSION) && echo OK)
> +ifeq ($(BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE),y)
> +HOST_QEMU_TARGETS += $(HOST_QEMU_ARCH)-softmmu

  Do we need this? Isn't --enable-system enough? Or will it build all arches then?

  Why the softmmu version? Shouldn't that depend on BR2_USE_MMU?

> +HOST_QEMU_OPTS += --enable-system
> +else
> +HOST_QEMU_OPTS += --disable-system
> +endif
>
>  #
>  # The principle of qemu-user is that it emulates the instructions of
> @@ -84,11 +87,34 @@ HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge $(
>  # built with kernel headers that are older or the same as the kernel
>  # version running on the host machine.
>  #

  You moved this comment away from the code that it applies to: the version check.

> +
> +ifeq ($(BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE),y)
> +HOST_QEMU_TARGETS += $(HOST_QEMU_ARCH)-linux-user
> +HOST_QEMU_OPTS += --enable-linux-user
> +
> +# kernel version as major*256 + minor
> +HOST_QEMU_HOST_SYSTEM_VERSION = $(shell uname -r | awk -F. '{ print $$1 * 256 + $$2 }')
> +HOST_QEMU_TARGET_SYSTEM_VERSION = $(shell echo $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) | awk -F. '{ print $$1 * 256 + $$2 }')
> +HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge $(HOST_QEMU_TARGET_SYSTEM_VERSION) && echo OK)

  This bit should also go inside the BR_BUILDING, in a separate patch.


  Regards,
  Arnout

> +
>  ifeq ($(BR_BUILDING),y)
>  ifneq ($(HOST_QEMU_COMPARE_VERSION),OK)
>  $(error "Refusing to build qemu-user: target Linux version newer than host's.")
>  endif
> +
> +else
> +HOST_QEMU_OPTS += --disable-linux-user
> +endif
>  endif
> +
> +ifeq ($(BR2_PACKAGE_HOST_QEMU_DEBUG),y)
> +HOST_QEMU_OPTS += --enable-debug
> +endif
> +
> +ifeq ($(BR2_PACKAGE_HOST_QEMU_STRIP_BINARY),n)
> +HOST_QEMU_OPTS += --disable-strip
> +endif
> +
>  endif
>
>  define HOST_QEMU_CONFIGURE_CMDS
> @@ -100,7 +126,8 @@ define HOST_QEMU_CONFIGURE_CMDS
>  		--host-cc="$(HOSTCC)"                   \
>  		--python=$(HOST_DIR)/usr/bin/python2    \
>  		--extra-cflags="$(HOST_CFLAGS)"         \
> -		--extra-ldflags="$(HOST_LDFLAGS)"
> +		--extra-ldflags="$(HOST_LDFLAGS)"       \
> +		$(HOST_QEMU_OPTS)
>  endef
>
>  define HOST_QEMU_BUILD_CMDS
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH 2/6] qemu: make qemu and host-qemu packages' version (separately) configurable
  2016-05-04  7:47 ` [Buildroot] [PATCH 2/6] qemu: make qemu and host-qemu packages' version (separately) configurable Simon Maes
@ 2016-05-07 19:01   ` Arnout Vandecappelle
  2016-07-03 22:26   ` Thomas Petazzoni
  1 sibling, 0 replies; 14+ messages in thread
From: Arnout Vandecappelle @ 2016-05-07 19:01 UTC (permalink / raw)
  To: buildroot

On 05/04/16 09:47, Simon Maes wrote:
> Signed-off-by: Simon Maes <simonn.maes@gmail.com>
> ---
>  package/qemu/Config.in      |  8 ++++++++
>  package/qemu/Config.in.host |  8 ++++++++
>  package/qemu/qemu.mk        | 26 ++++++++++++++++++--------
>  3 files changed, 34 insertions(+), 8 deletions(-)
>
> diff --git a/package/qemu/Config.in b/package/qemu/Config.in
> index ea6b946..a16a65c 100644
> --- a/package/qemu/Config.in
> +++ b/package/qemu/Config.in
> @@ -36,6 +36,14 @@ config BR2_PACKAGE_QEMU
>
>  if BR2_PACKAGE_QEMU
>
> +config BR2_PACKAGE_QEMU_VERSION
> +	string "qemu version"
> +	default "2.5.0"

  Our current version is 2.5.1, so the default should be that as well.

> +	help
> +	  QEMU version to use target qemu
                              ^^for

> +	  Sometimes the latest version is broken for some specific
> +	  architecture or target machine
> +
>  comment "Emulators selection"
>
>  config BR2_PACKAGE_QEMU_CUSTOM_TARGETS
> diff --git a/package/qemu/Config.in.host b/package/qemu/Config.in.host
> index 71f697e..c86768f 100644
> --- a/package/qemu/Config.in.host
> +++ b/package/qemu/Config.in.host
> @@ -18,6 +18,14 @@ config BR2_PACKAGE_HOST_QEMU
>
>  if BR2_PACKAGE_HOST_QEMU
>
> +config BR2_PACKAGE_HOST_QEMU_VERSION
> +	string "host qemu version"
> +	default "2.5.0"

  Same here, default 2.5.1.

> +	help
> +	  QEMU version to use for host qemu
> +	  Sometimes the latest version is broken for some specific
> +	  architecture or target machine
> +
>  #
>  # Configuration selection
>  #
> diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
> index 0e99138..151060b 100644
> --- a/package/qemu/qemu.mk
> +++ b/package/qemu/qemu.mk
> @@ -4,18 +4,19 @@
>  #
>  ################################################################################
>
> -QEMU_VERSION = 2.5.1
> -QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.bz2
> -QEMU_SITE = http://wiki.qemu.org/download
> -QEMU_LICENSE = GPLv2, LGPLv2.1, MIT, BSD-3c, BSD-2c, Others/BSD-1c
> -QEMU_LICENSE_FILES = COPYING COPYING.LIB
> -# NOTE: there is no top-level license file for non-(L)GPL licenses;
> -#       the non-(L)GPL license texts are specified in the affected
> -#       individual source files.

  There is no reason to move all this. When there are differences between host 
and target, we put target first. So just replace

QEMU_VERSION = $(call qstrip,$(BR2_PACKAGE_QEMU_VERSION))

and leave the rest as is.

>
>  #-------------------------------------------------------------
>  # Host-qemu
>
> +HOST_QEMU_VERSION = $(call qstrip,$(BR2_PACKAGE_HOST_QEMU_VERSION))
> +HOST_QEMU_SOURCE = qemu-$(HOST_QEMU_VERSION).tar.bz2
> +HOST_QEMU_SITE = http://wiki.qemu.org/download
> +HOST_QEMU_LICENSE = GPLv2, LGPLv2.1, MIT, BSD-3c, BSD-2c, Others/BSD-1c
> +HOST_QEMU_LICENSE_FILES = COPYING COPYING.LIB

  Only the first two are needed, all the rest can be inherited from target.


  Regards,
  Arnout

> +# NOTE: there is no top-level license file for non-(L)GPL licenses;
> +#       the non-(L)GPL license texts are specified in the affected
> +#       individual source files.
> +
>  HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
>  HOST_QEMU_SITE = $(QEMU_SITE)
>  HOST_QEMU_SOURCE = $(QEMU_SOURCE)
> @@ -146,6 +147,15 @@ QEMU_USER = $(HOST_DIR)/usr/bin/qemu-$(HOST_QEMU_ARCH)
>  #-------------------------------------------------------------
>  # Target-qemu
>
> +QEMU_VERSION = $(call qstrip,$(BR2_PACKAGE_QEMU_VERSION))
> +QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.bz2
> +QEMU_SITE = http://wiki.qemu.org/download
> +QEMU_LICENSE = GPLv2, LGPLv2.1, MIT, BSD-3c, BSD-2c, Others/BSD-1c
> +QEMU_LICENSE_FILES = COPYING COPYING.LIB
> +# NOTE: there is no top-level license file for non-(L)GPL licenses;
> +#       the non-(L)GPL license texts are specified in the affected
> +#       individual source files.
> +
>  QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman
>
>  # Need the LIBS variable because librt and libm are
>
>
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system
  2016-05-04  7:47 [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system Simon Maes
                   ` (5 preceding siblings ...)
  2016-05-04 22:34 ` [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system Arnout Vandecappelle
@ 2016-07-03 22:25 ` Thomas Petazzoni
  6 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2016-07-03 22:25 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  4 May 2016 09:47:54 +0200, Simon Maes wrote:
>     Additional package configurations are:
>     - Enable system or linux user-land emulation
>     - Enable SDL frontend and FDT support
>     - Enable Qemu debug
>     - Disable stripped binary format
> 
> Signed-off-by: Simon Maes <simonn.maes@gmail.com>

I just respined a new version of this patch, which takes into account
Arnout comments, and more. See:

   https://patchwork.ozlabs.org/patch/643849/

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 2/6] qemu: make qemu and host-qemu packages' version (separately) configurable
  2016-05-04  7:47 ` [Buildroot] [PATCH 2/6] qemu: make qemu and host-qemu packages' version (separately) configurable Simon Maes
  2016-05-07 19:01   ` Arnout Vandecappelle
@ 2016-07-03 22:26   ` Thomas Petazzoni
  1 sibling, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2016-07-03 22:26 UTC (permalink / raw)
  To: buildroot

Simon,

On Wed,  4 May 2016 09:47:55 +0200, Simon Maes wrote:

> +config BR2_PACKAGE_QEMU_VERSION
> +	string "qemu version"
> +	default "2.5.0"

Making the version selectable will break badly with the hash file: it
will only work if you use a version for which a hash is listed in the
hash file.

For now, we'd prefer to stick to a single supported version, and see if
we really have situations where using an older version is mandatory.

Therefore, I've marked this patch as Rejected in our patch tracking
system.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 3/6] qemu: code cleanup - (mostly) wrapping lines at 80 characters
  2016-05-04  7:47 ` [Buildroot] [PATCH 3/6] qemu: code cleanup - (mostly) wrapping lines at 80 characters Simon Maes
@ 2016-07-03 22:28   ` Thomas Petazzoni
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2016-07-03 22:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  4 May 2016 09:47:56 +0200, Simon Maes wrote:

>  config BR2_PACKAGE_QEMU_HAS_EMULS
>  	def_bool y
> -	depends on BR2_PACKAGE_QEMU_SYSTEM || BR2_PACKAGE_QEMU_LINUX_USER || BR2_PACKAGE_QEMU_CUSTOM_TARGETS != ""
> +	depends on BR2_PACKAGE_QEMU_SYSTEM ||     \
> +			BR2_PACKAGE_QEMU_LINUX_USER ||    \
> +			BR2_PACKAGE_QEMU_CUSTOM_TARGETS != ""

We indent continuation lines with just one more tab.

>  if BR2_PACKAGE_QEMU_HAS_EMULS
>  
> @@ -106,7 +108,7 @@ config BR2_PACKAGE_QEMU_FDT
>  	depends on !BR2_STATIC_LIBS # dtc
>  	select BR2_PACKAGE_DTC
>  	help
> -	  Say 'y' here to have QEMU capable of constructing Device Trees,
> +	  Say 'y' to have QEMU capable of constructing Device Trees,

Well, yes, but not super important.

>  	  and passing them to the VMs.
>  
>  comment "FDT support needs a toolchain w/ dynamic library"
> diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
> index 151060b..1910dbd 100644
> --- a/package/qemu/qemu.mk
> +++ b/package/qemu/qemu.mk
> @@ -17,7 +17,8 @@ HOST_QEMU_LICENSE_FILES = COPYING COPYING.LIB
>  #       the non-(L)GPL license texts are specified in the affected
>  #       individual source files.
>  
> -HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
> +HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 \
> +						 host-pixman

See above.

>  HOST_QEMU_SITE = $(QEMU_SITE)
>  HOST_QEMU_SOURCE = $(QEMU_SOURCE)
>  
> @@ -94,9 +95,15 @@ HOST_QEMU_TARGETS += $(HOST_QEMU_ARCH)-linux-user
>  HOST_QEMU_OPTS += --enable-linux-user
>  
>  # kernel version as major*256 + minor
> -HOST_QEMU_HOST_SYSTEM_VERSION = $(shell uname -r | awk -F. '{ print $$1 * 256 + $$2 }')
> -HOST_QEMU_TARGET_SYSTEM_VERSION = $(shell echo $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) | awk -F. '{ print $$1 * 256 + $$2 }')
> -HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge $(HOST_QEMU_TARGET_SYSTEM_VERSION) && echo OK)
> +HOST_QEMU_HOST_SYSTEM_VERSION = $(shell uname -r | awk -F. \
> +								'{ print $$1 * 256 + $$2 }')
> +
> +HOST_QEMU_TARGET_SYSTEM_VERSION = $(shell \
> +								echo $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) \
> +								| awk -F. '{ print $$1 * 256 + $$2 }')
> +
> +HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge \
> +							$(HOST_QEMU_TARGET_SYSTEM_VERSION) && echo OK)

This is actually a lot less readable than it was.

>  ifeq ($(BR_BUILDING),y)
>  ifneq ($(HOST_QEMU_COMPARE_VERSION),OK)
> @@ -120,14 +127,14 @@ endif
>  
>  define HOST_QEMU_CONFIGURE_CMDS
>  	cd $(@D); $(HOST_CONFIGURE_OPTS) ./configure    \
> -		--target-list="$(HOST_QEMU_TARGETS)"    \
> -		--prefix="$(HOST_DIR)/usr"              \
> -		--interp-prefix=$(STAGING_DIR)          \
> -		--cc="$(HOSTCC)"                        \
> -		--host-cc="$(HOSTCC)"                   \
> -		--python=$(HOST_DIR)/usr/bin/python2    \
> -		--extra-cflags="$(HOST_CFLAGS)"         \
> -		--extra-ldflags="$(HOST_LDFLAGS)"       \
> +		--target-list="$(HOST_QEMU_TARGETS)"        \
> +		--prefix="$(HOST_DIR)/usr"                  \
> +		--interp-prefix=$(STAGING_DIR)              \
> +		--cc="$(HOSTCC)"                            \
> +		--host-cc="$(HOSTCC)"                       \
> +		--python=$(HOST_DIR)/usr/bin/python2        \
> +		--extra-cflags="$(HOST_CFLAGS)"             \
> +		--extra-ldflags="$(HOST_LDFLAGS)"           \

Our convention now is to put the \ just one space after the line.

>  define QEMU_INSTALL_TARGET_CMDS
> -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(QEMU_MAKE_ENV) DESTDIR=$(TARGET_DIR) install
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(QEMU_MAKE_ENV) \
> +			DESTDIR=$(TARGET_DIR) install

Only one more tab indentation for the continuation lines.

So, I've marked your patch as Changes Requested in patchwork. Feel free
to submit an updated version that takes into account the comments if
you're interested.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 4/6] qemu: add qemu-system-run make target
  2016-05-04  7:47 ` [Buildroot] [PATCH 4/6] qemu: add qemu-system-run make target Simon Maes
@ 2016-07-03 22:29   ` Thomas Petazzoni
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2016-07-03 22:29 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  4 May 2016 09:47:57 +0200, Simon Maes wrote:
> Additional configuration for qemu package:
> - Save qemu commandline arguments to run qemu directly using
>  'make qemu-system-run'.
> 
> Signed-off-by: Simon Maes <simonn.maes@gmail.com>
> ---
>  package/qemu/Config.in.host | 7 +++++++
>  package/qemu/qemu.mk        | 9 +++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/package/qemu/Config.in.host b/package/qemu/Config.in.host
> index c86768f..8c07e71 100644
> --- a/package/qemu/Config.in.host
> +++ b/package/qemu/Config.in.host
> @@ -88,4 +88,11 @@ config BR2_PACKAGE_HOST_QEMU_STRIP_BINARY
>  
>  endif # BR2_PACKAGE_HOST_QEMU_HAS_EMULS
>  
> +config BR2_PACKAGE_HOST_QEMU_SYSTEM_ARGS
> +	string "qemu-system command arguments"
> +	depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE
> +	help
> +	  Arguments to be used for your target host-qemu-system to run
> +	  via "make qemu-system-run".
> +
>  endif # BR2_PACKAGE_HOST_QEMU
> diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
> index 1910dbd..4de32b9 100644
> --- a/package/qemu/qemu.mk
> +++ b/package/qemu/qemu.mk
> @@ -151,6 +151,15 @@ $(eval $(host-generic-package))
>  # variable used by other packages
>  QEMU_USER = $(HOST_DIR)/usr/bin/qemu-$(HOST_QEMU_ARCH)
>  
> +ifeq ($(BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE),y)
> +QEMU_SYSTEM = $(HOST_DIR)/usr/bin/qemu-system-$(HOST_QEMU_ARCH)
> +
> +.PHONY: qemu-system-run
> +qemu-system-run:
> +	$(QEMU_SYSTEM) $(call qstrip,$(BR2_PACKAGE_HOST_QEMU_SYSTEM_ARGS))
> +endif

We feel this is a bit "too special", and doesn't bring a lot of value
compared to just having a shell script next to Buildroot. So for now,
we prefer to keep this out of Buildroot.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 5/6] vde2: enable building host package
  2016-05-04  7:47 ` [Buildroot] [PATCH 5/6] vde2: enable building host package Simon Maes
@ 2016-07-03 22:30   ` Thomas Petazzoni
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2016-07-03 22:30 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  4 May 2016 09:47:58 +0200, Simon Maes wrote:
> In preparation of enabling vde2 support in host-qemu package.
> 
> Signed-off-by: Simon Maes <simonn.maes@gmail.com>
> ---
>  package/vde2/vde2.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/vde2/vde2.mk b/package/vde2/vde2.mk
> index bad758d..13fecd3 100644
> --- a/package/vde2/vde2.mk
> +++ b/package/vde2/vde2.mk
> @@ -38,3 +38,4 @@ VDE2_CONF_OPTS = \
>  VDE2_MAKE = $(MAKE1)
>  
>  $(eval $(autotools-package))
> +$(eval $(host-autotools-package))

You forgot to define HOST_VDE2_CONF_OPTS and HOST_VDE2_MAKE, so I've
added these and sent the changed version as part of my respin. See
http://patchwork.ozlabs.org/patch/643848/.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 6/6] qemu: add support for vde2
  2016-05-04  7:47 ` [Buildroot] [PATCH 6/6] qemu: add support for vde2 Simon Maes
@ 2016-07-03 22:31   ` Thomas Petazzoni
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2016-07-03 22:31 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  4 May 2016 09:47:59 +0200, Simon Maes wrote:
> Additional configuration for qemu package:
> - Enable VDE2 support for qemu
> 
> Signed-off-by: Simon Maes <simonn.maes@gmail.com>
> ---
>  package/qemu/Config.in.host | 8 ++++++++
>  package/qemu/qemu.mk        | 5 +++++
>  2 files changed, 13 insertions(+)

I also did a respin of this patch, in a very similar way. See
http://patchwork.ozlabs.org/patch/643850/.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2016-07-03 22:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-04  7:47 [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system Simon Maes
2016-05-04  7:47 ` [Buildroot] [PATCH 2/6] qemu: make qemu and host-qemu packages' version (separately) configurable Simon Maes
2016-05-07 19:01   ` Arnout Vandecappelle
2016-07-03 22:26   ` Thomas Petazzoni
2016-05-04  7:47 ` [Buildroot] [PATCH 3/6] qemu: code cleanup - (mostly) wrapping lines at 80 characters Simon Maes
2016-07-03 22:28   ` Thomas Petazzoni
2016-05-04  7:47 ` [Buildroot] [PATCH 4/6] qemu: add qemu-system-run make target Simon Maes
2016-07-03 22:29   ` Thomas Petazzoni
2016-05-04  7:47 ` [Buildroot] [PATCH 5/6] vde2: enable building host package Simon Maes
2016-07-03 22:30   ` Thomas Petazzoni
2016-05-04  7:47 ` [Buildroot] [PATCH 6/6] qemu: add support for vde2 Simon Maes
2016-07-03 22:31   ` Thomas Petazzoni
2016-05-04 22:34 ` [Buildroot] [PATCH 1/6] qemu: add support for host-qemu-system Arnout Vandecappelle
2016-07-03 22:25 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.