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
17 ISOSRC = file:$(shell pwd)/fuel-5.1.1.iso
18 ISOCACHE = $(shell pwd)/$(shell basename $(ISOSRC))
19 PRODUCT_NAME = "OPNFV_BGS"
21 NEWISO = $(shell pwd)/release/opnfv-${VERSION}.iso
22 DOCKERIMG = opnfv.org/ubuntu-builder:12.04
23 # Note! Invoke with "make VERSION=RXXXX iso" to make release build!
24 # Invoke with ICOCACHE=/full/path/to/iso if cached ISO is in non-standard location.
26 # END of variables to customize
27 #############################################################################
28 ORIGDIR = $(shell pwd)/origiso
31 SUBDIRS += f_opnfv_puppet
33 SUBDIRS += f_l23network
34 SUBDIRS += f_resolvconf
37 # f_example is only an example of how to generate a .deb package and
38 # should not be enabled in official builds.
41 SUBCLEAN = $(addsuffix .clean,$(SUBDIRS))
45 @docker version >/dev/null 2>&1 || (echo 'No Docker installation available'; exit 1)
47 @docker/runcontext $(DOCKERIMG) $(MAKE) $(MAKEFLAGS) iso
52 git clone https://github.com/stackforge/fuel-main
53 cd fuel-main && git checkout 5.1.1
54 # Setup cgroups for docker-in-docker
55 sudo /root/enable_dockerx2
56 # Need to patch to fix race condition in build
57 cd fuel-main && patch -p1 < ../fuel-main.patches
59 cd fuel-main && ./prepare-build-env.sh
60 # Need to patch not supported start-stop-daemon argument
61 sudo sed -i 's/--no-close//' /etc/init.d/docker
62 sudo /etc/init.d/docker start
63 cd fuel-main && make iso
64 mv fuel-main/build/artifacts/fuel*.iso .
68 # Used the "docker" target to build within the context of the Docker
69 # container created by the Makefile in the docker subdirectory.
74 docker/runcontext $(DOCKERIMG) $(MAKE) $(MAKEFLAGS)
76 .PHONY: get-iso mount-origiso umount-origiso
78 @echo "Mounting original ISO in $(ORIGDIR)"
80 @fuseiso $(ISOCACHE) $(ORIGDIR)
83 @echo "Unmounting original ISO from $(ORIGDIR)"
84 @fusermount -u $(ORIGDIR)
88 wget $(ISOSRC) -O $(ISOCACHE)
91 @echo "ISO data of source ISO:" >> release/.isodata
92 @isoinfo -d -i $(ISOCACHE) >> release/.isodata
96 @mkdir -p release/packages/ubuntu/pool/main release/puppet/modules release/isoroot
97 $(MAKE) -C $@ -f Makefile release
99 .PHONY: patch-packages
101 ORIGISO=$(ISOCACHE) VERSION=$(VERSION) $(MAKE) -C $@ -f Makefile release
103 .PHONY: clean $(SUBCLEAN)
105 $(MAKE) -C patch-packages -f Makefile clean
110 $(SUBCLEAN): %.clean:
111 $(MAKE) -C $* -f Makefile clean
114 install:$(SUBDIRS) patch-packages
115 install/install.sh live
121 # Todo: Make things smarter - we shouldn't need to clean everything
122 # betwen make invocations.
124 iso: clean $(ISOCACHE) $(SUBDIRS) patch-packages
125 install/install.sh iso $(ISOCACHE) $(NEWISO) $(PRODUCT_NAME) $(VERSION)
126 @printf "\n\nProduct ISO is $(NEWISO)\n\n"