1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 # stefan.k.berg@ericsson.com
4 # jonas.bjurel@ericsson.com
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
11 ############################################################################
12 # BEGIN of variables to customize
15 ISOSRC = file:$(shell pwd)/fuel-6.0.1.iso
16 ISOCACHE = $(shell pwd)/$(shell basename $(ISOSRC))
17 PRODUCT_NAME = "OPNFV_BGS"
19 NEWISO = $(shell pwd)/release/opnfv-${VERSION}.iso
20 DOCKERIMG = opnfv.org/ubuntu-builder:14.04
21 # Note! Invoke with "make VERSION=RXXXX iso" to make release build!
22 # Invoke with ICOCACHE=/full/path/to/iso if cached ISO is in non-standard location.
24 # END of variables to customize
25 #############################################################################
26 TOPDIR := $(shell pwd)
27 ORIGDIR := $(TOPDIR)/origiso
30 SUBDIRS += f_opnfv_puppet
32 SUBDIRS += f_l23network
33 SUBDIRS += f_resolvconf
36 # f_example is only an example of how to generate a .deb package and
37 # should not be enabled in official builds.
40 SUBCLEAN = $(addsuffix .clean,$(SUBDIRS))
44 @docker version >/dev/null 2>&1 || (echo 'No Docker installation available'; exit 1)
46 @docker/runcontext $(DOCKERIMG) $(MAKE) $(MAKEFLAGS) iso
49 # Clone Fuel to non-persistent location and build
50 cd /tmp && git clone https://github.com/stackforge/fuel-main
51 cd /tmp/fuel-main && git checkout stable/6.0
52 # Setup cgroups for docker-in-docker
53 sudo /root/enable_dockerx2
54 # Patch to fix race condition when doing "Docker-in-Docker" build
55 cd /tmp/fuel-main && patch -p1 < $(TOPDIR)/fuel-main_1.patch
56 # Patch to make the sandbox chroot in Fuel succeed with package
57 # installation in a Docker build
58 cd /tmp/fuel-main && patch -p1 < $(TOPDIR)/fuel-main_2.patch
59 # Remove Docker optimizations, otherwise multistrap will fail during
61 sudo rm -f /etc/apt/apt.conf.d/docker*
63 cd /tmp/fuel-main && ./prepare-build-env.sh
64 cd /tmp/fuel-main && make iso
65 mv /tmp/fuel-main/build/artifacts/fuel*.iso .
67 .PHONY: mount-origiso umount-origiso
68 mount-origiso: $(ISOCACHE)
69 @echo "Mounting original ISO in $(ORIGDIR)"
71 @fuseiso $(ISOCACHE) $(ORIGDIR)
74 @echo "Unmounting original ISO from $(ORIGDIR)"
75 @fusermount -u $(ORIGDIR)
80 @mkdir -p release/packages/ubuntu/pool/main release/puppet/modules release/isoroot
81 $(MAKE) -C $@ -f Makefile release
83 .PHONY: patch-packages
85 ORIGISO=$(ISOCACHE) VERSION=$(VERSION) $(MAKE) -C $@ -f Makefile release
87 .PHONY: clean $(SUBCLEAN)
89 $(MAKE) -C patch-packages -f Makefile clean
95 $(MAKE) -C $* -f Makefile clean
97 # Todo: Make things smarter - we shouldn't need to clean everything
98 # betwen make invocations.
100 iso: clean $(ISOCACHE) $(SUBDIRS) patch-packages
101 install/install.sh iso $(ISOCACHE) $(NEWISO) $(PRODUCT_NAME) $(VERSION)
102 @printf "\n\nProduct ISO is $(NEWISO)\n\n"