Commit Graph

2443 Commits

Author SHA1 Message Date
Steve Kowalik
84b2ac45de Allow overwriting old images
The two duplicated functions, save_image and finish_image will move
an existing image out of the way if it exists, but it isn't
configurable. Check an environment variable is 0 before doing so.

Switch save_image to just calling finish_image, rather than
duplicating its code exactly.

Change-Id: I26a5a8fa4b6e853c9440bffab195b0bc3728be40
2014-07-08 14:08:10 +10:00
Jenkins
3cdfd9565e Merge "Rename rhel element yum blacklist" 2014-07-08 01:38:05 +00:00
Jenkins
8a077a0b13 Merge "Last ditch effort to correct a wrong shasum." 2014-07-07 23:49:21 +00:00
Jenkins
92d4ed73db Merge "Don't match editor backup files in environment" 2014-07-07 11:51:08 +00:00
AzherKhan
d06a1caafb Correction: if then statement code style.
Corrected the if; then statement to follow bash convention.

Change-Id: Ia3f80520bb9446c4feb5ce36dccffa2b1c1d72c4
2014-07-07 03:43:15 -07:00
Chris Jones
a65d74f171 Last ditch effort to correct a wrong shasum.
Some users on corp networks are finding that cloud images appear in
their proxies before SHA256SUMS files.
We now try to force any to upstream proxies to update their copy and
retry the checksum, rather than immediately failing.
We also now add proper argument parsing to cache-url, and associated
help functionality, since we have now grown our first argument.

Change-Id: I44d44b62db8d1df990606fdf087ec1b837f491f6
Closes-Bug: #1336067
2014-07-05 12:06:28 -07:00
Ghe Rivero
24e33592c2 Avoid to install a blank list of packages
There are some situations where the list of packages to install
in a image is blank (packages blacklisted) on opensuse based
distributions.

Change-Id: Ib720473fa63671ed974d41a86fe10a9b10720f5d
2014-07-04 07:39:08 +00:00
Ben Nemec
541a4b2270 Add global exclusions to dib-lint
This will be useful for adopting dib-lint in other projects, in
particular tripleo-image-elements.  It allows some dib-lint rules
to be used even if the project can't pass all of the checks.  The
failing checks can then be fixed one at a time and removed from the
exclusions list.

For consistency, this change reads the new exclusions from tox.ini
in the same way as flake8.  To use the exclusion mechanism, the
the following section can be added to tox.ini:

  [dib-lint]
  ignore = sete setu setpipefail

Change-Id: I6d8024e7613890e935ceb5e50d0d507bd554d8dd
2014-07-03 11:50:04 -05:00
Ian Wienand
32eda4b92f Don't match editor backup files in environment
The current glob match for environment files can source editor backup
files (foo.bash~) which will override the real changes you have made.

Other parts matche use the regex to avoid matching such files, so do
the same for environment file matching.  Note this has to match "."
unlike the other regex, as most env files are "foo.bash"

Change-Id: I934486b3ff5884063d29c6d9b66fd9b11140464c
2014-07-03 13:54:18 +10:00
Richard Su
4e68a7965b Remove fixfiles from rpm-distro finalize
Running fixfiles after setfiles is redundant. setfiles
already corrected the SELinux file security contexts.

Change-Id: I48067f06968c5add48fa91a1496b9bf36944546c
Closes-Bug: #1316241
2014-07-03 11:47:10 +10:00
Jenkins
61c192ea3c Merge "Set LC_ALL=C into dib-run-parts env" 2014-07-03 01:22:34 +00:00
Jenkins
012c974430 Merge "Add RHEL7 to Red Hat family in pkg-map" 2014-07-03 00:50:35 +00:00
Ghe Rivero
4fd84db547 Rename rhel element yum blacklist
Rename rhel 10-yum-blacklist to 10-rhel-blacklist to
avoid future name conflict with a yum element blacklist.

Change-Id: Ic2136a06e1ec8f19908ada978782733d5fa7cacc
2014-07-02 10:53:35 +00:00
Jenkins
451e571753 Merge "Create an element to allow using a dpkg manifest" 2014-07-01 20:39:16 +00:00
Jenkins
bd3b025e97 Merge "VM element: Enable serial console on Debian" 2014-07-01 20:24:37 +00:00
Jenkins
b967b72006 Merge "Update README regarding Debian and OpenSUSE support" 2014-07-01 19:59:39 +00:00
Jenkins
f7625ca6f6 Merge "update opensuse element" 2014-07-01 16:57:05 +00:00
Jenkins
57293fac89 Merge "Element to remove unwanted kernel/initrd." 2014-07-01 10:40:36 +00:00
Yolanda Robla
8ed645f046 Set LC_ALL=C into dib-run-parts env
Force LC_ALL to C to allow printf to work independently
from the locale. Gives invalid number error if run in non-english
locale.

Change-Id: Ia68853505485fefbf0890313456e7edb6097666b
Closes-Bug: #1335932
2014-07-01 11:49:48 +02:00
Jenkins
5ee5aa5c89 Merge "Remove uneeded code from pkg-map" 2014-06-29 13:08:32 +00:00
Jenkins
5151dc0a33 Merge "Always bind-mount pypi mirror if dir exists" 2014-06-28 00:14:13 +00:00
Jenkins
d92cbb7b1e Merge "Disk-image-create should allow sending compat flags to qemu-img" 2014-06-28 00:14:07 +00:00
Jenkins
c307db119e Merge "Use $DISTRO_NAME instead of local lsb_release" 2014-06-27 23:45:42 +00:00
Chris Krelle
eed131c373 update opensuse element
This patch updates the openSuse element to work with the new
base image file format. It should be noted that the base image
file name has changed several times while updating this element,
and and may need to be set manually via the "BASE_IMAGE_NAME"
env var.

Change-Id: I4dac8bf9a4bf76a00d4a04cbf063fd245b11f3d6
2014-06-27 15:03:06 -07:00
Jenkins
a1aa1e92dc Merge "Update base element to make use of pkg-map" 2014-06-27 21:29:43 +00:00
Jenkins
75f6fd605f Merge "opensuse: support pkg-map in bin/install-packages" 2014-06-27 21:28:48 +00:00
Jenkins
850b7f16a9 Merge "dpkg: support pkg-map in bin/install-packages" 2014-06-27 21:25:59 +00:00
Jenkins
f866a6f240 Merge "introduce $SYSTEMD_SYSTEM_UNIT_DIR" 2014-06-27 08:38:37 +00:00
Jenkins
ec200af0f8 Merge "Use common element select-boot-kernel-initrd" 2014-06-27 07:00:14 +00:00
Jenkins
14741f3efc Merge "Add select-boot-kernel-initrd element" 2014-06-26 23:27:45 +00:00
Ryan Brady
4ca059f9d9 Use $DISTRO_NAME instead of local lsb_release
The $DISTRO_NAME var is now set in all of the OS elements
in environment.d.  This patch removes the call to
lsb_release and instead uses the $DISTRO_NAME variable.

Change-Id: I7088eb88b6a3611fef5a21a6b62975876549465f
2014-06-26 16:47:21 -04:00
Ryan Brady
4226bd66ba Add RHEL7 to Red Hat family in pkg-map
The current "redhat" os family omits RHEL7. The rhel7 element has the
corresponding $DISTRO_NAME set in environment.d.  This patch adds rhel7
so a pkg-map json file using "redhat" for the os family will work the
same as rhel, centos and fedora.

Change-Id: If6b4cbba618167669a499e6121f234942ca9367a
2014-06-26 16:29:59 -04:00
Jenkins
fb1adbbfee Merge "Ensure cache directory exists before use" 2014-06-26 20:15:15 +00:00
Jenkins
549f06bb53 Merge "update zypper element" 2014-06-26 20:15:09 +00:00
Ghe Rivero
156d3495e0 Use common element select-boot-kernel-initrd
Several elements were using almost similar code to
get the current kernel and initrd inside an image.
After factoring out this code into a common element,
modify the elements to make use of it.

Change-Id: Ib547cd96b2b354b1c97342cacf5f0d0a3f70a3da
2014-06-26 10:19:09 +00:00
Steve Baker
e822a0ff5a Always bind-mount pypi mirror if dir exists
It may be desirable to specify file://tmp/pypi as one of the list
of mirrors specified by PYPI_MIRROR_URL, so the local pypi mirror
should be mounted as long as the directory exists.

Even though the path is mounted, it is only used by pip if there is
no specified PYPI_MIRROR_URL, or if one PYPI_MIRROR_URL entry
specifies file://tmp/pypi.

The pypi element previously assumed that a local mirror would be
a complete offline mirror. This change allows for a mixture of
local mirror plus remote mirrors. This means that the local
mirror could (for example) contain a few locally built pip packages
from arbitrary git checkouts for gate testing of those projects.
In this scenario, most packages would be downloaded from the
configured remote mirrors.

This change is required for synchronous gating on the os-*-config
tools.

Change-Id: I0f6d153c06993ffd0d90bd8ca1717462e8b6b541
2014-06-26 14:49:06 +12:00
Ghe Rivero
4c977082c4 Add select-boot-kernel-initrd element
Encapsulate the new select-boot-kernel-initrd common function
into an element so other elements can make use of it.

Change-Id: Ie587bd5dae1afebfd5646190dfa951a7949938cd
2014-06-25 21:23:19 +00:00
Robert Collins
d34b9453f3 Ignore manifest outputs more carefully.
We use .d files within dib elements :).

Change-Id: I0350e5ee9373e21bb275cb387ec682e2137b4f64
2014-06-26 04:29:51 +12:00
Kiall Mac Innes
572b8b2b13 VM element: Enable serial console on Debian
Debian based distros do not enable the serial console by default
in grub.cfg, instead sending all boot messages to the display

Change-Id: I0e80859198e77862ab0301ab27ebe11702fba09d
2014-06-25 14:13:49 +00:00
Yolanda Robla
fabbb8da58 Disk-image-create should allow sending compat flags to qemu-img
Add a --options flag that allows disk-image-create to send custom
options to qemu-img calls. It is useful for forcing compat into
qemu-img created images.

Usage:
    disk-image-create --qemu-img-options compat=0.10 base ubuntu

Change-Id: I73ee2c86abc115220d51ffebbbe9ce3c4d92f188
Closes-Bug: #1329746
2014-06-25 12:38:06 +02:00
Chris Krelle
6077bd8b06 Ensure cache directory exists before use
Ensure cache mount directory exists before its used. The zypper element
would error when attempting to mount the cache directory because the
mount point did not exist. This patch corrects that.

Change-Id: Iaa3c2a0254b12bd847643a61a99f5a234097fd21
2014-06-24 16:35:59 -07:00
Chris Krelle
336e286637 update zypper element
Scripts in pre-install.d run as root so there is no need to sudo commands.
This patch also helps avoid an error when sudo is not installed in the
default image.

Change-Id: Iab20edfb161189f8c4e0cfa7d6946f63163d6413
2014-06-24 16:20:55 -07:00
Jenkins
20879b2ec9 Merge "avoid failure if /lib/firmware doesn't exist" 2014-06-24 16:46:20 +00:00
Jenkins
8422f46dc0 Merge "Drop ending slash from DIB_CLOUD_IMAGES" 2014-06-23 19:22:30 +00:00
Jenkins
83e35dfa49 Merge "map-services: add openvswitch" 2014-06-23 16:00:54 +00:00
Jenkins
5dfb4b5c93 Merge "Factor out error behavior in dib-lint" 2014-06-23 09:38:04 +00:00
Steve Kowalik
cf9870729d Drop ending slash from DIB_CLOUD_IMAGES
The DIB_CLOUD_IMAGES variable in ubuntu's root.d is already used
everywhere with a /, so we can safely drop it from the default
value.

Change-Id: I39dbd3f4004052fcccb4131dc838759f4c82312a
2014-06-23 16:22:51 +10:00
Dan Prince
4015097a31 Update base element to make use of pkg-map
With this change package name to distro mappings used
within the base element are now stored in the top
level pkg-map file.

Additionally, all bin/install-packages commands are updated
to use the -m option so that the base element pkg-map
namespace is used by default.

Change-Id: I3bdbf987c8525f9ef67ca0c263651d6613f29ef0
2014-06-20 16:02:28 -04:00
Dan Prince
99ebd302b0 opensuse: support pkg-map in bin/install-packages
Updates the opensuse element's bin/install-packages script
so that if supports using pkg-map instead of map-packages
for package mapping. To make use of the new change
simply add the -m <element name> to allow install-packages
to know which element namespace to use when installing packages.

Use of the new -m option is off by default.

As part of this change we also updated install-packages
to use getopt for in script argument parsing.

Change-Id: I56da8adf6c445c50c7642e221c6c11ba59330404
2014-06-20 16:02:28 -04:00
Dan Prince
9340ea309b dpkg: support pkg-map in bin/install-packages
Updates the dpkg element's bin/install-packages script
so that if supports using pkg-map for package mapping.
To make use of the new change simply add the -m <element name>
to allow install-packages to know which element namespace to use
when installing packages.

Use of the new -m option is off by default.

As part of this change we also updated install-packages
to use getopt for in script argument parsing.

Change-Id: Idfc40f2d75828a0f09d227f0332ccef8f0183efc
2014-06-20 16:02:28 -04:00