Skip to contentSkip to conversation

Split off mini-os to a separate tree

PATCH Superseded Wei Liu 3 participants 22 messages Feb 20, 2015 – Feb 25, 2015 Kbuild

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

v2 cover Split off mini-os to a separate tree

This is v2 of my mini-os splitting off patch series.

I use following runes to split off mini-os:

  git filter-branch --tag-name-filter cat \
    --subdirectory-filter extras/mini-os/ -- --all

# There is already a tag name 4.3.0-rc2 which points to the same commit. git tag -d xen-4.3.0-rc2

# Add xen- prefix to all tags
for t in git tag; do git tag "xen-$t" "$t"; git tag -d "$t" ; done

  git gc --aggressive

The tree can be found at:
git://xenbits.xen.org/people/liuw/mini-os.git master

The changeset used is 0cc86f6747f9bba01a332f3255c48dc743e29c4d which is currently the HEAD of mater branch.

The Xen side patches can be pulled from:
git://xenbits.xen.org/people/liuw/xen.git wip.build-system-v2

Now mini-os builds on its own. I've also done some minor adjustments to stubdom's build system, so that we can properly issue "make build-stubdom" in Xen tree top level directory.

Wei.

Wei Liu (7):
stubdom: fix "make build"
Makefile: refactor build/clean/distclean targets
stubdom: don't look for mini-os source file during configure git-checkout.sh: use "mkdir -p"
Mini-OS: standalone build
build system: stubdom targets now depends on mini-os target Remove in-tree mini-os directory

 .gitignore                                         |    7 +-
 Config.mk                                          |    6 +
 Makefile                                           |   58 +-
 Makefile.mini-os                                   |   15 +
 extras/mini-os/COPYING                             |   36 -
 extras/mini-os/Config.mk                           |   57 -
 extras/mini-os/Makefile                            |  226 ---
 extras/mini-os/README                              |   46 -
 extras/mini-os/app.lds                             |   11 -
 extras/mini-os/arch/arm/arm32.S                    |  294 ----
 extras/mini-os/arch/arm/events.c                   |   31 -
 extras/mini-os/arch/arm/hypercalls32.S             |   64 -
 extras/mini-os/arch/arm/minios-arm32.lds           |   83 --
 extras/mini-os/arch/arm/mm.c                       |  139 --
 extras/mini-os/arch/arm/panic.c                    |   98 --
 extras/mini-os/arch/arm/sched.c                    |   47 -
 extras/mini-os/arch/arm/setup.c                    |  119 --
 extras/mini-os/arch/arm/time.c                     |  136 --
 extras/mini-os/arch/x86/Makefile                   |   31 -
 extras/mini-os/arch/x86/arch.mk                    |   22 -
 extras/mini-os/arch/x86/events.c                   |   35 -
 extras/mini-os/arch/x86/ioremap.c                  |   75 -
 extras/mini-os/arch/x86/iorw.c                     |   35 -
 extras/mini-os/arch/x86/minios-x86_32.lds          |   74 -
 extras/mini-os/arch/x86/minios-x86_64.lds          |   74 -
 extras/mini-os/arch/x86/mm.c                       |  957 ------------
 extras/mini-os/arch/x86/sched.c                    |  139 --
 extras/mini-os/arch/x86/setup.c                    |  168 ---
 extras/mini-os/arch/x86/time.c                     |  238 ---
 extras/mini-os/arch/x86/traps.c                    |  333 -----
 extras/mini-os/arch/x86/x86_32.S                   |  305 ----
 extras/mini-os/arch/x86/x86_64.S                   |  383 -----
 extras/mini-os/blkfront.c                          |  736 ----------
 extras/mini-os/console/console.c                   |  164 ---
 extras/mini-os/console/console.h                   |    2 -
 extras/mini-os/console/xenbus.c                    |  195 ---
 extras/mini-os/console/xencons_ring.c              |  195 ---
 extras/mini-os/daytime.c                           |   67 -
 extras/mini-os/domain_config                       |   19 -
 extras/mini-os/events.c                            |  269 ----
 extras/mini-os/fbfront.c                           |  710 ---------
 extras/mini-os/gntmap.c                            |  250 ----
 extras/mini-os/gnttab.c                            |  196 ---
 extras/mini-os/hypervisor.c                        |  132 --
 extras/mini-os/include/arch/cc.h                   |   87 --
 extras/mini-os/include/arch/perf.h                 |   15 -
 extras/mini-os/include/arch/sys_arch.h             |   35 -
 extras/mini-os/include/arm/arch_endian.h           |    7 -
 extras/mini-os/include/arm/arch_limits.h           |    9 -
 extras/mini-os/include/arm/arch_mm.h               |   38 -
 extras/mini-os/include/arm/arch_sched.h            |   19 -
 extras/mini-os/include/arm/arch_spinlock.h         |   36 -
 extras/mini-os/include/arm/arm32/arch_wordsize.h   |    1 -
 extras/mini-os/include/arm/gic.h                   |    1 -
 extras/mini-os/include/arm/hypercall-arm.h         |   98 --
 extras/mini-os/include/arm/os.h                    |  216 ---
 extras/mini-os/include/arm/traps.h                 |   20 -
 extras/mini-os/include/blkfront.h                  |   54 -
 extras/mini-os/include/byteorder.h                 |   36 -
 extras/mini-os/include/byteswap.h                  |   39 -
 extras/mini-os/include/compiler.h                  |   10 -
 extras/mini-os/include/console.h                   |   89 --
 extras/mini-os/include/ctype.h                     |   60 -
 extras/mini-os/include/endian.h                    |   19 -
 extras/mini-os/include/err.h                       |   31 -
 extras/mini-os/include/errno-base.h                |   39 -
 extras/mini-os/include/errno.h                     |  122 --
 extras/mini-os/include/events.h                    |   59 -
 extras/mini-os/include/fbfront.h                   |   46 -
 extras/mini-os/include/fcntl.h                     |   99 --
 extras/mini-os/include/gntmap.h                    |   35 -
 extras/mini-os/include/gnttab.h                    |   17 -
 extras/mini-os/include/hypervisor.h                |   48 -
 extras/mini-os/include/ioremap.h                   |   33 -
 extras/mini-os/include/iorw.h                      |   16 -
 extras/mini-os/include/kernel.h                    |    9 -
 extras/mini-os/include/lib-gpl.h                   |   59 -
 extras/mini-os/include/lib.h                       |  230 ---
 extras/mini-os/include/linux/types.h               |    5 -
 extras/mini-os/include/lwipopts.h                  |   23 -
 extras/mini-os/include/mm.h                        |   82 --
 extras/mini-os/include/netfront.h                  |   24 -
 extras/mini-os/include/pcifront.h                  |   29 -
 extras/mini-os/include/posix/arpa/inet.h           |    7 -
 extras/mini-os/include/posix/dirent.h              |   24 -
 extras/mini-os/include/posix/err.h                 |   15 -
 extras/mini-os/include/posix/fcntl.h               |   11 -
 extras/mini-os/include/posix/limits.h              |   48 -
 extras/mini-os/include/posix/net/if.h              |   85 --
 extras/mini-os/include/posix/netdb.h               |    9 -
 extras/mini-os/include/posix/netinet/in.h          |    7 -
 extras/mini-os/include/posix/netinet/tcp.h         |    6 -
 extras/mini-os/include/posix/poll.h                |    1 -
 extras/mini-os/include/posix/pthread.h             |   64 -
 extras/mini-os/include/posix/signal.h              |   10 -
 extras/mini-os/include/posix/stdlib.h              |    8 -
 extras/mini-os/include/posix/strings.h             |   12 -
 extras/mini-os/include/posix/sys/ioctl.h           |   16 -
 extras/mini-os/include/posix/sys/mman.h            |   22 -
 extras/mini-os/include/posix/sys/poll.h            |   79 -
 extras/mini-os/include/posix/sys/select.h          |    7 -
 extras/mini-os/include/posix/sys/socket.h          |   31 -
 extras/mini-os/include/posix/sys/stat.h            |    7 -
 extras/mini-os/include/posix/syslog.h              |   37 -
 extras/mini-os/include/posix/termios.h             |   87 --
 extras/mini-os/include/posix/time.h                |   11 -
 extras/mini-os/include/posix/unistd.h              |   16 -
 extras/mini-os/include/sched.h                     |   55 -
 extras/mini-os/include/semaphore.h                 |  110 --
 extras/mini-os/include/spinlock.h                  |   55 -
 extras/mini-os/include/sys/lock.h                  |   52 -
 extras/mini-os/include/sys/time.h                  |   47 -
 extras/mini-os/include/time.h                      |   63 -
 extras/mini-os/include/tpm_tis.h                   |   61 -
 extras/mini-os/include/tpmback.h                   |  104 --
 extras/mini-os/include/tpmfront.h                  |   97 --
 extras/mini-os/include/types.h                     |   74 -
 extras/mini-os/include/wait.h                      |  105 --
 extras/mini-os/include/waittypes.h                 |   32 -
 extras/mini-os/include/x86/arch_endian.h           |    7 -
 extras/mini-os/include/x86/arch_limits.h           |   20 -
 extras/mini-os/include/x86/arch_mm.h               |  233 ---
 extras/mini-os/include/x86/arch_sched.h            |   25 -
 extras/mini-os/include/x86/arch_spinlock.h         |   94 --
 extras/mini-os/include/x86/os.h                    |  572 --------
 extras/mini-os/include/x86/traps.h                 |   78 -
 extras/mini-os/include/x86/x86_32/arch_wordsize.h  |    1 -
 .../mini-os/include/x86/x86_32/hypercall-x86_32.h  |  337 -----
 extras/mini-os/include/x86/x86_64/arch_wordsize.h  |    2 -
 .../mini-os/include/x86/x86_64/hypercall-x86_64.h  |  344 -----
 extras/mini-os/include/xenbus.h                    |  120 --
 extras/mini-os/include/xmalloc.h                   |   44 -
 extras/mini-os/kernel.c                            |  198 ---
 extras/mini-os/lib/ctype.c                         |   29 -
 extras/mini-os/lib/math.c                          |  426 ------
 extras/mini-os/lib/printf.c                        |  786 ----------
 extras/mini-os/lib/stack_chk_fail.c                |    8 -
 extras/mini-os/lib/string.c                        |  228 ---
 extras/mini-os/lib/sys.c                           | 1550 --------------------
 extras/mini-os/lib/xmalloc.c                       |  319 ----
 extras/mini-os/lib/xs.c                            |  194 ---
 extras/mini-os/lock.c                              |  112 --
 extras/mini-os/lwip-arch.c                         |  293 ----
 extras/mini-os/lwip-net.c                          |  386 -----
 extras/mini-os/main.c                              |  193 ---
 extras/mini-os/minios.mk                           |   76 -
 extras/mini-os/mm.c                                |  441 ------
 extras/mini-os/netfront.c                          |  675 ---------
 extras/mini-os/pcifront.c                          |  616 --------
 extras/mini-os/sched.c                             |  304 ----
 extras/mini-os/test.c                              |  577 --------
 extras/mini-os/tpm_tis.c                           | 1523 -------------------
 extras/mini-os/tpmback.c                           | 1136 --------------
 extras/mini-os/tpmfront.c                          |  631 --------
 extras/mini-os/xenbus/xenbus.c                     |  870 -----------
 scripts/git-checkout.sh                            |    2 +-
 stubdom/Makefile                                   |    6 +
 stubdom/configure.ac                               |    2 +-
 tools/misc/mktarball                               |    4 +-
 159 files changed, 84 insertions(+), 24025 deletions(-)
 create mode 100644 Makefile.mini-os
 delete mode 100644 extras/mini-os/COPYING
 delete mode 100644 extras/mini-os/Config.mk
 delete mode 100644 extras/mini-os/Makefile
 delete mode 100644 extras/mini-os/README
 delete mode 100644 extras/mini-os/app.lds
 delete mode 100644 extras/mini-os/arch/arm/arm32.S
 delete mode 100644 extras/mini-os/arch/arm/events.c
 delete mode 100644 extras/mini-os/arch/arm/hypercalls32.S
 delete mode 100755 extras/mini-os/arch/arm/minios-arm32.lds
 delete mode 100644 extras/mini-os/arch/arm/mm.c
 delete mode 100644 extras/mini-os/arch/arm/panic.c
 delete mode 100644 extras/mini-os/arch/arm/sched.c
 delete mode 100644 extras/mini-os/arch/arm/setup.c
 delete mode 100644 extras/mini-os/arch/arm/time.c
 delete mode 100644 extras/mini-os/arch/x86/Makefile
 delete mode 100644 extras/mini-os/arch/x86/arch.mk
 delete mode 100644 extras/mini-os/arch/x86/events.c
 delete mode 100644 extras/mini-os/arch/x86/ioremap.c
 delete mode 100644 extras/mini-os/arch/x86/iorw.c
 delete mode 100644 extras/mini-os/arch/x86/minios-x86_32.lds
 delete mode 100644 extras/mini-os/arch/x86/minios-x86_64.lds
 delete mode 100644 extras/mini-os/arch/x86/mm.c
 delete mode 100644 extras/mini-os/arch/x86/sched.c
 delete mode 100644 extras/mini-os/arch/x86/setup.c
 delete mode 100644 extras/mini-os/arch/x86/time.c
 delete mode 100644 extras/mini-os/arch/x86/traps.c
 delete mode 100644 extras/mini-os/arch/x86/x86_32.S
 delete mode 100644 extras/mini-os/arch/x86/x86_64.S
 delete mode 100644 extras/mini-os/blkfront.c
 delete mode 100644 extras/mini-os/console/console.c
 delete mode 100644 extras/mini-os/console/console.h
 delete mode 100644 extras/mini-os/console/xenbus.c
 delete mode 100644 extras/mini-os/console/xencons_ring.c
 delete mode 100644 extras/mini-os/daytime.c
 delete mode 100644 extras/mini-os/domain_config
 delete mode 100644 extras/mini-os/events.c
 delete mode 100644 extras/mini-os/fbfront.c
 delete mode 100644 extras/mini-os/gntmap.c
 delete mode 100644 extras/mini-os/gnttab.c
 delete mode 100644 extras/mini-os/hypervisor.c
 delete mode 100644 extras/mini-os/include/arch/cc.h
 delete mode 100644 extras/mini-os/include/arch/perf.h
 delete mode 100644 extras/mini-os/include/arch/sys_arch.h
 delete mode 100644 extras/mini-os/include/arm/arch_endian.h
 delete mode 100644 extras/mini-os/include/arm/arch_limits.h
 delete mode 100644 extras/mini-os/include/arm/arch_mm.h
 delete mode 100644 extras/mini-os/include/arm/arch_sched.h
 delete mode 100755 extras/mini-os/include/arm/arch_spinlock.h
 delete mode 100644 extras/mini-os/include/arm/arm32/arch_wordsize.h
 delete mode 100644 extras/mini-os/include/arm/gic.h
 delete mode 100644 extras/mini-os/include/arm/hypercall-arm.h
 delete mode 100644 extras/mini-os/include/arm/os.h
 delete mode 100644 extras/mini-os/include/arm/traps.h
 delete mode 100644 extras/mini-os/include/blkfront.h
 delete mode 100644 extras/mini-os/include/byteorder.h
 delete mode 100644 extras/mini-os/include/byteswap.h
 delete mode 100644 extras/mini-os/include/compiler.h
 delete mode 100644 extras/mini-os/include/console.h
 delete mode 100644 extras/mini-os/include/ctype.h
 delete mode 100644 extras/mini-os/include/endian.h
 delete mode 100644 extras/mini-os/include/err.h
 delete mode 100644 extras/mini-os/include/errno-base.h
 delete mode 100644 extras/mini-os/include/errno.h
 delete mode 100644 extras/mini-os/include/events.h
 delete mode 100644 extras/mini-os/include/fbfront.h
 delete mode 100644 extras/mini-os/include/fcntl.h
 delete mode 100644 extras/mini-os/include/gntmap.h
 delete mode 100644 extras/mini-os/include/gnttab.h
 delete mode 100644 extras/mini-os/include/hypervisor.h
 delete mode 100644 extras/mini-os/include/ioremap.h
 delete mode 100644 extras/mini-os/include/iorw.h
 delete mode 100644 extras/mini-os/include/kernel.h
 delete mode 100644 extras/mini-os/include/lib-gpl.h
 delete mode 100644 extras/mini-os/include/lib.h
 delete mode 100644 extras/mini-os/include/linux/types.h
 delete mode 100644 extras/mini-os/include/lwipopts.h
 delete mode 100644 extras/mini-os/include/mm.h
 delete mode 100644 extras/mini-os/include/netfront.h
 delete mode 100644 extras/mini-os/include/pcifront.h
 delete mode 100644 extras/mini-os/include/posix/arpa/inet.h
 delete mode 100644 extras/mini-os/include/posix/dirent.h
 delete mode 100644 extras/mini-os/include/posix/err.h
 delete mode 100644 extras/mini-os/include/posix/fcntl.h
 delete mode 100644 extras/mini-os/include/posix/limits.h
 delete mode 100644 extras/mini-os/include/posix/net/if.h
 delete mode 100644 extras/mini-os/include/posix/netdb.h
 delete mode 100644 extras/mini-os/include/posix/netinet/in.h
 delete mode 100644 extras/mini-os/include/posix/netinet/tcp.h
 delete mode 100644 extras/mini-os/include/posix/poll.h
 delete mode 100644 extras/mini-os/include/posix/pthread.h
 delete mode 100644 extras/mini-os/include/posix/signal.h
 delete mode 100644 extras/mini-os/include/posix/stdlib.h
 delete mode 100644 extras/mini-os/include/posix/strings.h
 delete mode 100644 extras/mini-os/include/posix/sys/ioctl.h
 delete mode 100644 extras/mini-os/include/posix/sys/mman.h
 delete mode 100644 extras/mini-os/include/posix/sys/poll.h
 delete mode 100644 extras/mini-os/include/posix/sys/select.h
 delete mode 100644 extras/mini-os/include/posix/sys/socket.h
 delete mode 100644 extras/mini-os/include/posix/sys/stat.h
 delete mode 100644 extras/mini-os/include/posix/syslog.h
 delete mode 100644 extras/mini-os/include/posix/termios.h
 delete mode 100644 extras/mini-os/include/posix/time.h
 delete mode 100644 extras/mini-os/include/posix/unistd.h
 delete mode 100644 extras/mini-os/include/sched.h
 delete mode 100644 extras/mini-os/include/semaphore.h
 delete mode 100644 extras/mini-os/include/spinlock.h
 delete mode 100644 extras/mini-os/include/sys/lock.h
 delete mode 100644 extras/mini-os/include/sys/time.h
 delete mode 100644 extras/mini-os/include/time.h
 delete mode 100644 extras/mini-os/include/tpm_tis.h
 delete mode 100644 extras/mini-os/include/tpmback.h
 delete mode 100644 extras/mini-os/include/tpmfront.h
 delete mode 100644 extras/mini-os/include/types.h
 delete mode 100644 extras/mini-os/include/wait.h
 delete mode 100644 extras/mini-os/include/waittypes.h
 delete mode 100644 extras/mini-os/include/x86/arch_endian.h
 delete mode 100644 extras/mini-os/include/x86/arch_limits.h
 delete mode 100644 extras/mini-os/include/x86/arch_mm.h
 delete mode 100644 extras/mini-os/include/x86/arch_sched.h
 delete mode 100644 extras/mini-os/include/x86/arch_spinlock.h
 delete mode 100644 extras/mini-os/include/x86/os.h
 delete mode 100644 extras/mini-os/include/x86/traps.h
 delete mode 100644 extras/mini-os/include/x86/x86_32/arch_wordsize.h
 delete mode 100644 extras/mini-os/include/x86/x86_32/hypercall-x86_32.h
 delete mode 100644 extras/mini-os/include/x86/x86_64/arch_wordsize.h
 delete mode 100644 extras/mini-os/include/x86/x86_64/hypercall-x86_64.h
 delete mode 100644 extras/mini-os/include/xenbus.h
 delete mode 100644 extras/mini-os/include/xmalloc.h
 delete mode 100644 extras/mini-os/kernel.c
 delete mode 100644 extras/mini-os/lib/ctype.c
 delete mode 100644 extras/mini-os/lib/math.c
 delete mode 100644 extras/mini-os/lib/printf.c
 delete mode 100644 extras/mini-os/lib/stack_chk_fail.c
 delete mode 100644 extras/mini-os/lib/string.c
 delete mode 100644 extras/mini-os/lib/sys.c
 delete mode 100644 extras/mini-os/lib/xmalloc.c
 delete mode 100644 extras/mini-os/lib/xs.c
 delete mode 100644 extras/mini-os/lock.c
 delete mode 100644 extras/mini-os/lwip-arch.c
 delete mode 100644 extras/mini-os/lwip-net.c
 delete mode 100644 extras/mini-os/main.c
 delete mode 100644 extras/mini-os/minios.mk
 delete mode 100644 extras/mini-os/mm.c
 delete mode 100644 extras/mini-os/netfront.c
 delete mode 100644 extras/mini-os/pcifront.c
 delete mode 100644 extras/mini-os/sched.c
 delete mode 100644 extras/mini-os/test.c
 delete mode 100644 extras/mini-os/tpm_tis.c
 delete mode 100644 extras/mini-os/tpmback.c
 delete mode 100644 extras/mini-os/tpmfront.c
 delete mode 100644 extras/mini-os/xenbus/xenbus.c
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v2 1/7 stubdom: fix "make build"

Cross compiling libxc requires some symlinks to exist.

Note that make -C tools/include requires running tools/configure. But at least now the error message is much better than just a "file not found" error.

---
 stubdom/Makefile | 2 ++
 1 file changed, 2 insertions(+)
stubdom/Makefile +2 -0
index 8fb885a..58ca08c 100644
@@ -333,6 +333,8 @@ $(TARGETS_MINIOS): mini-os-%:
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
 libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: cross-zlib
+	$(MAKE) -C $(XEN_ROOT)/tools/include
+	$(MAKE) DESTDIR= -C $(MINI_OS) links
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH v2 2/7 Makefile: refactor build/clean/distclean targets

In reply to Wei Liu

Factor out per-subsystem build/clean/distclean-% targets, so that we can build subsystems independently in top level directory.

The motive behind this is after splitting out mini-os from Xen tree, stubdom is in effect a downstream of mini-os. I would like to have the ability to build it independently and instrument OSSTest to test it.

---
 Makefile | 49 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 44 insertions(+), 5 deletions(-)
Makefile +44 -5
index 6e9a4c7..ad6f917 100644
@@ -10,6 +10,9 @@ all: dist
 SUBSYSTEMS?=xen tools stubdom docs
 TARGS_DIST=$(patsubst %, dist-%, $(SUBSYSTEMS))
 TARGS_INSTALL=$(patsubst %, install-%, $(SUBSYSTEMS))
+TARGS_BUILD=$(patsubst %, build-%, $(SUBSYSTEMS))
+TARGS_CLEAN=$(patsubst %, clean-%, $(SUBSYSTEMS))
+TARGS_DISTCLEAN=$(patsubst %, distclean-%, $(SUBSYSTEMS))
 
 export XEN_ROOT=$(CURDIR)
 include Config.mk
@@ -23,13 +26,25 @@ export DESTDIR
 install: $(TARGS_INSTALL)
 
 .PHONY: build
-build:
+build: $(TARGS_BUILD)
+
+.PHONY: build-xen
+build-xen:
 	$(MAKE) -C xen build
+
+.PHONY: build-tools
+build-tools:
 	$(MAKE) -C tools build
+
+.PHONY: build-stubdom
+build-stubdom:
 	$(MAKE) -C stubdom build
 ifeq (x86_64,$(XEN_TARGET_ARCH))
 	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom pv-grub
 endif
+
+.PHONY: build-docs
+build-docs:
 	$(MAKE) -C docs build
 
 # The test target is for unit tests that can run without an installation.  Of
@@ -135,28 +150,52 @@ src-tarball: subtree-force-update-all
 	bash ./tools/misc/mktarball $(XEN_ROOT) $$(git describe)
 
 .PHONY: clean
-clean::
+clean: $(TARGS_CLEAN)
+
+.PHONY: clean-xen
+clean-xen:
 	$(MAKE) -C xen clean
+
+.PHONY: clean-tools
+clean-tools:
 	$(MAKE) -C tools clean
+
+.PHONY: clean-stubdom
+clean-stubdom:
 	$(MAKE) -C stubdom crossclean
 ifeq (x86_64,$(XEN_TARGET_ARCH))
 	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom crossclean
 endif
+
+.PHONY: clean-docs
+clean-docs:
 	$(MAKE) -C docs clean
 
 # clean, but blow away tarballs
 .PHONY: distclean
-distclean:
+distclean: $(TARGS_DISTCLEAN)
 	rm -f config/Toplevel.mk
+	rm -rf dist
+	rm -rf config.log config.status config.cache autom4te.cache
+
+.PHONY: distclean-xen
+distclean-xen:
 	$(MAKE) -C xen distclean
+
+.PHONY: distclean-tools
+distclean-tools:
 	$(MAKE) -C tools distclean
+
+.PHONY: distclean-stubdom
+distclean-stubdom:
 	$(MAKE) -C stubdom distclean
 ifeq (x86_64,$(XEN_TARGET_ARCH))
 	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom distclean
 endif
+
+.PHONY: distclean-docs
+distclean-docs:
 	$(MAKE) -C docs distclean
-	rm -rf dist
-	rm -rf config.log config.status config.cache autom4te.cache
 
 # Linux name for GNU distclean
 .PHONY: mrproper
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH v2 3/7 stubdom: don't look for mini-os source file during configure

In reply to Wei Liu

Don't look for mini-os source file during configure. Mini-os source code will be fetched during build.

Instead look for xenstore-minios.cfg.

Please rerun autogen.sh after applying this patch.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
Changes in v2:
1. Look for xenstore-minios.cfg.

---
 stubdom/configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
stubdom/configure.ac +1 -1
index 6468203..9fec853 100644
@@ -4,7 +4,7 @@
 AC_PREREQ([2.67])
 AC_INIT([Xen Hypervisor Stub Domains], m4_esyscmd([../version.sh ../xen/Makefile]),
     [[email protected]], [xen], [http://www.xen.org/])
-AC_CONFIG_SRCDIR([../extras/mini-os/kernel.c])
+AC_CONFIG_SRCDIR([xenstore-minios.cfg])
 AC_CONFIG_FILES([../config/Stubdom.mk])
 AC_CONFIG_AUX_DIR([../])
 
Signature · 1 line
1.9.1
Acked-by on v2 3/7
#4 lore raw

Re: [PATCH v2 3/7] stubdom: don't look for mini-os source file during configure

Quoted 8 lines · Wei Liu

Don't look for mini-os source file during configure. Mini-os source code will be fetched during build.

Instead look for xenstore-minios.cfg.

Please rerun autogen.sh after applying this patch.

Quoted 21 lines
Cc Ian Jackson <[email protected]>

---
Changes in v2:
1. Look for xenstore-minios.cfg.

---
 stubdom/configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
stubdom/configure.ac +1 -1
index 6468203..9fec853 100644
@@ -4,7 +4,7 @@
 AC_PREREQ([2.67])
 AC_INIT([Xen Hypervisor Stub Domains], m4_esyscmd([../version.sh ../xen/Makefile]),
     [[email protected]], [xen], [http://www.xen.org/])
-AC_CONFIG_SRCDIR([../extras/mini-os/kernel.c])
+AC_CONFIG_SRCDIR([xenstore-minios.cfg])
 AC_CONFIG_FILES([../config/Stubdom.mk])
 AC_CONFIG_AUX_DIR([../])
 
author
#5 lore raw

PATCH v2 4/7 git-checkout.sh: use "mkdir -p"

In reply to Wei Liu

Otherwise mkdir extras/mini-os fails because extras doesn't exist.

---
 scripts/git-checkout.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/git-checkout.sh +1 -1
index 15b3ce9..20ae31f 100755
@@ -13,7 +13,7 @@ set -e
 
 if test \! -d $DIR-remote; then
 	rm -rf $DIR-remote $DIR-remote.tmp
-	mkdir $DIR-remote.tmp; rmdir $DIR-remote.tmp
+	mkdir -p $DIR-remote.tmp; rmdir $DIR-remote.tmp
 	$GIT clone $TREE $DIR-remote.tmp
 	if test "$TAG" ; then
 		cd $DIR-remote.tmp
Signature · 1 line
1.9.1
author
#6 lore raw

PATCH v2 5/7 Mini-OS: standalone build

In reply to Wei Liu

In order to keep the tree bisectable all the changes are done in one single commit.

Things done in this commit:

1. Import necessary .mk files from Xen.
2. Move all XEN_ related variables to MINIOS_ namespace.
3. Import Xen public header files.
4. Import BSD's list.h and helper script.

Mini-OS's vanilla Config.mk is modified to contain some macros copied from Xen's Config.mk. It also contains compatibility handling logic for Xen's stubdom build environment.

Files modified:
Config.mk
Makefile
arch/x86/Makefile
arch/x86/arch.mk
minios.mk

All other files are just imported from Xen.

[ output trimmed since this patch is acked ]

#7 lore raw

Re: [PATCH v2 5/7] Mini-OS: standalone build

Quoted 21 lines · Wei Liu

In order to keep the tree bisectable all the changes are done in one single commit.

Things done in this commit:

1. Import necessary .mk files from Xen.
2. Move all XEN_ related variables to MINIOS_ namespace.
3. Import Xen public header files.
4. Import BSD's list.h and helper script.

Mini-OS's vanilla Config.mk is modified to contain some macros copied from Xen's Config.mk. It also contains compatibility handling logic for Xen's stubdom build environment.

Files modified:

   Config.mk
   Makefile
   arch/x86/Makefile
   arch/x86/arch.mk
   minios.mk
Quoted 6 lines

All other files are just imported from Xen.

I'd be happier if it also had Samuel's ack on it.

Quoted 1 line

[ output trimmed since this patch is acked ]

Is it the same as was in
http://bugs.xenproject.org/xen/mid/%[email protected]%3E
?

author
#8 lore raw

Re: [PATCH v2 5/7] Mini-OS: standalone build

Quoted 29 lines · Ian Campbell
Quoted 21 lines · Wei Liu

In order to keep the tree bisectable all the changes are done in one single commit.

Things done in this commit:

1. Import necessary .mk files from Xen.
2. Move all XEN_ related variables to MINIOS_ namespace.
3. Import Xen public header files.
4. Import BSD's list.h and helper script.

Mini-OS's vanilla Config.mk is modified to contain some macros copied from Xen's Config.mk. It also contains compatibility handling logic for Xen's stubdom build environment.

Files modified:

   Config.mk
   Makefile
   arch/x86/Makefile
   arch/x86/arch.mk
   minios.mk
Quoted 6 lines

All other files are just imported from Xen.

Quoted 8 lines

I'd be happier if it also had Samuel's ack on it.

Quoted 1 line

[ output trimmed since this patch is acked ]

Is it the same as was in
http://bugs.xenproject.org/xen/mid/%[email protected]%3E
?

Yes, nothing was changed.

Wei.

#9 lore raw

Re: [PATCH v2 5/7] Mini-OS: standalone build

In reply to Ian Campbell
Quoted 22 lines · Ian Campbell, le Tue 24 Feb 2015 16:27:00 +0000, a écrit :
Quoted 21 lines · Wei Liu

In order to keep the tree bisectable all the changes are done in one single commit.

Things done in this commit:

1. Import necessary .mk files from Xen.
2. Move all XEN_ related variables to MINIOS_ namespace.
3. Import Xen public header files.
4. Import BSD's list.h and helper script.

Mini-OS's vanilla Config.mk is modified to contain some macros copied from Xen's Config.mk. It also contains compatibility handling logic for Xen's stubdom build environment.

Files modified:

   Config.mk
   Makefile
   arch/x86/Makefile
   arch/x86/arch.mk
   minios.mk
Quoted 8 lines
Quoted 6 lines

All other files are just imported from Xen.

I'd be happier if it also had Samuel's ack on it.

#10 lore raw

Re: [PATCH v2 5/7] Mini-OS: standalone build

Quoted 1 line · Samuel Thibault

Thanks.

Can I take it you are OK in principal with the plans to move things out? TBH I think it'll make very little difference to your day-to-day maintenance.

#11 lore raw

Re: [PATCH v2 5/7] Mini-OS: standalone build

Quoted 4 lines · Ian Campbell, le Wed 25 Feb 2015 09:53:52 +0000, a écrit :
Quoted 1 line · Samuel Thibault

Can I take it you are OK in principal with the plans to move things out?

Yes.

Quoted 2 lines

TBH I think it'll make very little difference to your day-to-day maintenance.

Yes :)

Samuel

author
#12 lore raw

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

In reply to Wei Liu

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.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
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 ]

.gitignore +2 -4
index cdbdca7..4979018 100644
@@ -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-*
Config.mk +6 -0
index d12ad91..f1d4c0a 100644
@@ -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.
Makefile +9 -6
index ad6f917..d4d0f74 100644
@@ -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:
Makefile.mini-os new file +15 -0
new file mode 100644
index 0000000..46b1d80
@@ -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 ]

stubdom/Makefile +4 -0
index 58ca08c..74b01ee 100644
@@ -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
tools/misc/mktarball +3 -1
index aad1096..73282b5 100755
@@ -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"
Signature · 1 line
1.9.1
#13 lore raw

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

Quoted 10 lines · Wei Liu
Makefile +1 -1
@@ -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

Makefile distclean-tools: · line 192

Quoted 5 lines
Makefile +1 -1
@@ -187,11 +189,12 @@ distclean-tools:
 	$(MAKE) -C tools distclean
 
 .PHONY: distclean-stubdom
-distclean-stubdom:
+distclean-stubdom: mini-os-dir

These two are a bit odd, since they will force a clone in order to clean (and in the distclean case immediately discard again).

The way we handle this with e.g. qemu is to have
subdir-clean-qemu-xen-traditional-dir:

        set -e; if test -d qemu-xen-traditional-dir/.; then \
                $(MAKE) -C qemu-xen-traditional-dir clean; \
        fi

so I think you want a pair of {clean,distclean}-mini-os-dir rules which recurse iff the dir exists.

Makefile.mini-os

Quoted 13 lines
Makefile +1 -0
 	$(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:
Makefile.mini-os new file +0 -0
new file mode 100644
index 0000000..46b1d80

I still think this file doesn't contain enough to warrant being separate to the main Makefile.

Ian.

author
#14 lore raw

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

Quoted 13 lines · Ian Campbell
Quoted 12 lines · Wei Liu
Makefile +1 -1
@@ -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
 
Quoted 7 lines

Makefile distclean-tools: · line 192

Quoted 3 lines
Makefile +1 -1
 .PHONY: distclean-stubdom
-distclean-stubdom:
+distclean-stubdom: mini-os-dir

These two are a bit odd, since they will force a clone in order to clean (and in the distclean case immediately discard again).

That's because stubdom's distclean is quite broken, it just won't work without mini-os.

Quoted 9 lines

The way we handle this with e.g. qemu is to have
subdir-clean-qemu-xen-traditional-dir:

        set -e; if test -d qemu-xen-traditional-dir/.; then \
                $(MAKE) -C qemu-xen-traditional-dir clean; \
        fi

so I think you want a pair of {clean,distclean}-mini-os-dir rules which recurse iff the dir exists.

No, we don't actually need to enter mini-os dir and make clean / distclean when doing clean and distclean of stubdom.

Quoted 6 lines
Quoted 6 lines
Makefile +1 -0
 	$(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
 
Quoted 11 lines

Makefile.mini-os

Quoted 7 lines
Makefile +0 -0
 .PHONY: distclean-docs
 distclean-docs:
Makefile.mini-os new file +0 -0
new file mode 100644
index 0000000..46b1d80

I still think this file doesn't contain enough to warrant being separate to the main Makefile.

Right, this now can be merged into main Makffile since all other references are removed.

Wei.

Quoted 1 line

Ian.

#15 lore raw

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

Quoted 22 lines · Wei Liu
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Wei Liu
Makefile +1 -1
@@ -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
 
Quoted 7 lines

Makefile distclean-tools: · line 192

Quoted 3 lines
Makefile +1 -1
 .PHONY: distclean-stubdom
-distclean-stubdom:
+distclean-stubdom: mini-os-dir

These two are a bit odd, since they will force a clone in order to clean (and in the distclean case immediately discard again).

Quoted 2 lines

That's because stubdom's distclean is quite broken, it just won't work without mini-os.

If the mini-os dir is not present then I don't think there is any need to distclean the stubdom, is there? How would anything be present?

Quoted 7 lines
Quoted 7 lines

The way we handle this with e.g. qemu is to have
subdir-clean-qemu-xen-traditional-dir:

        set -e; if test -d qemu-xen-traditional-dir/.; then \
                $(MAKE) -C qemu-xen-traditional-dir clean; \
        fi
Quoted 6 lines
Quoted 3 lines

so I think you want a pair of {clean,distclean}-mini-os-dir rules which recurse iff the dir exists.

No, we don't actually need to enter mini-os dir and make clean / distclean when doing clean and distclean of stubdom.

Didn't you just contradict what you said further above?

author
#16 lore raw

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

Quoted 23 lines · Ian Campbell
Quoted 22 lines · Wei Liu
Quoted 20 lines · Ian Campbell
Quoted 10 lines · Wei Liu
Makefile +1 -1
@@ -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

Makefile distclean-tools: · line 192

Quoted 5 lines
Makefile +1 -1
@@ -187,11 +189,12 @@ distclean-tools:
 	$(MAKE) -C tools distclean
 
 .PHONY: distclean-stubdom
-distclean-stubdom:
+distclean-stubdom: mini-os-dir

These two are a bit odd, since they will force a clone in order to clean (and in the distclean case immediately discard again).

Quoted 6 lines
Quoted 2 lines

That's because stubdom's distclean is quite broken, it just won't work without mini-os.

If the mini-os dir is not present then I don't think there is any need to distclean the stubdom, is there? How would anything be present?

If user builds stubdom then deletes mini-os then wants to clean studom.

If we don't have that dependence, we just print

Please run `make mini-os-dir' in top-level directory

due to a check in stubdom's Makefile. I think this is acceptable too.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

The way we handle this with e.g. qemu is to have
subdir-clean-qemu-xen-traditional-dir:

        set -e; if test -d qemu-xen-traditional-dir/.; then \
                $(MAKE) -C qemu-xen-traditional-dir clean; \
        fi
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

so I think you want a pair of {clean,distclean}-mini-os-dir rules which recurse iff the dir exists.

No, we don't actually need to enter mini-os dir and make clean / distclean when doing clean and distclean of stubdom.

Didn't you just contradict what you said further above?

I was thinking all those objects are not placed inside min-os's dir so there is nothing to clean inside mini-os's directory

However, stubdom does have
$(MAKE) DESTDIR= -C $(MINI_OS) clean

So there is no need for a separate subdir-clean-mini-os-dir.

We can also delete that line. But I would avoid touching stubdom's Makefile if not necessary.

Wei.

author
#17 lore raw

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

Quoted 60 lines · Wei Liu
Quoted 23 lines · Ian Campbell
Quoted 22 lines · Wei Liu
Quoted 20 lines · Ian Campbell
Quoted 10 lines · Wei Liu
Makefile +1 -1
@@ -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

Makefile distclean-tools: · line 192

Quoted 5 lines
Makefile +1 -1
@@ -187,11 +189,12 @@ distclean-tools:
 	$(MAKE) -C tools distclean
 
 .PHONY: distclean-stubdom
-distclean-stubdom:
+distclean-stubdom: mini-os-dir

These two are a bit odd, since they will force a clone in order to clean (and in the distclean case immediately discard again).

Quoted 6 lines
Quoted 2 lines

That's because stubdom's distclean is quite broken, it just won't work without mini-os.

If the mini-os dir is not present then I don't think there is any need to distclean the stubdom, is there? How would anything be present?

If user builds stubdom then deletes mini-os then wants to clean studom.

If we don't have that dependence, we just print

Please run `make mini-os-dir' in top-level directory

due to a check in stubdom's Makefile. I think this is acceptable too.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

The way we handle this with e.g. qemu is to have
subdir-clean-qemu-xen-traditional-dir:

        set -e; if test -d qemu-xen-traditional-dir/.; then \
                $(MAKE) -C qemu-xen-traditional-dir clean; \
        fi
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

so I think you want a pair of {clean,distclean}-mini-os-dir rules which recurse iff the dir exists.

No, we don't actually need to enter mini-os dir and make clean / distclean when doing clean and distclean of stubdom.

Didn't you just contradict what you said further above?

I was thinking all those objects are not placed inside min-os's dir so there is nothing to clean inside mini-os's directory

Quoted 8 lines

However, stubdom does have
$(MAKE) DESTDIR= -C $(MINI_OS) clean

So there is no need for a separate subdir-clean-mini-os-dir.

We can also delete that line. But I would avoid touching stubdom's Makefile if not necessary.

OK, it turns out if I just remove that line in stubdom's clean target everything works fine. With that change I can remove stubdom's clean and distclean dependency on mini-os dir.

Wei.

Quoted 1 line

Wei.

#18 lore raw

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

Quoted 66 lines · Wei Liu
Quoted 65 lines · Wei Liu
Quoted 23 lines · Ian Campbell
Quoted 22 lines · Wei Liu
Quoted 20 lines · Ian Campbell
Quoted 10 lines · Wei Liu
Makefile +1 -1
@@ -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

Makefile distclean-tools: · line 192

Quoted 5 lines
Makefile +1 -1
@@ -187,11 +189,12 @@ distclean-tools:
 	$(MAKE) -C tools distclean
 
 .PHONY: distclean-stubdom
-distclean-stubdom:
+distclean-stubdom: mini-os-dir

These two are a bit odd, since they will force a clone in order to clean (and in the distclean case immediately discard again).

Quoted 6 lines
Quoted 2 lines

That's because stubdom's distclean is quite broken, it just won't work without mini-os.

If the mini-os dir is not present then I don't think there is any need to distclean the stubdom, is there? How would anything be present?

If user builds stubdom then deletes mini-os then wants to clean studom.

If we don't have that dependence, we just print

Please run `make mini-os-dir' in top-level directory

due to a check in stubdom's Makefile. I think this is acceptable too.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

The way we handle this with e.g. qemu is to have
subdir-clean-qemu-xen-traditional-dir:

        set -e; if test -d qemu-xen-traditional-dir/.; then \
                $(MAKE) -C qemu-xen-traditional-dir clean; \
        fi
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

so I think you want a pair of {clean,distclean}-mini-os-dir rules which recurse iff the dir exists.

No, we don't actually need to enter mini-os dir and make clean / distclean when doing clean and distclean of stubdom.

Didn't you just contradict what you said further above?

I was thinking all those objects are not placed inside min-os's dir so there is nothing to clean inside mini-os's directory

However, stubdom does have
$(MAKE) DESTDIR= -C $(MINI_OS) clean

So there is no need for a separate subdir-clean-mini-os-dir.

Quoted 7 lines
Quoted 3 lines

We can also delete that line. But I would avoid touching stubdom's Makefile if not necessary.

OK, it turns out if I just remove that line in stubdom's clean target everything works fine. With that change I can remove stubdom's clean and distclean dependency on mini-os dir.

Ah, now I really see what you were getting at, unlike just now ;-)

Ian.

#19 lore raw

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

In reply to Wei Liu
Quoted 27 lines · Wei Liu
Quoted 26 lines · Ian Campbell
Quoted 24 lines · Wei Liu
Quoted 13 lines · Ian Campbell
Quoted 12 lines · Wei Liu
Makefile +1 -1
@@ -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
 
Quoted 7 lines

Makefile distclean-tools: · line 192

Quoted 3 lines
Makefile +1 -1
 .PHONY: distclean-stubdom
-distclean-stubdom:
+distclean-stubdom: mini-os-dir

These two are a bit odd, since they will force a clone in order to clean (and in the distclean case immediately discard again).

That's because stubdom's distclean is quite broken, it just won't work without mini-os.

Quoted 6 lines
Quoted 3 lines

If the mini-os dir is not present then I don't think there is any need to distclean the stubdom, is there? How would anything be present?

If user builds stubdom then deletes mini-os then wants to clean studom.

I think users who randomly delete things can be expected to cope with randomly cleaning other stuff too ;-)

Quoted 6 lines

If we don't have that dependence, we just print

Please run `make mini-os-dir' in top-level directory

due to a check in stubdom's Makefile. I think this is acceptable too.

That's better than cloning then removing it everytime someone runs distclean, for sure.

I'd prefer something saying "not cleaning because" but I suppose the above is from a generic catch-all rule not a *clean specific one.

Quoted 16 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The way we handle this with e.g. qemu is to have
subdir-clean-qemu-xen-traditional-dir:

        set -e; if test -d qemu-xen-traditional-dir/.; then \
                $(MAKE) -C qemu-xen-traditional-dir clean; \
        fi
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

so I think you want a pair of {clean,distclean}-mini-os-dir rules which recurse iff the dir exists.

No, we don't actually need to enter mini-os dir and make clean / distclean when doing clean and distclean of stubdom.

Didn't you just contradict what you said further above?

Quoted 7 lines

I was thinking all those objects are not placed inside min-os's dir so there is nothing to clean inside mini-os's directory

However, stubdom does have
$(MAKE) DESTDIR= -C $(MINI_OS) clean

So there is no need for a separate subdir-clean-mini-os-dir.

I see. What I was trying to say (and did badly, and then misunderstood your response) was that the stubdom *clean should check for mini-os-dir (which is different to the qemu case, I admit).

i.e. what I really was thinking of was:

subdir-clean-stubdom:

        set -e; if test -d mini-os-dir/.; then \
                $(MAKE) -C stubdom clean; \
	else
		echo "Not running clean in stubdom, no mini-os-dir.";\
                echo "run `make mini-os-dir' in top-level before cleaning stubdom" ;\
        fi

(similar for distclean)

Quoted 4 lines

We can also delete that line. But I would avoid touching stubdom's Makefile if not necessary.

Wei.

#21 lore raw
In reply to Wei Liu
Quoted 1 line · Wei Liu

This is v2 of my mini-os splitting off patch series.

I had a couple of small comments, but it's looking good.

You should have CCd Samuel and Stefano on this stuff. From MAINTAINERS:

MINI-OS
M: Stefano Stabellini <[email protected]>
M: Samuel Thibault <[email protected]>
S: Supported
F: config/MiniOS.mk
F: extras/mini-os/

Even more so than usual since we are moving the whole tree, so they really ought to be given the chance to object if not ack.

Ian.