############################################################################## # 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 @lsb_release -a | grep Ubuntu > /dev/null 2>&1 || (echo 'Ubuntu is the only supported Linux distribution for this build system'; exit 1) @KERNEL_VER=$$(uname -r); \ KERNEL_VER="$${KERNEL_VER%.*-*}"; \ KERNEL_VER="$${KERNEL_VER//.}"; \ [ $$KERNEL_VER -ge 319 ] || (echo 'Kernel version must be 3.19 or newer'; exit 1) @docker/runcontext $(DOCKERIMG) wget -q www.google.com > /dev/null 2>&1 || (echo 'No docker network connectivity or name server - check your network- and docker settings'; exit 1) @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 optimizati