summaryrefslogtreecommitdiffstats
path: root/fuel/build
diff options
context:
space:
mode:
Diffstat (limited to 'fuel/build')
-rw-r--r--fuel/build/Makefile3
-rw-r--r--fuel/build/f_ntp/puppet/modules/opnfv/manifests/ntp.pp11
-rw-r--r--fuel/build/f_odl_docker/puppet/modules/opnfv/manifests/odl_docker.pp87
-rw-r--r--fuel/build/f_resolvconf/puppet/modules/opnfv/manifests/resolver.pp20
-rw-r--r--fuel/build/install/apt-ftparchive-udeb.conf33
-rwxr-xr-xfuel/build/install/install.sh10
-rw-r--r--fuel/build/patch-packages/Makefile2
-rw-r--r--fuel/build/patch-packages/debootstrap/Makefile28
-rw-r--r--fuel/build/patch-packages/debootstrap/debootstrap.patch12
-rwxr-xr-xfuel/build/patch-packages/tools/udeb_pack38
-rwxr-xr-xfuel/build/patch-packages/tools/udeb_unpack58
11 files changed, 254 insertions, 48 deletions
diff --git a/fuel/build/Makefile b/fuel/build/Makefile
index fda212d..5f63120 100644
--- a/fuel/build/Makefile
+++ b/fuel/build/Makefile
@@ -27,6 +27,7 @@ export NEWISO = $(shell pwd)/release/opnfv-${REVSTATE}.iso
#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 CACHE_DIR := $(BUILD_BASE)/cache
export VERSION_FILE := $(BUILD_BASE)/.versions
@@ -108,7 +109,7 @@ umount-origiso:
.PHONY: $(SUBDIRS)
$(SUBDIRS):
- @mkdir -p release/packages/ubuntu/pool/main release/puppet/modules release/isoroot
+ @mkdir -p release/packages/ubuntu/pool/main release/packages/ubuntu/pool/debian-installer release/puppet/modules release/isoroot
$(MAKE) -C $@ -f Makefile release
.PHONY: patch-packages
diff --git a/fuel/build/f_ntp/puppet/modules/opnfv/manifests/ntp.pp b/fuel/build/f_ntp/puppet/modules/opnfv/manifests/ntp.pp
index 8180e3d..c5dce1b 100644
--- a/fuel/build/f_ntp/puppet/modules/opnfv/manifests/ntp.pp
+++ b/fuel/build/f_ntp/puppet/modules/opnfv/manifests/ntp.pp
@@ -31,6 +31,15 @@ class opnfv::ntp(
$file='/etc/ntp.conf'
) {
+ case $::operatingsystem {
+ centos, redhat: {
+ $service_name = 'ntpd'
+ }
+ debian, ubuntu: {
+ $service_name = 'ntp'
+ }
+ }
+
if $::fuel_settings['role'] {
if ($::fuel_settings['opnfv'] and
$::fuel_settings['opnfv']['ntp']) {
@@ -63,9 +72,9 @@ class opnfv::ntp(
service { 'ntp':
ensure => running,
+ name => $service_name,
enable => true,
require => [ Package['ntp'], File[$file]]
}
}
}
-
diff --git a/fuel/build/f_odl_docker/puppet/modules/opnfv/manifests/odl_docker.pp b/fuel/build/f_odl_docker/puppet/modules/opnfv/manifests/odl_docker.pp
index 922ab41..7370169 100644
--- a/fuel/build/f_odl_docker/puppet/modules/opnfv/manifests/odl_docker.pp
+++ b/fuel/build/f_odl_docker/puppet/modules/opnfv/manifests/odl_docker.pp
@@ -1,44 +1,45 @@
class opnfv::odl_docker
{
- case $::fuel_settings['role'] {
- /controller/: {
-
- file { "/opt":
- ensure => "directory",
- }
-
- file { "/opt/opnfv":
- ensure => "directory",
- owner => "root",
- group => "root",
- mode => 777,
- }
-
- file { "/opt/opnfv/odl":
- ensure => "directory",
- }
-
- file { "/opt/opnfv/odl/odl_docker_image.tar":
- ensure => present,
- source => "/etc/puppet/modules/opnfv/odl_docker/odl_docker_image.tar",
- mode => 750,
- }
-
- file { "/opt/opnfv/odl/docker-latest":
- ensure => present,
- source => "/etc/puppet/modules/opnfv/odl_docker/docker-latest",
- mode => 750,
- }
-
- file { "/opt/opnfv/odl/start_odl_conatiner.sh":
- ensure => present,
- source => "/etc/puppet/modules/opnfv/scripts/start_odl_container.sh",
- mode => 750,
- }
-
- # fix failed to find the cgroup root issue
- # https://github.com/docker/docker/issues/8791
- if $::operatingsystem == 'Ubuntu' {
+ case $::fuel_settings['role'] {
+ /controller/: {
+
+ file { '/opt':
+ ensure => 'directory',
+ }
+
+ file { '/opt/opnfv':
+ ensure => 'directory',
+ owner => 'root',
+ group => 'root',
+ mode => 777,
+ }
+
+ file { '/opt/opnfv/odl':
+ ensure => 'directory',
+ }
+
+ file { '/opt/opnfv/odl/odl_docker_image.tar':
+ ensure => present,
+ source => '/etc/puppet/modules/opnfv/odl_docker/odl_docker_image.tar',
+ mode => 750,
+ }
+
+ file { '/opt/opnfv/odl/docker-latest':
+ ensure => present,
+ source => '/etc/puppet/modules/opnfv/odl_docker/docker-latest',
+ mode => 750,
+ }
+
+ file { '/opt/opnfv/odl/start_odl_conatiner.sh':
+ ensure => present,
+ source => '/etc/puppet/modules/opnfv/scripts/start_odl_container.sh',
+ mode => 750,
+ }
+
+ # fix failed to find the cgroup root issue
+ # https://github.com/docker/docker/issues/8791
+ case $::operatingsystem {
+ 'ubuntu': {
package {'cgroup-lite':
ensure => present,
}
@@ -49,6 +50,12 @@ class opnfv::odl_docker
require => Package['cgroup-lite'],
}
}
+ 'centos': {
+ package {'docker-io':
+ ensure => latest,
+ }
+ }
+ }
+ }
}
- }
}
diff --git a/fuel/build/f_resolvconf/puppet/modules/opnfv/manifests/resolver.pp b/fuel/build/f_resolvconf/puppet/modules/opnfv/manifests/resolver.pp
index be4e67d..44f36a2 100644
--- a/fuel/build/f_resolvconf/puppet/modules/opnfv/manifests/resolver.pp
+++ b/fuel/build/f_resolvconf/puppet/modules/opnfv/manifests/resolver.pp
@@ -48,16 +48,26 @@ class opnfv::resolver()
mode => '0644',
content => template('opnfv/resolv.conf.erb'),
}
-# /etc/resolv.conf is re-generated at each boot by resolvconf, so we
-# need to store there as well.
- file { '/etc/resolvconf/resolv.conf.d/head':
+
+ # /etc/resolv.conf is re-generated at each boot by resolvconf, so we
+ # need to store there as well.
+
+ case $::operatingsystem {
+ 'ubuntu': {
+ file { '/etc/resolvconf/resolv.conf.d/head':
owner => root,
group => root,
mode => '0644',
content => template('opnfv/resolv.conf.erb'),
+ }
+ }
+ 'centos': {
+ exec { 'for file in ifcfg-eth*; do grep -q -F "PEERDNS=" $file || echo "PEERDNS=no" >> $file; done ':
+ provider => 'shell',
+ cwd => '/etc/sysconfig/network-scripts',
+ }
+ }
}
}
}
}
-
-
diff --git a/fuel/build/install/apt-ftparchive-udeb.conf b/fuel/build/install/apt-ftparchive-udeb.conf
new file mode 100644
index 0000000..2acbcf0
--- /dev/null
+++ b/fuel/build/install/apt-ftparchive-udeb.conf
@@ -0,0 +1,33 @@
+##############################################################################
+# 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
+##############################################################################
+
+Dir {
+ ArchiveDir ".";
+};
+
+TreeDefault {
+ Directory "pool";
+};
+
+BinDirectory "pool/debian-installer" {
+ Packages "dists/precise/main/debian-installer/binary-amd64/Packages";
+ BinOverride "./indices/override.precise.main.debian-installer";
+};
+
+Default {
+ Packages {
+ Extensions ".udeb";
+ Compress ". gzip";
+ };
+};
+
+Contents {
+ Compress "gzip";
+};
diff --git a/fuel/build/install/install.sh b/fuel/build/install/install.sh
index 823bcd9..dbb26d6 100755
--- a/fuel/build/install/install.sh
+++ b/fuel/build/install/install.sh
@@ -257,6 +257,14 @@ make_iso() {
copy_packages() {
echo "Copying Debian packages..."
+ cd $TOP/release/packages/ubuntu/pool/debian-installer
+
+ for udeb in `ls -1 | grep '\.udeb$'`
+ do
+ echo " $udeb"
+ cp $udeb $REPO/pool/debian-installer
+ done
+
cd $TOP/release/packages/ubuntu/pool/main
for deb in `ls -1 | grep '\.deb$'`
do
@@ -401,8 +409,10 @@ copy_packages() {
# The below methods are from 15B
APT_REL_CONF="$TOP/install/apt-ftparchive-release.conf"
APT_DEB_CONF="$TOP/install/apt-ftparchive-deb.conf"
+ APT_UDEB_CONF="$TOP/install/apt-ftparchive-udeb.conf"
apt-ftparchive -c "${APT_REL_CONF}" generate "${APT_DEB_CONF}"
+ apt-ftparchive generate "${APT_UDEB_CONF}"
# Fuel also needs this index file
cat dists/precise/main/binary-amd64/Packages | \
diff --git a/fuel/build/patch-packages/Makefile b/fuel/build/patch-packages/Makefile
index 9eb22fe..bcaac36 100644
--- a/fuel/build/patch-packages/Makefile
+++ b/fuel/build/patch-packages/Makefile
@@ -8,7 +8,7 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-SUBDIRS := python-nova
+SUBDIRS := python-nova debootstrap
SUBCLEAN = $(addsuffix .clean,$(SUBDIRS))
.PHONY: $(SUBDIRS) $(SUBCLEAN) clean
diff --git a/fuel/build/patch-packages/debootstrap/Makefile b/fuel/build/patch-packages/debootstrap/Makefile
new file mode 100644
index 0000000..0109312
--- /dev/null
+++ b/fuel/build/patch-packages/debootstrap/Makefile
@@ -0,0 +1,28 @@
+##############################################################################
+# 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)
+
+.PHONY: all
+all:
+
+.PHONY: clean
+clean:
+ @rm -rf udebPackage
+ @rm -rf *.udeb
+ @rm -rf patch-replacements
+ @rm -rf .udebpackage
+
+.PHONY: release
+release:
+ ../tools/udeb_unpack debootstrap-udeb_1.0.4*.udeb $(ORIGISO)
+ patch -s -p0 < debootstrap.patch
+ ../tools/udeb_pack $(REVSTATE)
+ @cp *.udeb $(UDEB_DEST)
diff --git a/fuel/build/patch-packages/debootstrap/debootstrap.patch b/fuel/build/patch-packages/debootstrap/debootstrap.patch
new file mode 100644
index 0000000..62342c9
--- /dev/null
+++ b/fuel/build/patch-packages/debootstrap/debootstrap.patch
@@ -0,0 +1,12 @@
+--- udebPackage/usr/share/debootstrap/scripts/gutsy.orig 2014-11-10 18:21:37.000000000 +0000
++++ udebPackage/usr/share/debootstrap/scripts/gutsy 2015-04-15 09:28:44.290437000 +0000
+@@ -112,7 +112,8 @@
+
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #2
+ ln -sf mawk "$TARGET/usr/bin/awk"
+- x_core_install base-files base-passwd
++ x_core_install base-passwd
++ x_core_install base-files
+ p; progress $baseprog $bases INSTCORE "Installing core packages" #3
+ x_core_install dpkg
+
diff --git a/fuel/build/patch-packages/tools/udeb_pack b/fuel/build/patch-packages/tools/udeb_pack
new file mode 100755
index 0000000..e961a73
--- /dev/null
+++ b/fuel/build/patch-packages/tools/udeb_pack
@@ -0,0 +1,38 @@
+#!/bin/bash -e
+##############################################################################
+# 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
+##############################################################################
+
+
+my_exit() {
+
+ if [ -d "$ISOROOT" ]; then
+ fusermount -u $ISOROOT
+ fi
+}
+
+ME=$(basename $0)
+
+trap my_exit EXIT
+
+if [ ! -d udebPackage ]; then
+ echo "$ME: Error - package directory does not exist"
+ exit 1
+fi
+
+echo "Stepping revision number to $REV"
+
+
+fakeroot dpkg-deb --build -Zgzip udebPackage
+PKGNAME=`grep "^Package: " udebPackage/DEBIAN/control | awk '{ print $2 }'`
+PKGREV=`grep "^Version: " udebPackage/DEBIAN/control | awk '{ print $2 }'`
+ARCH=`grep "^Architecture: " udebPackage/DEBIAN/control | awk '{ print $2 }'`
+mv udebPackage.deb ${PKGNAME}_${PKGREV}_${ARCH}.udeb
+
+ORIGPKG=`cat .udebpackage`
diff --git a/fuel/build/patch-packages/tools/udeb_unpack b/fuel/build/patch-packages/tools/udeb_unpack
new file mode 100755
index 0000000..ed9cd21
--- /dev/null
+++ b/fuel/build/patch-packages/tools/udeb_unpack
@@ -0,0 +1,58 @@
+#!/bin/bash -e
+##############################################################################
+# 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
+##############################################################################
+
+
+my_exit() {
+
+ if [ -d "$ISOROOT" ]; then
+ fusermount -u $ISOROOT
+ fi
+}
+
+ME=$(basename $0)
+
+trap my_exit EXIT
+
+
+if [ -z "$1" ]; then
+ echo "$ME: Error - No package specified"
+ exit 1
+fi
+
+if [ -z "$2" ]; then
+ echo "$ME: Error - No ISO path specified"
+ exit 1
+fi
+
+DEB=$1
+ORIGISO=$2
+DEST=udebPackage
+
+if [ -e $DEST -o -d $DEST ]; then
+ echo "$ME: Error - $DEST already exists"
+ exit 1
+fi
+
+ISOROOT=`mktemp -d /tmp/XXXXXXX`
+fuseiso -p $ORIGISO $ISOROOT
+sleep 1
+
+if [ ! -f $ISOROOT/ubuntu/pool/debian-installer/$DEB ];then
+ echo "Could not find package $DEB in source ISO!"
+fi
+
+mkdir -p $DEST
+dpkg -x $ISOROOT/ubuntu/pool/debian-installer/$DEB $DEST
+
+mkdir -p $DEST/DEBIAN
+dpkg -e $ISOROOT/ubuntu/pool/debian-installer/$DEB $DEST/DEBIAN
+
+echo $DEB > .udebpackage