Commit Graph

78 Commits

Author SHA1 Message Date
Markos Chandras
e22faa0f77 elements: Drop executable bits from environment files
Files in $element/environment.d are meant to be sourced, so drop
the executable bit. Moreover, drop the executable bit from a couple
of other scripts that are either meant to be sourced or simply because
they are configuration files.

Change-Id: I7f724dd9d409f4a835a136f12f48a84aa9acc41e
2016-12-01 23:06:56 +00:00
Ian Wienand
e531980a14 Remove RedHat grub workaround install
AFAICT this is no longer necessary.  I've tested minimal and image
builds and they seem to work.

The original problem seems to be with installing the package in the
chroot, although it was never quite clear it ever affected the Red Hat
path.

This code is currently broken (see
I884cb1e78ad8c31d985f3fc94a58091b993edd7d).  This is proposed as an
alternative to I74eed074494134334d5e49042bb5214bd0dd7339.

Related-Bug: #1627000

Change-Id: Iafe3611f4eec3c6357587a6cae6a30a261686ead
2016-10-25 15:52:27 +11:00
Jenkins
96ce53fa16 Merge "Fix grub installation for RHEL" 2016-10-12 14:22:49 +00:00
Yolanda Robla Mota
f6e11c91c3 Fix typo in extracting root partition
Change-Id: Ie8dfd958d57ef92988647166f2031adb8406b0d7
2016-09-27 09:41:32 +02:00
Jiri Stransky
93425d14ce Fix grub installation for RHEL
Grub is first removed and then installed during RHEL image building. The
grub2 package typically requires the same version of grub2-tools, so if
we just remove and install the grub2 package, the installation can
potentially fail on being out of sync with grub2-tools version. Removing
and reinstalling both packages fixes this issue. Those packages are
already in package map for RHEL as "grub-pc", so we can use this alias.

Change-Id: Iefd9c17fffd43de3fea260510ad218b1322eecb3
Closes-Bug: #1627000
2016-09-23 14:14:49 +02:00
Yolanda Robla Mota
c1bac651cb Allow to skip kernel cleanup
For some use cases, it can be useful to keep all the kernels
and not just keep the latest one. Add a parameter that allows
it, and continue cleaning up kernels by default.

Change-Id: Ia6e6c1fa18e3724c1eb89226151d81e9e748b793
2016-08-12 12:49:19 +02:00
stephane
09317fccca Make Fedora 24 the default
Fedora 24 is the current release, so use it in the
fedora and fedora-minimal elements.

Change-Id: I0ac0d0767d4de9d28ae86d1344fd7c9d8876e5a1
2016-07-08 09:15:08 -07:00
Erno Kuvaja
6fd6b3bb25 Add cinder-backup mappings
'cinder-backup' to 'openstack-cinder-backup' mappings where necessary

Change-Id: I5f57401295d655112f0ad1d6442268df149daa7e
2016-06-07 14:15:47 +02:00
Ian Wienand
cb0e0e903d Use dnf to cleanup old kernels
As described in the comment, there is a dnf equivalent of this command
that doesn't require us installing yum-utils (which drags in yum on
dnf-only systems such as f23)

This is a small consequence to this -- due to us not installing
yum-utils some installs will now be completely yum free.  This causes
a breakage in ironic-agent 99-remove-extra-packages where we remove
the yum package.  There is a long-standing bug/feature where missing
packages in a group of packages do not cause yum/dnf to exit with
failure, but uninstalling a single package will.  Because we have made
the systems yum-free, the uninstall of yum can fail in this corner
case.

It has always been like this, so I'm in favour of the "ain't broke"
approach.  To work-around this, I have just put yum into the existing
list of packages to be cleaned up.  I have added a note to the yum
installer taking note of this behaviour for future reference.

Change-Id: I8bbdc07ccdb89a105b4fc70d5a215077c42fcd03
2016-02-08 14:20:56 +11:00
Augustina Ragwitz
7df60c31b9 Fix title of env vars section of redhat-common README to match template
Change-Id: I37b33eba8af507c03088bc0025280a696e85b04f
2015-10-08 17:05:57 -07:00
Derek Higgins
fadb613e78 Download a compressed centos cloud images
The centos cloud images are both arround a GB in size, and
downloading them causes lot of CI timeouts, downloading the
compressed version saves 700MB of bandwith and should save
a lot of time.

Change-Id: I8dcd1db81fe5c4661945638ef3e6344fdf651243
2015-09-17 10:03:59 +01:00
Augustina Ragwitz
099bdc3d34 Update redhat-common elements README from free text to table formatting
Change-Id: Ie87cf9937a54110719814046c4f46829e307ff3d
2015-09-09 15:08:29 -07:00
Evgeny Antyshev
8349f0350e Remove grub2 in redhat-common/pre-install.d/15-remove-grub
In Id1e430e7d050a0b99ac449e2ea435e06cda1c4e6 I made the mistake of not
actually removing grub in 15-remove-grub.

This restores the removal phase and adds a bunch of comments.  It
seems the centos7 and centos (6) images have grub2 installed, but F22
does not; hence the check.

For anyone interested in the history; it seems the whole idea of
removing grub and re-installing it in the finalise stage is to do with
Ubuntu grub scripts failing in the chroot.  It is not clear this does,
or has ever, affected rpm based systems; but that's how it is, so
leave well enough alone.

The whole reasoning behind the rpm download & re-install is actually
explained in If095adc4abb52a19a3aa0b1caebfb3e4d8f605ef, but over time
the comments got lost as code moved around.  I've restored in here
some detailed explaination of why we don't just re-install the package
"normally".  I've also added a note to the pre-install of various
things that are related to this step.  Again I think there are some
questions around this that we can investigate in another change.

Change-Id: I1acd19da8567ab93b5003caf67673cc70efea5fa
2015-09-02 15:15:13 +10:00
Ian Wienand
e42066d685 Cleanup yum downloading
Using "yum --downloadonly" breaks the abstraction of
"install-packages" because it downloads to the yum cache.  It also
acts funny if the package is already there.

Add an argument to "-d" which is the directory to download to.  dnf
has "download" built in, and for the old case use yumdownloader which
acts about the same.  Ensure it is installed, since it comes in
yum-utils.

Also a slight cleanup of the getopt parsing so it's easier to have the
required argument for -d

Thus we can remove most of the stuff in 15-remove-grub.  The check for
centos6 and it's lack of grub2 is clarified.  All the stuff about
having to remove the package, purging the cache etc so yum gets the
right thing is no longer relevant.  The long section of commented out
code at the end is also removed for clarity.

I tested this with an F21, F22 & centos (6) build

Change-Id: Id1e430e7d050a0b99ac449e2ea435e06cda1c4e6
2015-07-20 09:08:06 +10:00
Pino Toscano
f91df5dfc6 redhat-common: rename 01-clean-old-kernels.sh to drop .sh extension
dib-run-parts filters the acceptable characters in script names,
and "." is not allowed (see $allowed_regex there), so
01-clean-old-kernels.sh is never executed.

Rename it to drop its .sh extension, so it is executed for real.

Change-Id: Ieb633b31214f1accf03b92a2b06590fdf2127b6b
2015-05-20 16:17:53 +02:00
Jenkins
d734899997 Merge "Mount with -o nouuid for XFS base images" 2015-05-04 00:42:21 +00:00
Steve Baker
ea69fb9c47 Mount with -o nouuid for XFS base images
This change uses blkid to identify the fs type during redhat-common
extract-image. The image is mounted with -o nouuid for redhat/rhel
images that have XFS filesystems.

This is required when building images from the same base image
as the host VM to avoid "Filesystem has duplicate UUID" mount
failures.

Change-Id: I066289fbb27733a5a555242a0e2c363d58dd27d0
Closes-Bug: 1443706
2015-04-24 15:42:28 +12:00
Pino Toscano
f35aace69f Use shorter temporary file names for kpartx
The loopback handling in the Linux kernel limits the filenames of
files associated to loopback devices, see also linux/loop.h.
This is reflected also on userspace, as kpartx will silently do nothing
(exiting with 0) when requesting to remove a filename longer than 64
characters, as that name will obviously not match the truncated
filename. The result of this is that, when extracting qcow2 images for
the first time, if the qcow2 filename is long enough then the loopback
device will not be removed, remaining as stale in the host.

As a workaround, use a temporary file name when convering a qcow2 image
to raw, instead of using the base name of the qcow2 file.
While this still will not fix the issue when manually using a long
temporary directory (e.g. TMP_DIR=/very/long/etc...), at least should
avoid it in other cases.

Change-Id: Ibf46cd313a9d89412c0e1068fa0993be6c5a29db
2015-04-21 10:36:33 +02:00
Pino Toscano
626ca9ad47 Run udevadm settle after kpartx -l
it may happen that if the system where disk-image-create runs is busy,
then the kpartx -l run may leave a stale autodelete loop device.

This is because kpartx -l first adds a new loop device, then does the
listing and removes the loop device. The latter may not end before the
end of the kpartx run, leaving a loop device marked as autodelete.
Such kind of loop device will automatically delete itself, so the
 rm -r $WORKING
after
 sudo umount -f $WORKING/mnt
in the EXIT trap will fail because $WORKING does not exist anymore.

To prevent this situation, just ask udev to finish its operations,
properly removing the (temporary) loop device.

Change-Id: I12246f3dbe6b5669e698767682a5a142f803823b
2015-03-23 10:38:21 +01:00
Jenkins
e0e0159ef7 Merge "CentOS 6 Element" 2015-03-19 19:42:40 +00:00
Yanis Guenane
6b8421e0f9 redhat-common: Fix MariaDB-Galera-server case
Official MariaDB repositories offer the package : MariaDB-Galera-server.
This package has been now ported within Fedora (and also RDO), the
package is now called mariadb-galera-server. Yum install being case
sensitive hence this change.

Change-Id: Icd03877f17d01708b3916578991e42eef30a69e4
2015-03-17 10:56:01 +01:00
Abel Lopez
8026dda8a0 CentOS 6 Element
This is the centos element, which builds CentOS 6.

There are a couple of modifications to redhat-common because
the version of tar in el6 doesn't support --xattrs-include.

There is a change to both pkg-map and svc-map to add 'centos'
to the 'redhat' family.

Also explicitly have to install cloud-utils growroot and
dracut growpart for proper fsresize at instance launch.

Also sets the DIB_EXTLINUX variable because there is no grub2
for this distro.

Change-Id: Iffd57bce1484c43c2cffcbdb37b602185216e63a
2015-03-03 23:09:45 -08:00
Ian Wienand
36b59c001c Standarise tracing for scripts
There is a wide variety of tracing options through the various shell
scripts.  Some use "set -eux", others explicity set xtrace and others
do nothing.  There is a "-x" option to bin/disk-image-create but it
doesn't flow down to the many scripts it calls.

This adds a global integer variable set by disk-image-create
DIB_DEBUG_TRACE.  All scripts have a stanza added to detect this and
turn on tracing.  Any other tracing methods are rolled into this.  So
the standard header is

---
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
    set -x
fi
set -eu
set -o pipefail
---

Multiple -x options can be specified to dib-create-image, which
increases the value of DIB_DEBUG_TRACE.  If script authors feel their
script should only trace at higher levels, they should modify the
"-gt" value.  If they feel it should trace by default, they can modify
the default value also.

Changes to pachset 16 : scripts which currently trace themselves by
default have retained this behaviour with DIB_DEBUG_TRACE defaulting
to "1".  This was done by running [1] on patch set 15.  See the thread
beginning at [2]

dib-lint is also updated to look for the variable being matched.

[1] https://gist.github.com/ianw/71bbda9e6acc74ccd0fd
[2] http://lists.openstack.org/pipermail/openstack-dev/2014-November/051575.html

Change-Id: I6c5a962260741dcf6f89da9a33b96372a719b7b0
2015-02-12 10:41:32 +11:00
Gregory Haynes
c4bbb6f3bc Create docs site containing element READMEs
We currently do not have the ability to create a docs site which
outlines all the elements.

Change-Id: I77ccf61e0c4b1509b3e7ce9b8f15ea5ccfd50d9b
2015-02-10 11:45:35 -08:00
yogananth subramanian
15ccf776be Add support for using local PowerPC VM image
Patch adds support for PowerPC Big-endian and Little-endian local
fedora VM images and using VM images with two partitions,  PReP
boot and root partition. Since PowerPC requires PReP boot
partition to be present.

Change-Id: Iba03226e187609df898732c13b1aa5f895b156e3
Closes-Bug: 1413487
2015-01-23 05:11:08 +05:30
Gregory Haynes
2626606980 Migrate to new package-installs
We have a new package-installs file format. Migrating existing
package-installs files to the new format.

Change-Id: I57d4a007efee9624e60c41357cefa627d8c7373f
2014-12-01 21:32:13 -08:00
Monty Taylor
1b51e22f7d Remove the grub2 install from redhat-common
We immediately remove this, but the -grub2 causes a later attempt to
remove it again which fails. Don't install it in the first place.

Change-Id: I31d64abc9596707bdb8a0505d0dcbf7b82e1b82d
2014-11-28 11:01:40 -05:00
Jenkins
019196ef7f Merge "Add deprecation warning when using map-services" 2014-11-22 14:48:33 +00:00
Jenkins
d506c42ec4 Merge "Deprecate map-packages, replaced by pkg-map" 2014-11-20 01:41:45 +00:00
Ryan Brady
4178c0c69d Deprecate map-packages, replaced by pkg-map
This patch writes a warning out to stderr to notify element authors
that may be using map-packages to migrate to pkg-map.  This patch
also prints out a warning during image-create that lists the specific
elements that are not using pkg-map.

Change-Id: I7e2a7611dd5650815736ce998aa94a7833193d06
2014-11-19 12:04:12 -05:00
Ryan Brady
1aecb41b7e Add deprecation warning when using map-services
This patch writes a warning out to stderr to notify element authors
that may be using map-services to migrate to svc-map.

Change-Id: Ic80db16c607958d025e89b3a4058a9cbb568938e
2014-11-12 17:03:49 +00:00
Derek Higgins
c26a9ee4b1 Install lsb_release from package
The URL we were using to download lsb_release from no longer works,
install from package so this is not affected by disappearing URL's
in future.

This was originally installed from a URL because the package dependencies
caused a 87M increase in the size of the base image. For fedora the
increase is now 27M which is a little more tolerable.

Change-Id: I6e56a4a81786b33c5c6b92df2bd8236cd3f19670
2014-11-10 11:28:49 +00:00
AzherKhan
bb38d0e325 Optimize speed of deletion in find command
I would like to recommend to use + instead of \; in the find
command. As this will ensure the removal of all selected
directories in a single invocation.

Hence improve the speed of deletion.

Change-Id: I409fe11aae217afb6f790491591005c679264ed4
2014-10-27 21:04:09 -07:00
Jenkins
34c273d8df Merge "Make diskimage-builder work in Docker." 2014-10-24 20:13:45 +00:00
Jenkins
8ba6a26e0a Merge "Allow source-repositories to be disabled completely" 2014-10-20 11:35:40 +00:00
Jenkins
e289b31d12 Merge "Consolidate lsb_release source-repositories" 2014-10-16 21:14:05 +00:00
Ghe Rivero
873de01491 Remove first-boot.d support
After being deprecated two releases ago, finally remove any reference
for the support of first-boot.d

Change-Id: I08d67404ef48cad61db3b18fb86e970abfa5d2b6
2014-10-16 09:48:14 +00:00
Ben Nemec
0eccd2808c Allow source-repositories to be disabled completely
In our official image builds we are only allowed to use resources
that are "blessed" by the build system.  This means that external
things like git repos and tar files are not allowed.  Currently,
even in offline mode source-repositories expects those things to
be available in the cache, so we need a way to disable it entirely.

This change adds an environment variable NO_SOURCE_REPOSITORIES
that does so.  It can be set in an environment.d script so elements
that might rely on a source repository will know it's not available.
The 02-lsb script in redhat-common is one such example and is
updated to handle this case.

Change-Id: I0de63bee6ad79733d6711478c707a9b41593e85f
2014-10-15 12:24:50 -04:00
Ben Nemec
0d08925892 Consolidate lsb_release source-repositories
Each distro had its own copy of the file, but they were all the
same and it's actually installed in redhat-common so it belongs
there.

Change-Id: Iad15f39fd28d1c4e20d30dcb2eb0ae6f2fa2b015
2014-10-14 15:09:44 -05:00
Ben Nemec
edd7477891 Save extended attributes when creating tar
The way redhat-common's extract-image script was creating the base
tarball caused file capabilities to get dropped, which meant that
things like ping in RHEL 7 images was unusable for regular users.
This change adds the necessary options to the tar call to maintain
as many extended attributes as possible.

--acls and --selinux are intentionally omitted, and the selinux
xattrs are filtered out because all of those items cause issues
in our chroot environment.  We restore selinux attributes at the
end of the build anyway so that shouldn't be a problem.

bz reference: https://bugzilla.redhat.com/show_bug.cgi?id=1144149

Change-Id: Ibff99ce9bde01bc5ecf95dc3a5d3e2cebe5015b9
2014-10-03 23:05:17 -05:00
Jenkins
0ddd704e08 Merge "Update to newer Centos7 images" 2014-09-19 22:05:10 +00:00
Ian Wienand
45afb6d86c Update to newer Centos7 images
Update to newer Centos7 images as announced at [1].

Changes included:
 * update to GA image
 * respect TMP_DIR for image working directory
 * use suffix-match rather than prefix-match to build RAW_IMAGE name
   to be more robust against weird names
 * partition layout work-arounds not needed any-more, all one
   partition.

Resulting image booted locally with kvm and virtualbox (after
conversion to vdi)

[1] https://www.redhat.com/archives/rdo-list/2014-August/msg00045.html

Closes-Bug: #1363146
Change-Id: Ie24033468b78587ea87188ee1b843b26895798ff
2014-09-18 10:48:40 +10:00
Victor Lowther
38b14df72c Make diskimage-builder work in Docker.
When running inside a Docker container, we cannot rely on devices in
/dev/mapper to be automagically created by udev, because we probably
don't have a udev at all.  To work around this, run dmsetup mknodes
after every kpartx run.

Change-Id: If7e30579224ce54c5ed26d08974d8293c144719a
2014-09-15 06:43:53 -05:00
James Slagle
9fa28a31f1 Add ceilometer service mappings
Add the service mappings needed for ceilometer elements.

Change-Id: Id139a7c208659ead6330842bec01f7466d7ba417
2014-09-12 09:00:18 -04:00
Jenkins
f4011996ee Merge "Lock around extract-image downloads and extracts" 2014-09-11 11:56:40 +00:00
James Slagle
07c22185bd Use package-installs in more elements
Updates additional elements in diskimage-builder to use the declarative
package install support provided by the package-installs element.
package-installs does not yet support the pkg-map functionality, so
elements using pkg-map are not migrated. That support will come in the
near future.

Change-Id: I3d36adad317ba44326eabd95243d45807e2a8a16
2014-09-08 15:16:14 -04:00
Jon-Paul Sullivan
ed833e628f Lock around extract-image downloads and extracts
This wil be needed for parallel image builds.

Change-Id: I6ba3a10b44fe37f8d8903ad06302a672c3e972c8
2014-08-28 17:42:25 +01:00
Jenkins
7d0e7fe5ad Merge "Centralize handling of /lost+found" 2014-08-28 16:33:12 +00:00
Jenkins
597acccbd7 Merge "map-services: add openstack-nova-novncproxy" 2014-08-26 08:28:13 +00:00
James Slagle
0c92466f5b Add service mappings for ironic
Adds the needed service mappings for ironic-api and ironic-conductor.

Change-Id: I8b218f926561d8fba1644fe883bf8aae4bb6473f
2014-08-20 17:31:45 -04:00