Commit Graph

1137 Commits

Author SHA1 Message Date
Steve Kowalik
e02dbd717b Stop using bash arrays for whitelisting in yum
Using -n for bash arrays was a little bit bad, and also resulted in
errors when running under set -u. Wean the yum element off the array
and switch to a straight string.

Change-Id: Ifd61fce7dadd5820022e9b2ab42020ba0cb71ce6
2014-05-22 19:05:28 +10:00
Jenkins
2afe36eca8 Merge "Add switch to turn on caching for debian element." 2014-05-22 09:05:17 +00:00
Jenkins
9941326be6 Merge "set -u doesn't permit bash arrays to test -n" 2014-05-21 20:21:11 +00:00
Jan Grant
b7aa04ed9d Tidy up SuSE kernel selection
This is just removing a C&P line that only ever returns a single result.

Change-Id: Iad37e982412a9199d86d9b4481cc14a85eef704e
2014-05-21 10:08:24 +01:00
Jan Grant
6df7039ba1 Parameterise PXE kernel and initrd selection
When using custom-built kernels, their filenames may not necessarily
follow the standard naming conventions for the stock systems in question.

This patch permits the specification of an alternative pattern to use
when looking for the correct kernel to construct the PXE images from.

Example:
  export DIB_BAREMETAL_KERNEL_PATTERN="kernel*jang"
  export DIB_BAREMETAL_INITRD_PATTERN="initrd*jang"

Change-Id: I86e5254051addd5e89dd4e363e9bba117e65353d
2014-05-21 10:08:23 +01:00
Jenkins
44922b8247 Merge "Ensure we can read the kernel out." 2014-05-20 03:18:42 +00:00
Jenkins
f70a9fa4e2 Merge "Add map-services for debian distros." 2014-05-19 21:23:00 +00:00
Jenkins
d69c0fce86 Merge "Fedora: Add support for configuring Yum mirrors" 2014-05-19 15:52:13 +00:00
Kiall Mac Innes
1757214196 Debian: Support additional debootstrap arguments
Add support for supplying a custom keyring and debootstrap script
using two new environment variables:

* DIB_DEBIAN_KEYRING - Path to a gpg keyring.
* DIB_DEBIAN_DEBOOTSTRAP_SCRIPT - Path to a alternative debootstrap
  script.

Change-Id: I42e8832b435b8a77b0681b5bc9d9332bbe860cd5
2014-05-18 19:40:38 +00:00
Dave Thomas
1a70916bca set -u doesn't permit bash arrays to test -n
Although set -u allows empty WHITELIST=() list to be set, you can't test
-n "$WHITELIST".  Looks like the intention of the commit that caused
this issue (Change-ID Iad2d490c86dceab148ea9ab08f457c49a5d5352e) is to
set a policy to prevent future use of bugs due to unbound variables.

Thanks StevenK for pairing with me and helping me hone my bash skills.

Change-Id: I2349c990ba53b0aaecd5119812582c7c848f1e4e
Closes-Bug: #1319987
2014-05-16 13:16:06 -07:00
Jenkins
a719b9fa5f Merge "4 spaces indent" 2014-05-14 08:26:08 +00:00
Robert Collins
072fee1a74 Ensure we can read the kernel out.
If the kernel is restricted read (as a security measure) we may not be
able to read it without chmodding it.

Change-Id: Ib577705c27d8c351288334de03a7848cf49f2de9
2014-05-14 04:25:05 +12:00
iberezovskiy
8995d6402a Export unbound variable DIB_RHSM_USER
If 'DIB_RHSM_USER' isn't set, the image build with rhel
element fails because of check 'set -u'. So, we should export
'DIB_RHSM_USER' in script to avoid error during build

Change-Id: Ic63a20e3d91a25bbe804440a5919b035489c60a3
Closes-bug: #1318717
2014-05-13 12:03:27 +04:00
Jenkins
dcb5f57a5a Merge "Move instead of copy the temporary git manifest" 2014-05-12 03:02:28 +00:00
Gonéri Le Bouder
ea3f4dd459 4 spaces indent
ensure 4 spaces indentation is used everywhere.

Change-Id: Ieb48faacb4c96b7b358771d70c17f2f22d0354f4
2014-05-10 11:17:29 +02:00
Trent Geerdes
771ed1903c Adding -x to set parameters for more output
When the cache tarball gets fail the output doesn't indicate
what url is failing.  Adding '-x' displays the urls attempted.

Change-Id: I71b2dbfd712e72c591410ca9b68edc76d493ad6e
2014-05-08 14:41:03 -06:00
Ben Nemec
16be6d7ce0 set -u and -o pipefail everywhere
As with the previous similar changes, this is intended to catch
problems as they happen instead of ignoring them and continuing on
to potentially fail later.  Setting this on all existing scripts
will allow us to enforce use via Jenkins.

Change-Id: Iad2d490c86dceab148ea9ab08f457c49a5d5352e
2014-05-06 15:51:07 -05:00
Dan Prince
131fb6e4db Fedora: Add support for configuring Yum mirrors
Updates the fedora element so that DIB_DISTRIBUTION_MIRROR can
be used to configure a custom Yum mirror on Fedora. This
implementation replaces the baseurl in each of the default
Fedora Yum .repo files so that a custom mirror URL/path
can be supplied. The URL should point to the directory
where the updates and release directories exist. Example:

  http://download.fedoraproject.org/pub/fedora/linux

As part of this change we also remove any existing
metalink settings in the .repo files to cover the case
where an end user runs their own createrepo command
to create the mirror... which means your metadata won't match that
of the normal Fedora mirrors and your baseurl won't get used.

Change-Id: I1a49a2941b1cc489e91a72b87430393cd32e865d
2014-05-06 10:11:26 -04:00
Gonéri Le Bouder
3ae4edc276 add some missing \n at end of file
This to avoid the “No newline at end of file” error from patch/git.

Change-Id: Ice82d4a36a0893e8f71dbffbdab154d1fbab8a09
2014-05-06 13:43:53 +02:00
Jenkins
dde3360057 Merge "Support declarative package installs/uninstalls" 2014-05-06 08:51:29 +00:00
Dan Prince
3a7800ec99 Add map-services for debian distros.
DIB's map-services is currently used in TIE's os-svc-config
binaries to support service name lookups. Many of the systemd
specific functions require bin/map-services to exist.

This change adds bin/map-services files that are noops
to both the debian and ubuntu elements so that as those
distros move towards using systemd they can make use
of the functions we already have in place.

Change-Id: If8d61f3858b11de86c3292e840d033e5e3cecedb
2014-05-05 16:08:40 -04:00
Ben Nemec
79ab95b16e Make sure all scripts are set -e
If scripts are not set -e then errors can be ignored, causing more
confusing failures later.

Also adds an exclusion comment to the ramdisk init script since we
don't want that to exit on failure.

Change-Id: Idf43993bd10b1ef16c1d3b0d9df8d0ad94c46458
2014-05-02 17:18:54 -05:00
Jenkins
928e6f237b Merge "debian: properly deal with Debian stable/unstable" 2014-05-02 15:37:26 +00:00
Jenkins
d99d8092a7 Merge "Add sysv support to elements/dhcp-all-interfaces" 2014-05-02 08:59:46 +00:00
James Slagle
7f9ebf2632 Support declarative package installs/uninstalls
Adds a new element, package-installs, that provides an interface for
declarative package installs and uninstalls. Packages to install can be
added to an install.d/package-installs-<element-name> file. The set of
packages listed across such files are installed in a single transaction
at the beginning of install.d.

Prefacing the package name with a "-" indicates that the package should
be uninstalled at the end of the install.d phase. Again, the full set of
uninstalls are done in a single transaction.

An element providing a package-installs file should add package-installs
to its element-deps file.

Change-Id: I5b540388eff1079c8dee933b869463371481152b
2014-05-01 08:47:14 -04:00
Gonéri Le Bouder
6da238485d debian: properly deal with Debian stable/unstable
This commit fixes the if/else block around Debian stable/unstable which
was badly merged during the last rebase.

Change-Id: Ia2eb806da3d7c8d28afffb026f35600c7125d8d7
2014-04-30 18:29:31 +00:00
Jenkins
b46ece4de9 Merge "debian: add systemd support" 2014-04-30 12:08:01 +00:00
Jenkins
6e1b64deb3 Merge "debian: support upstart on Wheezy" 2014-04-30 12:01:12 +00:00
Jenkins
71fafff215 Merge "Permit cache-url to work with fifos." 2014-04-30 08:30:44 +00:00
Jenkins
8bba3a2137 Merge "cleaning up 01-copy-manifests-dir" 2014-04-29 22:32:08 +00:00
Jenkins
301dc5cc0e Merge "set -e all the things" 2014-04-29 11:29:43 +00:00
Jenkins
1384f8aa16 Merge "Map openjdk-7-jre-headless to RHEL+SUSE" 2014-04-29 08:10:37 +00:00
Jenkins
59a2ccc6c3 Merge "Add package uninstall support" 2014-04-29 08:10:31 +00:00
Robert Collins
481f8de56a Permit cache-url to work with fifos.
This makes it easier to work with temporary files - less traps
scattered around higher layer code.

Change-Id: I2fdd93115a7b0d289c2e28f8c133d4059de75b87
2014-04-29 14:46:50 +12:00
Jenkins
8a566e67a6 Merge "Explicitly use bash" 2014-04-29 01:35:22 +00:00
Gonéri Le Bouder
9e60987e40 debian: add systemd support
This patch adds a debian-systemd element to get systemd support with
Debian.

A backport of systemd is used on Debian Wheezy.

Change-Id: I095c81b2c32844fccf940c97b79054923c25b8c2
2014-04-28 16:51:13 +02:00
Gonéri Le Bouder
155accb599 debian: support upstart on Wheezy
Upstart cannot be installed by debootstrap on Wheezy because of a
conflict with sysvinit. sysvinit is flagged a being “essential” and
apt-get will refuse to remove it.
See: https://bugs.debian.org/668001

This patch uses another strategy. We install a standard sysvinit
Debian chroot with debootstrap and during a second step, we
replace sysvinit with the wanted init system.

Change-Id: I081c81b2c32874fccf940c97b79054923c25b8c2
2014-04-28 16:51:13 +02:00
Jan Grant
90bbd1e98f Debian element should activate eth0
Cloud images expect the primary interface to run dhclient in order
to come up and acquire an IP address. Although we have technology
to manage without this for the undercloud and so on, the seed
still relies on this machinery in order to bring up its first
interface.

Change-Id: I079a679779de760ee9ca6f93cbb22e69a65e03af
2014-04-28 13:01:45 +01:00
Jenkins
b1e8c082c3 Merge "Add a mapping for kernel headers" 2014-04-26 00:38:12 +00:00
Ben Nemec
f6ba2aeaf4 set -e all the things
Using set -e in all of our scripts will prevent some subtle bugs
from slipping in, and will allow us to enforce use of set -e with
tooling.

This change also adds -u and set -o pipefail in the less complex
scripts where it is unlikely to cause problems.  A follow-up change
will enable those options in the complex scripts so that if it
breaks something it can be reverted easily.

Change-Id: I0ad358ccb98da7277a0ee2e9ce8fda98438675eb
2014-04-25 17:38:51 -05:00
Ben Nemec
0b367e919b Explicitly use bash
In the mailing list discussion, everyone seemed to agree that we
should just be explicit that these are bash scripts since that's
where we're testing them and there's no good way to ensure they
work on any other shells right now.

Change-Id: I86c41d2cddf6e91e7deeb4c2ab51635c80a1ce0c
2014-04-25 17:38:41 -05:00
Jenkins
db1ba39fed Merge "Remove All Rights Reserved" 2014-04-25 21:23:02 +00:00
Monty Taylor
1c07d4ba1a Remove All Rights Reserved
The phrase is no longer needed as of August 23, 2000 with Nicaragua's
joining of the Berne Convention.

Additionally, in at least one instance,
elements/cache-url/bin/cache-url, its existence in the file between
Copyright lines is just weird and feels misleading, even though it is
not.

Remove all of the lines, because sanity.

Change-Id: I24fd76c2b4f66b8036010b5079db39ead729abee
2014-04-25 11:25:10 -07:00
Jenkins
e1c28525fc Merge "Place /usr/lib64/ccache in PATH" 2014-04-25 17:17:50 +00:00
Jenkins
0ec786e5a1 Merge "Revert default Ubuntu release back to Saucy" 2014-04-25 02:01:12 +00:00
Jenkins
0303108857 Merge "indent: replace tab by 4 spaces" 2014-04-24 23:19:09 +00:00
James Slagle
6824181354 Add package uninstall support
Adds the ability to uninstall packages to our install-packages scripts.

Change-Id: I72e0252968a151d71176aa479c7233f6df0a10ac
2014-04-24 16:57:20 -04:00
Jenkins
23bb91dd5b Merge "Disable splashimage for legacy grub." 2014-04-24 20:20:33 +00:00
Adam Gandelman
927f80adaa Revert default Ubuntu release back to Saucy
Trusty ramdisks do not boot, failing to exec init.  This reverts
the default DIB_RELEASE back to Saucy until Trusty ramdisks have
been properly tested.

Change-Id: I5ac81822b78805275268cecc021a74a62c22ef58
2014-04-24 11:19:43 -07:00
Monty Taylor
ace82f16e9 Add a mapping for kernel headers
Nodepool needs to be able to install kernel headers, which means we
need a mapping for redhat systems here.

Change-Id: Ic83d642b5ebe85b042cf7b23b295be74bbe185fa
2014-04-24 10:44:40 -07:00
Alexis Lee
21f01e937c Map openjdk-7-jre-headless to RHEL+SUSE
Provide package name mappings for openjdk-7-jre-headless:
        RHEL/Fedora: java-1.7.0-openjdk-headless
        SUSE: java-1_7_0-openjdk-headless

See https://review.openstack.org/#/c/86314

Change-Id: I3a351d0f9854f6f320ba145a71ffc66fd02c231c
2014-04-24 07:49:12 +00:00
Alexis Lee
6b2a78f3ab Sort rhel/bin/map-packages
Unlike the redhat-common and opensuse map-packages maps, the RHEL one
appears to be unsorted. Fix that.

Change-Id: I75c5d2694525731660c2a3b5b58ee696c61923ba
2014-04-23 08:53:03 +01:00
Juerg Haefliger
e5f537ff2a Add sysv support to elements/dhcp-all-interfaces
This patch adds support for sysv init to the dhcp-all-interfaces element.
Specifically, it adds a sysv init script and the relevant install/config steps.

Tested with Debian jessie/testing.

Change-Id: I4ae1d5365bafda188cb65ea1fb72d8ffe2408910
2014-04-23 09:20:29 +02:00
Jenkins
621d63ce2a Merge "Make "trusty" (Ubuntu 14.04) the default release" 2014-04-23 02:46:55 +00:00
Derek Higgins
df78cd3dca Place /usr/lib64/ccache in PATH
ccache wasn't being used on fedora as the symlinks are in lib64.

Change-Id: I810558799dd2382b36b5112e435b74fd5caa8ccf
2014-04-23 01:18:29 +01:00
Steve Kowalik
0072a39b2b Small fixes for dhcp-all-interfaces
I3166951c6fbb2faec53ffc339edd2fd0c3512300 recently landed without two
fixes that I suggested, namely using rm -f rather than testing for
file existance, and a comment fix.

Change-Id: I68e187e20802f3482d4c524a6c435fec7526178e
2014-04-22 16:39:52 +10:00
Michael McCune
bcf529ce80 cleaning up 01-copy-manifests-dir
This change adds extra tests to the
elements/manifests/cleanup.d/01-copy-manifests-dir script to prevent it
from exiting with an error due to non-existant files.

The premature exit condition only seems to happen when an image is being
created without including the "base" element.

Changes
* adding file detection tests for dib_arguments and dib_environment
files

Closes-Bug: #1308224
Change-Id: Iaa8bafb6765241408b9f02d4896913d15f2f401d
2014-04-21 16:42:44 -04:00
Jenkins
b588e4af05 Merge "Use provides to note an element provides deploy" 2014-04-18 21:18:03 +00:00
Jenkins
6c966068b0 Merge "Remove dependency on /etc/lsb-release" 2014-04-18 20:20:34 +00:00
Jon-Paul Sullivan
ac73660c40 Remove the temporary deploy element after rename
This is dependent upon change in tripleo-incubator
I1ff4bb98c99dfe87ccc4fb19767b93e27707d3a7 and concludes the
renaming of deploy to deploy-baremetal

The rename was performed so that each element had a more descriptive
name, and so that each element could accurately set an element-provides
of "deploy", given that the elements enable tripleo deploys via the
ramdisk image.

Change-Id: Ic2ca5f95b8895fa0d6d7314cab9de30a7204541c
2014-04-18 20:18:54 +01:00
Jon-Paul Sullivan
0f12d45a50 Use provides to note an element provides deploy
Use "deploy" to denote that an element provides the deploy
capability for a ramdisk for tripleo installation purposes.

This will be a 3-part change to enable renaming deploy to
deploy-baremetal so that the generic "deploy" capability can
be used for the provides file, as a dependant change will have to
be made in tripleo-incubator.

The tripleo-incubator change is
I1ff4bb98c99dfe87ccc4fb19767b93e27707d3a7 and that swaps to using
deploy-baremetal in place of deploy for ramdisk creation when using
baremetal.

Change-Id: Ibb4026e8fc8ba6378061461c4796a91ab2fa991f
2014-04-18 20:10:46 +01:00
Jenkins
35a006cfa6 Merge "debian: simplify the way debian element is called" 2014-04-18 13:52:47 +00:00
Stephen Mulcahy
94d2cc42c6 Remove dependency on /etc/lsb-release
/etc/lsb-release doesn't always exist in cloud images and doesn't
serve any significant purpose in this element so removing the
dependency entirely.

Change-Id: I4d972074e6e10fea09a875cbc4ed4e60248d46d9
2014-04-18 11:43:17 +01:00
Gonéri Le Bouder
9cb0615f38 indent: replace tab by 4 spaces
As decided in I072cf8bf6748d0c910fecffdf2282bcc4656d038, tab indent
should be avoided.

Change-Id: I301b6319ef4f36878999b6109e1842f9e7cafd43
2014-04-18 10:32:43 +02:00
Jenkins
a9c0a7bf27 Merge "Add ability to add extra apt keys" 2014-04-17 22:47:58 +00:00
Jenkins
7b1c2b98e5 Merge "Document a little the concerns for operators." 2014-04-17 22:47:57 +00:00
Jenkins
4dc7d784b0 Merge "Change refspec used to fetch all branches and tags" 2014-04-17 20:23:05 +00:00
Jenkins
a4c48d78dd Merge "apt-conf: uninitialised variables fix" 2014-04-17 20:08:50 +00:00
Clint Byrum
404c695de9 Make "trusty" (Ubuntu 14.04) the default release
Ubuntu 14.04 was released today. Saucy will be EOL in 3 months.

Change-Id: I2043c3dfa8b795ae587b42cd80d3a0bf866bf82a
2014-04-17 11:20:06 -07:00
Jan Grant
fe33d34637 Add switch to turn on caching for debian element.
DIB_OFFLINE has wide-ranging effect. This patch adds a tunable that
only turns on the tarball-caching behaviour specifically for the
debian element.

Change-Id: Idd646d7909df6907afc0eeeec1129c3f1a1f92bc
2014-04-17 10:10:34 +01:00
Jenkins
95cdefebf6 Merge "Fix Grub configurations for Fedora images built on a UEFI host." 2014-04-17 07:48:06 +00:00
Dan Prince
0a797c86de Remove cloudy interfaces in dhcp-all-interfaces
Moves the code that removes default cloud interfaces
into the dhcp-all-interfaces element. Having it live in
stable-interface-names won't work right now because we
need this for virtualized testing.

Change-Id: I3166951c6fbb2faec53ffc339edd2fd0c3512300
2014-04-16 14:09:50 -04:00
Gonéri Le Bouder
eb26c1a0b1 debian: simplify the way debian element is called
“debian” element now source the ${TARGET_ROOT}/.extra_settings file. We
can use this file to adjust its behavior and specifiy what init system
should be used.

Change-Id: Id57ce879341184a57851d2578cf70978f409a48e
2014-04-16 17:39:18 +02:00
Jenkins
ed5a872adf Merge "Add mapping for mariadb rdo package" 2014-04-16 14:30:19 +00:00
Jenkins
c6c01fb237 Merge "Fix set -eu and pipefail failures" 2014-04-16 13:33:39 +00:00
Jenkins
c1af3770ec Merge "map-services: add apache2 in the list" 2014-04-16 02:22:00 +00:00
Jenkins
dd09afb670 Merge "Remove map-services from fedora element" 2014-04-16 02:21:55 +00:00
Ben Nemec
381ff6ab1d Fix set -eu and pipefail failures
Fixes problems found by set -eu and pipefail, including:
-Many unset variables
-Commands that can fail under normal circumstances, which breaks
with set -e.  This change swallows those expected errors to allow
our existing error code to handle them.
-The dkms element was not finding Fedora kernel versions correctly.
This may be an issue for other distros too, but since Fedora was
working fine without this functionality I only changed it to print
a warning message rather than failing the build when it happens.
-The ramdisk init script will not be set -eu because if it fails
the result is a kernel panic, which can be tricky to debug.
However, in testing with set -e a few failing commands were found
and have been fixed in this patch.

Change-Id: I44cf98dfc80cfcaec54b88cc83be80a3dbf2cec3
2014-04-15 20:53:15 -05:00
Jon-Paul Sullivan
b507cab2b5 Move instead of copy the temporary git manifest
This prevents a build-up of temporary files in the cache directory

Change-Id: Ice34b57ef4f24bbe69b43ee3b2e2e394894825e5
2014-04-15 11:24:43 +01:00
Jan Provaznik
40adbff681 Add mapping for mariadb rdo package
Mariadb package in RDO repository is mariadb-galera-server, but
this name is mapped to MariaDB-Galera-server because of
mariadb installed from mariadb.org.

To avoid mapping conflicts mariadb-rdo uses virtual package name
mariadb-rdo-galera-server which is mapped to mariadb-galera-server.

Change-Id: Idf77d91876baeb81d89eb688808b892ece2bf19a
2014-04-15 12:02:52 +02:00
Gonéri Le Bouder
707cb51c84 map-services: add apache2 in the list
apache2 service is called httpd on Fedora and RHEL unlike SUSE,
Debian and Ubuntu.

Change-Id: I125c46bebb0342ee3bdb957116e7c7e8e27a2ecc
2014-04-15 10:13:57 +02:00
Ben Nemec
2747e0139c Remove map-services from fedora element
This was supposed to have been moved to the redhat-common element,
and having it here too is both confusing and may break builds
depending on which version gets used.

Change-Id: Icae5cc633e9e49a9ee63bd9dfc94657c6795c6f1
2014-04-11 21:36:23 -05:00
Jenkins
ae9ccc4a23 Merge "Remove call to depmod in busybox" 2014-04-12 00:12:52 +00:00
Jenkins
b1a4eda4ee Merge "Standardise manifest creation and retrieval" 2014-04-11 22:10:52 +00:00
Jon-Paul Sullivan
793dae8fe6 Use provides to note an element provides an OS
Use "operating-system" to denote that an element provides that to the
image being created.  This can then be used to specify an abstract
dependency in other elements to assist in build-time image verification.

Change-Id: Ic125803da65e0f8f8c20ef90b08815f4f7d09762
2014-04-10 14:42:04 +01:00
Jon-Paul Sullivan
4c467964f5 Standardise manifest creation and retrieval
* Create a standard element to copy manifests out of the image and
  into the build area.
* Ensure all current manifests are copied into a standard manifests
  directory

Change-Id: I37eff5a13a14564e1adc33eb4f0144d571267617
2014-04-10 12:25:13 +01:00
Nicholas Randon
d11c10fb6a Remove call to depmod in busybox
The version of depmod in busybox does not work if two versions of
the same kernel version are available, as search paths are not
honoured correctly.  However, we don't need to actually call
depmod as it's done during image building anyway.

Change-Id: Idd3cd5854e7c86e7ca1f2b0e50758d7db79ab6e7
Co-Author: matthew.gilliard@hp.com
Closes-bug: #1302856
2014-04-09 10:10:11 +01:00
Stuart McLaren
06ccb7484f apt-conf: uninitialised variables fix
In the bash script "99-override-default-apt-conf" 'set -u'
is being used to check for uninitialised variables.

This resulted in generic 'unbound variable' messages rather
than the intended error messages.

Tweaked the check for DIB_APT_CONF to work if the variable is unbound;
so that we get the intended error message rather than the `unbound
variable` message.

Change-Id: Ib8e287060f32312ab80dd7f44e2792ecca48edbb
2014-04-09 09:12:31 +02:00
Jenkins
0fc211a82a Merge "Remove hardcoded /tftpboot/ from token's tftp path" 2014-04-08 17:24:59 +00:00
Jenkins
53561fc295 Merge "debian: use sudo to create file in the chroot" 2014-04-08 13:09:17 +00:00
Steven DuChene
2408569566 Add ability to add extra apt keys
Adds an environment variable DIB_ADD_APT_KEYS pointing to a folder of
apt repo GPG keys. Each key will be verified and installed with apt-key
to the apt keyring.

Change-Id: I4b15347a76aa3241e741931bb94f17598641ae42
2014-04-07 13:51:30 +01:00
Robert Collins
3b7d6694e9 Document a little the concerns for operators.
Change-Id: I2429371d3c5d931d46674c4e46d99599fda9f42e
2014-04-05 20:17:30 +13:00
Gonéri Le Bouder
4004985844 debian: use sudo to create file in the chroot
The ${TARGET_ROOT} chroot is owned by the root user.

Without this change, the build will fail for a standard user
with a “Permission denied” error.

Change-Id: I6eb87d3a14292da5620bdfd623ea7ef846fe2af6
2014-04-04 10:14:26 +02:00
Om Kumar
2fb1b91dec Disable splashimage for legacy grub.
There is a known issue in legacy grub. When using splashimage with
serial console, Legacy grub wont start properly. This commit is to
ensure that when serial console is used, legacy grub should not
contain splashimage. It also adds serial support to legacy grub
configuration file.

Change-Id: I2007916998dfe7c66ef51bf8c57c1698dc0fcb75
2014-04-03 15:16:51 +05:30
Jon-Paul Sullivan
f8416b1fe5 Change refspec used to fetch all branches and tags
When the repository references are sha1s the fetch command used will
not work.  This will ensure that all of the objects are still fetched,
and all of the local cache references for branches and tags will be
updated rather than just the specified reference in use.

Change-Id: Iad2554b3087a5da37dac6e9f6a72432d49fce83d
Closes-Bug: #1301435
2014-04-02 16:25:48 +01:00
Gonéri Le Bouder
341d7aaff7 fix grub2 installation on Debian Wheezy
--target has been introduced in grub2. This patch ensure we use
the minimal version before adding the --target XXX flag.

Debian Wheezy and Precise share the same limitation regarding the
root device.

Change-Id: I5b3ad42b9fb536d13fb65d84339bc15bc23d99a3
2014-04-02 11:37:49 +02:00
Om Kumar
50d1e09df1 Fix Grub configurations for Fedora images built on a UEFI host.
The grub install scripts on Fedora have hardcoded checks for
/sys/firmware/efi and if the directory exists, it uses efi
specific instruction like initrdefi, linuxefi etc. vm element
should fix it once the configuration is generated.

Closes-bug: #1231946
Change-Id: I888304cb9167b8e074b04ca6c5b2f9143b70d37d
2014-04-02 03:09:29 +00:00
Robert Collins
f49e8a42c4 Fix dhcp-all-interfaces upstart job
This was calling it for all interfaces previously, making the fixes
we'd put in place be ineffective.

Change-Id: I16bf81225a942e3b19a7e745d949e6ddea2fd50e
2014-04-02 09:14:03 +13:00
Robert Collins
c7875398b3 Fix resource exhaustion with upstart.
When high VM churn is encountered dhcp-all-interfaces got tangled up
and leaked instances until upstart run out of filedescriptors.

This happened because we were locking on every invocation, and the
lock logic was disabling the single-interface code - so we always
probed every interface every time - and this was serialized across
every instance of dhcp-all-interfaces.

Change-Id: I4ef1fb83d978cc99d4cb9cc2666bde302c6db7d1
2014-04-01 22:45:12 +13:00
Jenkins
6090f520d1 Merge "Fix "(None)" seed hostname on Debian" 2014-03-31 15:41:08 +00:00
Jon-Paul Sullivan
843085a7cd Write a dpkg manifest to list installed packages
To create an auditable log of packages installed in an image use
dpkg-query to create a json data file with the package names, version
and install status.

Change-Id: I59018221edcb944a876ad47b402538c63c426bc7
2014-03-28 18:12:02 +00:00
Jenkins
b9189a204f Merge "Uses policy-rc.d to prevent dpkg starting daemons" 2014-03-27 18:38:06 +00:00
Jenkins
eacdb2a4a5 Merge "dhcp-all-interfaces: correct ifquery return stmt" 2014-03-27 18:01:52 +00:00
Jonathan Brownell
5af25b5f46 Fix "(None)" seed hostname on Debian
The cloud-init package on Debian Linux overwrites the system
hostname to "(None)" unless a hostname is specified in one
of the /etc/cloud/cloud.cfg.d/* files. This change applies
a default hostname of "debian" using cloud-init.

Change-Id: I9b411df44cfa05f899e708900f95719c0bcd6267
2014-03-27 10:08:03 -07:00
Jenkins
5feeb06738 Merge "Make stable-interface-names its own element." 2014-03-27 16:14:08 +00:00
Dan Prince
6f764d9119 dhcp-all-interfaces: correct ifquery return stmt
Corrects an issue in the config_exists function that could
cause duplicate interfaces to be configured on Ubuntu.

Previously we used 'return ifquery' directly which caused
a silent 'numberic argument required' error to go unnoticed.
This would also return 1 meaning a new interface would get
configured.

The new logic should handle things properly.

Change-Id: I625225e15113d7e184e3bcb5054df1616dec008a
Closes-bug: #1298430
2014-03-27 10:47:55 -04:00
Jenkins
54d16fa9f8 Merge "Adds package mapping for mariadb packages" 2014-03-27 13:30:14 +00:00
Jenkins
57ff15ea80 Merge "rename udev.rules to dhcp-all-interfaces-udev" 2014-03-27 07:24:40 +00:00
Dan Prince
99c54323a0 Make stable-interface-names its own element.
Virtual baremetal instances have their NICs show up as ens4
which doesn't play nicely as a default in devtest at
the moment.

Ideally we'd want it to be em1 like real baremetal
(which is why we put this in the baremetal element
to begin with). Turns out the baremetal element is
required in devtest so we can extract the ramdisk and kernel
so lets leave it alone for now and move this elsewhere
until we get a better solution for fake 'baremetal'
testing.

Closes-bug: #1298152
Change-Id: Ia71e1d32b93db0c4c844a6dc1ebcd04ab0c13f05
2014-03-26 22:25:39 -04:00
Jenkins
f93147795c Merge "debian: install cloud-init on Wheezy" 2014-03-26 23:28:39 +00:00
Thom Leggett
46a14ae0e6 Uses policy-rc.d to prevent dpkg starting daemons
Currently the dpkg element fakes start-stop-daemon, initctl and
invoke-rc.d to stop dpkg from starting a bunch of daemons in the
chroot. This is problematic when packages use service, start, stop or
restart commands.

This patch uses a policy-rc.d instead of faking invoke-rc.d to achieve
the same thing. This approach now aligns exactly with debootstrap.
Without this patch DIB runs on some debian distributions fail
when trying to umount the chroot loop device as there are daemons
running.

The log will now show "invoke-rc.d: policy-rc.d denied execution of
start." instead of "Warning: Fake invoke-rc.s called, doing nothing."

Change-Id: I6db192127aca19b5b7915179b781f5192078bfc7
Related-Bug: #1211564
2014-03-26 20:59:49 +00:00
Ben Nemec
63230414d2 Alphabetize all element-deps
Change-Id: Idc31d60daeea61d6df0b70dac4a5671fa5a804ee
2014-03-26 15:23:18 -05:00
Jan Provaznik
507b717c61 Adds package mapping for mariadb packages
Change-Id: I6fb0e176da3f73cb2388cd833395f5880c4ce3c3
2014-03-26 21:12:58 +01:00
Trent Geerdes
8007882726 Adding pypi-mirror dependencies for redhat
Change-Id: I030f27460c92ce0b59188e9469206b293271697a
2014-03-26 06:44:15 -06:00
Jenkins
a78e33f617 Merge "Add console kernel parameters to extlinux configuration" 2014-03-26 09:47:40 +00:00
Gonéri Le Bouder
2514b822d2 debian: install cloud-init on Wheezy
cloud-init packages are not available in the Debian Wheezy repository.
However, they are available in wheezy-backports.

With this change, the cloud-init packages are installed from
wheezy-backports if DIB_RELEASE is wheezy.

Change-Id: I3daa3b0ba185ba3f7c1bf6b8f9b1f8c167fcb340
2014-03-26 10:21:13 +01:00
Jenkins
73c3b2c404 Merge "serial-console: Use udev rules to startup getty" 2014-03-26 05:33:52 +00:00
Jenkins
440de95f41 Merge "Set +x on executable files" 2014-03-25 20:54:41 +00:00
Jenkins
593680e936 Merge "DHCP: make udev rules want dhcp-interface@.service" 2014-03-25 20:23:14 +00:00
Jenkins
8c5aff82a2 Merge "baremetal: correct the path of ifcfg-eth0" 2014-03-25 15:50:31 +00:00
Luigi Toscano
be3efed80b Add console kernel parameters to extlinux configuration
Those parameters allow to access the console for VMs using
extlinux (CentOS 6 for example). They are already added to
Fedora images.

Change-Id: I035170bd101062e004fb3782b5f8e5a7944a4f03
Closes-Bug: 1296899
2014-03-25 14:24:43 +01:00
Robert Collins
ee18fe41da Permit use of wheel mirrors in pypi element.
pypi-mirror creates a separate mirror index for wheels (one per OS
that mirrors are built on). To be able to use it one then needs to be
able to export multiple mirrors for inclusion in pip.conf. As a drive
by I made it possible to disable the use of the pypi.python.org index
without using --offline (as --offline has larger impact).

Change-Id: I3e85a8069b18cafd7eae4cd0591821acc3b5a739
2014-03-25 16:48:18 +13:00
Dan Prince
6957bd8db3 baremetal: correct the path of ifcfg-eth0
Remove the correct ifcfg-eth0 file on Fedora.

This will require an associated incubator change as well
to ensure the undercloud/overcloud now use em1.

Change-Id: I4b4bb7b6a25b058eebe889fd8ce1a403aaf193fd
2014-03-24 09:20:40 -04:00
Jan Provaznik
2f24062753 Adds libmariadb-dev package mapping
libmariadb-dev is named mariadb-devel on Fedora. mariadb-devel
package is needed for upcoming mariadb element.

Change-Id: Ib62071a964a4449c4e32ef1646ab7a0fb0f5f7b7
2014-03-24 10:39:43 +01:00
Dan Prince
8378072446 rename udev.rules to dhcp-all-interfaces-udev
Renames to udev.rules files to avoid potential
install.d collisions in DIB.

Change-Id: I2d70aa8b6e3e5fe957cb81c57f378d9623809c03
2014-03-21 15:13:35 -04:00
Dan Prince
576fa64abf serial-console: Use udev rules to startup getty
Update the systemd serial port element implementation
so that it uses udev rules. Much nicer than
hard coding ttyS0 and ttyS1.

The udev rule only adds real serial device types
(i.e. == 4). See:

  define TTY_DRIVER_TYPE_SERIAL 0x0003

from include/linux/tty_driver.h.

Change-Id: I5d7de4815fd09c01693b7da4b8949f22fee20745
2014-03-21 15:01:39 -04:00
Ben Nemec
81957625e7 Set +x on executable files
Change-Id: I6007aa3f4e6326b1c7030ad0463c7e8f49fbd507
2014-03-20 15:38:30 -05:00
Jenkins
94805549d8 Merge "Add RHEL 7 image element" 2014-03-20 11:33:24 +00:00
Jenkins
bc3950c7a5 Merge "Use redhat-common in fedora element" 2014-03-20 02:13:25 +00:00
Jenkins
62f8f4b120 Merge "Add redhat-common element" 2014-03-20 02:10:52 +00:00
Dan Prince
00d853e5fd DHCP: make udev rules want dhcp-interface@.service
Updates the dhcp-all-interfaces element to fix a race
with the recent udev rules implementation on Fedora.

With the new approach we make the udev rule want (require
to startup) a generic dhcp-interface@.service template which
can be started individually for each interface that is
discovered.

The dhcp-interface@.service is setup such that it:

1) It calls dhcp-all-interfaces <iface> directly with
 a pre-exec script. This creates the ifcfg file right
 before we need it but avoids the case where network.service
 might get greedy and try to start it itself.

2) Only runs if the ifcfg script doesn't already exist. This
 is important because we only need to bootstrap the DHCP configs...
 Once they exist the network.service will take care of starting them
 on reboots, upgrades, etc.

3) On initial boot ensure that the initial DHCP interfaces come
 up after network.service. Since we really only want
 dhcp-all-interfaces to help bootstrap that haven't already
 been configured this seems reasonable.

4) We also try to ensure that cloud-init
 comes up after the DHCP interfaces. Cloud init has a decently
 long timeout that this wasn't a functional problem but it keeps
 log file spew down.

Change-Id: I71b026f027182aad49c3435bb903e5e38e524685
Closes-bug: #1294803
2014-03-19 14:33:14 -04:00
Jenkins
39964b975e Merge "Update openSUSE package mapping for libffi-dev" 2014-03-19 01:18:17 +00:00
Ben Nemec
3b77e1b3c5 Add RHEL 7 image element
This is being added as a separate element because RHEL 7 is too
different from either RHEL 6 or Fedora to share all of the
configuration they do.  It uses the redhat-common element for
pieces that are duplicated.

Some current limitations of the element:
-RHEL 7 is currently still in beta, so final image locations are
 not available.  This currently defaults to the RHEL 6.5 image,
 but that will need to be overridden using the DIB_* env vars.
-There are additional tripleo-image-elements changes that will be
 needed to be able to use this for building tripleo images.
-Open vSwitch packages are not currently available in the official
 RHEL 7 repos.
-RHEL does not support qemu without kvm acceleration, so at this
 time it cannot be used as a compute node for virtualized testing.

Change-Id: I705fd475303576525a27ce6801c673b5721792c9
2014-03-17 16:14:41 -05:00
Ben Nemec
94f07c5962 Use redhat-common in fedora element
Have the fedora element use the common steps in the redhat-common
element.

Change-Id: Ic71b11c03b5c3868cc9e82e049f2700c1b67263a
2014-03-17 16:14:41 -05:00
Ben Nemec
ed15edf165 Add redhat-common element
Add an element intended for use in both Fedora and RHEL.  This
allows them to share install steps that are common to both.

Change-Id: Ie4e820a7b777b8701514351b1f802cfe57c3812e
2014-03-17 16:14:36 -05:00
Jenkins
5af4c268f9 Merge "Support adding DHCP interfaces one at a time." 2014-03-17 19:52:41 +00:00
Jenkins
f2578f2614 Merge "Move install type enablement into base element" 2014-03-17 13:07:07 +00:00
Dan Prince
f10e614579 Support adding DHCP interfaces one at a time.
Refactors dhcp-all-interfaces.sh so that if an optional
INTERFACE argument (the first argument) is passed to the script
it only inspects that single interface. If no argument is
passed then the previous default behaviour is used which
causes all interfaces to be inspected.

To avoid a collision with the previous $1 we move to using
$FLOCKED for the exec flock command which runs on distributions
using ENI.

Also sets PATH so that the commands within the script
can all be found if it isn't set properly (/sbin/ip, /bin/cat, etc.)

This is a move towards using udev rules to add these types
of interfaces automatically.

Change-Id: I3ec8fd2cc2071bfc6943c744ca619e31b71146fc
2014-03-14 13:30:17 -04:00
Jenkins
3f9299e12b Merge "RHEL Package maps for build-essential, python-dev and libz-dev." 2014-03-14 17:03:57 +00:00
James Slagle
b4dfa6cb90 Move install type enablement into base element
Move whether the package or source install type is enabled out of the
source-repositories element and into the base element.
source-repositories wasn't a great fit for this functionality to begin
with.

Specify the install type for an element via the
DIB_INSTALLTYPE_<install_dir_prefix> environment variable.

Additionally with this approach, any new install type can be added
in an element, without having to update source-repositories or anything
in dib.

You could just write your install type implementation under
nova-foo-install, then define DIB_INSTALLTYPE_nova=foo in your
environment, and the scripts under nova-foo-install would get run during
the image build.

Source installs (any scripts under <install_dir_prefix>-source-install)
is the default install type for all elements.

Change-Id: I9414aca360c41e030e27d3d0c0a52d9d8e13d8b1
2014-03-14 12:25:11 -04:00
Alexander Gordeev
7d50c04bf7 Remove hardcoded /tftpboot/ from token's tftp path
Since file to be fetched from the root tftp directory it shouldn't
contain any hardcoded path. Additionaly it eliminates bearing with
map-file containing regular expressions for tftp path replacement.

Change-Id: Iee1672834f735d7dfefce43000540522e1d053b9
Closes-Bug: #1291533
2014-03-14 18:59:26 +04:00
Jenkins
14140ae180 Merge "Add apache2 mod_wsgi pkg map for suse" 2014-03-14 14:02:52 +00:00
Jenkins
09ad2ae482 Merge "Extract move cache logic to a function" 2014-03-14 08:08:24 +00:00
Om Kumar
dd7b7765e6 RHEL Package maps for build-essential, python-dev and libz-dev.
Some of the tripleo-image-elements were failing for RHEL due to lack of
build essential, python-dev and libz-dev.

This commit should fix those failure.

Change-Id: I080f9601faedb3259deada5cfbda7d00d3f13eb9
2014-03-14 08:54:48 +05:30
James Polley
ca95cf9f70 Extract move cache logic to a function
We use the same logic twice - extract it to a function.

Change-Id: I32a257663de37d5f3588c91e4164abceb12ee80d
2014-03-14 09:36:52 +11:00
Jenkins
bae43c91c6 Merge "98-source-repositories tries to return from script" 2014-03-13 16:17:51 +00:00
Jenkins
c9282cf2ee Merge "Better apt-sources docs." 2014-03-13 15:13:34 +00:00
Jenkins
7b0119808d Merge "Create a git manifest from source-repositories" 2014-03-13 15:11:40 +00:00
Jenkins
12463106c8 Merge "Enable extlinux support for (non-Ubuntu) Debian platforms" 2014-03-13 03:34:18 +00:00
Dan Prince
6f8f6b049b baremetal element: Enable stable interface names
By default most cloud images have disabled the
udev rules which give us stable network interface names. While
this is a reasonable default for something like EC2 (the target
for these images) this is very bad behavour on bare metal
and can cause a "musical NICs" situation to occur where
on reboot the NIC names get swapped.

In this commit we re-enable stable interface naming by
removing the dev nulled rules softlink and installing
the biosdevname package. Once this is done interface
names should again show up as em1, em2 instead of
the old eth0, eth1.

We also remove some the common, statically configured
eth0 config files on some distributions. Equivalent
files (if needed) may be auto-generated by using
the dhcp-all-interfaces element.

Change-Id: Idd67977342719e2f295e2fa2c0ed6cfa8602171a
2014-03-12 16:48:48 -04:00
Jenkins
66cf95c321 Merge "Fix unbound variable in debian element" 2014-03-12 10:59:46 +00:00
Jenkins
6dd90ae476 Merge "Add libaio1 to libaio pkg map for fedora" 2014-03-12 10:59:00 +00:00
Jon-Paul Sullivan
179aa31d41 Fixup all occurrences of REPONAME for replacing '-'
There was a single REPONAME variable missed in change 76679.
Fix it up.

Change-Id: Ibc6cd59cb3f3d949fd7679ee18d85c7574d9acd5
2014-03-11 13:13:10 +00:00
Jenkins
ffdd57b8a5 Merge "Replace more then just "-" in REPONAME" 2014-03-11 12:51:31 +00:00
Jenkins
d0ba5a9dfd Merge "Additional swift storage service mappings" 2014-03-11 12:48:21 +00:00
Jon-Paul Sullivan
e4c43e608c Create a git manifest from source-repositories
As git repositories are copied into the image make a note of their
details and add them to a manifest on the build system.

This allows the code used in building an image to be found after
the image build is completed without needing to open the image up
for inspection.

Change-Id: I7dbe9e163ad38a418cf2869a81e720de2c27dfb1
2014-03-11 12:38:52 +00:00
Gregory Haynes
7b550e3c96 Add apache2 mod_wsgi pkg map for suse
Horizon installs libapache2-mod-wsgi which is called apache2-mod_wsgi on
suse.

Change-Id: Id80b6f9bd2131906a25722e515aa9f14720f323b
2014-03-10 19:44:27 -07:00
Dan Prince
ef379f05e4 98-source-repositories tries to return from script
In 8b2325118f we added a line
so that 98-source-repositories tries to return from the top
level script (not from within a function).

Also, remove the return 1 within the function as well
because we just want to continue in these cases.

Change-Id: I66eddc12208b278594a0a8d8676c38d72045ca75
2014-03-10 17:21:20 -04:00
Gregory Haynes
0bd84775e7 Add libaio1 to libaio pkg map for fedora
The libaio1 package for ubuntu is called libaio on fedora

Change-Id: I81c7baba4ab50e2fa05a950b0773cfe07bb0b3e9
2014-03-10 12:14:15 -07:00
Jenkins
1080b40368 Merge "Add rsync to the package list used by debootstrap" 2014-03-10 19:02:37 +00:00
Jenkins
e83d4dcbb2 Merge "Bash eval the lines in source-repository scripts" 2014-03-10 18:55:06 +00:00
Richard Su
f4c8075768 Additional swift storage service mappings
Change-Id: I07ad7a5b175bf7730e9425a66122c63477fb5e21
2014-03-07 09:16:11 -08:00
Ralf Haferkamp
5044113fe8 Update openSUSE package mapping for libffi-dev
Change-Id: I9c5ec5bd839a51a5292be37a7696499554c6ae16
2014-03-06 10:51:05 +01:00
Robert Collins
e5f120274b Better apt-sources docs.
Minor layout tweaks, fix markdown syntax errors and mention the new
SEED_DIB_EXTRA_ARGS variable.

Change-Id: I18104c80e64d06b084df57ee5adc15519bc3ddf6
2014-03-06 13:29:13 +13:00
Ryan Brady
d96740dc8a Add nfs-common package mapping
NFS client utilities for Debian are found in nfs-common, and the
Fedora equivalent is found in nfs-utils.  The NFS server components
are already accounted for in the nfs-kernel-server mapping.

Change-Id: I2a43208f54b7fb625c239ce22231c43e194a97ed
2014-03-05 14:31:28 -05:00
Derek Higgins
0226cf2246 Replace more then just "-" in REPONAME
Looks like shells only support alphanumeric characters and "_"'s in
environment variables. We were substituting "-" characters but in
order to be able to set overrides in projects with names containing
other characters we need to substitute more, I'm looking at you
oslo.config.

Change-Id: I3e2b1b0bc5871e4ec4ffd8117906cd077aa2cb0d
Co-authored-by: James Polley <jp@jamezpolley.com>
2014-03-06 04:56:50 +11:00
Jenkins
5bcc1365e3 Merge "Alphabetize openSUSE services dictionary" 2014-03-05 09:16:07 +00:00
Jenkins
9edd996056 Merge "Alphabetize openSUSE packages dictionary" 2014-03-05 09:16:06 +00:00
Jenkins
3f4e44436b Merge "Alphabetize Fedora services dictionary" 2014-03-05 09:14:01 +00:00
Jenkins
af1369ee99 Merge "Alphabetize Fedora packages dictionary" 2014-03-05 09:13:55 +00:00
Jenkins
e602863642 Merge "Replace use of show-ref with name-rev" 2014-03-04 18:05:46 +00:00
Jenkins
d55d54d9cf Merge "Fix syntax error in GRUB_OPTS env var handling" 2014-03-04 18:04:29 +00:00
Gregory Haynes
6a6d913459 Bash eval the lines in source-repository scripts
This will allow us to add environment variables to source-repository
scripts. Useful for things like arch-specific download urls.

Change-Id: I4d046825a317dc88db3d7673ad261cedacd1a104
2014-03-03 16:37:43 -08:00
Jenkins
9595197474 Merge "Improve usability of the source-repositories cache" 2014-03-04 00:21:52 +00:00
Jenkins
5b7f6dcc1d Merge "Fix spelling error in "vm" element README.md" 2014-03-03 22:12:12 +00:00
Jenkins
27421cb257 Merge "Add $EXTRA_ARGS back to yum call" 2014-03-03 18:37:17 +00:00
Jonathan Brownell
9c05300728 Fix spelling error in "vm" element README.md
Change-Id: I7b5e38277843da1ee6496292a7d6ff147c97cf31
2014-03-03 09:58:12 -08:00
James Slagle
30d1668c03 Add $EXTRA_ARGS back to yum call
This got removed accidentally in a recent consolidation of
install-packages.  Adding it back so that -d support works again.

Closes-bug: #1287142

Change-Id: If17e613bc9bc0f808517edfa1506858d3b9dce54
2014-03-03 17:42:18 +00:00
Perry Myers
b9e77477bb Update the image name for RHEL Guest Image
The RHEL 6 Guest Image has been updated with a new release that
addresses a number of bugs.  The diskimage-builder element that
references this file needed to be updated to reference the correct
image name.  In addition, some notes to help users download the
image from RHN have been added to the README.

Change-Id: I3c9e64a1887afd9c0b370d70eff4b7f9598cebd1
Closes-bug: launchpad-bug-1286568
2014-03-01 12:23:02 -05:00
Newell Jensen
1d3ceef5c2 Alphabetize openSUSE services dictionary
This patch alphabetizes the openSUSE services dictionary in
map-services.

Change-Id: Ib3b596e7c25475ecdc2a6bbeb98b84bb60e03ac3
2014-02-28 10:12:03 -08:00
Newell Jensen
80e07afab4 Alphabetize openSUSE packages dictionary
This patch alphabetizes the openSUSE packages dictionary in
map-packages.  The openstack mappings were left
at the bottom as it looked deliberate.

Change-Id: I3661fba4d4ed68c836893e21fb4a8728c691af20
2014-02-28 10:10:22 -08:00
Newell Jensen
1646d30d1d Alphabetize Fedora services dictionary
This patch alphabetizes the Fedora services dictionary in
map-services.

Change-Id: If35b0249c33e553937e7016c2480aee45f1c7353
2014-02-28 09:50:46 -08:00
Newell Jensen
8896af2cc7 Alphabetize Fedora packages dictionary
This patch alphabetizes the Fedora packages dictionary in
map-packages.  The openstack mappings were left
at the bottom as it looked deliberate.

Change-Id: I4874c19f2a6826062874698e8f61bc6e2685ab19
2014-02-28 09:47:56 -08:00
Jonathan Brownell
1eabcdf35f Enable extlinux support for (non-Ubuntu) Debian platforms
Extlinux bootloader configuration in "vm" element requires vmlinuz and
initrd.img files in /boot/ with "generic" suffix. When these don't exist,
bootloader configuration should fall back to using whatever does exist.

Change-Id: I79d426e8f008e9f23db899f0b8f8cf2f23643e28
2014-02-28 06:56:41 -08:00
Jon-Paul Sullivan
41f1ca2ad4 Replace use of show-ref with name-rev
Testing showed that show-ref did not accurately determine whether a
git repository contained the given reference.  Testing with name-rev
showed that it did.

Change the HAS_REF determination appropriately to avoid unnecessary
cache updates when using fixed references.

Change-Id: Iece213348516358af84417807f8dd36e959139eb
2014-02-28 14:35:07 +00:00
Jenkins
e5afa4d6f9 Merge "Add NFS package mapping" 2014-02-28 10:47:24 +00:00
Jenkins
4a45704edf Merge "Enable simple modification of git repo location" 2014-02-28 04:32:29 +00:00
Jenkins
4dfd81a70b Merge "Generalize install-packages for yum" 2014-02-28 04:20:17 +00:00
Jenkins
142dfad122 Merge "Enable custom apt.conf in apt-conf element" 2014-02-28 04:17:51 +00:00
Jonathan Brownell
2189b627de Fix syntax error in GRUB_OPTS env var handling
Reference to ${GRUB_OPTS:""} in 'vm' element causes syntax error
if GRUB_OPTS is set. Fix by changing to ${GRUB_OPTS:-""}.

Change-Id: Iae3ee8b7c4064c92d0cfc1b5a8caa22e53d6d112
2014-02-27 13:53:07 -08:00
Robert Collins
2843e8a802 Improve local-config proxy handling.
We were applying proxy settings after apt-get install runs are done
in the Ubuntu element, which made it ineffective. Secondly, we were
not applying no_proxy settings to apt, which caused it to fail in
corporate settings. More explicit control may be facilitated in future
but local-config is a DTRT tool, and so we should help it DTRT.

I think I've correctly setup Zypper for this, and I have no idea
how to make the same improvement for Yum (and also Yum currently
doesn't set HTTPS proxies, which may lead to similar reports there).

Change-Id: Idbb9781d64d44b717ea22a25429383fa45d84148
2014-02-28 00:01:11 +13:00
Jon-Paul Sullivan
852cec3789 Enable custom apt.conf in apt-conf element
Allow DIB_APT_CONF to be set to the apt.conf file to be inserted
into the built images.

Change-Id: I5d148ae7286a93e81b3e984c94ba4f089d3a3280
2014-02-26 19:10:23 +00:00
Jonathan Brownell
263e0310dc Add rsync to the package list used by debootstrap
Debian builds fail due to missing rsync in the baseline set
of packages that debootstrap defaults to. Rsync is used by a
variety of tripleo-image-elements and should be included in
disk images by default.

Change-Id: I8d83a53dfab279075e11f9825f15ee960395dd17
2014-02-26 10:53:55 -08:00
Jon-Paul Sullivan
0edfcf6587 Enable simple modification of git repo location
Add the DIB_GITREPOBASE variable to the source-repositories element
to enable global changing of git repository location.

Change-Id: Icfac5e103fce6e5a3f1a2db094144a0ed89fcc33
2014-02-26 13:52:03 +00:00
Jenkins
61d474f2cd Merge "Update pypi element to suggest pypi-mirror" 2014-02-26 08:52:19 +00:00
Ryan Brady
90d416e857 Add NFS package mapping
In Fedora, the package is nfs-utils and in Debian the package is
'nfs-kernel-server'.

Change-Id: I34f793bb6eb43f749bf383a082e90371f8e28219
2014-02-25 19:28:06 -05:00
Jon-Paul Sullivan
8b2325118f Improve usability of the source-repositories cache
* Rename the cache directory for sources

Make the cache directory name match that of the element that creates
it.  This makes it easier to find and more logically implies what
element created the cache directory.

* Add REPONAME to repository cache directory

For better usability add the reponame to the directory created
to cache it.

* Add migration code

Move pre-existing cache directories of the old name to the new name.

Change-Id: Ic62f19acb1746888ccbdf95eebf6e653f3e66357
2014-02-24 20:42:48 +00:00
Ghe Rivero
48e6ceebe9 Fix unbound variable in debian element
Change-Id: Ie4bf86fa0ce387a55f1c390f58e58d17267ae61d
2014-02-24 10:19:30 +01:00
Steve Kowalik
a84611d766 Replace security.ubuntu.com when setting mirror
The current method to rewrite the mirror URL in the ubuntu element will
only rewrite archive.ubuntu.com, which leaves the security URL alone.
This is probably not intended for people who are creating images behind
firewalls.

Change-Id: I54a867e0e9d5a7c94324a5c00ff1a83b4e6e4524
2014-02-24 11:00:24 +11:00
Ben Nemec
004474e93b Generalize install-packages for yum
All of the yum-based install-packages scripts are doing essentially
the same thing, so let's use one script for all of the elements
that depend on the yum element.

Change-Id: I49e8c9b44e41bcf4cb9fa820e8a9179754694a97
2014-02-21 12:00:24 -06:00
Jenkins
6360b46229 Merge "Add 00-fedora-fixup-vim" 2014-02-21 14:31:54 +00:00
Jenkins
86cd539496 Merge "Permit using arbitrary PyPI urls." 2014-02-21 04:43:26 +00:00
James Slagle
959aed3f86 Remove accidental merge marker
Change-Id: If98066c418f64be9f1bdce16558969d800e602c0
2014-02-20 15:10:32 -05:00
Dan Prince
4f795b91ed Add libvirt-bin -> libvirtd to map-services.
We'll need this soon for the Nova TripleO image element.

Change-Id: I9f4284aa503f422828e2ccb56597852b5a0c9591
2014-02-20 14:38:56 -05:00
Jenkins
66ae41756b Merge "Pep8/Pyflakes fixing" 2014-02-20 04:28:41 +00:00
James Slagle
4072ae232f Add 00-fedora-fixup-vim
We need to update vim-minimal, otherwise when rabbitmq-server gets
installed and pulls in vim-common, we run into:

https://bugzilla.redhat.com/show_bug.cgi?id=1066983

Change-Id: I910cd6c5c5fcfc6f6780b86029b1b4e660dd8d05
2014-02-19 08:32:25 -05:00
Clint Byrum
d03b14b4eb Update pypi element to suggest pypi-mirror
jeepyb no longer contains pypi-mirror.

Change-Id: Ifa905181119b30b1184dde53deaf0a97e2cb2ab2
2014-02-19 12:10:38 +00:00
Robert Collins
1adf3a377e Permit using arbitrary PyPI urls.
The pypi element is cool, but some folk have local network mirrors
which we should permit them to use.

Change-Id: Ie840ad1184e72b0e01966eee0298cfd6511b6c19
2014-02-19 14:05:31 +13:00
Dirk Mueller
0ab2a1300f Pep8/Pyflakes fixing
Just avoiding the error popups in the editor that way.

Change-Id: Ic0cb903dfb0e9eff6b12d004da720919f6f1a009
2014-02-17 22:37:34 +01:00
Steve Kowalik
98fa6c882f Shift debian element to DIB_DISTRIBUTION_MIRROR
The ubuntu element supports simple replacement of sources.list by using
the DIB_DISTRIBUTION_MIRROR environment variable. Drag the debian
element into line by supporting both DIB_DEBIAN_MIRROR and the new shiny
DIB_DISTRIBUTION_MIRROR.

Change-Id: I9d5f8d1e3251965b34e55929182aa601a524fe8f
2014-02-17 14:16:25 +11:00
Jenkins
e9b4ec2104 Merge "Teach cache-url to handle file:// URIs." 2014-02-14 12:23:40 +00:00
Robert Collins
1dfd4b3e44 Revert "Add Fedora DHCP interfaces via udev rules."
This reverts commit 201c9e8527.

This depended on the revert for one-at-a-time.

Change-Id: I05f1f85b8f13a1eea3d5e4b144ff92e0e791bdac
2014-02-14 14:43:09 +13:00
Robert Collins
39e6f7a5c4 Revert "Support adding DHCP interfaces one at a time. "
This reverts commit a1b469b10b.

This broke testenv deployments - it does not yet work on Ubuntu.

Change-Id: I0f74abc6b99da4b8cabca8ed673c606bae7de0e1
2014-02-14 14:42:58 +13:00
Chris Jones
fde4572764 Teach cache-url to handle file:// URIs.
We can now support file:// URIs in source-repositories files and other
places, by ignoring curl's inability to determine an HTTP status code
for them.

Change-Id: Ie226ce05ecb912b23cedc73fd7ba53c0b9c0fe35
2014-02-13 19:43:50 +00:00
Jenkins
b4e2968aea Merge "Add Fedora DHCP interfaces via udev rules" 2014-02-13 16:44:12 +00:00
Jenkins
0d52928a53 Merge "Support adding DHCP interfaces one at a time." 2014-02-13 16:43:47 +00:00
Jenkins
14ad0df6e7 Merge "Don't hardcode environment.d" 2014-02-13 08:45:43 +00:00
Dan Prince
201c9e8527 Add Fedora DHCP interfaces via udev rules
Updates the dhcp-all-interfaces element so that
we add new DHCP interfaces using a udev rule
instead of a systemd service.

The previous approach (using the systemd service)
was proving to be problematic when used with
the new Fedora constistent network naming
convention rules (em1, em2, etc.). We aren't using
these device names as a default yet... but we will
need to soon and when we do udev rules seem to be the
best way to avoid racy behaviour when calling
dhcp-all-interfaces.sh from the systemd service.

Change-Id: I87e0aed1f34718e896bd414388886a1f1073b0c0
2014-02-12 12:00:50 -05:00
Dan Prince
a1b469b10b Support adding DHCP interfaces one at a time.
Refactors dhcp-all-interfaces.sh so that if an optional
INTERFACE argument (the first argument) is passed to the script
it only inspects that single interface. If no argument is
passed then the previous default behaviour use used which
causes all interfaces to be inspected.

Also sets PATH so that the commands within the script
can all be found if it isn't set properly (/sbin/ip, /bin/cat, etc.)

This is a move towards using udev rules to add these types
of interfaces automatically.

Change-Id: Ia482c1d3ddce0f0d8d77f9bc3ac76d6924640715
2014-02-12 11:57:56 -05:00
Jenkins
eab085af02 Merge "ifquery doesn't exist on Fedora" 2014-02-12 03:11:43 +00:00
Jenkins
983f918804 Merge "Make the MIRROR_TARGET directory if it didn't exist" 2014-02-11 14:38:10 +00:00
Jenkins
0a678da6b6 Merge "Remove unneeded service mapping for mysql on openSUSE" 2014-02-11 14:17:37 +00:00
James Slagle
f760f11050 Don't hardcode environment.d
Don't assume environment.d is always under /tmp/in_target.d. This makes
dib-run-parts more flexible, and less specific to diskimage-builder. For
instance, dib-run-parts is already used by os-refresh-config, but
/tmp/in_target.d/environment.d is never going to exist when it's called
by os-refresh-config.

This is useful b/c elements can now install os-refresh-config scripts
under /opt/stack/os-config-refresh/environment.d to influence how
further scripts are run. Specifically, the OpenSuse packages prepend the
OpenStack user accounts with "openstack-". Instead of checking for which
users exists with an if/else in all the os-refresh-config scripts that
need to do user related things, we can just update the scripts to use
$NOVA_USER, etc. The OpenSuse element can then install a file under
/opt/stack/os-config-refresh/environment.d to set NOVA_USER to
openstack-nova. We could have files that declare defaults as well within
each specific element, or just set a default variable at the top of each
os-refresh-config script.

Change-Id: Iadbfad995da657e2965fd55fc4ba3a88138b4cfc
2014-02-11 08:33:45 -05:00
Jenkins
014e3bf875 Merge "Adjust neutron package install for Fedora" 2014-02-11 09:39:54 +00:00
Jenkins
e1d58046f0 Merge "Add lsof package to all Fedora images" 2014-02-10 12:32:05 +00:00
Jenkins
9295162946 Merge "Add more package name mappings for openSUSE." 2014-02-10 10:49:19 +00:00
Dirk Mueller
af3cf11b27 Add more package name mappings for openSUSE.
Adjust for naming difference on openSUSE.

Change-Id: Ieda36c14b94add4d9877a25224b15563c648d122
2014-02-07 22:56:12 +01:00
Dan Prince
72ca729c67 Add lsof package to all Fedora images
Really useful when debugging.

Change-Id: I0862ad2b97f5fa061aea592f4a267856ac124f65
2014-02-07 16:29:37 -05:00
Dan Prince
01e25c378b ifquery doesn't exist on Fedora
Updates dhcp-all-interfaces so that we avoid using
ifquery on Fedora to determine if an interface exists.

Adds a new config_exists function which simply looks for
the ifcfg config file on distro's that use netscripts.

Change-Id: Ie55524b83820fe4fab28cc9d3f7e08ca2e42c182
2014-02-07 13:33:35 -05:00
Ralf Haferkamp
b3ab436a62 Remove unneeded service mapping for mysql on openSUSE
The service is called mysql on openSUSE and that's what the mysql element uses.
Change-Id: I73cb6a1c06c3096aa8a9f515fd79014e5b2962d2
2014-02-07 11:15:09 +01:00
Shane Wang
4aeee175d8 Fix misspellings in diskimage-builder
Fix misspellings detected by:
* pip install misspellings
* git ls-files | grep -v locale | misspellings -f -

Change-Id: I42acbcce7611ff3e2e120168acccc518299c2c42
Closes-Bug: #1257295
2014-02-07 14:42:45 +08:00
Dirk Mueller
abc3bcd2f3 Adjust neutron package install for Fedora
With https://review.openstack.org/#/c/70721 installing
the dhcp-agent subpackage was introduced, which is needed
for openSUSE. It seems on Fedora this is part of the main
package, so we need to map it back to that one.

Change-Id: I80f8412d291b3571d220fd26cfece86a03479440
2014-02-06 23:11:56 +01:00
Derek Higgins
c2ccfa6504 Make the MIRROR_TARGET directory if it didn't exist
Just adding an element shouldn't make a disk image build crash, even if
we're not using the element for its intended purpose.

Change-Id: I2ec91ce4975b3b0deee7c85bb223f854c694553f
2014-02-06 14:10:42 +00:00
Jenkins
5964fec479 Merge "Update openSUSE package mappings for OpenStack" 2014-02-06 12:45:41 +00:00
Ghe Rivero
03a7c4a117 Add tgt service mapping for Fedora
tgt service is called tgtd in Fedora
(https://review.openstack.org/#/c/71466)

Change-Id: Ic345b4a228cd665063a6753d05b3a7e29796039f
2014-02-06 08:10:45 +00:00
Jenkins
22cc3900a5 Merge "Add mysql mapping for Fedora" 2014-02-05 22:50:21 +00:00
Dirk Mueller
f76873fd61 Update openSUSE package mappings for OpenStack
There are some subtle naming differences between
Fedora and openSUSE, adjust.

Change-Id: I286e656ad980443abe0d578e9390c2a989cfdee7
2014-02-05 20:32:27 +01:00
Jenkins
79ab588592 Merge "Update map-services for Fedora" 2014-02-03 14:19:20 +00:00
James Slagle
e7118cec1d Update map-services for Fedora
Additional service names added to map-services for cinder and swift.

Change-Id: I0c4afc505ccb80d7e2e397614792d74b3294264a
2014-01-30 20:22:07 -05:00
Ana Krivokapic
609746f1f3 Add Fedora packages mappings for snmpd
Change-Id: I61ee59ee6e9ffc8391dbdd3e459df4f0cb369801
Closes-Bug: #1272234
2014-01-30 18:18:07 +01:00
Jenkins
97c7e8fd5e Merge "Add ability to use local cloud image" 2014-01-30 15:51:45 +00:00
Jenkins
5658b85d8a Merge "Add package map for stunnel4" 2014-01-30 10:23:15 +00:00
Ralf Haferkamp
28e0d2dd98 Add mysql mapping for Fedora
To be able to use the os-svc-* helpers for mysql. (See:
https://review.openstack.org/#/c/68278/)

Change-Id: I0af105f6d4bc02a165c5004859c1823f508d43ec
2014-01-30 11:18:24 +01:00
Jenkins
f43f0eea85 Merge "Skip relabel unless SELinux is enforcing" 2014-01-30 08:03:01 +00:00
James Slagle
dfde5c434b Add package map for stunnel4
stunnel4 is called stunnel on Fedora/RHEL.

Change-Id: Ic27692e485792c87a9e54c5baa6b7a75410e8cf2
2014-01-28 19:47:32 -05:00
James Slagle
15960f01cd Add ability to use local cloud image
Adds the ability to set $DIB_LOCAL_IMAGE to use as the base cloud image
for a Fedora image build. There are many repetitve tasks that are done
every image build. With this change you can build an image with the
fedora and vm element and then reuse the resulting image as input to
future image builds. This greatly reduces future image build times.

For instance 99-up-to-date is already taking almost 2 minutes (even with
rpm downloads already cached) for Fedora 20, and is only going to keep
taking longer. By having a local up to date Fedora cloud image, this
time can be saved on each image build.

There is one minor change to support this in that /tmp/grub needs to get
cleaned up at the end of image builds so that the image can be reused.
Plus, there is no reason for it to stick around anyway.  (didn't think
this was worth a seperate commit).

Change-Id: Ic74d138da922ecc99c38c27f105170d90009a84a
2014-01-28 11:01:30 -05:00
Jenkins
fb5a25f379 Merge "Fix tftp mapping on openSUSE" 2014-01-27 12:22:29 +00:00
Jenkins
1420386541 Merge "Add bash as a dependency to the deploy ramdisk" 2014-01-27 10:26:44 +00:00
Jenkins
d2a0098d01 Merge "Use /usr/bin/env, not /bin/env" 2014-01-27 10:15:34 +00:00
Dirk Mueller
d8a045c813 Add a service mapping for openSUSE
Change-Id: I90fcb217e39ac5ef9d5e821a9dd59a1283419843
2014-01-27 10:17:00 +01:00
Jenkins
82080313db Merge "Mount root filesystem readonly during boot" 2014-01-27 08:56:10 +00:00
Ralf Haferkamp
cb26d4478c Add bash as a dependency to the deploy ramdisk
Otherwise some dependend libraries might be missing in the ramdisk. E.g.
on SUSE bash is dynamically linked against libreadline.

Change-Id: I8b36bee6aa5a1e1da419e748e8bba046c29f3ae2
2014-01-27 09:32:24 +01:00
Jenkins
b948d4a23f Merge "Fix ramdisk element for openSUSE" 2014-01-27 02:45:35 +00:00
Dirk Mueller
6ecc8ab766 Fix tftp mapping on openSUSE
the atftp package is not compatible with what TripleO expects

Change-Id: I3309de2bb445bba1ab5ed000e87583387b519f2d
2014-01-24 17:46:10 +01:00
Dirk Mueller
0c2c2ab2d9 Use /usr/bin/env, not /bin/env
/usr/bin/env is more portable (/bin/env does not exist on SUSE).
Also address minor nit on review about python 3.x compatibility.

Change-Id: I6bc1a579bb43664f4d2be35a96f45189a6df0e27
2014-01-24 15:55:39 +01:00
Jenkins
fac607e8d8 Merge "Rename generate-interfaces-file.sh..." 2014-01-23 21:58:31 +00:00
Jenkins
6a50d3cdd6 Merge "Only configure DHCP for real interfaces" 2014-01-23 21:55:13 +00:00
Jenkins
8810011028 Merge "Add map-services" 2014-01-23 21:49:53 +00:00
Dan Prince
5da1f1324b Rename generate-interfaces-file.sh...
Rename generate-interfaces-file.sh to dhcp-all-interfaces.sh
so that it is easier to find/remember in the $PATH on a deployed
image.

Also, on some distros the script actually generates many files
so the previous name was a bit confusing.

Change-Id: I7152fa7c28e8ade251311da2cd5f75972423b66c
2014-01-23 16:38:41 -05:00
Dan Prince
f58f859303 Only configure DHCP for real interfaces
Updates the generate-interfaces-file.sh script in
the dhcp-all-interfaces element so that we only
add interfaces that have real MAC addresses.

The generate-interfaces-file.sh script is run early enough
in the boot process (before OVS is initialized) that this
isn't usually a problem unless you execute it manually by hand
after booting. Then you'll end up with network/DHCP
configs for all of your OVS bridges, etc. This
patch avoids configuring all of the virtual interfaces
which have generated MAC addresses.

Change-Id: I7a705084aa5b11305ac0ec5ca37fd2e87a2ae8b7
Closes-bug: 1239479
2014-01-23 16:37:44 -05:00
James Slagle
c53d58dd11 Add map-services
map-services is used by os-svc-restart from Change-Id:
I15eb2a5db4b0a08e1fb40bda640cd8f224939a92

map-services is not only distro specific, it also needs to be able to
handle different service names for a given distro based on source vs
package installs, since the service names may be different. This is done
via a simple check if the requested service is defined, if it is, we
print the requested name, otherwise, we print the mapped name.

Currently only implemented for Fedora. Support for other distros is
easily implemented just like map-packages.

Change-Id: Ie7b2dcfa7cabd887d5c212df110d90f9d00a7f65
2014-01-23 15:32:27 -05:00
James Slagle
ea257c96d9 Skip relabel unless SELinux is enforcing
The SELinux relabel of the filesystem is taking almost 2 minutes and
isn't needed unless you actually plan to run with SELinux enforcing.
Plus, it appears to "leak" out of the chroot, referencing filesystems on
partitions that aren't even mounted in the chroot.

Note you just can't use getenforce or selinuxenabled here to get the
state of SELinux because those commands are not accurate inside a
chroot.

TBH, a downside of this is that if someone goes to try to enable SELinux
in an image where it was built with it not enabled, the file contexts
are going to be wrong. So they'd need to relabel themselves at that
point. However, this saves me quite a bit of time during image builds,
so I thought I'd submit to get other folks opinion on it.

Change-Id: I2132060d573fc93cf974f3560fdc651ff8ba38b4
2014-01-23 15:29:29 -05:00
Jenkins
1e04079d4f Merge "Fix kernel/initrd extraction for SUSE based distros" 2014-01-23 17:26:01 +00:00
Derek Higgins
2c8d4b2271 Mount root filesystem readonly during boot
If creating an image of a disto without grub2 extlinux is instead used,
extlinux was being configured to mount the root filesystem as
read/write which in turn causes e2fsck to fail to test the filesystem,
on RHEL 6.5 this causes the boot process to fail.

Change-Id: I07859e0df9a2bc1ddd8c5f2ed4509ba14312e140
2014-01-23 16:03:03 +00:00
Ralf Haferkamp
de2becc9ff Fix kernel/initrd extraction for SUSE based distros
Change-Id: Ib4c8ddfe3592242ce684676e9dcb6428466ca66e
2014-01-23 15:30:52 +01:00
Ralf Haferkamp
5fb556f44d Fix ramdisk element for openSUSE
The openSUSE base image does not contain /sbin/dhclient-script, install it.

Change-Id: Ib0db15139930d42bd60213437ef63d7915d8134a
2014-01-23 14:26:11 +01:00
Dirk Mueller
b12c28dde8 Workaround broken udev update on openSUSE
Delete stale symlinks created by current openSUSE 13.1
for kpartx loopback partitions. Those break bootloader
installation otherwise.

Change-Id: I13a7387e341b4426b459610fd1d3c49ce5730f46
2014-01-23 08:34:22 +01:00
Jenkins
e882bb5836 Merge "Setup ccache symlinks on openSUSE" 2014-01-22 21:03:15 +00:00
Jenkins
35aa61617a Merge "Add support for Red Hat Satellite" 2014-01-22 14:02:32 +00:00
Jenkins
f67a3805e2 Merge "Support list of Red Hat channels and repos" 2014-01-22 14:02:31 +00:00
Jenkins
0a5b5159ad Merge "Add support Red Hat Network (RHN)" 2014-01-22 14:02:30 +00:00
Jenkins
f1704ed421 Merge "Update default RHEL guest image" 2014-01-22 11:37:19 +00:00
Clint Byrum
0c6b346c15 Add Copyright and License header to debian element
These were forgotten in the initial commit.

Change-Id: I42ef745cc56d0a6983b1cc9c870d5a81d1f61940
2014-01-21 15:57:43 -08:00
Ralf Haferkamp
831cd69790 Setup ccache symlinks on openSUSE
openSUSE's ccache package doesn't include symlinks to enable ccache
for gcc by default, so we set them up manually.

Change-Id: I79dbe814ff2dfad8158fb1f06d68cc07eae19a41
2014-01-21 22:01:17 +01:00
aweiteka
bb04ff1ef2 Add support for Red Hat Satellite
A Red Hat Satellite URL may be provided as the source for
Red Hat packages. A Satellite key may be provided for a pre-
defined set of RHN channels to be automatically applied. Support
for installation of a Satellite certificate also provided.

Change-Id: Iae5b97d6f4732a28efa08ab778a56c2f9b6b6bd9
2014-01-21 14:26:35 -05:00
aweiteka
ce14214a7a Support list of Red Hat channels and repos
When registering to RHN or RHSM a list of space-separated
channels or repositories may be provided. This allows control
over which packages are available to the system during build.
Note, the optional channel or repository is added by default
since diskimage-builder requires access to its packages. This
list is for additional channels or repos.

Change-Id: I9cf90d47ab1d09f5491f574132410438f9e294e3
2014-01-21 14:26:35 -05:00
aweiteka
78dbbe68fe Add support Red Hat Network (RHN)
This provides basic support to register to the Red Hat Network
(RHN Classic) for packages. The image is unregistered from RHN
before completing image build. The rhnsd service is prevented
from starting since it is not needed for packagage install.

Change-Id: I2dc124cdc6ae59a63fd94d82d77108acccc3f668
2014-01-21 14:26:35 -05:00
aweiteka
3dc40c925d Update default RHEL guest image
Red Hat periodically updates the qcow2 guest image available
for download. This sets the default image name to the latest.

Change-Id: Iba3075bbee3b41918d5cd3da9721fcbf98ff3bcd
2014-01-21 14:26:35 -05:00
Steve Kowalik
58c755cf4c Create a new baremetal element
Rather than using a script to mount the image using nbd to extract the
kernel and ramdisk, make a new element called baremetal, which contains
a cleanup.d script that will copy them out to <image name>.{vmlinuz,initrd}.

Closes-Bug: 1224669
Change-Id: I8f3569aa12148d18b1c8242b6fbbd8857894b26f
2014-01-21 16:48:20 +11:00
Jenkins
ed8264c9d9 Merge "Update to Fedora 20" 2014-01-20 21:30:11 +00:00
Jenkins
6397fd3b5f Merge "Add debian-upstart for experimenting with upstart" 2014-01-20 21:27:24 +00:00
Jenkins
037e798625 Merge "Fix mysql package mappings for opensuse" 2014-01-20 21:27:01 +00:00
Jenkins
ca2a430375 Merge "Allow adding packages to debootstrap" 2014-01-20 21:26:51 +00:00
Jenkins
c21c82bacf Merge "Convert -dev to -devel in fedora/map-packages" 2014-01-20 21:26:16 +00:00
Jenkins
cf7af05fff Merge "Fix the curl command in the ironic-deploy element" 2014-01-20 18:58:54 +00:00
Jenkins
92ab5ab5af Merge "fedora/RHEL: use env from /usr/bin" 2014-01-20 18:54:26 +00:00
Ralf Haferkamp
2e2b19fd4f Fix mysql package mappings for opensuse
Change-Id: I231df61a79e6c8686afbbd203fa6bba96497f228
2014-01-20 18:52:22 +01:00
Dirk Mueller
2def5b7727 fedora/RHEL: use env from /usr/bin
/usr/bin/env is the new canonical location of "env", use
it.

Change-Id: Ifc5fbd942d409b1f54057579c5f57ccac63d4b72
2014-01-20 16:16:41 +01:00
Jenkins
1831a2bfbd Merge "Allow use of mirrors when building Ubuntu images" 2014-01-20 11:35:31 +00:00
Steve Kowalik
48f5359efb Allow use of mirrors when building Ubuntu images
Add a script to ubuntu's pre-install.d that will change
archive.ubuntu.com to a mirror specified in $DIB_DISTRIBUTION_MIRROR.

Change-Id: Idfd5a40ec8a1912a5de5dcdcaf9795946b0b53b8
2014-01-20 15:07:04 +11:00
James Slagle
82668aacc0 Update to Fedora 20
Update the default version of Fedora to 20 for the cloud image. A few of
us have run through devtest using Fedora 20 and it's working.

To continue to use 19, just specify DIB_RELEASE=19 for your image
builds.

Change-Id: I3d48272dedcd424747db5485ae0d8e9953f04191
2014-01-17 11:12:58 -05:00
Angus Salkeld
a021b110ad Convert -dev to -devel in fedora/map-packages
If there is not a special case in package_map then
convert all *-dev packages into *-devel

Change-Id: I411935c1f3221016b56263ac9502221cd75d130d
2014-01-17 18:10:13 +10:00
Lucas Alvares Gomes
af8eeebeb8 Fix the curl command in the ironic-deploy element
We need to use the eval command together with curl so that the
$TOKEN_HEADER variable is seems by curl as two arguments: "-H" and
"'X-Auth-Token: ...". Without the eval bash would interpret the variable
as only one argument "-H 'X-Auth-Token: ...'" making the curl command
to not understand that parameter and fail to pass the auth_token to the
Ironic API.

Change-Id: I4dcfc323d6ab9b7fa207328386ef65a146a93617
2014-01-16 13:16:47 +00:00
Jenkins
016fc76d84 Merge "Symlink correct element install type" 2014-01-16 11:56:23 +00:00
Jenkins
5108838071 Merge "dib-run-parts should dereference symlinks" 2014-01-16 11:56:17 +00:00
Jenkins
71fb3e0f3c Merge "Wait for tgtd socket to be available" 2014-01-16 00:03:12 +00:00
Jenkins
e152e27937 Merge "Implement serial-console for systemd." 2014-01-16 00:03:11 +00:00
James Slagle
57ba300be4 Symlink correct element install type
The source-repositories element will now symlink the install scripts
corresponding to the set install type for an element into the install.d
directory.

Different install types are implemented by elements by writing scripts to do
the install type under install.d/<element-name>-<install-type>-install
directories.

For example, the nova element would provide:

nova/install.d/nova-package-install/74-nova
nova/install.d/nova-source-install/74-nova

source-repositories will create the following symlink for the package
install type:

$TMP_HOOKS_PATH/install.d/74-nova -> nova-package-install/74-nova

Or, for the source install type:

$TMP_HOOKS_PATH/install.d/74-nova -> nova-source-install/74-nova

Change-Id: I1bfaf39e5a98b2af904fbc6d674dbada30b27ed9
2014-01-15 14:57:08 -05:00
James Slagle
79f31d0476 dib-run-parts should dereference symlinks
dib-run-parts should dereference symlinks, and if they point to an
executable file, execute that file as a script. This can be accomplished
by using the xtype predicate in the find command instead of the type
predicate.

This change is needed so that we can dynamically symlink hook scripts
into hook directories such as install.d at runtime to support different
install types.

Change-Id: I933e7f4b4dcf16956841d8c14aa63b0f9a18fc5d
2014-01-15 14:57:08 -05:00
Clint Byrum
611a8b701a Add debian-upstart for experimenting with upstart
Upstart support in Debian is somewhat experimental, but having it would
be especially useful for TripleO which already generates upstart scripts
which will work fairly well on Debian based systems.

Change-Id: I267da5ae7bc4a484fac152a14963d96ca2ad2693
2014-01-14 22:41:25 -08:00
Clint Byrum
4ce573c582 Allow adding packages to debootstrap
Also allows setting the "distro name" so that things that change the
debootstrap signature will have a different tarball.

This is being done in advance of a debian-upstart element to allow
experimenting with debian and upstart.

Change-Id: I1a558fdaf5924c65f1cced9f9bf29d73643c30af
2014-01-14 22:41:25 -08:00
Clint Byrum
d0fd8915f6 Add support for Debian
Change-Id: Ibc6bc57dea1eab295fb23cccf40b38f3fcb285c3
2014-01-14 22:41:16 -08:00
James Slagle
8d910d10f8 Wait for tgtd socket to be available
tgtd returns execution control and backgrounds itself almost immediately
and before it has made it's listening socket available. This can cause a
race condition as the tgtd socket is not available when tgtadm is run,
resulting in an error:

failed to send request hdr to tgt daemon

Add a function to check if the socket is available before moving on to
calling tgtadm, and a wait_for helper function we can use.  We'll
check for the socket every 0.5 seconds, for up to 5 seconds.

I'm seeing this issue on almost every deploy using a ramdisk built from
Fedora 20. I'm not sure if something has changed in tgtd, but this
behavior is documented since Fedora 18 at least. In the systemd script
for tgtd, there is actually "sleep 5" to work around the problem.

See Also: https://bugzilla.redhat.com/show_bug.cgi?id=848942

Change-Id: Iffa9fc63393309ca653d592dff17316ecbea3e09
2014-01-14 12:53:03 -05:00
Jenkins
de7deb7ce9 Merge "Add new modprobe-blacklist element." 2014-01-14 13:05:55 +00:00
Jenkins
d9303ac9af Merge "Add package support to source-repositories" 2014-01-14 12:42:29 +00:00
Jenkins
85bb142641 Merge "Retry link check up to 10 times." 2014-01-14 11:12:25 +00:00
Jenkins
cccb870d92 Merge "Removing the config-applier element" 2014-01-14 11:09:14 +00:00
Dan Prince
ab9d5d3cc3 Add new modprobe-blacklist element.
This element can be used to provide a custom list
of modules via DIB_MODPROBE_BLACKLIST which
will be disabled via modprobe.d/blacklist.conf.

I'm using this to disable network adapters on the
Red Hat TripleO rack where the devices can't be
explicitly disabled via the BIOS.

Change-Id: I8a0a8ee05fa62628434d7f6422577dbf5cdd7a2e
2014-01-13 15:43:29 -05:00
Dan Prince
5ae9c5d24c Install traceroute on Fedora.
Useful for debugging, etc.

Change-Id: Ia06f8d7a76de2f082bea09c57fbb8150c9706afc
2014-01-13 15:12:39 -05:00
Dan Prince
ae28c99b5f Retry link check up to 10 times.
Updates the dhcp-all-interfaces element so that the link
check tries up to 10 times.

On some of my machines 3 times (seconds) doesn't appear to
be quite long enough...

Change-Id: Ibf7015162fc890d4de8a417b868b0301146944c0
2014-01-13 13:58:42 -05:00
Dan Prince
ae22d39472 Implement serial-console for systemd.
Update install.d/20-stty so that we try to start
a getty on ttyS0 and ttyS1 when using systemd.

Change-Id: Id5b605c74bf82855af0af4d0f95659cdd3a7b3a0
2014-01-13 13:02:54 -05:00
Derek Higgins
63a4c1e9d5 Removing the config-applier element
This is pretty much a duplicate of t-i-e/elements/os-apply-config, isn't used
in tripleo and the upstart script is out of date. We don't need to carry this.

Change-Id: I2b23d5930afae42cff28e2d5ce3d6c84224afa4a
2014-01-13 14:10:10 +00:00
James Slagle
d253ed16d8 Add package support to source-repositories
Adds a new "package" type to source-repositories. When the package type
is specified in an origin-repository-* file the package name and type
"package" need to be specified like so:

nova package

The existing map-packages mechanism can be used to map the specified
package name to the actual distribution package names.  The
pre-configured package repositories on the image will be used to install
the packages during the install.d phase of the image build.

If the repo type is package, an environment.d hook script is updated
with an environment variable which is sourced by dib-run-parts. This is
so that other hooks, particularly in install.d, will know what repo type
was used and can make the correct decision about doing a source install
or not.

Change-Id: Ief4e524664cd32d2087aeb3b1766f05e017de91e
2014-01-13 08:23:53 -05:00
James Slagle
380df31aac Remove old versions of grub2 from the yum cache
Before downloading and caching the latest version of grub2, we need to
first remove all old versions. Otherwise, the find command that writes
the grub2 version to /tmp/grub/install to install during the finalise
phase could pick one of the older versions of grub2 in the cache. This
will cause the install during the finalise phase to fail since the older
version of grub2 will conflict with the newer installed version of
grub2-tools.

Change-Id: I5b43e359db3ba81ed6283dfb41c7e89629516d38
2014-01-10 17:12:13 -05:00
Jenkins
843214246c Merge "Install tcpdump on Fedora" 2014-01-10 17:28:28 +00:00
Dan Prince
7511faa2b1 Implement dhcp-all-interfaces for systemd.
Includes:

 * Enhancements to the generate-interfaces-file.sh script
 so that it generates ifcfg network-scripts for
 distros like Fedora/RHEL.

 * Includes a new dhcp-all-interfaces.service systemd
 script which ensures network interfaces get generated
 before the network service starts on Fedora.

 * Add a new disable_interface function to
 generate-interfaces-file.sh which (on Fedora)
 will delete the ifcfg config for an interface which
 isn't plugged in.
 This is important because ifcfg-eth0 exists by default
 and we want to remove it if the NIC isn't connected.
 Previous behaviour on Ubuntu is unchanged and the
 generate-interfaces-file.sh just logs it as skipped.

 * General doc updates...

I tested this on a multi-nic machine w/ Fedora where the first NIC
exists but was not connected.

Change-Id: Ia99e312539da43caefd72aa60398d43dac5dcc8f
Closes-Bug: 1239880
2014-01-10 10:14:07 -05:00
Derek Higgins
864e209bfa Install tcpdump on Fedora
Tcpdump has a fairly small footprint and should be installed to all
images (it currently is on the ubuntu image by default). Sometimes the
reason you need it is also the reason its to late to get it.

Change-Id: I4849157515b389d534bdee755cdac6b0768fcb29
2014-01-10 14:16:30 +00:00
James Slagle
f5d4d8c711 Mark install-packages +x.
install-packages is an executable script, it should be +x.  The install
command that was installing it is setting permissions to 755, so we were
fine there.  However, I was trying to test the script outside of an
image build to test a change, and it's helpful to have it +x in the
repository for that context like all the other scripts under bin.

Change-Id: Ic300cc56d463640d119db4e310d375c66ed133ca
2014-01-07 07:54:47 -05:00
Jan Provaznik
c9cceeeb40 Make sure a loop device exists before kpartx is called
If "kpartx -av" is called and there is no unused /dev/loop* device,
then kpartx fails. Calling "losetup -f" finds first unused device
and creates it if it doesn't exist.

Fixes bug #1195264

Change-Id: I5d59b519fd8e2a7380b71a788f9d3f2331b6567f
2014-01-06 11:30:51 +01:00
Jenkins
e85bab58ec Merge "Fixed command dib-init-system not found error" 2014-01-03 10:11:25 +00:00
JUN JIE NAN
3968e5bd2c Fixed command dib-init-system not found error
dib-init-system is installed in 04-dib-init-system. Before it is
installed, 10-dib-init-system.bash may be sourced so command not found
issue found.

The patch invokes "/tmp/target.d/dib-init-system" directly in
10-dib-init-system.bash.

Change-Id: I9843224497c7dab8392261b26d62b6d79d1795ee
2014-01-03 17:42:21 +08:00
Tomas Sedovic
f176a78486 Add a package mapping for libvirt-dev
This is a dependency for the libvirt-python Python package that
ceilometer-agent-compute uses. libvirt-python is already installed globally in
the system via apt/yum, but that's not available to ceilometer-agent-compute's
virtualenv.

Change-Id: I07a12226889c6cda3bd04021240ee9714a396522
2014-01-02 12:01:03 +01:00
Chris Jones
4794df890a Log unsupported source repository types.
If we don't recognise git/tar/etc as source-repositories repotypes, we
now log the repotype, for debugging purposes.

Change-Id: I7b870807658441c928c7880291eb0284b6f97778
2013-12-20 14:53:53 +00:00
Chris Jones
4c7a3bf79f Improve source-repositories git caching.
We now unconditionally cache the repositories being fetched with
source-repositories.

Additionally, by improving the way we handle repository refs, we are now
able to build images with code taken directly from gerrit reviews.

Change-Id: Ifd4c5691f6761eb5551663e6d0aa1c0e42afced3
2013-12-20 14:48:30 +00:00
Jenkins
c1eb44c9b2 Merge "Add element to modify /etc/apt/sources.list in dib" 2013-12-19 11:01:13 +00:00
Kui Shi
5daa989fb8 Add element to modify /etc/apt/sources.list in dib
Add apt-sources element for Ubuntu OS to override the default
/etc/apt/sources.list in cloudimg.

Set DIB_APT_SOURCES with a proper sources.list file to replace
the default one.

If you want to use this element in tripleo project, set NODE_DIST or
EXTRA_ELEMENTS / UNDERCLOUD_DIB_EXTRA_ARGS / OVERCLOUD_DIB_EXTRA_ARGS
to make it take effect at build time and run time.

e.g. before running devtest.sh:
export DIB_APT_SOURCES=/etc/apt/sources.list
export NODE_DIST="ubuntu apt-sources"

Change-Id: I9ce0d03b506c2948b96382e4d6e85f0aff906450
2013-12-18 06:01:36 -08:00
Ralf Haferkamp
2da3235b82 Fix package-mappings for openSUSE
Change-Id: I6b59d62a9b3df89d8eef7aa2d7eb0b65308428d0
2013-12-18 14:23:33 +01:00
Ralf Haferkamp
641840b2c7 Update login.defs on openSUSE
Some of the tripleo image elements rely useradd a for creating a group
with the same name as the user that is added. On openSUSE is feature
is turned off by default. So enable it here.

Change-Id: I120067e5e522dc6e704e7f09b724d60dee0c7f22
2013-12-18 10:19:08 +01:00
Ralf Haferkamp
7da1425438 Merge force-text-mode-console into the bootloader script
52-force-text-mode-console, running after 51-bootloader, calls
grub2-mkconfig (on Ubuntu that will happen via the update-grub call).
This call will overwrite all the changes that 51-bootloader did to the
grub.cfg. By merging the 52-force-text-mode-console code into
51-bootloader we avoid that. This also means that 51-bootloader will now
call grub2-mkconfig regardless of whether there is already and existing
grub2 configuration or not (52-force-text-mode-console did that in the
past anyway).

Additionally this commit enables the force to textmode code for openSUSE
(was previously only working correctly for Ubuntu and Fedora).

Closes-Bug: #1260323
Change-Id: Ida8e1a69df22d41ad70eb7154707c50613b536a8
2013-12-16 13:58:42 +01:00
Jenkins
b89cf37104 Merge "Add zypper element" 2013-12-11 20:45:54 +00:00
Ralf Haferkamp
f8a0715c56 Add zypper element
This provides some customizations for zypper based distributions (e.g.
openSUSE and SLES). It is heavily inspired by the yum element and sets up
zypper to cache downloaded package outside of the chroot so that they can be
reused to speed up subsequent builds.

Change-Id: I775c921ee19cf7d1180fb68c1b7857ea6245a77d
2013-12-11 17:09:24 +01:00
Ralf Haferkamp
c719e5b4ee opensuse: Update README.md
Remove the comment about the rpm-distro element. The only tiny bit we copied
from it is 01-install-bin. 01-override-zypp-arch was unneeded and has been
removed from the opensuse element before the initial merge.

Change-Id: I9886bb6e7d723690f2d2ac476d6d3aca5a367607
2013-12-11 15:17:08 +01:00
Jenkins
ca667d0a33 Merge "local-config: Configure proxy for zypper repos" 2013-12-11 09:50:54 +00:00
Ralf Haferkamp
ba5aa8725e Fix $TARGET_ROOT usage in yum element
Fix the test for $TARGET_ROOT in root.d/50-yum-cache.

Don't use $TARGET_ROOT in pre-install, it's only set for "root" and "cleanup".

Change-Id: I048364ea08ef503a4466f3494f18f72ebf99b5c2
2013-12-10 17:56:42 +01:00
Ralf Haferkamp
f6c2901b0a local-config: Configure proxy for zypper repos
This allows using the local-config element with openSUSE based images.

Closes-Bug: #1256982
Change-Id: I670c938a44095ea7e7c31b81194acc1555212f06
2013-12-10 15:54:59 +01:00
Tim Serong
54c8508d45 Add support for building openSUSE images
This is currently experimental/incomplete.  See
elements/opensuse/README.md for details.

Change-Id: Ie5bcab15c9703cf15ceb642fb986a8afc34f96fb
Co-Authored-By: Ralf Haferkamp <rhafer@suse.de>
2013-12-05 15:18:46 +01:00
Jenkins
e8e7f45fb2 Merge "Log the repository fetches in source-repositories" 2013-12-05 13:06:17 +00:00
Mark McLoughlin
10eac21043 Log the repository fetches in source-repositories
Make the source-repositories element log which repo it's cloning from
so it's easier to tell what's going on.

Change-Id: I224f7bd98bc3d0ba94313dae9063d4ba4e25bdaa
2013-12-05 06:28:13 +00:00
Jenkins
0e536ba062 Merge "Default name for ramdisks to image." 2013-12-04 23:37:24 +00:00
James Slagle
6b220a044f Default name for ramdisks to image.
If you build a ramdisk with ramdisk-image-create and forget to specify
-o, you end up with a .kernel and .initramfs file as the image outputs.
This commit defaults the $IMAGE_NAME value to image so you'd end up
with image.kernel and image.initramfs

Change-Id: I10f3ac9ad178c32119523e4da930070e3ade4f73
2013-12-04 15:31:46 -05:00
Yuriy Zveryanskyy
bf222fe7bc Add deploy ramdisk element for Ironic
Ironic requires callback from deploy ramdisk via API with json data.
Auth token also required if Keystone auth enabled for Ironic API.
This patch adds separate element 'deploy-ironic' for Ironic deploy
ramdisk creation.

Change-Id: I5ef96711763e50307cfa17c406a9e16bffb937bc
2013-12-04 17:57:44 +02:00
JUN JIE NAN
d7e43c0861 Modify /etc/selinux/config if it exists
When `/etc/selinux/config' does not exist, although selinux has
already been disabled, the image creation will fail.

Change-Id: I9e4a9a006073fd3f708049407ef98f82c3f399d1
2013-12-03 15:35:49 +08:00
JUN JIE NAN
08797d44b5 Remove dot after TMP_HOOKS_PATH
"$TMP_HOOKS_PATH." is always be nonzero so we should remove the dot.

Change-Id: I0432bb3e21cc29806e1e2ae245dd4b6301ee9ba6
2013-12-02 12:44:11 +08:00
Jenkins
8a38b14ecf Merge "Switch Ubuntu element to installing saucy." 2013-11-27 13:30:24 +00:00
Chris Jones
a84b2763fc Switch Ubuntu element to installing saucy.
In tests, saucy has been able to match raring for the ability to bring
up clouds, so we can roll forwards and switch the default to saucy.

Change-Id: I4df35d40f902c0daa7b2761d7afea8db25526753
2013-11-27 10:10:39 +00:00
JUN JIE NAN
afc07e2b2d Enhance dib-run-parts usage message
and fix $1: unbound variable issue when run dib-run-parts --list.

Change-Id: Id18e21683f785f318bce11d401cb4f826bed1b01
2013-11-27 17:42:37 +08:00
James Slagle
476ec8feec Add mapping for tgt to RHEL element.
tgt maps to scsi-target-utils on RHEL.  This mapping already exists for
the Fedora element, so no need to add it there.

Change-Id: Ifc9a8976299458cdef50c2fbe00ba6a0c8d22f00
Closes-Bug: #1252975
2013-11-26 15:21:21 -05:00
James Slagle
f5d5667b32 Update openssl for Fedora.
We need to update openssl before proceeding as part of the image build
because the version on the Fedora cloud image is no longer compatible
with new python environments installed by virtualenv.

Change-Id: I3ed889f7382e7ca0de052ef5bdd6afeefc8bbdd8
Closes-Bug: #1254879
2013-11-26 09:09:47 -05:00
Mark McLoughlin
4f97b087d5 Fix typo in source-repositories README
Change-Id: Iaf5367099544fc5d4699140af642dfd392c7090f
2013-11-25 10:54:18 +00:00
Chris Jones
09eb230ea3 Detect udevd version and behave accordingly.
We can no longer rely on the name of the udevd binary as a hint for its
version, so instead we query the binary and behave accordingly.

Change-Id: Id4c869dfeeca5ed970169343b6b5f0f2c4499ca3
2013-11-20 11:13:06 +00:00
Jenkins
1373ed5374 Merge "Fix issue with Ubuntu grub pre-install step for ARM" 2013-11-20 09:24:45 +00:00
Ripal Nathuji
8f118af7d3 Fix issue with Ubuntu grub pre-install step for ARM
The Ubuntu build for ARM breaks when the pre-install step attempts to remove
grub components. This change gates those package removals based on whether
they are currently installed.

Change-Id: Ie169dbf12213e69b3713b3b1f9a68ae224f9fd31
2013-11-19 15:26:17 -06:00
iberezovskiy
41caf597a5 Check existence of rhel rpm key
The key 'RPM-GPG-KEY-redhat-release' may not exist in image
e.g. when you use non-default image (for example, if you build CentOS
image using rhel element).

Fixes bug #1252697

Change-Id: Iae642abb7a7f76c5528750dafedd4fd4bda56fe2
2013-11-19 20:02:12 +04:00
Chris Jones
f093d4d38d Fix troubleshooting override.
We can now actually override the $TROUBLESHOOT environment variable in
ramdisks, by not declaring it as readonly. Yay for insufficient
end-to-end testing.

Change-Id: I026c9dbdd411bf3eb945d5b18188eb1eedf3850a
2013-11-19 11:25:58 +00:00
Jenkins
9eb2719998 Merge "Add mapping for gearmand" 2013-11-18 22:06:59 +00:00
Chris Jones
a19d8ceee7 Document ramdisk troubleshooting.
We now document how to trigger a troubleshooting shell when booting a
di-b ramdisk.

Change-Id: Ief44347893fa81a7f2669143e1746a5ee99599af
2013-11-18 19:45:59 +00:00
Jenkins
45a0082fa7 Merge "Add troubleshooting override to deploy ramdisk." 2013-11-18 19:08:45 +00:00
Chris Jones
1f328087d9 Add troubleshooting override to deploy ramdisk.
We now allow operators to drop into a troubleshooting shell while
booting a deploy ramdisk, without having to have pre-configured their
desire to do so ahead of time, by means of a 10 second pause for them to
press a key.

Change-Id: I05ffa1ebaa95c83dee7bd2a2f52ba4c08928bb10
2013-11-18 17:22:26 +00:00
Derek Higgins
257a9dd139 Add mapping for gearmand
The ubuntu gearman-job-server package maps to the Red Hat gearmand
package.

Change-Id: I3ec90b2759498488fce2ecaed03effc18313d1e6
2013-11-18 16:44:14 +00:00
Jenkins
6f7eae51b2 Merge "Split network bringup out of base ramdisk init." 2013-11-18 11:38:43 +00:00
Jenkins
6fb7a22166 Merge "/bin/bash all the things." 2013-11-18 09:36:01 +00:00
Jenkins
670f1f7312 Merge "Don't block the upstart daemon if it doesn't exist" 2013-11-18 09:35:03 +00:00
Victor Lowther
dbacf3e8df Make pxe_mac accurate in two common cases.
If we are booting pxe booting using syslinux, and it has IPAPPEND 2 in
the boot stanza, then it will append the mac address of the device we
are booting from to the kernel parameters where we can get at it
pretty easily.

If we are booting physical hardware via UEFI over the network, we can
rely on the BootCurrent EFI variable to point at the boot entry for
the NIC we booted from, which will include the MAC address of that
nic.

If neither of those cases are in play, we can just fall back to the
all-physical-devices-with-links code.

This currently uses the Bash 4 support for associative arrays to handle
the netboot-in-UEFI case, if needed I can rewrite it to be Bash 3 compatible.

Change-Id: I5e50e30c60d6d732a09ab61251cbb9be08bb6113
2013-11-17 21:43:59 -06:00
Victor Lowther
43b70ce224 /bin/bash all the things.
Since we are using bash syntax in some of the element fragments,
we should make sure we use bash for all of them, so that things don't
break on systems where /bin/sh != /bin/bash.

Change-Id: If2f043c57aa4e1492b7f9839213ef6123f683612
2013-11-17 16:59:31 -06:00
Chris Jones
c9f432d45b Split network bringup out of base ramdisk init.
We now run the network bringup portion of the ramdisk init from an
init.d script, thus allowing image builders to inject code into the init
script before that point (e.g. configure network hardware).
The environment variables used by the network bringup code are retained
in the base init script so they can be overridden by init.d fragments.

Change-Id: I1ef0bb21e7f26c0ff3f02266f853ce5402bcb94d
Closes-Bug: #1252023
2013-11-17 20:37:26 +00:00
Russell Sim
b9348447b9 Don't block the upstart daemon if it doesn't exist
Check if Upstart exists before blocking the daemon.  Not all dpkg based
OS's have Upstart installed so this should help increase compatibility.

Closes-Bug: #1251949
Change-Id: I2dcb1ff3641778b5653ca5762a728398adb57da1
2013-11-17 14:46:14 +11:00
Chris Jones
5387b01af9 Make sorting of ramdisk init elements explicit.
We assemble the init script of ramdisks with the fragments from included
elements, alphabetically.
We now place leading numbers on all of the fragments we ship, to make it
more obvious to element authors and downstream users, how the process
works.

Closes-Bug: #1251706

Change-Id: I56b0d42971c8c462eddcfe1769f8124405e1233c
2013-11-15 17:18:34 +00:00
Roman Podoliaka
b01c73aadc Provide a way of determining init system used
dib-init-system script is installed into $PATH. Called
without arguments it will print the name of init system
used to stdout.

Additionally, set DIB_INIT_SYSTEM environment variable to
the init system used.

Tested on ubuntu+upstart, centos+upstart, fedora+systemd,
debian+sysv.

Closes-Bug: #1251610

Change-Id: I29668079091f6060dab66d8259890384d3bbd653
2013-11-15 17:10:38 +02:00
Derek Higgins
726a816cac Add mapping for libffi-dev
libffi header files are needed to pip install xattr, which is a
requirement of swift.

Change-Id: I69560425f7106c35ec432825eab94ca8424eb89e
2013-11-12 20:32:52 +00:00
Derek Higgins
64f4323ae7 Allow heat-admin to sudo without tty
This is needed to run scripts from devtest, in particular so that
swift ring files can be distributed.

Change-Id: Icbe8c5b24a0d494730357983f230a37a7f078de7
2013-11-12 20:26:11 +00:00
Jan Provaznik
f6f4e808d1 Remove BUSYBOX variable from ramdisk-defaults
ramdisk-defaults file is sourced before chroot to an image being created
is executed. Busybox path should be set inside chroot instead.

Change-Id: Ic0e1d3093ca9d489dd96b14157e93b336cf0baee
2013-11-11 14:36:15 +01:00
iberezovskiy
f23babe971 Check existence of directory 'lost+found'
The command `sudo rmdir $TARGET_ROOT/lost+found` will fail
if `$TARGET_ROOT/lost+found` directory doesn't exist,
e.g. when you use non-default image.

Fixes bug #1245856

Change-Id: I48c8f2f201b29912a726249023ca7d20893cc958
2013-10-29 18:51:49 +04:00
Derek Higgins
d91ececa06 Remove mapping of atftpd to tftpd-server
These are different tftp implementations, tftpd-hpa and tftpd-server are
equivalent, this mapping was added in a previous commit.

Change-Id: Idd1f554d4ee8e1d3c515d5f2f191e90abe0ff396
2013-10-25 12:27:39 +01:00
Jenkins
0e4ddaa586 Merge "Add redhat mapping from tftpd-hpa to tftp-server" 2013-10-25 11:24:20 +00:00
Derek Higgins
4508a685de Remove dependency on dracut-network
Now that we have moved onto neutron-dhcp-agent. dracut-network is no
longer needed, infact it was getting in the way. Dracut wasn't
requesting the classless-static-routes dhcp parameter but was
configuring networking. Removing this causes the network service to
redo dhcp and set the appropriate static route (specifically so
overcloud nodes are routed to the correct metadata server). This element
is still required for undercloud nodes so needs to be included there.

Change-Id: Ic23560164aff7791dd87ed2c3ad008efd248ae93
2013-10-25 09:15:40 +01:00
Derek Higgins
66b293af1c Add redhat mapping from tftpd-hpa to tftp-server
This will be needed by a patch I'll be submitting to t-e-i to
change the tftp implementation used by ubuntu, so that both
Ubuntu and Fedora can use the same implementation.

Change-Id: Ie9581265dfa2c37342e01162fe580b1948dd3e03
2013-10-24 14:55:22 +01:00
Jenkins
3144cc63be Merge "Allow for bad Fedora image mirrors" 2013-10-23 23:10:29 +00:00
Tomas Sedovic
1c132f6aa5 Add apache and mod_wsgi to Fedora's package map
We need this for the Horizon element (which should work both on debian and
fedora-based distros).

Change-Id: I3a1dacbd1823abe051ba977b92b67ed27423f405
Signed-off-by: Tomas Sedovic <tsedovic@redhat.com>
2013-10-23 15:23:42 +02:00
Derek Higgins
9947cdebd9 Allow for bad Fedora image mirrors
I am getting a lot of http 404's from Fedora mirrors, in particular in
the US. Alternatively we could get cache-url to use previously existing
files if they exist and there is an error but this may not be the
correct thing todo in all cases.

So for now we do a retry if HTTP 404 is returned to the request for a
Fedora image.

Change-Id: I7634aeac3bdfe6930fafe6d276186c09fc8587b5
2013-10-23 10:49:29 +01:00
Derek Higgins
1adb4072b8 exit 44 if http 404 is returned
This will allow the fedora element to know that there was a http 404 so
it can retry.

Change-Id: I42100a175e42af1c53909508245695ac82204fc0
2013-10-23 10:44:47 +01:00
Jenkins
194df26096 Merge "Remove old-kernels for fedora" 2013-10-17 21:01:34 +00:00
Lucas Alvares Gomes
f707a6bd82 Dracut regenerate initrd w/ the right kernel
When picking the latest version of the kernel on i386 we should prioritize
PAE kernels. Debug kernels will be ignored.

Change-Id: Ic0fc5907074ee2a5ddfbbb1db2f1c8a6060cae9f
Related-Bug: #1240873
2013-10-17 13:50:54 +01:00
Lucas Alvares Gomes
0181b177c2 Remove old-kernels for fedora
Remove the old kernels on fedora to save some space in the image.

Change-Id: Ia7ace63c286052713ac1ef3092373cc2712db11a
2013-10-17 11:51:44 +01:00
Derek Higgins
d23ba2a8a8 Conditionally add dhcp-all-interfaces
If the /etc/init drectory gets created on Fedora, it causes
os-svc-daemon to add upstart init scripts instead of systemd.
As a result none of the openstack services can start.

Partial-Bug: #1239880

Change-Id: Iec317baa3eb9ff651fa66c582d2f614993cde45e
2013-10-15 13:43:50 +13:00
Jenkins
a019fcf470 Merge "Specify distro release in fedora image name" 2013-10-14 11:51:22 +00:00
Jenkins
52956a2c3a Merge "Allow for redirects to ftp servers" 2013-10-12 15:38:39 +00:00
Clint Byrum
f96f705559 Remove \r chars from dhcp-all-interfaces
For some reason we are adding CR's to/etc/network/interfaces, but it
does not require them. They are a bit annoying to see in an editor and
serve no known purpose there.

Change-Id: I9aeeff5533f418f09fcf33edd42e5d85cd486d23
2013-10-11 11:06:16 -07:00
Clint Byrum
28190d5954 Make dhcp-all-interfaces block all interfaces
Previously dhcp-all-interfaces was only blocking the first network
interface to come up. We add an instance stanza to make it run one
instance of generate-interfaces-file per interface. We then use flock to
serialize runs of generate-interfaces-file.

Fixes bug #1233577

Change-Id: Ib16bed6b37ce0789e315ef57e05ac561470a6f2a
2013-10-11 11:06:16 -07:00
Clint Byrum
2129d78124 Fix ifquery call in dhcp-all-interfaces
Ifquery does not print anything for interfaces which only have a single
iface line. It does, however, return non-zero if the interface is not
configured at all, so we can use that to indicate whether or not there
is a configuration.

Fixes bug #1233579

Change-Id: Ia2fdafbea57e806eba99ae8ddaf395ebdcc306e1
2013-10-11 11:06:16 -07:00
Derek Higgins
b67b850a7e Allow for redirects to ftp servers
The Fedora image can redirect to a ftp server, in which case outputs a
213 if not modified.

Change-Id: I714fc3562bf188994357e1918af309d8edeecde5
2013-10-11 10:16:51 +01:00
Derek Higgins
11b116977c Specify distro release in fedora image name
The fedora element downloads the latest available image so presumably
will jump to F20 once available. Probably causing several days (weeks?)
of busted stuff. Of course it will be impossible to know when all users
of the elements are ready to switch but the least we can do is allow a
little time as a buffer.

This commit ties it down to a specific version which can then be updated
when the consumers of this element are ready. This allso follows the
same pattern as the ubuntu element.

Change-Id: I15c8e15a66e8af1bd152c27144acbc55af9da88e
2013-10-10 08:21:52 +01:00
Tim Serong
43c0082aa7 Move /tmp/ccache setup to base element
Commit c7d80dd (Cleanup mount points automatically) removed the unmount
of $TMP_MOUNT_PATH/tmp/ccache in run_d_in_target() and moved the
"rm /tmp/ccache" to elements/base/finalise.d/02-remove-ccache.  There
are two problems with this:

1) Not unmounting at the end of run_d_in_target() results in tmp/ccache
   being bind mounted muliple times on top of itself (three times, if you
   just run `disk-image-create base`).  It is eventually unmounted, but
   somehow the auto unmount code is confused, and tries to unmount it
   one more time than it was mounted, which results in an error like
   "umount: /tmp/image.THQkZxQa/mnt/tmp/ccache: not mounted".
   This doesn't actually break anything, but it's a little messy.

2) "rm /tmp/ccache" in elements/base/finalise.d/02-remove-ccache never
   succeeds in removing /tmp/ccache, because that hook is invoked by
   run_d_in_target(), *while* /tmp/ccache is mounted.

This present commit solves the above by moving the ccache setup glue out
of img-functions and into the base element's root.d.  This has the
following implications:

1) lib/img-functions is a little cleaner.

2) /tmp/ccache is available in the chroot during the root, extra-data,
   pre-install, install and post-install stages.  It is not available
   during block-device, finalise and cleanup stages as it will have been
   automatically unmounted by then.

3) /tmp/ccache won't be setup if you're building an image that doesn't
   include the base element.

Change-Id: Ief4c0a6f4ec622db6c6f652776215684178d8943
2013-10-10 16:27:09 +11:00
Jenkins
126099cd6d Merge "Use --numeric-owner when extracting base image" 2013-10-08 22:54:08 +00:00
Tim Serong
6da49c6d49 Use --numeric-owner when extracting base image
When extracting the base image without --numeric-owner, user and group
names in the tarball are mapped to uid/gid by the host.  This can cause
problems when building an image for some other distro than you're
running yourself.  For example, building an Ubuntu image on openSUSE
ends up with /var/cache/man in the image owned by 'proxy' (uid 13)
instead of 'man' (uid 6), because the host (openSUSE) uses uid 13 for
the 'man' user.  This particular man/proxy discrepancy results in
"fopen: Permission denied" errors when apt-get does its "Processing
triggers for man-db" thing in the Ubuntu system.  I wouldn't be
surprised if there were other kinks caused by this uid/gid mapping
discrepancy too, but that's the one I found so far.

The same thing can also happen with Fedora, but seems to be less likely,
or at least less obvious to me when building Fedora images on openSUSE.
But, IMO, it's better to be safe and just use --numeric-owner on all
base image untarring outside the chroot.

Change-Id: I9da5ac66dd182e7278fe4fee932093f61d35673a
2013-10-08 22:45:51 +11:00
Matthew Farrellee
ddef437cd2 Make RHEL subscription optional
The code to handle unregister of RHEL subscriptions was buggy and
broke if no subscription credentials were supplied.

Change-Id: Iac29c45f207725e31eac6487a87367fcd3d34d49
2013-10-07 14:46:57 -04:00
Jenkins
21a81d8b79 Merge "Fix mellanox module loading." 2013-10-07 03:49:46 +00:00
Jenkins
59db52aa80 Merge "Ignore empty files returned by curl" 2013-10-07 00:36:55 +00:00
Chris Jones
8c17a5d040 Fix mellanox module loading.
My previous attempt at forcing the mellanox module to load was
completely bogus. This should not be (although I lack hardware to be
100% sure).

Change-Id: I22ff88181c9c9f0c024e021eeb7f16d79715241a
Closes-Bug: #1233949
2013-10-04 09:53:03 +01:00
Derek Higgins
50ea375154 Ignore empty files returned by curl
In cases where servers ignore the Modified time, curl cancels the
download, outputs a http 200 and leaves the output file untouched, we
don't want this empty file.

Fixes bug #1234926

Change-Id: I05b0dd95dcd53ca50d88ec07f2f1ee9958b6adb7
2013-10-04 09:26:43 +01:00
Clint Byrum
4a751ba162 Generate interfaces file before cloud-init runs
Cloud-init needs to query the metadata server after the network
interfaces are configured. The upstart job "cloud-init-nonet" is
specifically in place to provide a hook to block cloud-init from
running while we rearrange network interface configurations.

Fixes bug #1233577

Change-Id: Ib5cf75d858fdb670b2abcc082e912c4644d6b169
2013-10-03 16:00:19 -07:00
Robert Collins
2684cddd3d Fix typo in dhcp-all-interfaces.
It is meant to write to /etc/network/interfaces, not
/etc/network/interfaces].

Change-Id: I15ea677edf7129ffd222c39627f7f76356f68e11
2013-10-01 20:32:40 +13:00
Tomas Sedovic
d5afe2b1fa Set locale for the profiling printf command
When LC_NUMERIC is set to a format that doesn't use a decimal point,
`printf` will fail.

Change-Id: Ie6c4d075928f47b17cc413d537fc31c9d0734bdb
Signed-off-by: Tomas Sedovic <tsedovic@redhat.com>
2013-09-30 12:10:07 +02:00
Clint Byrum
f120e122bc Add mapping for atftpd in fedora/rhel
Upcoming tripleo-image-elements changes will need this.

Change-Id: I775dda78aaee892c8b47999707574054c3d9a95b
2013-09-26 10:38:44 -07:00
Jenkins
d744f7697c Merge "Make RHEL subscriptions optional" 2013-09-25 09:47:30 +00:00
Matthew Farrellee
1d4893b8bb Make RHEL subscriptions optional
The code to handle RHEL subscriptions was buggy and broke if no
subscription was supplied.

Change-Id: Ie4f30171f716312b69d760d45f25659606dadc1f
2013-09-24 17:05:40 -04:00
Matthew Farrellee
0add227af3 Add RHEL mapping for openssh-client
Change-Id: Ic0b5355c186dea403a9535497d28330f693e6843
2013-09-24 07:46:39 -04:00
Matthew Farrellee
18acacc26a Add RHEL mapping for augeas-tools
Change-Id: I296425504f5302e21bd4ba89e772c20c2be13838
2013-09-24 07:46:39 -04:00
Matthew Farrellee
50cb156369 Add RHEL mapping for default-jre
Change-Id: Icb474af27670d1266ce02cfd8179443496b3948f
2013-09-24 07:46:39 -04:00
Jenkins
6ede4c2016 Merge "Add DIB_IMAGE_CACHE" 2013-09-19 20:47:17 +00:00
Cody A.W. Somerville
a8d8e7a30d Do not prompt on removal of apt-xapian-index from ubuntu cloud images
Change-Id: I49582a0c51aafcda6c0ad7911c291d58bb6c52a6
2013-09-19 16:35:31 -04:00
Matthew Farrellee
1d2a85d5e4 Add DIB_IMAGE_CACHE
DIB_IMAGE_CACHE will be a user override for the location where images
are cached. Default location is ~/.cache/image-create

Change-Id: I3e9b9f970864d555c9ec9436344b53f6d3d66dfa
2013-09-19 14:34:05 -04:00
Clint Byrum
2d70812e81 Remove apt-xapian-index from ubuntu cloud images
This package recently caused us some very large headaches when it
was updated for a security issue. It is completely unnecessary and
should be removed.

Note that we have recommended that it be removed from the cloud images
in launchpad bug #1227425.

fixes bug #1227420

Change-Id: Ic0d4efa7b44c46271d19576f5191c9421d07c015
2013-09-18 17:22:59 -07:00
Monty Taylor
5e3b5320e4 Remove github references
OpenStack runs git.openstack.org which is more reliable and responsive
when projects operate within OpenStack Infra. Replace all of the
references to github with referneces to git.openstack.org.

Change-Id: Ib3ece85aba6451801487b0bdbd83147e39d9e155
2013-09-18 08:17:10 -05:00
Chris Jones
b50dbb0571 Move textmode forcer to vm element.
Changing the grub config makes no sense in a build not heading for a vm
and may fail because grub is removed from images not including the vm
element. Forcing textmode for those images would be better done in nova.

Change-Id: I1c5b89e551e62df2463200b1889cb2342498c7dd
2013-09-18 01:57:35 +01:00
Jenkins
bd632a92fd Merge "Fix grub/linux text mode override." 2013-09-18 00:05:12 +00:00
Chris Jones
d799ad5beb Fix grub/linux text mode override.
Apply a wider range of hammers to the recurring issue of images booting
with graphical consoles.

Change-Id: I96345bf8f2f13d615131557b572201b9d41b6c75
2013-09-17 22:03:02 +01:00
Ghe Rivero
6d1f03bda3 Add deploy-kexec element
Boots into the new image kernel once baremetal-deploy-helper signals
it is finished using kexec utilities.

Change-Id: I705787cc394ef14200d80404ee497762ab79b452
2013-09-17 14:01:20 -07:00
Dan Prince
fb33adc5ba Consolidate the checks for /etc/grub.
Create a single check for grub2 so we skip these steps on F19.

Change-Id: I5f05adcf409be5c2532478439bcb55ab397da20e
2013-09-17 11:08:04 -07:00
Jenkins
f5e191dc8e Merge "Check cached file size when downloading an url" 2013-09-16 21:24:53 +00:00
Jan Provaznik
9a5e14cbc5 Check cached file size when downloading an url
In some cases cache-url fails when downloading an image and leaves
an empty cached file. qemu-img then fails with "Wrong medium type"
error on next run.

Change-Id: I23e91c52094f27248cf8452f192ad63646051190
2013-09-16 13:32:36 -07:00
Dan Prince
15007cc184 Fedora 19 has no grub2 conf file.
This fixes ramdisk creation on Fedora 19.

Change-Id: Ica486473cecb93feac740ae905fba5f2a3723bc2
2013-09-16 12:21:59 -07:00
Steve Baker
9ba761ef27 Install fedora grub from cached rpm during finalise
When uninstalling grub2, leave all its dependencies
including grub2-tools installed to minimise the number of packages
which need to be installed in the finalise stage.

Since the yum cache is unmounted during finalise, installing
grub2 in finalise is slowed by re-populating the yum cache.

This change copies the grub2 rpm out of the yum cache so it can be installed
from file during finalise.

This should prevent disk becoming full during finalise on Fedora.

Closes-Bug: #1217185

Change-Id: If095adc4abb52a19a3aa0b1caebfb3e4d8f605ef
2013-09-15 09:11:58 +10:00
Jeff Peeler
ccd7b86b60 Remove -r option from kpartx for successful build
This option does not exist on RHEL hosts and matches what is
currently present in elements/rhel/root.d/10-rhel-cloud-image.

Change-Id: I578233c1f37d035c67600fc60e7c4eb4ff75cbb3
2013-09-12 17:56:30 -04:00
Matthew Farrellee
43b96d91c2 Add package mapping for default-jre
Change-Id: Idffbc84ea2afaf2584c1bb79729c3e0cf52b851e
2013-09-10 20:01:21 -04:00
Jenkins
d339f9b25e Merge "Add --list support to dib-run-parts." 2013-09-04 10:59:46 +00:00
Chris Jones
6311388892 Add --list support to dib-run-parts.
Our custom dib-run-parts now supports --list for better compatibility
with some OS-provided run-parts tools.

Change-Id: I2feb615b2094d9d6522bfe9b422362223bb8e652
Closes-Bug: #1190521
2013-09-04 09:44:48 +01:00
Steve Baker
c182fef45c On Fedora, use Linux Foundation bzr lsb_release
Installing redhat-lsb-core adds 87M to the install due
to bugzilla #1002342

lsb_release is a platform agnostic script, so this change fetches
a single file via source-repositories from linuxfoundation bzr http
and installs it to /usr/local/bin

Change-Id: I4c979d4eb5e34a753d9143d9dcfe4e5d08f74a0d
2013-09-04 10:16:49 +12:00
Steve Baker
9e5bc37265 Add support for file to source-repositories
Adds a file type to source-repositories to allow individual files
to make use of source-repositories caching.

REPO_DIRECTORY has been rename to REPO_DEST since it is now sometimes
a file.

This change also fixes the incorrect path to the cache-url in the
tar type.

Change-Id: Ib79e41969c982a02f0235318d9f254b39c3c6d93
2013-09-04 10:16:49 +12:00
Steve Baker
cc681eb830 Install patch for dracut patching
patch is installed indirectly via redhat-lsb-core, so it
should really be installed directly.

Meanwhile, Daddy Shadowman waited for these patches to be
submitted to bugzilla.

Change-Id: I2107cf7be99f396c5dd489a2693b949022a512e7
2013-08-29 15:10:11 +12:00
Jenkins
9211a7fecb Merge "Add rhel installation element" 2013-08-28 16:58:37 +00:00
Chris Alfonso
44c3ff7ece Add rhel installation element
If you want to have the installation update packages, you'll
need to register the system log in to rhn and subscribe to an
available subscription.
export DIB_RHSM_USER to your rhn username
export DIB_RHSM_PASSWORD to your rhn password

To get the qcow2 image, log into rhn.redhat.com and download the
image from
https://rhn.redhat.com/rhn/software/channel/downloads/Download.do?cid=16952
Then export DIB_CLOUD_IMAGES to whereever you're hosting the qcow2.

Change-Id: Idb547f4ffe75514b1e3f6b34f5f347493b132925
2013-08-28 11:35:53 -04:00
IvanBerezovskiy
d4a9b44e73 Add package mappings for MySQL-MariaDB
Partial-Bug: #1213891

Change-Id: I1ac1d11ff1716eccee4c734395282be25dd5b541
2013-08-28 15:04:12 +04:00
Lucas Alvares Gomes
5dd6c4a834 Extlinux fallback
If GRUB2 is not available in the system a fallback to install Extlinux
will happen. This patch also allows you to enforce the use of Extlinux
exporting the DIB_EXTLINUX variable.

Change-Id: I88fa792a0bd19cacca167134f2054b11c807a451
2013-08-27 11:14:44 +01:00
Lucas Alvares Gomes
b01f412c1e Rename 51-grub to 51-bootloader
This patch is part of a another big patch that will implement a fallback
to Extlinux in case GRUB2 is not available in the system. The reason why
it's being splitted in two patches is because git is not being able to
recognize the file changes when the rename happens in the same commit.

Change-Id: Ic2027dfa057fd6d62b532203b7ff50c3c739bccb
2013-08-27 10:43:26 +01:00
James Slagle
0702ce9843 Add a pip-cache element.
The element bind mounts a pip cache inside the image build chroot so
that pip downloads can be reused across image builds.  While similar
in purpose to the PyPi element that sets up a mirror, this element
just allows for a reusable download cache and doesn't require anything
to be setup beforehand.

The pip-cache element is not concurrency safe, and that is indicated
in the README for the element.  An upstream bug was file as well:
https://github.com/pypa/pip/issues/1141

Change-Id: Ibd1d4ea17c24923ed939357ada95b781e3179cfd
2013-08-26 15:17:41 -04:00
Derek Higgins
11df3a45f4 Fix URL to os-apply-config
Just incase anybody is actually using this element(which may not be the
case).

Change-Id: I663f8e4db86a38d8c9063d02da3dfaa6715e465a
2013-08-26 11:19:32 +01:00
Jenkins
6687bdd267 Merge "Fixed a network setup issue for F19" 2013-08-25 22:35:10 +00:00
Richard Su
1fb5d232be qpid package mappings
Change-Id: Iad2c21f3c2cd771f58d5444f61186b3aaf84e89e
2013-08-22 23:52:05 -07:00
Chris Alfonso
301c3c4475 Extracting common functionality for rpm based distros
Rather than dublicating code to implement rhel or any
other derivitive, this patch introduces an rpm-distro
element that should be used as a dependency.

Change-Id: I8a92bb041764d03f430b438f0013704f79a8674c
2013-08-20 16:44:19 -04:00
Chris Alfonso
e7a8fefa0b Use kpartx if partition device doesn't exist
If the loop partition isn't created as a device by the kernel, go ahead and use
kpartx to create the device.

Change-Id: I53290b7724d0cb45a1fc9225ec096025db8978dd
2013-08-20 13:27:49 -04:00
sjing
6c26cec656 Set file permission to be executable.
When ramdisk-image-create is called with the hwdiscovery element,
it failed to install hwinfo package.

The root reason is 10-hwinfo is not executable, the fix is to
set the file permission of 10-hwinfo to be executable.

Change-Id: I3a57147103f607b3975eb6ad23a44475f26c2f1e
2013-08-20 08:44:43 +00:00
Jan Provaznik
c93dfeec7f Fixed a network setup issue for F19
IP address is passed as a kernel boot param when booting undercloud
machine. For Fedora 19, this IP is not set, instead IP is fetched
from DHCP.

The problem is caused by a bug in dracut-network version 029, which
causes that dracut network setup script is not executed properly. This
patch applies a fix for the bug when building undercloud image.

Fixes: bug #1213833
Change-Id: Ie94a86ed716044343791628973143c1a7d0778dc
2013-08-19 10:37:46 +02:00
Monty Taylor
d18891d952 Update stackforge references to openstack
Change-Id: I17e896eddf6fe84f4784cac8231552ee3d21aa39
2013-08-17 22:58:26 -04:00
James Slagle
c9a6aef9f4 Add yum element.
The yum element provides for specific customizations
for yum based distros.  The included customization is
a yum cache mounted outside of the chroot so that yum
downloaded packages are reused on subsequent image builds.

Change-Id: I6833c9fdbc83cb09debec6a789082e105c917800
2013-08-14 18:26:51 -04:00
Steven Dake
2c73a001b2 dkms is unavailable on RHEL and derivatives
The dynamic kernel module system is not available on RHEL, CentOS,
Scientific Linux, or SUSE.  Make it part of the distro post-install
rather then base post-install.

Change-Id: Ic2c345bf9f0738dadae611194e263d3a5d424a3e
2013-08-12 19:07:28 -07:00
Clint Byrum
89fe51b83d Fix pypi element README.md errors
- pip install to a github URL without a git+ prefix fails.
- Need to close EOF heredoc when creating mirror.yaml

Change-Id: Ic555174881e9c06fede1cf731141cbe6eb0e0b02
2013-08-12 14:53:18 -07:00
Robert Collins
97bc5d7853 Allow using a pypi mirror to install via pip.
Using a custom pypi mirror can be very convenient, making image builds
substantially faster - because we create multiple virtual
environments we benefit more than single-virtualenv users would.

Change-Id: I997daf1f9477c447e1fb30818aea9e80a49b31a6
2013-08-10 22:07:30 +12:00
Robert Collins
c7d80ddeed Cleanup mount points automatically.
Manually listing the mount points that need cleanup is not
maintainable and makes it hard to write elements that use bind
mounting to inject resources into the build environment.

Change-Id: I7c9ade444f4ebe42552f8e321f257a7ec0a674ef
2013-08-09 22:53:32 +12:00
Derek Higgins
a5806cd482 Change the rootfs label in F18 and F19
The images produced by the diskimage-builder have their filesystem with
a label of "cloudimg-rootfs", The regex changing fstab on fedora didn't
match the F19 case.

This regex matches both
F18 :
LABEL=_/   /         ext4    defaults        1 1
F19 :
UUID=f2da0fc8-2e12-4a6e-8e95-a31a474aa1a8 / ext4 defaults,noatime 0 0

Change-Id: Iafcf5e069199f1df76874309b2d5064f343fb5e5
2013-08-07 09:57:21 +01:00
Robert Collins
c7c4ec19a3 Capture the repositories from source-repositories.
We try to expose metadata to users about what dib included in the
image and source-repositories was not doing that, so this fixes it. It
also permits easy introspection from other elements (such as an
upcoming PyPI cache layer).

Change-Id: I1e48e65f69ebe1f4556cc3bf35ccf195e99bcc76
2013-08-05 09:52:28 +12:00
Jenkins
9233ca4056 Merge "Enable running disk-image-create on SUSE Linux" 2013-08-01 00:36:36 +00:00
Clint Byrum
5a69fa879e Make Ubuntu 13.04 (raring) the default release
Ubuntu 13.04 has been released now for 3 months. The updated libvirt,
openvswitch and kernel are all beneficial to various OpenStack components,
and many other software is updated beyond the versions in Ubuntu 12.10.

Change-Id: I358aed8bf906c3ff5103f19b1f9e6ac689b5d5ee
2013-07-29 17:02:23 -07:00
Jenkins
45f32b4b82 Merge "Ignore emacs autosave files in source-repositories" 2013-07-29 05:04:12 +00:00
Jenkins
1146fe63fc Merge "Add needed symlink for Fedora deployment ramdisk." 2013-07-28 19:58:59 +00:00
Monty Taylor
4535c5323a Ignore emacs autosave files in source-repositories
source-repositories uses find to discover things it should import. If
someone happens to use emacs, and happens to have had an autosave file
in a directory with a wildly broken version of a source-repositories-
file, then dib will attempt to execute the contents of the autosave file
and the user will be sad. Adding a filter to the find command for files
ending in ~ will prevent pain and suffering.

Change-Id: I27c8a4b53d3c9b913ca926db16b4271941f6fb5d
2013-07-27 14:53:29 -04:00
Monty Taylor
c179d9b04d Add downloadonly flag to fedora
devstack-gate needs to be able to make an image that has pre-downloaded
but not installed a sequence of packages. To support that, add a -d flag
to install-packages to allow downloading but not installing. -d passes
through on a dpkg install, and with this patch should be transformed
to --downloadonly which is the yum version.

Change-Id: Ia4e61fa4304df86afbee7dfc8067ea1bdf528f3e
2013-07-27 12:17:02 -04:00
James Slagle
92fa96b2f6 Add needed symlink for Fedora deployment ramdisk.
Symlink /usr/lib -> ../lib for Fedora deployment ramdisk.  This
symlink is needed for systemd-udevd.  Otherwise, the network device is
not loaded and initialized when the deployment image is booted.  This
logic was previously contained in
elements/deploy/root.d/50-redhat-prepare-fs, but now that ramdisk
images are built in a chroot, the change needs to be moved so that it
is applied to the ramdisk build.

Change-Id: Icea43230126956ccf5fb8a6a96ca706b75d5c32f
2013-07-26 11:09:29 -04:00
Derek Higgins
d8ba46f8e3 Install which on Fedora
Create an install hook where core utilities can be installed
on Fedora. In this case we are installing which.
Which is being used by
  ramdisk/post-install.d/01-ensure-binaries
  vm/finalise.d/51-grub
The absence to which caused the ramdisk build to fail on F19.

On Ubuntu which is installed with the package debianutils, this pretty
much has to exist on Ubuntu images, so a corresponding package install for
ubuntu isn't needed.

Fixes Bug 1202612

Change-Id: I847c1619cdab021c9348caed3fa32db64e663e8e
2013-07-26 11:04:58 +01:00
Tim Serong
ee5ae03d58 Enable running disk-image-create on SUSE Linux
- Ensures /sbin and friends are in $PATH when invoked (without this,
  various sudo invocations fail in exciting ways).
- Use dib-run-parts in lib/common-functions instead of run-parts
  (neither SLES nor openSUSE ship run-parts).
- Ensure dib-run-parts doesn't descend into subdirectories (same
  behaviour as run-parts).
- Move dib-run-parts from root.d to bin (cleaner, consistent with
  other elements with separate bin scripts).
- Tested by building Ubuntu image on openSUSE 12.3.
- Note: this doesn't add support for creating SUSE images, it just
  lets you run disk-image-create on SUSE-based distros.

Change-Id: I906c6bc3cf51cdf2c4415adeae1ca250faac25e1
2013-07-24 20:16:31 +10:00
Jenkins
5f52562570 Merge "Support repo names with multiple '-'s" 2013-07-19 19:45:42 +00:00
Derek Higgins
a4a0523f2b Support repo names with multiple '-'s
The search and replace that converted dashes in REPONAME only converted
the first dash. They should all be converted.

Change-Id: I76a48cf5bdfa8664f0a65d0238fa4da7d80305db
2013-07-19 17:45:01 +01:00
Derek Higgins
51216dbd2d Set work-dir to cached repository
source-repositories does a git reset on the .git directory of cached
repositories. But doesn't specify the directory to reset. A working
directory needs to be specified so that the $PWD isn't used.

Without this change $PWD is polluted with the contents of repositories
being cached.

Change-Id: Ic37b702ac579bf766bb2204a988fa9468d308abf
2013-07-19 17:40:16 +01:00
Robert Collins
e187a402ae Move the getsources hook earlier.
Caching PyPI objects will require inspecting the content downloaded by
the source repositories, so needs to run after it.

Change-Id: I551c075e0bb6853b2ef79268b7f6455a4f06743d
2013-07-18 23:06:30 +12:00
Robert Collins
79ca4d901c Cache repository-sources data.
Cloning large repositories over the internet can take considerable
time.  Caching them locally makes repeated image builds significantly
faster, so lets do that.

When users override the element source they will often be using a
local repository, so in those cases I don't cache - but we could
easily change our minds on that in the future.

Change-Id: I9822362cf722b904d9806dbbb4bb07cfe2b33437
2013-07-18 22:40:23 +12:00
Robert Collins
b8d08006db Update the Fedora element to honour --offline.
Similar to the Ubuntu element the Fedora element had not been updated
to honour --offline. Also similarly we only check for the existence of
the final cached file rather than the image we directly download,
because they are generated separately.

The -u change is just hygiene to detect future buggy changes.

Change-Id: Ib92a9d419bb485c8861da041066827e8d6aac0b7
2013-07-18 13:19:35 +12:00
Robert Collins
d7379df8b8 Enable --offline support for Ubuntu root images.
When --offline is set elements should not revalidate cached data. The
ubuntu element had not been updated to match this. SHA checking is
also skipped as we only move a new cached file into place when the
hash matches, and we might download a new hash before updating the
image cache, which would cause persistent --offline failures.

Change-Id: If1a0366b51951a73b7a3ffe23a29a3d910b08938
2013-07-18 13:19:35 +12:00
Lucas Alvares Gomes
64d7b8d4cb Fedora 19 GRUB
In the 52-force-text-mode-console hook, gracefully exit when the
/boot/grub2 directory does not exist on the Fedora 19 cloud image
filesystem. By default the Fedora 19 cloud image is using extlinux to boot
the image instead of GRUB. The decision was taken because GRUB is quite
big (would pull in ~30MB of dependencies) and there's very little benefit
in using it because cloud images don't need to cover all the corner cases.

Change-Id: I52723d4d14c21b1787b4c7e0dd21a09cdbdae0d1
2013-07-16 18:05:04 +01:00
Ivan Berezovskiy
894134fd30 Fix for mounted readonly filesystem for Fedora 19
Change-Id: Ie168618924116f88ef4ec46f59e79818239b4c70
Fixes: bug #1201774
2013-07-16 15:49:36 +04:00
Jenkins
5d84c9ea46 Merge "Update Fedora cloud image to its latest version" 2013-07-15 15:37:53 +00:00
Jenkins
e75ada24e1 Merge "EFI hosts" 2013-07-15 15:31:52 +00:00
Lucas Alvares Gomes
a1beca7b44 EFI hosts
If you have an EFI host but the image doesn't have the EFI modules
installed the grub-install command will fail in case the --target
argument is not set. The problem is that the grub-install script will
check whether the /sys/firmware/efi file exists or not to determine if
it's an EFI installation, but this value comes from the host, so this
patch will look for the /sys/firmware/efi file and will also check if
the EFI modules are installed in the image, if not set the --target to
a non-efi platform.

Change-Id: I4481b43e4a8fe4144be9c7eb9d9c618bbb2df21e
2013-07-15 10:22:51 +01:00
Jenkins
29bff3d601 Merge "Build ramdisks in an image chroot." 2013-07-12 20:25:00 +00:00
Jenkins
e057476f09 Merge "Make cloud-init-nocloud work cross-platform." 2013-07-12 20:12:08 +00:00
Lucas Alvares Gomes
6f8b8f07b2 F19 GRUB configuration file
In the 51-grub hook, after the GRUB installation, the script will look
for a GRUB configuration file and in case it's not present one will
be generated using the grub-mkconfig command. The reason why it have
to be done is because the new Fedora 19 cloud images is using extlinux
by default.

Change-Id: I80b15b3122698d98ac4d47dc06faf5909a90ab00
2013-07-12 17:21:15 +01:00
Matthew Farrellee
82eacdec2f Add package mappings for augeas-tools and openssh-client
Change-Id: I06e2c30ea13ff616ca2ae7c55a7c050aaae64df9
2013-07-12 10:24:15 -04:00
Chris Jones
8d1ce9c0c3 Build ramdisks in an image chroot.
Ramdisks are now built inside a chroot which is built by the normal
image build process. Doing so improves our independence of the
precise state of the build host.

This fixes bug 1194055.

Change-Id: Ibc254fbb9e7b404b5f38c1b35bcde8a4136e8e28
2013-07-12 11:09:35 +01:00
Clint Byrum
ac738685fb Make cloud-init-nocloud work cross-platform.
Previously debconf was used and thus this only worked on dpkg based
systems. Now we can support any system that runs a reasonably recent
cloud-init.

Change-Id: I1397aefb3af400adcfd98f858c5a32fad2b584b5
2013-07-11 08:21:51 -07:00
Kashyap Chamarthy
92313e0c81 Update Fedora cloud image to its latest version
Latest Fedora cloud images are available here

  http://cloud.fedoraproject.org/

With this change, when a Fedora version comes up,
d-i-b will point to it automatically.

Fixes 1199237

(Also, thanks to Lucas Gomes for testing.)

Change-Id: Ifcb8a48f3baf3ef841f00e6a20c6fd9f79fea129
2013-07-11 11:58:42 +05:30
Jenkins
8c5888e853 Merge "Adding docs for the source-repositories element" 2013-07-10 20:45:09 +00:00
Derek Higgins
195053108b Adding docs for the source-repositories element
Change-Id: I57244a5cc2f563b2e69eb49388c3c6b49202c9eb
2013-07-10 13:04:39 +01:00
Clint Byrum
f6cc6bb185 Use ccache to cache all compiles between builds.
Many python extensions are built from source each time an image is
built. Repeating these is wasteful, so ccache is employed to eliminate
that waste. A cache dir outside the chroot is used to speed up
subsequent image builds.

Change-Id: Ib73563ddbe5f3be7454bfc54ab91cedb559a1304
2013-07-09 18:18:19 -07:00
Clint Byrum
3464064a87 Add environment.d hook to setup environment.
Before each phase dib-run-parts will pick these up to setup the
environment for the commands it runs.

Change-Id: I56697d7bc370918d4063eee67a1c35d4988a5359
2013-07-09 15:01:33 -07:00
Lucas Alvares Gomes
9f93451710 Curl to redo the request (Found 302)
The URL to download the Fedora 19 images is not persistent anymore,
they are now download from http://download.fedoraproject.org where the
request will be redirected to a different location. Passing the -L option
to the curl command will make it redo the request on the new place and
download the image correctly.

Related to bug #1199237

Change-Id: Ib9b9d65734992e2bf1a6888c5f2eb9de366f8204
2013-07-09 11:22:51 +01:00
Richard Su
9a81644d65 Fix loop0p2 does not exist on F19
On Fedora 19, there is a delay between the time loop0p2
is created to the time it is ready to be mounted.

This patches waits for 5 seconds for /dev/mapper/loop0p2
to be accessible. If it is not ready then the script
exits with status 1.

Fixes: bug #1197340

Change-Id: Iff0cfd0566673799a77500e0e24954f5f3743a17
2013-07-05 12:38:24 -07:00
Lucas Alvares Gomes
57a1304df9 Add arping to the fedora map-packages
Needed for the quantum-network-node element

Change-Id: I9a96476667c33a8260a60e7ad95c0f15166bc868
2013-07-05 10:21:33 +01:00
Lucas Alvares Gomes
095b0b3b61 Add mysql-devel to fedora map-packages
Needed for Ifc3580d4b59a5f1e97de77c0c4a875b123208100

Change-Id: I984a5c63a20bc79747d3d09affd9b45371c46702
2013-06-28 16:22:56 +01:00
Vipul Sabhaya
c0206aa52c Fix cache-url to use single '=' in test expression
When downloading the base image for the first time, the response
test expression fails with '[: 200: unexpected operator'.  This is
caused by using '==' in the test expression, which is not supported
in sh scripts.

Fixes bug 1195030

Change-Id: I66260814cb591371dc5c10f8436f90c2f18d78cf
2013-06-26 14:51:30 -07:00
Jenkins
860090bd1a Merge "Re-use cache_url() in fedora element." 2013-06-26 13:04:24 +00:00
Jenkins
2ced195d20 Merge "Fix pyOpenSSL on Fedora." 2013-06-26 04:25:34 +00:00
Richard Su
44df18af75 Fix cloud-init routing issue on Fedora
Add "NONZEROCONF=yes" to /etc/sysconfig/network to prevent
169.254.0.0 route from being created. This route interferes
with fedora baremetal nodes' access to the nova metadata
server at 169.254.169.254.

Change-Id: Iad77abfc97c0eba944680772f233389481a270ff
2013-06-25 14:49:18 -07:00
Lucas Alvares Gomes
1ee499729b Fix pyOpenSSL on Fedora.
On fedora 18 the package pyOpenSSL is conflicting with one of the
packages needed to build the bootstack image. The problem gets sorted
if you install pyOpenSSL at the beginning of the image building process
and this is what this patch is doing.

Change-Id: I681683b81ad638dfeb690fde1bc7d08a2116aaed
2013-06-21 18:08:44 +01:00
Jenkins
539e8e2e69 Merge "Improve first time download of ubuntu images." 2013-06-21 13:51:54 +00:00
Derek Higgins
674a6c172b Use the source-repository interface.
Use the new source-repository interface to git clone
source repository.

Also there was a few thing in this element that needed to be fixed.
o url to the git repo wasn't curren't.
o pip and git are also dependencies that needed to be installed.

Change-Id: Ieb7be6576fc909aa4bba0233b7b81cab03395d76
2013-06-20 14:47:27 +01:00
Derek Higgins
f527b024b9 Install git with source-repositories element.
Git isn't a dependency of this element, but is a dependency of pbr
if you are doing pip install on a git cloned directoy, because this
looks to be a fairly common pattern it makes sense to have git on the
target image.

Change-Id: I49ee3fa4eac493b9dfa379a674ab9b3390cfc89a
2013-06-20 14:47:08 +01:00
Derek Higgins
866c55dced Use full path to dib-run-parts during firstboot.
Commit cc5ecb4e9c switched from using
run-parts in favor of dib-run-parts.

/usr/local/bin isn't part of PATH on Ubuntu causing
"/usr/sbin/dib-first-boot: line 8: dib-run-parts: command not found".

Change-Id: Ia7e401221add197edf880af82e0148f3ba7d2b9c
2013-06-20 08:13:30 +01:00
Jenkins
92094ecdc5 Merge "Add mechanism to send error messages to helper." 2013-06-19 23:09:22 +00:00
Mark McLoughlin
6c997fda97 Re-use cache_url() in fedora element.
The fedora element downloads images too, so we should re-use the caching
code from the ubuntu element.

There doesn't seem to be other examples of code shared between root.d
scripts. In the fedora and dpkg elements we copy install-packages into
the chroot, but that model doesn't apply when we're running scripts
outside of the chroot. Seems sane to just run it directly from the bin/
dir in the temporary hooks directory.

Change-Id: Iaa6aca660042fea323cab4271633a4bdbbc271b8
2013-06-20 00:04:59 +01:00
Mark McLoughlin
efb1f435d4 Improve first time download of ubuntu images.
If a cached copy of the file doesn't exist, cache_url() passes a
non-existent path to -z/--time-cond and you see this warning:

 Warning: Illegal date format for -z, --timecond (and not a file name).
 Warning: Disabling time condition. See curl_getdate(3) for valid date syntax.

It works just fine, but the warning is ugly.

Change-Id: Ic6f13a2c596b988308d7fca9cd1745e5d48ae5fb
2013-06-20 00:04:53 +01:00
Jenkins
ded16a0eb3 Merge "Use dib-run-parts on dib-first-boot." 2013-06-19 22:27:27 +00:00
Jenkins
35c4a0a8fa Merge "Adding element to get source for elements." 2013-06-19 22:23:19 +00:00