Commit Graph

1361 Commits

Author SHA1 Message Date
Gregory Haynes
037e71c023 Add explicit f21 test
Now that we are changing fedora to default to f22, lets gate on f21
still working.

Depends-On: Icbd08fb5aa69446ad65ff72af631902c4e1fa12b

Change-Id: I8b7b957fafc028aa2970803bd23ea644114f9b7f
2015-06-11 16:39:50 +00:00
Gregory Haynes
fe559242cb Dont fail if were missing setfiles
We are using which to find the location of setfiles. Our script is set
-e though, and we need to also be able to handle the case where setfiles
does not exist (like on centos-minimal).

Change-Id: If53c7a80efc081b95b143c28be64d39b12bfb469
2015-06-11 01:47:07 +00:00
Jenkins
6b1d482423 Merge "Add Ironic API version to passthru URL for deploy-ironic" 2015-06-04 22:13:43 +00:00
Jenkins
8fd7fd9e0a Merge "Add smoketest for fedora" 2015-06-04 03:34:17 +00:00
Jenkins
b35c6f27c8 Merge "Revert "Ensure DIB_RELEASE is exported for fedora"" 2015-06-04 01:24:25 +00:00
Jenkins
250cdbc9f1 Merge "Address follow-up comments" 2015-06-03 19:21:42 +00:00
Gregory Haynes
7a4c396948 Revert "Ensure DIB_RELEASE is exported for fedora"
The default release for fedora is actually 21 for us, and we are unable
to build 22 right now.

This reverts commit 379d6a2650.

Change-Id: Iffcc505f1e115cb6bc662b57a78878e498ce338e
2015-06-03 19:13:35 +00:00
Abel Lopez
184311b7f8 CentOS-6 resize support
Wrong package in the list, dracut-modules-growpart is wrong,
needed dracut-modules-growroot for proper resize to work

Change-Id: Iea8789ea3d44d182197a4713244b551f2cd4dd55
Closes-Bug: 1461601
2015-06-03 09:13:00 -07:00
Jenkins
348c15fdc3 Merge "Add grub2 element" 2015-06-03 10:48:18 +00:00
Jenkins
ee5893d859 Merge "Ensure DIB_RELEASE is exported for fedora" 2015-06-02 09:50:46 +00:00
Lucas Alvares Gomes
1b9520e955 Add grub2 element
This patch is adds a new grub2 element that installs the
grub2 bootloader on the image so it can work with Ironic's
local boot support.

This patch also modifies the iso element which was installing
same grub2. It removes the grub2 installation from iso element
and makes it dependent on grub2 element.

Co-Authored-By: Ramakrishnan G <rameshg87@gmail.com>
Change-Id: I37bcf2c525708d1e2e0f95cf5874a279f76861f7
2015-06-02 05:35:03 +00:00
Jenkins
f0dc50e83b Merge "Support custom kernel cmdline args for deploy iso" 2015-06-01 21:05:13 +00:00
Ramakrishnan G
af629c914c Support custom kernel cmdline args for deploy iso
This commit adds support for providing custom kernel
cmdline args while building deploy ISO.  This is useful
for adding kernel cmdline like 'console=ttyS1' in
environment (assuming all bare metals have been configured
to output to COM2 in BIOS).

Closes-Bug: 1451634
Change-Id: I20b04d9d104cfe46df0439c3f567a721a27e186a
2015-06-01 15:40:01 +00:00
Ramakrishnan G
eeb979fa13 Address follow-up comments
This commit addresses follow-up comments on
I1ffb832ebab009b2d77a46e6c8fc758dd9632359. The change
is to delete get-pip.py immediately after installing pip.

Change-Id: I2768da2365b08304b8e7fcf55c91101b05ec33ea
2015-06-01 02:14:41 +00:00
Jenkins
80057470a6 Merge "Fix disk image create errors behind proxy" 2015-05-29 16:53:46 +00:00
Jenkins
8efa1fe154 Merge "rhel-common element should not use attach with activation key" 2015-05-29 10:13:23 +00:00
Yuriy Zveryanskyy
5de277fb54 Add Ironic API version to passthru URL for deploy-ironic
Add current version of Ironic API for consistensy with IPA and Ironic
API settings, and for compatibility in the future.

Change-Id: I13c7a26b6cfb47a14aa49ee78441a1d97d7b42d0
2015-05-29 09:12:21 +03:00
Jenkins
934608cad6 Merge "Make $DIB_YUM_REPO_CONF accept a list of repo files" 2015-05-28 23:53:18 +00:00
Ian Wienand
379d6a2650 Ensure DIB_RELEASE is exported for fedora
This variable is useful for scripts to know what release they are
building.

Change-Id: Ib5f5d13a8f25f00fda07dad19aa1d603c1616a2e
2015-05-27 12:46:13 +10:00
John Trowbridge
6856d96f03 rhel-common element should not use attach with activation key
In the case of using portal registration with an activation key, the
rhel-common element is still executing a `subscription-manager attach`
command. This should not happen if an activation key is provided. This
is because an activation key already provides the subscriptions to
attach.

This patch fixes this behavior.

Change-Id: I5a8425d1778362bb7a0dadc91a46308f16b2a526
Closes-Bug: #1456648
2015-05-25 07:18:47 -04:00
James Slagle
aee9cc0ce6 Make $DIB_YUM_REPO_CONF accept a list of repo files
It's useful to be able to pass in multiple yum repo configuration files
via $DIB_YUM_REPO_CONF, not just a single one.

Change-Id: I43722229a2df58be55bdb2b50c253e957b18e6fe
2015-05-22 19:37:29 -07:00
Jenkins
31b0b5a1ca Merge "Use environment setfiles" 2015-05-22 23:44:27 +00:00
Monty Taylor
da65ce3c26 Pass glean output to the console log
When something goes wrong, you usually can't boot the image. nova
console-log is usually available though.

Change-Id: Ie4525d0c3ee8b59f035544592b30f0635aba1811
2015-05-22 13:19:39 -07:00
Jenkins
2d62cd93ee Merge "redhat-common: rename 01-clean-old-kernels.sh to drop .sh extension" 2015-05-22 00:35:00 +00:00
Jenkins
6fb2a28495 Merge "Simple-init should disable cloud-init" 2015-05-21 23:29:54 +00:00
Abel Lopez
7514fc066f Use environment setfiles
Hard coded path fails on Distros (such as el6) with setfiles bin
in different places, for example, rhel6 has this in /sbin/setfiles

Change-Id: I7aff9cdadd9aed9cfc806a1010acbf36b7b6d0e7
2015-05-21 14:59:31 -07:00
Jenkins
d490404682 Merge "Install debian locales" 2015-05-21 20:19:26 +00:00
Jenkins
eb732d3d65 Merge "Initial element tests" 2015-05-21 20:19:20 +00:00
Jenkins
8287a3fa6a Merge "Use Centos 7 cloud image symlink" 2015-05-20 19:08:46 +00:00
Jenkins
061669fee2 Merge "Have simple-init regenerate ssh keys on boot" 2015-05-20 19:06:42 +00: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
76f64ae0da Merge "Export DIB_RELEASE in centos" 2015-05-20 01:29:12 +00:00
Gregory Haynes
9a6cf7ee6f Add debian build test case
Weve had some regressions recently with the changes in the debian
element. Lets tests that we can build debian images.

Change-Id: I048e7a32ecb4088ec1b1e3b1efdf146187b093db
2015-05-19 19:23:53 +00:00
Gregory Haynes
917962d26c Install debian locales
Building debian images failes due to missing the locale were trying to
set.

Change-Id: I9fa330fd82e5289b549713f6b31345f6113cef1d
2015-05-19 19:22:43 +00:00
Gregory Haynes
b4300fdc5c Add smoketest for fedora
Adding a test case which verifies fedora images successfully build

Change-Id: Ie9a41cde02d6380d9bfa6eeff43ab62480519ac7
2015-05-18 18:31:57 +00:00
Gregory Haynes
b9b6640fa7 Initial element tests
Adding a test function which allows us to use elements to perform
element-specific tests. In order for this to work sanely, also adding
some configuration to our break system so we can assert on negative
tests.

Also adding a test for apt-sources to verify this code actually works.

Change-Id: I378a74255010eca192f5766b653f8a42404be5ea
2015-05-17 02:07:40 +00:00
Jenkins
a4db3f5ccb Merge "centos/centos7: switch to epel element" 2015-05-15 18:07:52 +00:00
Jenkins
c30f3d85ff Merge "vm: use $DISTRO_NAME instead of lsb_release" 2015-05-15 17:40:40 +00:00
Jenkins
c0b02f4623 Merge "rax-nova-agent: switch to $DISTRO_NAME" 2015-05-15 17:40:14 +00:00
James Slagle
6e358d1cd4 Use Centos 7 cloud image symlink
We should make use of the CentOS-7-x86_64-GenericCloud.qcow2 symlink from
http://cloud.centos.org/centos/7/images/ instead of having a hard coded cloud
image. Specific cloud images can still be downloaded by overriding
$DIB_RELEASE.

More importantly, using the symlink will keep us automatically up to date with
the latest CentOS 7 cloud image. The image in use by the hard coded value
occassionally exhibits "No space left on device" errors after the cloud-init
filesystem resize. More info about this issue is at:
http://xfs.org/index.php/XFS_FAQ#Q:_Why_do_I_receive_No_space_left_on_device_after_xfs_growfs.3F

The newer cloud image (with a newer kernel) does not exhibit this issue.

Change-Id: I3e19f6269ceba937fcd630bab265d132bd525519
2015-05-14 15:24:13 -04:00
Jenkins
df437f9b7c Merge "Add packages required for iscsi extension in agent" 2015-05-13 20:47:35 +00:00
Jenkins
f8d618bfa6 Merge "force arch amd64 for EL7 elements" 2015-05-12 20:30:00 +00:00
Pino Toscano
043711e3fa vm: use $DISTRO_NAME instead of lsb_release
Use the distribution string already available as $DISTRO_NAME.

Change-Id: I4aa3b19d66cc4bed39e9778f0ed21e86743afe41
2015-05-12 17:49:03 +02:00
Pino Toscano
341ad6c15c rax-nova-agent: switch to $DISTRO_NAME
Check for the current distribution using $DISTRO_NAME instead of
`lsb_release`.
Also, remove the existency check, as $DISTRO_NAME is supposed to be
provided by distribution elements.

Change-Id: I2276c63e9ac43576da528a70235129800c093b3e
2015-05-12 17:48:49 +02:00
Jenkins
97954ccd4e Merge "Make managing hosts entries optional" 2015-05-12 13:29:48 +00:00
Jenkins
556644388d Merge "Address comments on virtual media device label commit" 2015-05-11 19:36:26 +00:00
Gregory Haynes
dc33f6ddd0 Simple-init should disable cloud-init
Cloud-init and simple-init are not meant to play together. Lets disable
cloud-init if simple-init is installed.

Also guarding cloud-init-datasources against running in an environment
where cloud-init is not installed.

Change-Id: I5bfa9a3e83d3259db2436404034ad58c780de1c9
2015-05-11 16:55:02 +00:00
Jiri Stransky
a43b23c45a Make managing hosts entries optional
Diskimage-builder currently writes cloud-init config file which adds a
host entry mapping the hostname and FQDN to 127.0.0.1 into every image
built. This is probably useful for some use cases but not for all, so we
now allow customizing the manage_etc_hosts value via
DIB_CLOUD_INIT_ETC_HOSTS variable and also not writing the config at all
if that variable is explicitly set to an empty string (currently the
default is 'localhost' but in the future the default will be empty
string).

Particular description of the problem this causes in TripleO follows:

We get hosts files like this:

    ::1     localhost       localhost.localdomain   localhost6      localhost6.localdomain6
    127.0.0.1       localhost       localhost.localdomain   localhost4      localhost4.localdomain4
    127.0.0.1       ov-rl5i5saoc6h-1-hj5tzsbrdv4c-controller-dy6nuyarqy5z.novalocal ov-rl5i5saoc6h-1-hj5tzsbrdv4c-controller-dy6nuyarqy5z

    # HEAT_HOSTS_START - Do not edit manually within this section!

    192.0.2.17 ov-rl5i5saoc6h-0-wfzcsrqo34p6-controller-m3hy26lhxavl ov-rl5i5saoc6h-0-wfzcsrqo34p6-controller-m3hy26lhxavl.novalocal
    192.0.2.15 ov-rl5i5saoc6h-1-hj5tzsbrdv4c-controller-dy6nuyarqy5z ov-rl5i5saoc6h-1-hj5tzsbrdv4c-controller-dy6nuyarqy5z.novalocal
    192.0.2.16 ov-rl5i5saoc6h-2-a6v7saxnivm5-controller-7jboskte34r7 ov-rl5i5saoc6h-2-a6v7saxnivm5-controller-7jboskte34r7.novalocal
    # HEAT_HOSTS_END

The duplicate hostname/FQDN entry for 127.0.0.1 and 192.0.2.15 confuses
Corosync, which then fails to start a cluster when using hostnames in
the config file instead of IPs.

Change-Id: Ia8582883f737548e2911d3f36a1943e5b236281b
Partial-Bug: #1447497
2015-05-11 14:40:43 +02:00
Monty Taylor
53a57e8713 Have simple-init regenerate ssh keys on boot
If the keys aren't there on boot, we want to generate them.

Change-Id: I84d185887007d501306fe22731dd073e62fdfe36
2015-05-10 13:50:49 -04:00
James Slagle
d8ff69957e Remove install of vlan/vconfig from base
vconfig is actually deprecated in favor of the ip command, and is not
available on some newer distros (RHEL 7 at least). I'm not honestly sure
why it needs to be installed in all images anyway. I traced the origins
of installing the vlan package here all the way back to the first dib
git import from some other repo...so, I don't see any obvious reason why
it needs to be installed.

Change-Id: I272667cf29f5e41c217a26f70937b2842a04f748
2015-05-08 15:42:37 -04:00
Jenkins
9ac2a5bbb3 Merge "Package ldlinux.c32 along with isolinux.bin if it exists" 2015-05-07 22:42:34 +00:00
Jenkins
cb4ce88048 Merge "package-installs: fix error case for Python 2.6" 2015-05-07 17:25:54 +00:00
Jenkins
a10ac00756 Merge "Support arch-specific package-installs" 2015-05-07 09:29:29 +00:00
Jenkins
ffbdfc893f Merge "epel: support centos element" 2015-05-07 06:48:56 +00:00
Jenkins
b62d9043ea Merge "debootstrap: fix syntax issues" 2015-05-06 18:50:31 +00:00
Jenkins
5ee056ab7e Merge "Turn docs warnings into errors and fix issues" 2015-05-06 17:48:16 +00:00
Pino Toscano
655648f99b package-installs: fix error case for Python 2.6
subprocess.CalledProcessError in Python 2.6 does not have the 'out'
parameter for __init__, so pass only two of them and manually set
'output' in that case.

Fixes/improves commit 7f410aaff2.

Change-Id: I279bdf433b1272a9c3af4d66a2a52c78a7ac5de2
2015-05-06 16:18:30 +02:00
Pino Toscano
7c74084eca centos/centos7: switch to epel element
Instead of manually creating epel.repo files, make use of the epel
element, which will properly install epel-release.

Change-Id: Iea7b389bc1ade716c622fd39d5e7dcf119dcb447
2015-05-06 15:50:09 +02:00
Pino Toscano
9fcb919dc7 epel: support centos element
Allow the epel element to enable EPEL also on CentOS 6.x.

Change-Id: I0e0ea0d2ea764d8ce4398635ae9124602b933791
2015-05-06 15:49:59 +02:00
Ramakrishnan G
acc604c490 Address comments on virtual media device label commit
This commit address last comments on
I5e8a706989bad13051eb47db0b1e762e6c672318. It adds
the date for a comment was added and removes redundant
wait period for initialization.

Change-Id: Idff38835969c094175f68be78c407ae975473b57
2015-05-06 02:21:20 -07:00
Pino Toscano
3ec833806f debootstrap: fix syntax issues
There's no need for 'break' to exit a switch case, ';;' will work fine.

Change-Id: I4f23c80422a3c1dbd0db3972854ae67e38fc7be8
2015-05-05 11:00:10 +02:00
Ramakrishnan G
afe739ceed Fix disk image create errors behind proxy
This commit fixes errors while trying to create a
DIB ramdisk with ironic-agent element when built
behind proxy. It fixes the issue by making it install
latest versions of pip and setuptools which has the
fixes for them.

Change-Id: I1ffb832ebab009b2d77a46e6c8fc758dd9632359
Closes-Bug: 1449852
2015-05-04 21:17:47 -07:00
Gonéri Le Bouder
725f91078e force arch amd64 for EL7 elements
rhel7 and centos7 images are both only available on x86_64 arch.
if $ARCH is misconfigured, some strange error will happen during the build.
For example, DIB will try to install EPEL i386 on the 64bit root system.

For the record, tripleo-incubator $NODE_ARCH default value is i386. The
problem will happend as soon as the default value is used with one of
these root elements.

This commit ensure the $ARCH is set to amd64 as soon as the centos7 or
rhel7 root element are used.

Change-Id: Ie41fa2da48eac6bf89b96cfa137c0f572dae6734
2015-05-04 14:18:51 +02:00
Ramakrishnan G
45db8f1280 Add packages required for iscsi extension in agent
In Kilo, we added added an iscsi extension in
ironic-python-agent which requires tgtd and tgtadm.
This commit adds scsi-target-utils to the ramdisk for
this.

Also the git protocol for retrieving the source code is
changed to http.  Git protocol doesn't go through a proxy,
but http can.

Closes-Bug: 1449854
Change-Id: I8cf274913a16404941770d0c6115bd6feec1ccb8
2015-05-04 00:16:19 -07:00
Ramakrishnan G
91e9e0aef8 Package ldlinux.c32 along with isolinux.bin if it exists
Starting from syslinux 5.00, isolinux.bin is dependent on
ldlinux.c32 to boot for BIOS machine.  syslinux > 5.00 is
delivered with Fedora 21 cloud image which breaks the boot
from ISO if ldlinux.c32 doesn't exist.

Change-Id: If722f36aeaabc759d93ef6ae3f49b21bb840a92d
Closes-Bug: 1449882
2015-05-04 00:13:32 -07:00
Jenkins
d734899997 Merge "Mount with -o nouuid for XFS base images" 2015-05-04 00:42:21 +00:00
Gregory Haynes
28d32f1b5f Export DIB_RELEASE in centos
We export this variable by convention in the other OS elements.

Change-Id: I311a54ff614596fe7ee23bf44b44b55f9d04690d
2015-05-01 17:43:33 +00:00
Jenkins
4a1c833c27 Merge "Download of translations not properly disabled in APT" 2015-04-30 20:58:09 +00:00
Adam Gandelman
0afdb07445 debian-minimal: Remove -backport's restricted + universe
These are ubuntu-isms that do not exist on debian mirrors and cause
builds to break if they're based on a stable debian release.

Change-Id: I08c2826eba4aabd0be69955220624b2f179a15ee
Closes-bug: #1450198
2015-04-29 13:45:29 -07:00
Jenkins
ecdd551ce2 Merge "Use labels for virtual media dev in Ironic ramdisk" 2015-04-29 14:41:54 +00:00
Jenkins
37baf8b2b4 Merge "Generate locales in debian-based elements" 2015-04-28 23:00:00 +00:00
Jenkins
b7c22723d4 Merge "Fix to load only signed kernel in UEFI secure boot" 2015-04-28 11:02:52 +00:00
Jenkins
f8302171f5 Merge "Add element ubuntu-signed to provide signed kernel" 2015-04-28 11:02:44 +00:00
Jenkins
d2727fccf4 Merge "Split the debootstrap functions into an element" 2015-04-28 10:55:36 +00:00
Jenkins
8b002cba09 Merge "Clean up targetcli ramdisk installation" 2015-04-28 06:22:14 +00:00
Antoine Musso
8d052a54a7 Turn docs warnings into errors and fix issues
Set the pbr option 'warnerrors' to make build_sphinx turns warnings into
error. Fix all warnings.

`tox -edocs` will thus abort whenever someone introduce a new error.

Change-Id: Id6d09768a241866e1fdc1a1e2bf90336f5c5087d
2015-04-27 15:03:19 +00:00
Monty Taylor
d22cc0ce0d Generate locales in debian-based elements
Without generating locales, annoying warnings are spewed.

Change-Id: Ibb2f241a5eb398377967a77cd5dd8fe55719fdbf
2015-04-27 05:08:24 +00:00
Monty Taylor
23aa76dff0 Split the debootstrap functions into an element
debootstrap is not debian or ubuntu specific. We can make a debootstrap
element that knows how to do all of the things, and then a
debian-minimal and ubuntu-minimal image that use it. Finally, make
the debian element simply be a collection of the extra things we do to
make it look like a cloud-init based cloud image.

Change-Id: Iaf46c8e61bf1cac9a096cbfd75d6d6a9111b701e
2015-04-26 18:04:59 +00:00
Monty Taylor
c1d7cb4d6c Install glean from openstack source
glean is now moved into the openstack-infra repos, so the reference to
the originally temporary home can be discarded.

Change-Id: Ie89fff85e264a36d9bab15801314d5195b45031c
2015-04-25 08:45:10 -04:00
Jenkins
55fd6ab5e2 Merge "Port centos-minimal to yum-minimal" 2015-04-24 22:20:32 +00:00
Gregory Haynes
28c42fafdc Support arch-specific package-installs
In some cases, like linux-image-* on debian, we need to only install
packages for a specific target architecture.

Change-Id: Ic0009d0c1e121d6f3f1f21345c544e2d98f080f9
2015-04-24 21:58:05 +00:00
Jenkins
362cb398c8 Merge "Make troubleshoot work with dracut ramdisks" 2015-04-24 21:24:17 +00:00
Jenkins
c4072920ab Merge "Update cloud-init-datasources README" 2015-04-24 04:43:15 +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
Jenkins
49bc98dc7c Merge "Add generic devuser element" 2015-04-23 03:58:43 +00:00
Jenkins
74b777dae8 Merge "Fix dhclient in Fedora ramdisks" 2015-04-23 03:58:33 +00:00
Jenkins
c108943dd2 Merge "Generate the default en_US locale" 2015-04-23 03:55:19 +00:00
Jenkins
1f38bfad41 Merge "Allow setting DIB_PIP_RETRIES" 2015-04-23 03:51:57 +00:00
Jenkins
97c2432635 Merge "Use shorter temporary file names for kpartx" 2015-04-23 03:51:48 +00:00
Jenkins
26a11cddc1 Merge "Create the dracut directory if not existing already" 2015-04-23 03:46:53 +00:00
Monty Taylor
eadd79c2cb Port centos-minimal to yum-minimal
Now that we have a generic yum-minimal element, just use it in centos
instead of rinse. Adding base as an element-provides of yum-minimal
because this element conflicts with the base element.

Co-Authored-By: Gregory Haynes <greg@greghaynes.net>

Change-Id: I15275d821781171c118f21aa0c0bca55f65a65b3
2015-04-22 20:34:48 -04:00
Jenkins
c67ab571cb Merge "Add a yum-minimal element that just uses yum" 2015-04-22 22:26:15 +00:00
Jenkins
b0f41ac66f Merge "Add element to process config-drive network info" 2015-04-22 22:25:54 +00:00
Jenkins
1fc2cbff50 Merge "Break install-types out of base" 2015-04-22 19:40:02 +00:00
Jenkins
d2dcfbc3cf Merge "update the dib centos7 baseurl to use a mirrorlist" 2015-04-21 21:47:00 +00:00
Jenkins
e61ffb7fc8 Merge "Don't trace RHEL Registration scripts" 2015-04-21 14:29:02 +00: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
Jenkins
bb93df23b1 Merge "openSUSE update" 2015-04-21 03:55:25 +00:00
Jenkins
8b96cfd4bb Merge "Switch default Fedora image to F21" 2015-04-20 22:35:49 +00:00
Ramakrishnan G
1540e753dc Use labels for virtual media dev in Ironic ramdisk
This commit changes Ironic deploy ramdisk to find out
the virtual media device by using labels instead of
looking at the model of block device.  This helps in
finding out the device irrespective of the hardware.
Corresponding Ironic change is
If5b78d9af7048f2631d050ee5ce01ab7a67e2354.

Closes-Bug: #1429340
Change-Id: I5e8a706989bad13051eb47db0b1e762e6c672318
2015-04-18 04:58:03 +00:00
Jenkins
07da09b4f4 Merge "Update packages earlier" 2015-04-15 08:58:16 +00:00
Wesley Hayutin
7edf0f2a2d update the dib centos7 baseurl to use a mirrorlist
* replace baseurl with a centos mirrorlist
* fix typo in repoid

Change-Id: I028d1d7e9bf0b180ad73f750630adfbe41424512
2015-04-14 22:28:43 +00:00
Jenkins
b0e809cbca Merge "Do not export REG_HALT_UNREGISTER between hook scripts" 2015-04-14 20:50:35 +00:00
Thomas Bechtold
f411297e74 openSUSE update
Commit b4a1f1c190 wrongly changed the format of the available
images. There was a missconfiguration on the buildservice which produces
the images so no static links were available. That's fixed now so use
the correct names again.

Change-Id: Iac4cbc8672da67f5a89ac2f1be8bb9530215ea19
2015-04-14 21:53:38 +02:00
Monty Taylor
b5bcb3b60e Add a yum-minimal element that just uses yum
The centos-minimal approach of using rinse does not, it turns out, work
on centos. That's a bummer. It's also rather heavyweight. Instead, with
minor machinations, we can just use yum itself pointed at a chroot.

Also adding fedora-minimal element which creates a fedora image using
the new yum-minimal approach.

Co-Authored-By: Gregory Haynes <greg@greghaynes.net>

Change-Id: I026fd9d323e786dae5bb67824c6501067e1ceaa3
2015-04-14 13:39:18 -04:00
Monty Taylor
a33ddb89f1 Add element to process config-drive network info
If you don't want cloud-init, you may need to get a few things
from config-drive because you may be operating on a cloud with no DHCP.
In that case, simply reading some values from config-drive and writing
out either DHCP or static network info, in addition to grabbing ssh keys
is helpful. Both Infra and bifrost want this for their images.

Co-Authored-By: Gregory Haynes <greg@greghaynes.net>

Change-Id: I2746ed256b9783eab058b803130d3ccac484eaeb
2015-04-14 13:39:18 -04:00
Gregory Haynes
0c58eb11a0 Break install-types out of base
We support building elements without depending on the base element.
Breaking install-types out into its own element while making base depend
on it so elements can depend in it without base.

Change-Id: I104543d5482c76f60902e9fc32d91e196eeab51a
2015-04-14 13:39:18 -04:00
Dan Prince
208da5f605 Update packages earlier
Turns out that updating packages last causes some pretty
non-intuitive behaviour if you are trying to pin a package
to a specific version. Lets just update the base RPMs first...
subsequent installations should install the most updated version
anyways (unless they are pinned).

Also moves the package-installs script from the 00 step to 01 so
we can do the update first.

Co-Authored-By: Ben Nemec <bnemec@redhat.com>

Change-Id: I962046cc6048e852e6582fbc579f88bb73e23fdd
2015-04-13 21:50:10 +00:00
Shivanand Tendulker
f0315b4ed4 Fix to load only signed kernel in UEFI secure boot
This fix prevents loading of unsigned ubuntu kernel in UEFI secure
boot environment when image is created using 'iso' element.

'iso' element uses 'linux' and 'initrd' modules of grub2 to load
kernel and initrd respectively. The grub2 implementation of Ubuntu
can load unsigned kernel when these modules are used.

Ubuntu has Grub2 modules 'linuxefi' and 'initrdefi' which exits
boot process if unsigned kernel is used in UEFI secure boot mode.
The 'iso' element should use these modules in grub.cfg to prevent
loading of unsigned kernel when node is booted in the UEFI secure
boot environment.

'linuxefi' and 'initrdefi' works seamlessly when node is booted in
normal UEFI boot mode (non-secure).

Fedora do not have this issue. This fix has been tested in Fedora
environment. It works fine.

Closes-Bug: 1443114
Change-Id: If256ba1f7d7c149482d0f37fabcdfa8ed22e3f91
2015-04-13 13:20:12 +00:00
Shivanand Tendulker
06e3d7c767 Add element ubuntu-signed to provide signed kernel
ubuntu-signed element would install 'linux-signed-image-generic' that
provides signed kernel that can be used for deploy in UEFI secure boot mode.

Package 'linux-signed-image-generic' ships signed kernel with extension
'.efi.signed' (Ex. '/boot/vmlinuz-3.13.0-49-generic.efi.signed').

The kernel modules directory for signed kernel and unsigned kernel is same.
It is without 'efi.signed' extension to its name. This is different from normal
practice of directory naming in '/lib/modules' (Ex. For signed kernel
'vmlinuz-3.13.0-49-generic.efi.signed', modules directory is
'/lib/modules/3.13.0-49-generic').
This needed some changes in '/lib/ramdisk-functions' and 'ramdisk' element to
copy kernel modules.

The signed kernel package contains both signed and unsigned kernel. The
unsiged kernel is without extension '.efi.signed' (Ex.
'/boot/vmlinuz-3.13.0-49-generic'). This required change into
'/lib/img-functions' and 'baremetal' element to pick up signed kernel version
when this element is used.

Closes-Bug: 1443076
Change-Id: I60061cbea847b47fa752b9463cfd387e8e7f0635
2015-04-12 11:36:17 -07:00
Derek Higgins
51ff3bab65 Switch default Fedora image to F21
Fedora 21 was release 4 months ago, we should switch to use it as default
before it goes EOL.

Change-Id: I72686911cc21aeb75d61430878dd36c54edb6904
2015-04-10 16:22:18 +01:00
Jenkins
65ad6377a6 Merge "No markdown docs for elements" 2015-04-09 13:59:32 +00:00
Ben Nemec
9c27fae1e4 Clean up targetcli ramdisk installation
The targetcli element was triggering a bunch of errors from dracut
when we installed all of Python.  It turns out this is because there
were filenames with spaces in the find output and the loop didn't
handle that properly.  This switches to a while loop that can
handle odd filenames.

Change-Id: Iacbf16f26f2bc9991840250dc8ae7990db54d811
2015-04-08 15:26:06 -05:00
Ben Nemec
ffe825113e Make troubleshoot work with dracut ramdisks
Currently, calling the troubleshoot function in a ramdisk script
doesn't work as expected on dracut ramdisks.  This adds an alternate
troubleshoot implementation that will behave as intended.

I did not make it conditional on a kernel param as was done in the
original because dracut can behave strangely if you allow it to
continue after an error.  Always dropping to a shell immediately
should be less confusing.

Change-Id: I98000f4ac6d7890b1f44fe4d10394ac0ea332fcb
2015-04-08 12:54:32 -05:00
Pino Toscano
8d19032a4a Do not export REG_HALT_UNREGISTER between hook scripts
Do not rely on environment changes (like exporting REG_HALT_UNREGISTER)
to persist between different hooks run. This helps when the hooks are
run in different new environments every time.

Instead, in 99-unregister redo the same checks on REG_METHOD as done in
00-rhel-registration, still respecting REG_HALT_UNREGISTER in case the
user does not want to unregister the image generated.

Change-Id: Id594dcd72334f38a2fa96da21206da77a83d7a1a
Closes-Bug: #1434431
2015-04-08 09:28:47 +02:00
Gregory Haynes
031a7b03be Add generic devuser element
The devuser element is useful for configuring a generic utility user for
the built images.

Change-Id: Ifd9dcf3ba88d7abc98b1e44a93f6d9a6b4e764dd
2015-04-08 07:01:24 +00:00
Gregory Haynes
954b9de79b Update cloud-init-datasources README
Updating the README for this element to follow our new environment
variables convention.

Change-Id: I9cf21bd063ea2bfbea7244656af8f3d0e79f20b1
2015-04-08 06:57:44 +00:00
Gregory Haynes
8111fc40aa Improved apt-sources README
Cleaning up the apt-sources README to be easier to consume. Also
removing some tripleo references from the README.

Change-Id: I6937fd5cd51288b36890dde214701bcef1d61381
2015-04-07 23:05:38 +00:00
Ben Nemec
952915f25e Don't trace RHEL Registration scripts
We don't want to trace the RHEL registration scripts because that
is likely to log things like passwords and activation keys.  To
still allow for debugging failed runs, add sanitized logging of
the arguments passed to the registration commands, since that is
the part of the process where problems are most likely to manifest.

Change-Id: I0f661e9c152f43b814fda61211bd56ba93e3b9dc
2015-04-07 10:33:33 -05:00
Cédric Ollivier
3deb171a7a Generate the default en_US locale
The default locale set by cloud-init is now generated to prevent the
warning printed when the user is logged in.

Closes-Bug: 1440728
Change-Id: I2faff6c9d3ab8bb5f66d58e77bcf37f186bf501d
2015-04-06 15:31:04 +02:00
Gregory Haynes
cc308464c6 No markdown docs for elements
Sphinx does not support markdown, therefore all our element docs should
not be in this format.

Change-Id: I6fceb5c2c218e94a463f13d6d9050aea485e6c31
2015-04-02 23:55:19 +00:00
Jenkins
2888318eab Merge "Report status of boot loader installation to Ironic" 2015-04-02 13:07:40 +00:00
Pino Toscano
f7aefb1498 Create the dracut directory if not existing already
Make sure that the target directory for 50targetcli exists already, in
case there is no dracut installed at extra-data.d run time.

Change-Id: I85ade9e85e823b7564a5839c8b6181548a15ad41
2015-04-02 15:07:33 +02:00
Jenkins
5f0f296f58 Merge "Refactor deploy ramdisk to allow use of targetcli" 2015-04-01 21:20:59 +00:00
Jenkins
6446b2eebf Merge "Split dib-init-system into its own element" 2015-04-01 20:35:04 +00:00
Jenkins
88309de96b Merge "Handle non-cloud-init installs" 2015-04-01 04:01:39 +00:00
Jenkins
de0c663a1c Merge "Use find instead of ls" 2015-03-31 20:18:15 +00:00
Jenkins
64d2b3647e Merge "Run udevadm settle after kpartx -l" 2015-03-31 20:17:03 +00:00
Jenkins
60bafe6d93 Merge "Fedora: install redhat-rpm-config" 2015-03-31 19:55:41 +00:00
Ramakrishnan G
9fb2d14cf1 Report status of boot loader installation to Ironic
This commit changes the 80-deploy-ironic script of
deploy-ironic element to report back the status of
boot loader install (when boot_option == "local")
using a newly introduced vendorpassthru.

Closes-Bug: 1422723
Change-Id: I9c1d8643be7cb9e273d65ddd791715a5c271fd93
2015-03-31 16:41:24 +00:00
Derek Higgins
5671a38e8e Fix dhclient in Fedora ramdisks
Copy all of the necessary parts for a Fedora based dhclient to work. This
includes a number of network scripts. Also grab the ip command supplied by
the iproute package, the busybox "ip addr" command was missing the valid_lft
and preferred_lft options.

This will allow the dhcp to work in the ramdisk instead of getting passed the
PXE net config.

Related-Bug: #1417026
Change-Id: I8feee9a740855dab7b47162c5727bf91db77fcc6
2015-03-31 12:27:40 +01:00
Pino Toscano
516e3ae7d6 Use find instead of ls
The listing of *-$INSTALL_TYPE-install files currently uses ls, which
errors out when the glob matches no files, thus using true to not fail
it.
Instead, use find to collect the file list, so there is no need to
ignore the command errors.

Change-Id: Ic6888106858df320a1c90a84f1b9ec74d436b9e6
2015-03-31 13:24:29 +02:00
Gregory Haynes
89dd01e4a0 Run svc-map tests
We currently do not run these tests and they also fail.

Change-Id: I60c8cbd9495b52fb8b4c848549822a05f921664f
2015-03-29 04:11:41 +00:00
Mathieu Gagné
34a196b8e7 Download of translations not properly disabled in APT
The wrong APT config name is used to disable download of translations.
It's Acquire::Languages, not APT::Acquire::Languages.

Change-Id: Ie0c12d444bab19b4486845944ef51031e9133470
Closes-bug: #1436523
2015-03-25 15:23:45 -04:00
Monty Taylor
12165f7b25 Split dib-init-system into its own element
Other elements need this and don't necessarily need base.

Change-Id: I3a12611d7d891a1fb0476f4095be522210b60cba
2015-03-25 13:28:38 -04:00
Monty Taylor
05356cbc09 Handle non-cloud-init installs
Not all operating-system elements install cloud-init, but the base
element assumes its existence. Create the directory if it does not
exist.

Change-Id: I4bda8dc5d200825ea0c8163a4e5c44050a45083f
2015-03-25 13:28:12 -04: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
100959de8d Merge "Add no_timer_check to vm grub cmdline" 2015-03-20 13:05:03 +00:00
Jenkins
b30513f0a2 Merge "openSUSE update" 2015-03-20 09:34:15 +00:00
Jenkins
0a82b3ebcc Merge "Flagging ubuntu-minimal as untested" 2015-03-20 09:00:16 +00:00
Jenkins
e0e0159ef7 Merge "CentOS 6 Element" 2015-03-19 19:42:40 +00:00
Ben Nemec
c98a17222f Refactor deploy ramdisk to allow use of targetcli
RHEL 7 does not ship tgtadm or tgtd so they cannot be used in the
deploy ramdisk.  This change separates the tgt-specific parts of
the ramdisk into their own element, and adds a new one that supports
targetcli instead.

For now, the tgt implementation can only be used with traditional
busybox ramdisks and the targetcli one can only be used with dracut.
This is because dracut is primarily used for RHEL right now so it
makes sense to keep the dependencies simple.  If there is a future
desire to mix and match the implementations that could be done, but
it would require users to explicitly select between tgt and
targetcli.

Change-Id: I4f99c91016287e08d836095c2f2261de8b45abdc
Co-Authored-By: James Slagle <jslagle@redhat.com>
2015-03-18 11:42:00 -05:00
Ben Nemec
6377c723aa Allow elements to add drivers to dracut
It is reasonable that elements may need to include additional
kernel modules in a dracut ramdisk.  This is done with the
--add-drivers option to dracut, but previously the value passed
was hard-coded.

This change allows an element to put a file containing its desired
drivers in a dracut-drivers.d directory, and the list there will
be added to the list of drivers added.  This functions in
essentially the same way as the binary-deps.d directory that
already exists for including additional executables in a ramdisk.

Change-Id: Ie892b908d36c175a469f7cde7dd803ad4b1942b6
2015-03-18 11:40:20 -05:00
Dan Prince
ec0123554f Fedora: install redhat-rpm-config
This is required on Fedora 21 in order to build some
packages via source. Includes files like:

 /usr/lib/rpm/redhat/redhat-hardened-cc1

Specifically this fixed MySQL driver compilation issues on Fedora 21
for source builds.

Change-Id: I459f2203fa145049dda185da952813118193d573
2015-03-18 08:25:18 -04:00
Jenkins
a341ca84e7 Merge "redhat-common: Fix MariaDB-Galera-server case" 2015-03-18 02:32:34 +00:00
Jenkins
dd5a917571 Merge "Allow disabling apt-get clean" 2015-03-17 18:20:11 +00:00
Jenkins
a1c1470017 Merge "Convert leftover unconditional set -x to DIB_DEBUG_TRACE" 2015-03-17 16:58:34 +00:00
Jenkins
b2fc2cc358 Merge "Ironic: Deploy ramdisk to find the right root device" 2015-03-17 15:44:30 +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
Jenkins
85a4d42879 Merge "Fix incorrect package name dmidecoded to dmidecode" 2015-03-16 16:28:04 +00:00