############################################################################## # Copyright (c) 2015 Ericsson AB and others. # stefan.k.berg@ericsson.com # jonas.bjurel@ericsson.com # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## SHELL = /bin/bash # This file will be created if needed by runcontext to contain proxy # settings. -include environment.mk ############################################################################ # BEGIN of variables to customize # #Input args export ISOSRC = file:$(shell pwd)/fuel-8.0.iso export ISOCACHE = $(shell pwd)/$(shell basename $(ISOSRC)) export PRODNO = "OPNFV_FUEL" export REVSTATE = "P0000" ifdef BUILD_FUEL_PLUGINS $(warning Overriding plugin build selection to $(BUILD_FUEL_PLUGINS)) export NEWISO = $(shell pwd)/release/unofficial-opnfv-${REVSTATE}.iso else export NEWISO = $(shell pwd)/release/opnfv-${REVSTATE}.iso endif # Note! Invoke with "make REVSTATE=RXXXX all" to make release build! # Invoke with ICOCACHE=/full/path/to/iso if cached ISO is in non-standard location. # Build variables export BUILD_BASE := $(shell pwd) export DEB_DEST := $(BUILD_BASE)/release/packages/ubuntu/pool/main export UDEB_DEST := $(BUILD_BASE)/release/packages/ubuntu/pool/debian-installer export PUPPET_DEST := $(BUILD_BASE)/release/puppet/modules export VERSION_FILE := $(BUILD_BASE)/.versions export DOCKERIMG = opnfv.org/ubuntu-builder:14.04 export TOPDIR := $(shell pwd) export REPOINFO := $(BUILD_BASE)/repo_info.sh # Use snapshots # Use nearby repositories export MIRROR_UBUNTU_URL := $(shell ./f_isoroot/f_repobuild/select_ubuntu_repo.sh --url) export MIRROR_UBUNTU := $(shell echo "$(MIRROR_UBUNTU_URL)" | cut -d'/' -f3 ) export MIRROR_UBUNTU_ROOT := $(shell echo -n '/' ; echo "$(MIRROR_UBUNTU_URL)" | cut -d'/' -f4-) export LATEST_MIRROR_ID_URL := http://$(shell ./select_closest_fuel_mirror.py) export MIRROR_MOS_UBUNTU := $(shell echo "$(LATEST_MIRROR_ID_URL)" | cut -d'/' -f3) export LATEST_TARGET_UBUNTU := $(shell curl -sSf "$(MIRROR_MOS_UBUNTU)/mos-repos/ubuntu/8.0.target.txt" | head -1) export MIRROR_MOS_UBUNTU_ROOT := "/mos-repos/ubuntu/$(LATEST_TARGET_UBUNTU)" export LATEST_TARGET_CENTOS := $(shell curl -sSf "$(LATEST_MIRROR_ID_URL)/mos-repos/centos/mos8.0-centos7-fuel/os.target.txt" | head -1) export MIRROR_FUEL := "$(LATEST_MIRROR_ID_URL)/mos-repos/centos/mos8.0-centos7-fuel/$(LATEST_TARGET_CENTOS)/x86_64" # uncomment and use: make print-VARIABLE #print-% : ; @echo $* = $($*) #Build subclasses SUBDIRS := f_isoroot # f_example is only an example of how to generate a .deb package and # should not be enabled in official builds. #SUBDIRS += f_example ORIGDIR := $(TOPDIR)/origiso # # END of variables to customize ############################################################################# SUBCLEAN = $(addsuffix .clean,$(SUBDIRS)) .PHONY: all all: @docker version >/dev/null 2>&1 || (echo 'No Docker installation available'; exit 1) @make -C docker @docker/runcontext $(DOCKERIMG) $(MAKE) $(MAKEFLAGS) iso ############################################################################ # BEGIN of Include definitions # include config.mk include cache.mk # # END Include definitions ############################################################################# $(ISOCACHE): # Clone Fuel to non-persistent location and build if [ ! -d /tmp/fuel-main ]; then \ cd /tmp && git clone $(FUEL_MAIN_REPO); \ fi cd /tmp/fuel-main && git checkout $(FUEL_MAIN_TAG) @echo "fuel" `git -C /tmp/fuel-main show | grep commit | head -1 | cut -d " " -f2` >> $(VERSION_FILE) # Patch for adding dosfstools, as Fuel 6.1 is running mkfs.vfat cd /tmp/fuel-main && patch -f -p0 < $(TOPDIR)/fuel-main_5.patch # Patch for using the Czech Fuel mirror # cd /tmp/fuel-main && patch -p0 < $(TOPDIR)/fuel-main_7.patch # Remove Docker optimizations, otherwise multistrap will fail during # Fuel build. sudo rm -f /etc/apt/apt.conf.d/docker* # # Need to replace the old Docker v. 1.5.0 with a later version to be # able to access the Docker remote repository! cd /tmp/fuel-main && patch -f -p0 < $(TOPDIR)/fuel-main_docker_version.patch # cd /tmp/fuel-main && patch -f -p0 < $(TOPDIR)/fuel-main_docker_dns.patch # cd /tmp/fuel-main && ./prepare-build-env.sh # Verify that Docker is alive sudo docker info cd /tmp/fuel-main && make repos $(REPOINFO) -r /tmp/fuel-main > gitinfo_fuel.txt # Repeat build up to ten times sudo ./fu