Commit Graph

858 Commits

Author SHA1 Message Date
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