Commit Graph

479 Commits

Author SHA1 Message Date
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
Jan Provaznik
0eaddbd214 Fixes files ordering when choosing newest image
For example if there are following kernels in undercloud/overcloud
image:
/boot/vmlinuz-3.9.5-301.fc19.i686.PAE
/boot/vmlinuz-3.10.10-200.fc19.i686.PAE
then disk-image-get-kernel picks vmlinuz-3.9.5. It should use the
newest one.

Change-Id: I7bbf06705e85370d66c7dd8a5d4f8d6c93b21c0c
Fixes: bug #1224365
2013-09-12 11:26:57 +02:00
Matthew Farrellee
43b96d91c2 Add package mapping for default-jre
Change-Id: Idffbc84ea2afaf2584c1bb79729c3e0cf52b851e
2013-09-10 20:01:21 -04:00
Derek Higgins
e8c73cde49 Set raw image size to be multiple of 64k
This works around a bug in qemu-img causing it to sometimes error if
compressing a raw image that isn't a multiple of 64k (the qcow2
cluster size).
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1180021
http://lists.gnu.org/archive/html/qemu-devel/2013-04/msg02520.html

Change-Id: I88f8bb5c6bf3606ef5856b085a284af6b8858dbb
2013-09-08 21:36:29 +01:00
Ghe Rivero
a495079695 Delete -new image once copied
Before, this was created on /tmp/image.XXX so was removed at the
end of the script.

Change-Id: I8ceb97626d389c5bcb66fa3058f74388009ea677
2013-09-05 09:19:15 +00: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
Jenkins
771f3ec141 Merge "Add option --min-tmpfs <size> to disk-image-create" 2013-08-28 15:40:31 +00:00
Jenkins
2d7930447c Merge "Add package mappings for MySQL-MariaDB" 2013-08-28 15:40:30 +00:00
Jenkins
316d6beeaf Merge "Combine compress and save image into one function" 2013-08-28 15:39:56 +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
Ghe Rivero
fefc28a918 Add option --min-tmpfs <size> to disk-image-create
In some scenarios, the required space in the tmpfs partition can be
larger (or smaller) than the default one, producing errors due to
the lack of enough space (or performance penalties for not using
tmpfs).

Using --min-tmpfs <size>, we can hint the working set size we'll need
and let dib choose to avoid or use tmpfs.

Change-Id: I7d5fe498302a100c8555ae542268e14b21f3a0c5
2013-08-28 11:14:06 +00:00
IvanBerezovskiy
d4a9b44e73 Add package mappings for MySQL-MariaDB
Partial-Bug: #1213891

Change-Id: I1ac1d11ff1716eccee4c734395282be25dd5b541
2013-08-28 15:04:12 +04:00
Ghe Rivero
dbfca7a816 Combine compress and save image into one function
When compressing an image, this is done in the same dir where the raw
image resides, doubling the amount of space needed (scarce when
using tmpfs), and then it's moved to the .cache folder in disk.

Combining these two functions, we reduce the amount of space needed
in the tmpfs partition (when in use), and the compressed image is
created directly on the .cache folder disk, so there is no need to
move the compressed image after the process into disk.

Change-Id: I451d24bdd6fa0983414244135dff5e96c0549833
2013-08-28 10:51:40 +00: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
1dea2f3524 Call sync before unmounting keeps the mount from being busy.
here is a bug associated with this patch because there is a
workaround included. Calling sync to enable the unmounting...
https://bugs.launchpad.net/diskimage-builder/+bug/1214388

Change-Id: I9d5a1f092fd8f3ae1c14de03dd516203baab4da3
2013-08-21 09:10:35 -04:00
Jenkins
473d08cb84 Merge "Remove a device mapping, then let the loop device get removed" 2013-08-20 23:09:43 +00:00
Chris Alfonso
35364749de Remove a device mapping, then let the loop device get removed
Change-Id: Ie1eb621ff56688208421d0115547f127a3c7fd56
2013-08-20 16:58:25 -04: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
Steve Baker
d6deb9f565 Package dib-run-parts
dib-run-parts is a symlink into the elements directory.

During packaging the symlink is preserved however
during installation dib-run-parts becomes a file containing
the contents of the symlink target.

Related-Bug: #1212482
Change-Id: I78c28a52689810a2ccfc9925a9ac8df017c44326
2013-08-15 12:39:39 +12: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
d6d941a8f1 Make $HOME in the chroot be reasonable.
With sudo -E $HOME is inherited, which is nearly always wrong.

Change-Id: Ic77b9c2892c19a2fc08a07d35f76da79a346ebac
2013-08-10 01:16:02 +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
Jenkins
39d4d9b941 Merge "Remove explicit sudoers requirement." 2013-08-06 20:57:33 +00:00
Jenkins
585a155d17 Merge "Document the dangers of co-existing elements." 2013-08-06 20:55:50 +00:00
Chris Jones
357c2de681 Remove explicit sudoers requirement.
Most of our build process runs as root and the overhead of explicitly
tracking sudo commands in the shipped sudoers.d file, plus the
operational overhead of keeping the sudoers.d file updated on build
hosts over time, is now considered to be unnecessary.
Instead, we now document that the build process will expect sudo
commands to work and the operator must make this happen (either by
running as root, via sudo -E, or allowing passwordless sudo for the
build user).

Change-Id: If2628e7d0c7efde0fb99c84a217523ba29b1b38d
2013-08-06 16:08:35 +12:00
Chris Jones
3708e40051 Document the dangers of co-existing elements.
Add a potent example (and simply remedy) of how element authors can
unwittingly conflict with each other in ways that it is almost
impossible for us to guard against with low level policy/mechanism in
di-b. Fixes bug 1181309.

Change-Id: I51e845065702911371e448521327143495c3b405
2013-08-06 16:07:09 +12:00
Robert Collins
bcad3737e8 Blacklist H803
H803 isn't supported by community consensus. Blacklist it to avoid
breaking folk's muscle memory.

Change-Id: I8eea9eb2562e12136018e762c8a5e23527fcf48f
2013-08-06 13:59:13 +12: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
Robert Collins
950fa15d64 Improve caching documentation.
It was a little weak, and folk need enough detail to reason about
performance.

Change-Id: I67f81ab5a206b3d42dd1e4e1eb52af88ac1a3adc
2013-08-02 22:48:51 +12:00
Steve Baker
7795c7b108 Package with pbr.
Uses pbr-0.5.20 glob support to install elements, lib and scripts.

Change-Id: Ie466e753f6e75a943ced1a2939c9bb27aec4a6b0
2013-08-02 12:32:25 +12:00