[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 6/7] build system: stubdom targets now depends on mini-os target



Provide mini-os url and revision in Config.mk

Introduce Makefile.mini-os which contains mini-os specific targets.
Target mini-os-dir clones mini-os tree from upstream.

Make stubdom targets depend on mini-os-dir target. Make
subtree-force-update{,-all} depend on mini-os-dir-force-update.

Also make mktarball script generate mini-os archive.

Original mini-os directory is renamed to mini-os-intree to help reduce
patch length. That directory will be deleted in a separate patch.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
Changes in v2:
1. Use hash in Config.mk.
---
 .gitignore                                                |  6 ++----
 Config.mk                                                 |  6 ++++++
 Makefile                                                  | 15 +++++++++------
 Makefile.mini-os                                          | 15 +++++++++++++++
[ output trimmed ]
 stubdom/Makefile                                          |  4 ++++
 tools/misc/mktarball                                      |  4 +++-
 227 files changed, 39 insertions(+), 11 deletions(-)
 create mode 100644 Makefile.mini-os
[ rename output trimmed ]

diff --git a/.gitignore b/.gitignore
index cdbdca7..4979018 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,10 +46,8 @@ docs/man1/
 docs/man5/
 docs/pdf/
 docs/txt/
-extras/mini-os/include/mini-os
-extras/mini-os/include/x86/mini-os
-extras/mini-os/include/list.h
-extras/mini-os/mini-os*
+extras/mini-os
+extras/mini-os-remote
 install/*
 stubdom/autom4te.cache/
 stubdom/binutils-*
diff --git a/Config.mk b/Config.mk
index d12ad91..f1d4c0a 100644
--- a/Config.mk
+++ b/Config.mk
@@ -245,14 +245,20 @@ OVMF_UPSTREAM_URL ?= 
http://xenbits.xen.org/git-http/ovmf.git
 QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
 QEMU_TRADITIONAL_URL ?= http://xenbits.xen.org/git-http/qemu-xen-unstable.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
+MINIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/mini-os.git
 else
 OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
 QEMU_TRADITIONAL_URL ?= git://xenbits.xen.org/qemu-xen-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
+MINIOS_UPSTREAM_URL ?= git://xenbits.xen.org/mini-os.git
 endif
 OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
 QEMU_UPSTREAM_REVISION ?= master
+MINIOS_UPSTREAM_REVISION ?= 0cc86f6747f9bba01a332f3255c48dc743e29c4d
+# Thu Jan 29 19:10:04 2015 +0000
+# Mini-OS: standalone build
+
 SEABIOS_UPSTREAM_REVISION ?= rel-1.7.5
 # Thu May 22 16:59:16 2014 -0400
 # python3 fixes for vgabios and csm builds.
diff --git a/Makefile b/Makefile
index ad6f917..d4d0f74 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,8 @@ TARGS_DISTCLEAN=$(patsubst %, distclean-%, $(SUBSYSTEMS))
 export XEN_ROOT=$(CURDIR)
 include Config.mk
 
+include Makefile.mini-os
+
 SUBARCH := $(subst x86_32,i386,$(XEN_TARGET_ARCH))
 export XEN_TARGET_ARCH SUBARCH
 export DESTDIR
@@ -37,7 +39,7 @@ build-tools:
        $(MAKE) -C tools build
 
 .PHONY: build-stubdom
-build-stubdom:
+build-stubdom: mini-os-dir
        $(MAKE) -C stubdom build
 ifeq (x86_64,$(XEN_TARGET_ARCH))
        XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom pv-grub
@@ -84,7 +86,7 @@ install-tools:
        $(MAKE) -C tools install
 
 .PHONY: install-stubdom
-install-stubdom: install-tools
+install-stubdom: install-tools mini-os-dir
        $(MAKE) -C stubdom install
 ifeq (x86_64,$(XEN_TARGET_ARCH))
        XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub
@@ -125,11 +127,11 @@ rpmball: dist
        bash ./tools/misc/mkrpm $(XEN_ROOT) $$($(MAKE) -C xen xenversion 
--no-print-directory)
 
 .PHONY: subtree-force-update
-subtree-force-update:
+subtree-force-update: mini-os-dir-force-update
        $(MAKE) -C tools subtree-force-update
 
 .PHONY: subtree-force-update-all
-subtree-force-update-all:
+subtree-force-update-all: mini-os-dir-force-update
        $(MAKE) -C tools subtree-force-update-all
 
 # Make a source tarball, including qemu sub-trees.
@@ -161,7 +163,7 @@ clean-tools:
        $(MAKE) -C tools clean
 
 .PHONY: clean-stubdom
-clean-stubdom:
+clean-stubdom: mini-os-dir
        $(MAKE) -C stubdom crossclean
 ifeq (x86_64,$(XEN_TARGET_ARCH))
        XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom crossclean
@@ -187,11 +189,12 @@ distclean-tools:
        $(MAKE) -C tools distclean
 
 .PHONY: distclean-stubdom
-distclean-stubdom:
+distclean-stubdom: mini-os-dir
        $(MAKE) -C stubdom distclean
 ifeq (x86_64,$(XEN_TARGET_ARCH))
        XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom distclean
 endif
+       rm -rf extras/mini-os extras/mini-os-remote
 
 .PHONY: distclean-docs
 distclean-docs:
diff --git a/Makefile.mini-os b/Makefile.mini-os
new file mode 100644
index 0000000..46b1d80
--- /dev/null
+++ b/Makefile.mini-os
@@ -0,0 +1,15 @@
+.PHONY: mini-os-dir
+mini-os-dir:
+       GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
+               $(MINIOS_UPSTREAM_URL) \
+               $(MINIOS_UPSTREAM_REVISION) \
+               $(XEN_ROOT)/extras/mini-os
+
+.PHONY: mini-os-dir-force-update
+mini-os-dir-force-update: mini-os-dir
+       set -ex; \
+       if [ "$(MINIOS_UPSTREAM_REVISION)" ]; then \
+               cd extras/mini-os-remote; \
+               $(GIT) fetch origin; \
+               $(GIT) reset --hard $(MINIOS_UPSTREAM_REVISION); \
+       fi


[ rename output trimmed ]

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 58ca08c..74b01ee 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -1,6 +1,10 @@
 XEN_ROOT = $(CURDIR)/..
 MINI_OS = $(XEN_ROOT)/extras/mini-os
 
+ifeq ($(wildcard $(MINI_OS)/Config.mk),)
+$(error Please run `make mini-os-dir' in top-level directory)
+endif
+
 export XEN_OS=MiniOS
 
 export stubdom=y
diff --git a/tools/misc/mktarball b/tools/misc/mktarball
index aad1096..73282b5 100755
--- a/tools/misc/mktarball
+++ b/tools/misc/mktarball
@@ -6,7 +6,7 @@
 set -ex
 
 function git_archive_into {
-    mkdir "$2"
+    mkdir -p "$2"
 
     git --git-dir="$1"/.git \
        archive --format=tar HEAD | \
@@ -33,6 +33,8 @@ git_archive_into $xen_root/tools/qemu-xen-dir-remote 
$tdir/xen-$desc/tools/qemu-
 
 git_archive_into $xen_root/tools/qemu-xen-traditional-dir-remote 
$tdir/xen-$desc/tools/qemu-xen-traditional
 
+git_archive_into $xen_root/extras/mini-os-remote $tdir/xen-$desc/extras/mini-os
+
 GZIP=-9v tar cz -f $xen_root/dist/xen-$desc.tar.gz -C $tdir xen-$desc
 
 echo "Source tarball in $xen_root/dist/xen-$desc.tar.gz"
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.