Commit Graph

282 Commits

Author SHA1 Message Date
Jenkins
2536d3f28d Merge "Retry losetup -d for up to 10 seconds." 2013-05-09 23:08:29 +00:00
Robert Collins
a8707cc152 Add an element to configure a serial console.
With ILO and other remote machine management cards, a serial console is
actually useful.

Change-Id: I86f74d9dae3821b4682df813c5b52a83a29a138a
2013-05-10 07:38:31 +12:00
Clint Byrum
20661e8d80 Retry losetup -d for up to 10 seconds.
When partition tables are added to loopback devices, this can set off a
chain of udev hooks that may still be holding the loopback open. Failing
to detach loopback devices was the reason we were seeing leaked tmpfs
volumes.

Fixes bug #1178091

Change-Id: I836d6e2bbce824951dd4786e3ef28273ea18ee73
2013-05-09 09:34:53 -07:00
Jenkins
bd0f73f4cc Merge "Use conditional GET to fetch latest ubuntu image." 2013-05-09 05:13:06 +00:00
Jenkins
4506d948ea Merge "Reinstate support for real hardware with Ubuntu." 2013-05-09 01:20:23 +00:00
Lucas Alvares Gomes
e537e046d1 Force the inclusion of /usr/local/bin in PATH.
Sudo compiled with the --with-secure-path option enabled (default on
Ubuntu, Fedora and potentially other distros) will cause sudo to ignore
any changes made to the PATH variable in the user's environment (even when
the -E option is used). Also, some distros might not have /usr/local/bin
set in their sudoers secure_path causing the diskimage-builder to fail
when building an image using such distros as host. This patch will force
the inclusion of the /usr/local/bin in the PATH enviroment variable
inside the chroot.

Change-Id: Idb7156d8ff124bfe685cc721337d9bb21f49dc9e
Fixes: bug #1175980
2013-05-08 23:32:47 +01:00
Robert Collins
d5d775e9b4 Tweak the moved cleanup_dirs to match the original.
Change-Id: I5cb240aa82a5d9ccea539927d355a1f07e728381
2013-05-09 08:32:36 +12:00
Jenkins
fe36ab5554 Merge "Extend mellanox support to disk images." 2013-05-08 19:54:15 +00:00
Jenkins
c26bd8d655 Merge "Remove img-functions from ramdisk-image-create." 2013-05-08 19:51:32 +00:00
Chris Krelle
76d8d98a60 Remove img-functions from ramdisk-image-create.
Ramdisk-image-create sources both img-functions and ramdisk-functions
causing duplicate functions. To correct this situation this patch
removes the import of img-functions from ramdisk-image-create.
It moves cleanup_dirs and run_d functions from img-functions to
common-functions to allow this.

fixes bug 1175427
Authored-by: Chris Krelle <nobodycam@gmail.com>

Change-Id: I971d019b0d92b06d9de661663b49c433e823ea42
2013-05-08 07:39:30 -07:00
Ghe Rivero
a72d3c1af5 Ignore errors when ldd'ing static binaries.
When trying to get the library dependencies from a static program
it fails and die.
This scapes the error and continue with the execution.

Change-Id: Id3463f2dd77a182ce4f9d9d28165d35f17806892
2013-05-08 14:30:22 +02:00
Chris Jones
dbe715e97b Extend mellanox support to disk images.
We need to support mellanox devices in disk images as well as ramdisks.
This adds the requisite element structure to provide that support.

Change-Id: Iaf383f5b32b84fbb69569ef42ec2460ab1b231e5
2013-05-08 11:07:12 +01:00
Jenkins
7893e23435 Merge "Remove tripleo PPA from base element." 2013-05-08 07:58:46 +00:00
Robert Collins
3052127ae0 Reinstate support for real hardware with Ubuntu.
Change-Id: Ibfdcd9c4b707a41258153c15a09d5976311080a0
2013-05-08 19:23:08 +12:00
Clint Byrum
b751213a24 Remove tripleo PPA from base element.
The PPA would have to be updated for each release we want to build for,
including raring. The PPA also gives the tripleo team root on every
built image, something we don't necessarily want.

A shallow review of the packages in the PPA and known elements shows
only one dependency in the tripleo-image-elements heat-cfntools element.

Change-Id: Ic514f929eba26014dd3a0d76d5bb3b8e9e0caf3c
2013-05-07 09:07:35 -07:00
Clint Byrum
d9a2211d14 Only use tmpfs if build machine has 4GB+ RAM.
For machines with low RAM (or no access to /proc/meminfo) the builder
will still run, but will just build inside the filesystem that is
hosting /tmp. This will result in a slower build (especially if there
are a lot of .deb packages installed).

Fixes bug #1175453

Change-Id: I79f2672058c11e377548820df0ab4fad8f47ffdc
2013-05-03 06:55:53 -07:00
Clint Byrum
60a1405eef Use conditional GET to fetch latest ubuntu image.
This also switches to using curl which some people may not have
installed. However, curl is far superior for this type of download.

Change-Id: I7ac5a84b30eb8daad320c082f976931c41a24669
2013-05-03 00:38:31 -07:00
Jenkins
f13570d322 Merge "Fix architecture filter." 2013-05-02 20:37:58 +00:00
Robert Collins
d119c28f49 Revert "Improve Fedora build host support."
This reverts commit 591059ffd3.

Change-Id: I8ad5bde2eabe12c6575d51e7443d9b46521c0928
2013-05-03 08:16:43 +12:00
Chris Jones
488c462dcd Fix architecture filter.
If we are using uname to collect the name of the architecture, we need
to filter its output to make it consistent with dpkg. This is now
happening in the right place to avoid a spurious warning on i386 builds.

Change-Id: Iae80dbfb757fc068155730686841c742acb7a6a2
2013-05-02 20:58:48 +01:00
Jenkins
55993863fc Merge "Improve Fedora build host support." 2013-05-02 19:30:43 +00:00
Jenkins
999296272c Merge "Add few other packages to the map list for fedora." 2013-05-02 19:16:54 +00:00
Jenkins
90a64d745b Merge "Fix up the conflict between audit and glibc packages." 2013-05-02 19:16:11 +00:00
Robert Collins
f725be5dd1 Unbreak grub for precise.
Change-Id: I5739b95e08c25d732223ad36d00aa1a46f67ff28
2013-05-02 16:30:03 +12:00
justin-hopper
6dae56c452 Fix GRUB command quote escape for VM element
Quotes were being eaten by bash

Change-Id: Ib33be02eeb703df5b23fc8d0b312f480c69f1b1b
Fixes: bug #1175374
2013-05-01 15:47:27 -07:00
Jenkins
9e9f5fecb8 Merge "Fix missing export of $ARCH" 2013-05-01 20:47:39 +00:00
justin-hopper
b7bcbe6215 Fix GRUB for for precise
--target param is not supported in precise

Change-Id: Ie369ed9d53dbb462cf253144251da4d5c463107c
Fixes: bug #1175275
2013-05-01 12:40:23 -07:00
Lucas Alvares Gomes
2cd44bd77c Fix missing export of $ARCH
So that elements can have access to the variable.

Change-Id: I9a63160ef891e3a3a3c6c90856e2539250c8b807
2013-05-01 15:13:24 +01:00
Lucas Alvares Gomes
591059ffd3 Improve Fedora build host support.
Sudo command (even using -E) resets $PATH for security reasons, Fedora
and other distos might have to explicitly add /usr/local/bin to $PATH
in order to run the commands in the chroot environment.

Change-Id: I95068ecf1e7437152e11c6d6789f59bcfd6ae9cc
2013-05-01 09:40:15 +01:00
Robert Collins
e27ac025fc Use a different approach to solving the ramdisk-image-create failure.
Change-Id: I2861927d1989bde1137c253c8b3a48b245c65f19
2013-05-01 15:03:44 +12:00
Tim Miller
7ef33c51db Source img-functions into common-functions.
A recent commit added a call to function cleanup_dirs to
the common-functions file, but this function is not in scope
for all code paths.

The problem can be reproduced like so:
  bin/ramdisk-image-create deploy -o /tmp/foo

Which results in the error:
  bin/../lib/common-functions: line 35: cleanup_dirs: command not found

This change causes cleanup_dirs to be in scope when calling ramdisk-image-create.

Change-Id: Iaf01beb9dd42a9d810d8aed1aa4ce19a5854c09b
2013-04-30 19:36:37 -07:00
Jenkins
39152c1b30 Merge "Improve Fedora build host support: architectures." 2013-05-01 01:52:10 +00:00
Robert Collins
cb62bae9b8 Build images using loopdev instead of qemu-nbd.
Qemu-nbd does not perform well with older versions of qemu due to
the lack of writeback caching mode. It also only builds qcow2 images
and there is a desire for raw image support. Finally, qemu-nbd makes
it very difficult to build images concurrently due to the somewhat
opaque nature of how it selects a /dev/nbd# device. losetup, on
the other hand, makes this process very straight forward.

Change-Id: I309fad8af4fd1e8d1720c17b65e1897a76d5e897
Co-Author: Clint Byrum <clint@fewbar.com>
2013-04-30 08:56:12 -07:00
Lucas Alvares Gomes
5bb6b362d4 Add few other packages to the map list for fedora.
Needed to build some modules with pip.

Change-Id: If6e210bbd68ffe7454069c4b0880ba787733aa7a
2013-04-29 16:03:43 +01:00
Lucas Alvares Gomes
da7e5b837c Fix up the conflict between audit and glibc packages.
Update audit in order to fix up a conflict with a file from the glibc
package on a fresh Fedora 18 install.

Change-Id: Ib44c8415bce4ec47e21626a697cf426b96a9061a
2013-04-26 11:55:10 +01:00
Chris Jones
be48317fc3 Improve Fedora build host support: architectures.
Instead of blindly calling dpkg, we will now perform an appropriate test
and fall back on uname with some subsequent massaging of uname's output
on amd64 and ARM build hosts.

Based on a patch from Lucas Alvares Gomes

Change-Id: I363addd9f8b4d748d50b69f4509ce627aa5676aa
2013-04-25 11:04:02 +01:00
Jenkins
0a1bf74c32 Merge "Adds support for post-install scripts." 2013-04-22 22:18:25 +00:00
Chris Jones
3202a8f69c Fix Ubuntu image fetching.
Set a bash option which has been breaking cold builds due to an extended
glob pattern.

Change-Id: Ideab0fca057eb3744002ae137ac1f988b61bb560
2013-04-21 21:31:51 +01:00
Robert Myers
1001e750e7 Fix a small typo in fake init scripts.
Change-Id: Iaae4e8424ce2e87b0d19391fa2994042aed832e5
2013-04-18 13:57:55 -05:00
Lucas Alvares Gomes
45173ccdb5 Adds support for post-install scripts.
Post install scripts are useful because they can perform tasks you want
to handle after the OS/application install but before the first boot
of the image. e.g: Clean the cache left by the package manager reducing
the size of the image.

Change-Id: I03e77f602192bbdce29c02999d1b57fac8051ddc
Fixes: Bug #1145786
2013-04-17 09:47:51 +01:00
Jenkins
26ba473c72 Merge "Migrate cloud image URL/Release options to DIB_." 2013-04-12 19:59:19 +00:00
Jenkins
2c442c5b02 Merge "Grab the next available /dev/nbdX." 2013-04-12 19:59:18 +00:00
Lucas Alvares Gomes
b20e133714 Grab the next available /dev/nbdX.
Change-Id: I6a2c8e58cdab889d747e870d0009f51bba0ff148
2013-04-12 17:49:23 +01:00
Devananda van der Veen
8a22115c6d Allow build dir to be changed from /tmp
Adds an env var TMP_DIR which will override mktemp's default location.

Fixes bug 1168432

Change-Id: I60c63389bb2a639f948e7e96bf9aaea0ea73e27d
2013-04-12 07:43:53 -07:00
Chris Jones
a8312db742 Migrate cloud image URL/Release options to DIB_.
This switches $CLOUD_IMAGES and $RELEASE to the DIB_ namespace so
they will survive future changes to the sanitisation of the build
environment.

Change-Id: I7dc2aa82fb9ef452705b080cc404f41046014f20
2013-04-12 14:48:54 +01:00
Jenkins
66b563e466 Merge "Introduce the DIB_ namespace for build-time config." 2013-04-12 09:38:43 +00:00
Chris Jones
bd1bae7c58 Introduce the DIB_ namespace for build-time config.
Document the use of DIB_ as a prefix on environmental variables that can
be overridden at build time.

Introduce the first such variable by migrating IMAGE_SIZE to
DIB_IMAGE_SIZE.

Change-Id: Ie36b734991b913a23f37f2add47d470d7c1576e4
2013-04-12 09:50:34 +01:00
Tim Miller
9eda303f5f Fedora element allows root to sudo without TTY.
The root user tries to `sudo -u stack`, without a tty,
causing fedora+devstack images builds to fail in Jenkins.

Change-Id: Ia0a7fb315cf9bd17cf250e70dba06363a697c97c
2013-04-09 16:46:16 -07:00
Jenkins
169382246b Merge "Generate ssh hostkeys on first-boot." 2013-04-09 20:54:15 +00:00
Tim Miller
21e3fb185c Generate ssh hostkeys on first-boot.
cloud-init is expected to generate unique hostkeys on first
boot, but sometimes it doesn't.

This change ensures that hostkeys are always generated.
This change should be removed if the cloud-init problem is solved.

Change-Id: I7d7e05fbd12727992cf1aebec547ae0488e002ff
2013-04-09 11:18:02 -07:00