Skip to contentSkip to conversation

build upstream qemu and seabios by default

PATCH In review Stefano Stabellini 3 participants 14 messages Jan 16, 2012 – Jan 25, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

v10 cover build upstream qemu and seabios by default

Hi all,
this is the tenth version of the patch series to introduce upstream qemu and seabios in the xen-unstable build system.

Changes to v9:

- rename QEMU_UPSTREAM_TAG to QEMU_UPSTREAM_REVISION: we are going to use it with a branch name by default;

- set QEMU_UPSTREAM_REVISION to "master" by default;

- set SEABIOS_UPSTREAM_URL to git://xenbits.xen.org/seabios.git by default;

- add a patch to update MAINTAINERS.

Changes to v8:

- build upstream qemu out of tree;

- add a tools/qemu-xen-dir-force-update target;

- add a tools/firmware/seabios-dir-force-update target;

- call make install from subdir-all and subdir-install qemu-xen-traditional and qemu-xen targets;

- fix a typo in patch #5;

Changes to v7:

- call upstream qemu's configure script right before building qemu and after building libxc and xenstore because it needs them;

- introduce a new patch to move the call to xen-setup after building libxc and xenstore for consistency with upstream qemu;

- fix a typo in tools/Makefile (patch #4);

Changes to v6:

- add "set -e" to git-checkout.sh;

- add argument count check to git-checkout.sh;

- remove spurious semicolons in git-checkout.sh.

Changes to v5:

- use $GIT in git-checkout.sh;

- add an http mirror for seabios;

- use $(LIBEXEC) to configure upstream qemu;

- append a patch for libxenlight to find the upstream qemu binary under $(LIBEXEC).

Changes to v4:

- remove an obsolete comment;

- use /bin/sh to execute git-checkout.sh rathen than /bin/bash.

Changes to v3:

- reduce the scope of git-checkout.sh, now it only does what the name says; calling "configure" is responsibility of the caller. As a result of this change, the build still works when the user specifies a local directory in the CONFIG_QEMU environmental variable;

- use a more official qemu repository hosted on xenbits;

- use a changeset as QEMU_UPSTREAM_TAG rather than a branch name.

Changes to v2:

- move tools/git-checkout.sh to scripts/git-checkout.sh;

- use git-checkout.sh for seabios;

- improve seabios integration with tools/firmware make system;

- add qemu-xen-traditional, qemu-xen and seabios dir entries to .hgignore.

Changes to v1:

- always build upstream qemu and seabios, rather than introducing them as an option.

Cheers,

Stefano

#1 lore raw

PATCH v10 1/7 Introduce git-checkout.sh

From: [email protected] <[email protected]>

Introduce a script to perform git checkout on an external git tree; use git-checkout.sh in ioemu-dir-find.

---
 .hgignore               |    2 +-
 scripts/git-checkout.sh |   27 +++++++++++++++++++++++++++
 tools/Makefile          |   20 ++++----------------
 3 files changed, 32 insertions(+), 17 deletions(-)
 create mode 100755 scripts/git-checkout.sh
.hgignore +1 -1
index 87d8ef7..3145eee 100644
@@ -296,7 +296,7 @@
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^tools/xm-test/tests/.*\.test$
-^tools/ioemu-remote
+^tools/ioemu-dir-remote
 ^tools/ioemu-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
scripts/git-checkout.sh new file +27 -0
new file mode 100755
index 0000000..15b3ce9
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+if test $# -lt 3; then
+	echo "Usage: $0 <tree> <tag> <dir>"
+	exit 1
+fi
+
+TREE=$1
+TAG=$2
+DIR=$3
+
+set -e
+
+if test \! -d $DIR-remote; then
+	rm -rf $DIR-remote $DIR-remote.tmp
+	mkdir $DIR-remote.tmp; rmdir $DIR-remote.tmp
+	$GIT clone $TREE $DIR-remote.tmp
+	if test "$TAG" ; then
+		cd $DIR-remote.tmp
+		$GIT branch -D dummy >/dev/null 2>&1 ||:
+		$GIT checkout -b dummy $TAG
+		cd ..
+	fi
+	mv $DIR-remote.tmp $DIR-remote
+fi
+rm -f $DIR
+ln -sf $DIR-remote $DIR
tools/Makefile +4 -16
index 443ee7f..7f5ee3e 100644
@@ -75,7 +75,7 @@ clean: subdirs-clean
 
 .PHONY: distclean
 distclean: subdirs-distclean
-	rm -rf ioemu-dir ioemu-remote
+	rm -rf ioemu-dir ioemu-dir-remote
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
 IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
@@ -93,20 +93,8 @@ ioemu-dir-find:
 	if test -d $(CONFIG_QEMU); then \
 		mkdir -p ioemu-dir; \
 	else \
-		if [ ! -d ioemu-remote ]; then \
-			rm -rf ioemu-remote ioemu-remote.tmp; \
-			mkdir ioemu-remote.tmp; rmdir ioemu-remote.tmp; \
-			$(GIT) clone $(CONFIG_QEMU) ioemu-remote.tmp; \
-			if [ "$(QEMU_TAG)" ]; then			\
-				cd ioemu-remote.tmp;			\
-				$(GIT) branch -D dummy >/dev/null 2>&1 ||:; \
-				$(GIT) checkout -b dummy $(QEMU_TAG);	\
-				cd ..;					\
-			fi;						\
-			mv ioemu-remote.tmp ioemu-remote; \
-		fi; \
-		rm -f ioemu-dir; \
-		ln -sf ioemu-remote ioemu-dir; \
+		export GIT=$(GIT); \
+		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) ioemu-dir; \
 	fi
 	set -e; \
 		$(buildmakevars2shellvars); \
@@ -117,7 +105,7 @@ ioemu-dir-find:
 ioemu-dir-force-update:
 	set -ex; \
 	if [ "$(QEMU_TAG)" ]; then \
-		cd ioemu-remote; \
+		cd ioemu-dir-remote; \
 		$(GIT) fetch origin; \
 		$(GIT) reset --hard $(QEMU_TAG); \
 	fi
Signature · 1 line
1.7.2.5
#2 lore raw

PATCH v10 2/7 Rename ioemu-dir as qemu-xen-traditional-dir

In reply to Stefano Stabellini

From: [email protected] <[email protected]>

---
 .hgignore        |    4 ++--
 Makefile         |   14 +++++++-------
 stubdom/Makefile |    8 ++++----
 tools/Makefile   |   26 +++++++++++++-------------
 4 files changed, 26 insertions(+), 26 deletions(-)
.hgignore +2 -2
index 3145eee..4b773c3 100644
@@ -296,8 +296,8 @@
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^tools/xm-test/tests/.*\.test$
-^tools/ioemu-dir-remote
-^tools/ioemu-dir$
+^tools/qemu-xen-traditional-dir-remote
+^tools/qemu-xen-traditional-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
 ^tools/ocaml/.*/META$
Makefile +7 -7
index 31e8795..c0197a5 100644
@@ -70,7 +70,7 @@ install-tools:
 	$(MAKE) -C tools install
 
 ifeq ($(CONFIG_IOEMU),y)
-install-tools: tools/ioemu-dir
+install-tools: tools/qemu-xen-traditional-dir
 endif
 
 .PHONY: install-kernels
@@ -78,18 +78,18 @@ install-kernels:
 	for i in $(XKERNELS) ; do $(MAKE) $$i-install || exit 1; done
 
 .PHONY: install-stubdom
-install-stubdom: tools/ioemu-dir install-tools
+install-stubdom: tools/qemu-xen-traditional-dir install-tools
 	$(MAKE) -C stubdom install
 ifeq (x86_64,$(XEN_TARGET_ARCH))
 	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub
 endif
 
-tools/ioemu-dir:
-	$(MAKE) -C tools ioemu-dir-find
+tools/qemu-xen-traditional-dir:
+	$(MAKE) -C tools qemu-xen-traditional-dir-find
 
-.PHONY: tools/ioemu-dir-force-update
-tools/ioemu-dir-force-update:
-	$(MAKE) -C tools ioemu-dir-force-update
+.PHONY: tools/qemu-xen-traditional-dir-force-update
+tools/qemu-xen-traditional-dir-force-update:
+	$(MAKE) -C tools qemu-xen-traditional-dir-force-update
 
 .PHONY: install-docs
 install-docs:
stubdom/Makefile +4 -4
index 3705059..e9dbf02 100644
@@ -218,15 +218,15 @@ $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci
 QEMU_ROOT := $(shell if [ -d "$(CONFIG_QEMU)" ]; then echo "$(CONFIG_QEMU)"; else echo .; fi)
 
 ifeq ($(QEMU_ROOT),.)
-$(XEN_ROOT)/tools/ioemu-dir:
-	$(CROSS_MAKE) -C $(XEN_ROOT)/tools ioemu-dir-find
+$(XEN_ROOT)/tools/qemu-xen-traditional-dir:
+	$(CROSS_MAKE) -C $(XEN_ROOT)/tools qemu-xen-traditional-dir-find
 
-ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/ioemu-dir
+ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir
 	mkdir -p ioemu
 	set -e;									\
 	$(buildmakevars2shellvars);						\
 	cd ioemu;								\
-	src="$$XEN_ROOT/tools/ioemu-dir"; export src;				\
+	src="$$XEN_ROOT/tools/qemu-xen-traditional-dir"; export src;		\
 	(cd $$src && find * -type d -print) | xargs mkdir -p;			\
 	(cd $$src && find *	! -type l  -type f  $(addprefix ! -name ,	\
 			'*.[oda1]' 'config-*' config.mak qemu-dm qemu-img-xen	\
tools/Makefile +13 -13
index 7f5ee3e..14e6d07 100644
@@ -35,7 +35,7 @@ SUBDIRS-y += libvchan
 
 # do not recurse in to a dir we are about to delete
 ifneq "$(MAKECMDGOALS)" "distclean"
-SUBDIRS-$(CONFIG_IOEMU) += ioemu-dir
+SUBDIRS-$(CONFIG_IOEMU) += qemu-xen-traditional-dir
 endif
 
 SUBDIRS-y += xenpmd
@@ -75,7 +75,7 @@ clean: subdirs-clean
 
 .PHONY: distclean
 distclean: subdirs-distclean
-	rm -rf ioemu-dir ioemu-dir-remote
+	rm -rf qemu-xen-traditional-dir qemu-xen-traditional-dir-remote
 
 ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
 IOEMU_CONFIGURE_CROSS ?= --cpu=$(XEN_TARGET_ARCH) \
@@ -88,34 +88,34 @@ ifneq ($(QEMU_ROOT),.)
 export QEMU_ROOT
 endif
 
-ioemu-dir-find:
+qemu-xen-traditional-dir-find:
 	set -ex; \
 	if test -d $(CONFIG_QEMU); then \
-		mkdir -p ioemu-dir; \
+		mkdir -p qemu-xen-traditional-dir; \
 	else \
 		export GIT=$(GIT); \
-		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) ioemu-dir; \
+		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) qemu-xen-traditional-dir; \
 	fi
 	set -e; \
 		$(buildmakevars2shellvars); \
-		cd ioemu-dir; \
+		cd qemu-xen-traditional-dir; \
 		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS)
 
-.PHONY: ioemu-dir-force-update
-ioemu-dir-force-update:
+.PHONY: qemu-xen-traditional-dir-force-update
+qemu-xen-traditional-dir-force-update:
 	set -ex; \
 	if [ "$(QEMU_TAG)" ]; then \
-		cd ioemu-dir-remote; \
+		cd qemu-xen-traditional-dir-remote; \
 		$(GIT) fetch origin; \
 		$(GIT) reset --hard $(QEMU_TAG); \
 	fi
 
-subdir-all-ioemu-dir subdir-install-ioemu-dir: ioemu-dir-find
+subdir-all-qemu-xen-traditional-dir subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
 
-subdir-clean-ioemu-dir:
-	set -e; if test -d ioemu-dir/.; then \
+subdir-clean-qemu-xen-traditional-dir:
+	set -e; if test -d qemu-xen-traditional-dir/.; then \
 		$(buildmakevars2shellvars); \
-		$(MAKE) -C ioemu-dir clean; \
+		$(MAKE) -C qemu-xen-traditional-dir clean; \
 	fi
 
 subdir-clean-debugger/gdbsx subdir-distclean-debugger/gdbsx: .phony
Signature · 1 line
1.7.2.5
#3 lore raw

PATCH v10 3/7 move the call to xen-setup after libxc and xenstore are built

In reply to Stefano Stabellini

From: [email protected] <[email protected]>

Move the call to xen-setup, the wrapper script to configure qemu-xen-traditional, right before building qemu-xen-traditional and after libxc and xenstore are already built.

---
 tools/Makefile |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
tools/Makefile +5 -4
index 14e6d07..3ff1ed1 100644
@@ -96,10 +96,6 @@ qemu-xen-traditional-dir-find:
 		export GIT=$(GIT); \
 		$(XEN_ROOT)/scripts/git-checkout.sh $(CONFIG_QEMU) $(QEMU_TAG) qemu-xen-traditional-dir; \
 	fi
-	set -e; \
-		$(buildmakevars2shellvars); \
-		cd qemu-xen-traditional-dir; \
-		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS)
 
 .PHONY: qemu-xen-traditional-dir-force-update
 qemu-xen-traditional-dir-force-update:
@@ -111,6 +107,11 @@ qemu-xen-traditional-dir-force-update:
 	fi
 
 subdir-all-qemu-xen-traditional-dir subdir-install-qemu-xen-traditional-dir: qemu-xen-traditional-dir-find
+	set -e; \
+		$(buildmakevars2shellvars); \
+		cd qemu-xen-traditional-dir; \
+		$(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \
+		$(MAKE) install
 
 subdir-clean-qemu-xen-traditional-dir:
 	set -e; if test -d qemu-xen-traditional-dir/.; then \
Signature · 1 line
1.7.2.5
#4 lore raw

PATCH v10 4/7 Clone and build upstream Qemu by default

In reply to Stefano Stabellini

From: [email protected] <[email protected]>

---
 .hgignore      |    2 ++
 Config.mk      |    7 +++++++
 Makefile       |    9 ++++++++-
 tools/Makefile |   44 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 61 insertions(+), 1 deletions(-)
.hgignore +2 -0
index 4b773c3..cbcc0f5 100644
@@ -298,6 +298,8 @@
 ^tools/xm-test/tests/.*\.test$
 ^tools/qemu-xen-traditional-dir-remote
 ^tools/qemu-xen-traditional-dir$
+^tools/qemu-xen-dir-remote
+^tools/qemu-xen-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
 ^tools/ocaml/.*/META$
Config.mk +7 -0
index 1c229c0..d229ab6 100644
@@ -202,6 +202,13 @@ else
 QEMU_REMOTE=git://xenbits.xensource.com/qemu-xen-unstable.git
 endif
 
+ifeq ($(GIT_HTTP),y)
+QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
+else
+QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
+endif
+QEMU_UPSTREAM_REVISION ?= master
+
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
Makefile +8 -1
index c0197a5..edc5e3d 100644
@@ -70,7 +70,7 @@ install-tools:
 	$(MAKE) -C tools install
 
 ifeq ($(CONFIG_IOEMU),y)
-install-tools: tools/qemu-xen-traditional-dir
+install-tools: tools/qemu-xen-traditional-dir tools/qemu-xen-dir
 endif
 
 .PHONY: install-kernels
@@ -91,6 +91,13 @@ tools/qemu-xen-traditional-dir:
 tools/qemu-xen-traditional-dir-force-update:
 	$(MAKE) -C tools qemu-xen-traditional-dir-force-update
 
+tools/qemu-xen-dir:
+	$(MAKE) -C tools qemu-xen-dir-find
+
+.PHONY: tools/qemu-xen-dir-force-update
+tools/qemu-xen-dir-force-update:
+	$(MAKE) -C tools qemu-xen-dir-force-update
+
 .PHONY: install-docs
 install-docs:
 	sh ./docs/check_pkgs && $(MAKE) -C docs install || true
tools/Makefile +44 -0

68 lines not on this page · raw message

Signature · 1 line
1.7.2.5
#5 lore raw

PATCH v10 5/7 Clone and build Seabios by default

In reply to Stefano Stabellini

From: [email protected] <[email protected]>

---
 .hgignore                         |    2 +
 Config.mk                         |   12 ++-----
 Makefile                          |    4 ++
 tools/firmware/Makefile           |   21 ++++++++++-
 tools/firmware/hvmloader/Makefile |    1 +
 tools/firmware/seabios-config     |   73 +++++++++++++++++++++++++++++++++++++
 6 files changed, 102 insertions(+), 11 deletions(-)
 create mode 100644 tools/firmware/seabios-config
.hgignore +2 -0
index cbcc0f5..64b440e 100644
@@ -300,6 +300,8 @@
 ^tools/qemu-xen-traditional-dir$
 ^tools/qemu-xen-dir-remote
 ^tools/qemu-xen-dir$
+^tools/firmware/seabios-dir-remote
+^tools/firmware/seabios-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
 ^tools/ocaml/.*/META$
Config.mk +3 -9
index d229ab6..152c783 100644
@@ -204,10 +204,13 @@ endif
 
 ifeq ($(GIT_HTTP),y)
 QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
+SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
+SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 QEMU_UPSTREAM_REVISION ?= master
+SEABIOS_UPSTREAM_TAG ?= 7fc039e9c262b4199fab497f3e12f4e425c37560
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
@@ -221,15 +224,6 @@ QEMU_TAG ?= bb36d632e4cabf47882adff07a45c6702c4a5b30
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
 
-# SeaBIOS integration is a work in progress. Before enabling this
-# option you must clone git://git.qemu.org/seabios.git/, possibly add
-# some development patches and then build it yourself before pointing
-# this variable to it (using an absolute path).
-#
-# Note that using SeaBIOS requires the use the upstream qemu as the
-# device model.
-SEABIOS_DIR ?= 
-
 # Optional components
 XENSTAT_XENTOP     ?= y
 VTPM_TOOLS         ?= n
Makefile +4 -0
index edc5e3d..8edea0d 100644
@@ -98,6 +98,10 @@ tools/qemu-xen-dir:
 tools/qemu-xen-dir-force-update:
 	$(MAKE) -C tools qemu-xen-dir-force-update
 
+.PHONY: tools/firmware/seabios-dir-force-update
+tools/firmware/seabios-dir-force-update:
+	$(MAKE) -C tools/firmware seabios-dir-force-update
+
 .PHONY: install-docs
 install-docs:
 	sh ./docs/check_pkgs && $(MAKE) -C docs install || true
tools/firmware/Makefile +19 -2
index 4b6d144..c3ec9a0 100644
@@ -6,13 +6,18 @@ TARGET      := hvmloader/hvmloader
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
 
 SUBDIRS :=
+SUBDIRS += seabios-dir
 SUBDIRS += rombios
 SUBDIRS += vgabios
 SUBDIRS += etherboot
 SUBDIRS += hvmloader
 
+seabios-dir:
+	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
+	cp seabios-config seabios-dir/.config;
+
 .PHONY: all
-all:
+all: seabios-dir
 	@set -e; if [ $$((`( bcc -v 2>&1 | grep version || echo 0.0.0 ) | cut -d' ' -f 3 | awk -F. '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -lt $$((0x00100e)) ] ; then \
 	echo "==========================================================================="; \
 	echo "Require dev86 rpm or bin86 & bcc debs version >= 0.16.14 to build firmware!"; \
@@ -35,4 +40,16 @@ clean: subdirs-clean
 distclean: subdirs-distclean
 
 subdir-distclean-etherboot: .phony
-	$(MAKE) -C etherboot distclean
\ No newline at end of file
+	$(MAKE) -C etherboot distclean
+
+subdir-distclean-seabios-dir: .phony
+	rm -rf seabios-dir seabios-dir-remote
+
+.PHONY: seabios-dir-force-update
+seabios-dir-force-update:
+	set -ex; \
+	if [ "$(SEABIOS_UPSTREAM_TAG)" ]; then \
+		cd seabios-dir-remote; \
+		$(GIT) fetch origin; \
+		$(GIT) reset --hard $(SEABIOS_UPSTREAM_TAG); \
+	fi
tools/firmware/hvmloader/Makefile +1 -0
index ec33155..41a4369 100644
@@ -44,6 +44,7 @@ CFLAGS += -DENABLE_ROMBIOS
 ROMBIOS_ROM := $(ROMBIOS_DIR)/BIOS-bochs-latest
 endif
 
+SEABIOS_DIR := ../seabios-dir
 ifneq ($(SEABIOS_DIR),)
 OBJS += seabios.o
 CFLAGS += -DENABLE_SEABIOS
tools/firmware/seabios-config new file +73 -0

73 lines not on this page · raw message

Signature · 1 line
1.7.2.5
Acked-by on v10 5/7
#6 lore raw

Re: [PATCH v10 5/7] Clone and build Seabios by default

Quoted 1 line · On Mon, 2012-01-16 at 16:52 +0000, [email protected] wrote:

From: [email protected] <[email protected]>

Something is weird in your git metadata here..

Quoted 1 line
Quoted 206 lines
---
 .hgignore                         |    2 +
 Config.mk                         |   12 ++-----
 Makefile                          |    4 ++
 tools/firmware/Makefile           |   21 ++++++++++-
 tools/firmware/hvmloader/Makefile |    1 +
 tools/firmware/seabios-config     |   73 +++++++++++++++++++++++++++++++++++++
 6 files changed, 102 insertions(+), 11 deletions(-)
 create mode 100644 tools/firmware/seabios-config
.hgignore +2 -0
index cbcc0f5..64b440e 100644
@@ -300,6 +300,8 @@
 ^tools/qemu-xen-traditional-dir$
 ^tools/qemu-xen-dir-remote
 ^tools/qemu-xen-dir$
+^tools/firmware/seabios-dir-remote
+^tools/firmware/seabios-dir$
 ^tools/ocaml/.*/.*\.annot$
 ^tools/ocaml/.*/.*\.cmx?a$
 ^tools/ocaml/.*/META$
Config.mk +3 -9
index d229ab6..152c783 100644
@@ -204,10 +204,13 @@ endif
 
 ifeq ($(GIT_HTTP),y)
 QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
+SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
+SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 QEMU_UPSTREAM_REVISION ?= master
+SEABIOS_UPSTREAM_TAG ?= 7fc039e9c262b4199fab497f3e12f4e425c37560
 
 # Specify which qemu-dm to use. This may be `ioemu' to use the old
 # Mercurial in-tree version, or a local directory, or a git URL.
@@ -221,15 +224,6 @@ QEMU_TAG ?= bb36d632e4cabf47882adff07a45c6702c4a5b30
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.
 
-# SeaBIOS integration is a work in progress. Before enabling this
-# option you must clone git://git.qemu.org/seabios.git/, possibly add
-# some development patches and then build it yourself before pointing
-# this variable to it (using an absolute path).
-#
-# Note that using SeaBIOS requires the use the upstream qemu as the
-# device model.
-SEABIOS_DIR ?= 
-
 # Optional components
 XENSTAT_XENTOP     ?= y
 VTPM_TOOLS         ?= n
Makefile +4 -0
index edc5e3d..8edea0d 100644
@@ -98,6 +98,10 @@ tools/qemu-xen-dir:
 tools/qemu-xen-dir-force-update:
 	$(MAKE) -C tools qemu-xen-dir-force-update
 
+.PHONY: tools/firmware/seabios-dir-force-update
+tools/firmware/seabios-dir-force-update:
+	$(MAKE) -C tools/firmware seabios-dir-force-update
+
 .PHONY: install-docs
 install-docs:
 	sh ./docs/check_pkgs && $(MAKE) -C docs install || true
tools/firmware/Makefile +19 -2
index 4b6d144..c3ec9a0 100644
@@ -6,13 +6,18 @@ TARGET      := hvmloader/hvmloader
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
 
 SUBDIRS :=
+SUBDIRS += seabios-dir
 SUBDIRS += rombios
 SUBDIRS += vgabios
 SUBDIRS += etherboot
 SUBDIRS += hvmloader
 
+seabios-dir:
+	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
+	cp seabios-config seabios-dir/.config;
+
 .PHONY: all
-all:
+all: seabios-dir
 	@set -e; if [ $$((`( bcc -v 2>&1 | grep version || echo 0.0.0 ) | cut -d' ' -f 3 | awk -F. '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -lt $$((0x00100e)) ] ; then \
 	echo "==========================================================================="; \
 	echo "Require dev86 rpm or bin86 & bcc debs version >= 0.16.14 to build firmware!"; \
@@ -35,4 +40,16 @@ clean: subdirs-clean
 distclean: subdirs-distclean
 
 subdir-distclean-etherboot: .phony
-	$(MAKE) -C etherboot distclean
\ No newline at end of file
+	$(MAKE) -C etherboot distclean
+
+subdir-distclean-seabios-dir: .phony
+	rm -rf seabios-dir seabios-dir-remote
+
+.PHONY: seabios-dir-force-update
+seabios-dir-force-update:
+	set -ex; \
+	if [ "$(SEABIOS_UPSTREAM_TAG)" ]; then \
+		cd seabios-dir-remote; \
+		$(GIT) fetch origin; \
+		$(GIT) reset --hard $(SEABIOS_UPSTREAM_TAG); \
+	fi
tools/firmware/hvmloader/Makefile +1 -0
index ec33155..41a4369 100644
@@ -44,6 +44,7 @@ CFLAGS += -DENABLE_ROMBIOS
 ROMBIOS_ROM := $(ROMBIOS_DIR)/BIOS-bochs-latest
 endif
 
+SEABIOS_DIR := ../seabios-dir
 ifneq ($(SEABIOS_DIR),)
 OBJS += seabios.o
 CFLAGS += -DENABLE_SEABIOS
tools/firmware/seabios-config new file +73 -0
new file mode 100644
index 0000000..202d15f
@@ -0,0 +1,73 @@
+#
+# Automatically generated make config: don't edit
+# SeaBIOS Configuration
+# Wed Sep  7 13:03:21 2011
+#
+
+#
+# General Features
+#
+# CONFIG_COREBOOT is not set
+CONFIG_XEN=y
+CONFIG_THREADS=y
+# CONFIG_THREAD_OPTIONROMS is not set
+CONFIG_RELOCATE_INIT=y
+CONFIG_BOOTMENU=y
+# CONFIG_BOOTSPLASH is not set
+CONFIG_BOOTORDER=y
+
+#
+# Hardware support
+#
+CONFIG_ATA=y
+CONFIG_ATA_DMA=y
+CONFIG_ATA_PIO32=y
+CONFIG_AHCI=y
+CONFIG_VIRTIO_BLK=y
+CONFIG_FLOPPY=y
+CONFIG_PS2PORT=y
+CONFIG_USB=y
+CONFIG_USB_UHCI=y
+CONFIG_USB_OHCI=y
+CONFIG_USB_EHCI=y
+CONFIG_USB_MSC=y
+CONFIG_USB_HUB=y
+CONFIG_USB_KEYBOARD=y
+CONFIG_USB_MOUSE=y
+CONFIG_SERIAL=y
+CONFIG_LPT=y
+# CONFIG_USE_SMM is not set
+CONFIG_MTRR_INIT=y
+
+#
+# BIOS interfaces
+#
+CONFIG_DRIVES=y
+CONFIG_CDROM_BOOT=y
+CONFIG_CDROM_EMU=y
+CONFIG_PCIBIOS=y
+CONFIG_APMBIOS=y
+CONFIG_PNPBIOS=y
+CONFIG_OPTIONROMS=y
+# CONFIG_OPTIONROMS_DEPLOYED is not set
+CONFIG_PMM=y
+CONFIG_BOOT=y
+CONFIG_KEYBOARD=y
+CONFIG_KBD_CALL_INT15_4F=y
+CONFIG_MOUSE=y
+CONFIG_S3_RESUME=y
+# CONFIG_DISABLE_A20 is not set
+
+#
+# BIOS Tables
+#
+CONFIG_PIRTABLE=y
+CONFIG_MPTABLE=y
+CONFIG_SMBIOS=y
+CONFIG_ACPI=y
+
+#
+# Debugging
+#
+CONFIG_DEBUG_LEVEL=1
+# CONFIG_DEBUG_SERIAL is not set
#7 lore raw

PATCH v10 6/7 libxl: use new qemu at the location where xen-unstable installs it

In reply to Stefano Stabellini

From: Ian Campbell <[email protected]>

---
 tools/libxl/libxl_dm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/libxl/libxl_dm.c +1 -1
index 97d91b4..9d84b6f 100644
@@ -58,7 +58,7 @@ const char *libxl__domain_device_model(libxl__gc *gc,
             dm = libxl__abs_path(gc, "qemu-dm", libxl_libexec_path());
             break;
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-            dm = libxl__strdup(gc, "/usr/bin/qemu");
+            dm = libxl__abs_path(gc, "qemu", libxl_libexec_path());
             break;
         default:
             LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
Signature · 1 line
1.7.2.5
#8 lore raw

Re: [PATCH v10 6/7] libxl: use new qemu at the location where xen-unstable installs it

Quoted 12 lines · On Mon, 2012-01-16 at 16:52 +0000, [email protected] wrote:

From: Ian Campbell <[email protected]>

---
 tools/libxl/libxl_dm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/libxl/libxl_dm.c +0 -0
index 97d91b4..9d84b6f 100644

tools/libxl/libxl_dm.c const char *libxl__domain_device_model(libxl__gc *gc, · line 61

Quoted 5 lines
tools/libxl/libxl_dm.c +1 -1
@@ -58,7 +58,7 @@ const char *libxl__domain_device_model(libxl__gc *gc,
             dm = libxl__abs_path(gc, "qemu-dm", libxl_libexec_path());
             break;
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-            dm = libxl__strdup(gc, "/usr/bin/qemu");
+            dm = libxl__abs_path(gc, "qemu", libxl_libexec_path());

The actual installed path (in staging tree now)
is /usr/lib/xen/bin/qemu-system-i386 so if I boot a guest with
device_model_version="qemu-xen" then, as you might expect, I get:
libxl: error: libxl_dm.c:809:libxl__create_device_model: device model /usr/lib/xen/bin/qemu is not executable: No such file or directory
libxl: error: libxl_create.c:579:do_domain_create: failed to create device model: -3
libxl: error: libxl_dm.c:926:libxl__destroy_device_model: Couldn't find device model's pid: No such file or directory
libxl: error: libxl.c:796:libxl_domain_destroy: libxl__destroy_device_model failed for 21

I can add device_model_override="/usr/lib/xen/bin/qemu-system-i386" and then things work as expected.

Presumably if I build my tools for 64 bit it will be qemu-system-amd64.

So, should we fix libxl, the qemu build or our build integration?

Ian.

#9 lore raw

Re: [PATCH v10 6/7] libxl: use new qemu at the location where xen-unstable installs it

Quoted 28 lines · Ian Campbell
Quoted 12 lines · On Mon, 2012-01-16 at 16:52 +0000, [email protected] wrote:

From: Ian Campbell <[email protected]>

---
 tools/libxl/libxl_dm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/libxl/libxl_dm.c +0 -0
index 97d91b4..9d84b6f 100644

tools/libxl/libxl_dm.c const char *libxl__domain_device_model(libxl__gc *gc, · line 61

Quoted 5 lines
tools/libxl/libxl_dm.c +1 -1
@@ -58,7 +58,7 @@ const char *libxl__domain_device_model(libxl__gc *gc,
             dm = libxl__abs_path(gc, "qemu-dm", libxl_libexec_path());
             break;
         case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
-            dm = libxl__strdup(gc, "/usr/bin/qemu");
+            dm = libxl__abs_path(gc, "qemu", libxl_libexec_path());

The actual installed path (in staging tree now)
is /usr/lib/xen/bin/qemu-system-i386 so if I boot a guest with
device_model_version="qemu-xen" then, as you might expect, I get:
libxl: error: libxl_dm.c:809:libxl__create_device_model: device model /usr/lib/xen/bin/qemu is not executable: No such file or directory
libxl: error: libxl_create.c:579:do_domain_create: failed to create device model: -3
libxl: error: libxl_dm.c:926:libxl__destroy_device_model: Couldn't find device model's pid: No such file or directory
libxl: error: libxl.c:796:libxl_domain_destroy: libxl__destroy_device_model failed for 21

Quoted 4 lines

I can add device_model_override="/usr/lib/xen/bin/qemu-system-i386" and then things work as expected.

Presumably if I build my tools for 64 bit it will be qemu-system-amd64.

It is always qemu-system-i386, unless we change the target in the configure line. Of course it doesn't really matter for us because we don't use it for cpu emulation.

Quoted 1 line

So, should we fix libxl, the qemu build or our build integration?

The binary name changed for the 1.0 release, I don't expect it to change again. I think we should update libxl.

#10 lore raw

PATCH v10 7/7 update MAINTAINERS file

In reply to Stefano Stabellini

From: Stefano Stabellini <[email protected]>

Add Ian as Seabios maintainer and myself as upstream Qemu maintainer.

---
 MAINTAINERS |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
MAINTAINERS +10 -0
index 60f724d..cd0d71d 100644
@@ -176,6 +176,11 @@ M:	Ian Jackson <[email protected]>
 S:	Supported
 T:	git git://xenbits.xen.org/qemu-xen-*.git
 
+QEMU UPSTREAM
+M:	Stefano Stabellini <[email protected]>
+S:	Supported
+T:	git git://xenbits.xen.org/qemu-upstream-*.git
+
 REMUS
 M:	Shriram Rajagopalan <[email protected]>
 S:	Maintained
@@ -190,6 +195,11 @@ M:	George Dunlap <[email protected]>
 S:	Supported
 F:	xen/common/sched*
 
+SEABIOS UPSTREAM
+M:	Ian Campbell <[email protected]>
+S:	Supported
+T:	git git://xenbits.xen.org/seabios.git
+
 STUB DOMAINS
 M:	Stefano Stabellini <[email protected]>
 S:	Supported
Signature · 1 line
1.7.2.5
Acked-by on v10 7/7
#11 lore raw

Re: [PATCH v10 7/7] update MAINTAINERS file

Quoted 5 lines · On Mon, 2012-01-16 at 16:52 +0000, [email protected] wrote:

From: Stefano Stabellini <[email protected]>

Add Ian as Seabios maintainer and myself as upstream Qemu maintainer.

Quoted 32 lines
---
 MAINTAINERS |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
MAINTAINERS +10 -0
index 60f724d..cd0d71d 100644
@@ -176,6 +176,11 @@ M:	Ian Jackson <[email protected]>
 S:	Supported
 T:	git git://xenbits.xen.org/qemu-xen-*.git
 
+QEMU UPSTREAM
+M:	Stefano Stabellini <[email protected]>
+S:	Supported
+T:	git git://xenbits.xen.org/qemu-upstream-*.git
+
 REMUS
 M:	Shriram Rajagopalan <[email protected]>
 S:	Maintained
@@ -190,6 +195,11 @@ M:	George Dunlap <[email protected]>
 S:	Supported
 F:	xen/common/sched*
 
+SEABIOS UPSTREAM
+M:	Ian Campbell <[email protected]>
+S:	Supported
+T:	git git://xenbits.xen.org/seabios.git
+
 STUB DOMAINS
 M:	Stefano Stabellini <[email protected]>
 S:	Supported
#12 lore raw
In reply to Stefano Stabellini

Stefano Stabellini writes ("[PATCH v10 0/7] build upstream qemu and seabios by default"):

Quoted 2 lines

this is the tenth version of the patch series to introduce upstream qemu and seabios in the xen-unstable build system.

Thanks. This all looks good and I intend to apply it as soon as we get a push in xen-unstable. (Until then I'll wait in case it breaks the build and makes it harder to get a push.)

Ian.

#13 lore raw
In reply to Stefano Stabellini

Stefano Stabellini writes ("[Xen-devel] [PATCH v10 0/7] build upstream qemu and seabios by default"):

Quoted 2 lines

this is the tenth version of the patch series to introduce upstream qemu and seabios in the xen-unstable build system.

I have successfully build-tested and hence applied this series, thanks.

Ian.