summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan K. Berg <stefan.k.berg@ericsson.com>2015-09-22 12:05:35 +0200
committerStefan K. Berg <stefan.k.berg@ericsson.com>2015-09-22 12:26:39 +0200
commit99373ffa44102439c3006a78527443f36d75a378 (patch)
tree8a8d4aefb3995de412ab890bc3c33fa3082addfc
parent53cd9a92f87cf8fbb46f27363f5a61e0457bafc2 (diff)
Ubuntu package repositories added to Fuel ISO
Starting with Fuel 6.1, the Ubuntu repositories are no longer stored on the Fuel ISO, but by default fetched from the Internet during installation (the exact URI can be modified in the Fuel configuration). In order to being able to handle a deployment scenario where the Fuel node has no Internet connectivity, the OPNFV Fuel ISO is adding the necessary repositories into /var/www/nailgun by fetching them during the generation of the ISO. The actual fetching is done by a Fuel provided package, fuel-createmirror.deb, which can be found in /opt of the Fuel master (but which is run outside Fuel in the context of the build process when generating the OPNFV ISO). An additional OPNFV post installation script is added as /opt/opnfv/bootstrap/post.d/03_install_repo.sh which will populate /var/www/nailgun with these repositories in the late stage of the bootstrap_admin_node process. Important! In order to use these repositories For deployment, the default Fuel repo configuration must be changed as below: Repository "mos-updates" URI="deb http://10.20.0.2:8080/mos-ubuntu mos6.1-updates main restricted" Repository "mos-security" URI="deb http://10.20.0.2:8080/mos-ubuntu mos6.1-security main restricted" Repository "mos-holdback" URI="deb http://10.20.0.2:8080/mos-ubuntu mos6.1-holdback main restricted" Repository "ubuntu" URI="deb http://10.20.0.2:8080/ubuntu-part trusty main" Repository "ubuntu-security" URI="deb http://10.20.0.2:8080/ubuntu-part trusty main" Repository "ubuntu-updates" URI="deb http://10.20.0.2:8080/ubuntu-part trusty main" Change-Id: I25211bd3f277b560808fd838180aa52e278af404 Signed-off-by: Stefan K. Berg <stefan.k.berg@ericsson.com>
-rw-r--r--fuel/build/f_isoroot/Makefile2
-rw-r--r--fuel/build/f_isoroot/f_bootstrap/post-scripts/03_install_repo.sh19
-rw-r--r--fuel/build/f_isoroot/f_repobuild/Makefile50
3 files changed, 70 insertions, 1 deletions
diff --git a/fuel/build/f_isoroot/Makefile b/fuel/build/f_isoroot/Makefile
index 8a7f48a..b2a9f79 100644
--- a/fuel/build/f_isoroot/Makefile
+++ b/fuel/build/f_isoroot/Makefile
@@ -8,7 +8,7 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-SUBDIRS = f_kscfg f_bootstrap
+SUBDIRS = f_kscfg f_bootstrap f_repobuild
SUBCLEAN = $(addsuffix .clean,$(SUBDIRS))
.PHONY: all
diff --git a/fuel/build/f_isoroot/f_bootstrap/post-scripts/03_install_repo.sh b/fuel/build/f_isoroot/f_bootstrap/post-scripts/03_install_repo.sh
new file mode 100644
index 0000000..c077d57
--- /dev/null
+++ b/fuel/build/f_isoroot/f_bootstrap/post-scripts/03_install_repo.sh
@@ -0,0 +1,19 @@
+#/bin/sh
+echo "Installing pre-build repo"
+if [ ! -d /opt/opnfv/nailgun ]; then
+ echo "Error - found no repo!"
+ exit 1
+fi
+
+mkdir -p /var/www/mailgun
+mv /opt/opnfv/nailgun/* /var/www/nailgun
+if [ $? -ne 0 ]; then
+ echo "Error moving repos to their correct location!"
+ exit 1
+fi
+rmdir /opt/opnfv/nailgun
+if [ $? -ne 0 ]; then
+ echo "Error removing /opt/opnfv/nailgun directory!"
+ exit 1
+fi
+echo "Done installing pre-build repo"
diff --git a/fuel/build/f_isoroot/f_repobuild/Makefile b/fuel/build/f_isoroot/f_repobuild/Makefile
new file mode 100644
index 0000000..ee0e819
--- /dev/null
+++ b/fuel/build/f_isoroot/f_repobuild/Makefile
@@ -0,0 +1,50 @@
+##############################################################################
+# 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
+##############################################################################
+
+TOP := $(shell pwd)
+DOCKNAME = fuelrepo
+DOCKVERSION = 1.0
+
+.PHONY: all
+all: .nailgun
+
+.fuel-createmirror:
+ sudo apt-get install -y rsync python dpkg-dev fakeroot openssl
+ sudo ln -s `pwd` /var/www
+ sudo mkdir /var/log/mirror-sync
+ sudo chmod 777 /var/log/mirror-sync
+ rm -rf tmpiso tmpdir
+ mkdir tmpiso
+ fuseiso ${ISOCACHE} tmpiso
+ cp tmpiso/ubuntu/pool/main/f/fuel-createmirror/fuel-createmirror_6.1*.deb .
+ fusermount -u tmpiso
+ rm -rf tmpiso
+ sudo dpkg -i fuel-createmirror_6.1*.deb
+ sudo sed -i 's/DOCKER_MODE=true/DOCKER_MODE=false/' /etc/fuel-createmirror/common.cfg
+ touch .fuel-createmirror
+
+
+.PHONY: clean
+clean:
+ # Deliberately not cleaning nailgun directory to speed up multiple builds
+ @rm -rf ../release/opnfv/nailgun fuel-createmirror_6.1*.deb
+
+.PHONY: release
+release:.nailgun
+ @rm -Rf ../release/opnfv/nailgun
+ @mkdir -p ../release/opnfv
+ @cp -Rp nailgun ../release/opnfv/nailgun
+
+.nailgun: .fuel-createmirror
+ rm -Rf nailgun
+ fakeroot /opt/fuel-createmirror-6.1/fuel-createmirror
+ # Bug fix for https://bugs.launchpad.net/fuel/+bug/1476593
+ find nailgun/mos-ubuntu -type d -exec chmod 755 {} \;
+ touch .nailgun