Commit Graph

184 Commits

Author SHA1 Message Date
Lucas Alvares Gomes
cc5ecb4e9c Use dib-run-parts on dib-first-boot.
At least on RedHat the run-parts command is very precarious and doesn't
even check for the return code of the scripts it runs causing the
dib-first-boot to delete itself even when something went wrong with the
configuration of the first boot of the image. Using the dib-run-parts
instead will make the whole first boot routine to be more robust and
less platform dependent.

Change-Id: I0073fd52fc1fc8848ca9277a84603124215cdb6e
2013-06-19 17:22:18 +01:00
Jenkins
207aeced03 Merge "deploy element: Call find_disk in loop w/ timeout." 2013-06-16 22:08:29 +00:00
Jenkins
13858d499c Merge "Add disable-selinux element." 2013-06-16 22:07:51 +00:00
Dan Prince
9fe9afb159 deploy element: Call find_disk in loop w/ timeout.
Updates our deploy element's init script so that it calls
find_disk in a loop until it returns true (meaning we have a disk).

Previously on some bare metal machines find_disk would return ""
which causes the subsequent iscsi target commands to fail due to
a bad backing store.

This commit also updates the error message when start_iscsi_target
fails to be a bit more accurate as well.

Fixes LP Bug #1190984.

Change-Id: I3cd535d6672c197c1c3c539c83bba36be7a14e18
2013-06-14 09:36:15 -04:00
Lucas Alvares Gomes
50e0512a28 Add disable-selinux element.
Having all security enabled is not always interesting, e.g. when
developing or testing new elements.

Change-Id: I828ecedc805ce4f89d60d185994eaa9c651d436a
2013-06-14 09:39:07 +01:00
Lucas Alvares Gomes
4e428c6844 dib-run-parts was failing with empty targets.
When the target directory is empty, the for loop printing our profile
data was failing because of a glob problem.

Change-Id: I34e612021c70d6b8f75423de0d8be969c52e58e2
2013-06-13 11:29:02 +01:00
Lucas Alvares Gomes
f17e169f69 Add /usr/local/bin to the secure_path variable.
This patch will append /usr/local/bin to the sudoers secure_path variable,
by doing so commands prefixed with sudo will then find some binaries
delivered by other elements in that path (e.g nova-rootwrap).

Change-Id: I1ebad8b1932620559a3d90aa39298f9b12e636fd
2013-06-12 11:01:01 +01:00
Robert Collins
03b437db0e Fix cloud-init-nocloud to actually work.
Bug 1124593 reported that ssh host keys were not being created, and the
lack of seed metadata files was the cause. Add those files and remove
the workaround.

Change-Id: I6fb55be7f8c7efd1f75aeba9123f495e312ff695
2013-06-12 13:28:27 +12:00
Jenkins
e66bb40e7e Merge "Change the rootfs label in fedora's /etc/fstab." 2013-06-11 08:49:12 +00:00
Lucas Alvares Gomes
6219ad7917 Change the rootfs label in fedora's /etc/fstab.
The images produced by the diskimage-builder have their filesystem with
a label of "cloudimg-rootfs", so we need to change the default /etc/fstab
on fedora to reflect that.

Change-Id: Id1bb00cb81cb200a114f500e26272624be577da0
2013-06-11 09:46:57 +01:00
Jenkins
233ee29299 Merge "Add zlib-devel and qemu-img to fedora map-packages." 2013-06-10 22:13:44 +00:00
Jenkins
8c847b75c9 Merge "Add dracut-network element." 2013-06-10 22:07:09 +00:00
Lucas Alvares Gomes
f58adecaf6 Add zlib-devel and qemu-img to fedora map-packages.
Needed for building the bootstack image.

Change-Id: I4da14527f1647633213d86bef59fbd0eee3591f3
2013-06-07 16:42:39 +01:00
Lucas Alvares Gomes
4e4a88a387 Add dracut-network element.
This element will install the network modules for dracut and regenerate
the initramfs. The network support would allow us to configure the network
of the image via kernel cmdline instead of injecting files into the image.

Change-Id: I829405127e77aec80b99ac8dd2032cb0c6d81063
2013-06-05 14:18:57 +01:00
Jenkins
8532b3d7ad Merge "Add fedora support for ramdisk-image-create." 2013-06-05 10:00:11 +00:00
Lucas Alvares Gomes
cd27dff29a Add fedora support for ramdisk-image-create.
This patch allows the creation of ramdisks from a fedora system.

Change-Id: Ic3b393af45ae1b85d015d2ceb5601ea723457da6
2013-05-31 15:37:31 +01:00
Jenkins
e34a211d21 Merge "Remove obsolete Fedora rc-local install.d hook." 2013-05-31 10:33:42 +00:00
Lucas Alvares Gomes
58538cea51 Remove obsolete Fedora rc-local install.d hook.
After the refactor of the first-boot routine there's no use for this
script anymore, in fact all it's doing is to create a broken link.

Change-Id: Ic09e7208bc950380341e8a073647950ac99a05fd
2013-05-31 11:29:23 +01:00
Matthew Farrellee
e6608d42da Switch from losetup+partprobe to kpartx for Fedora image creation.
Fedora's partprobe does not create devices the same way it does on
Ubuntu. Instead of using partprobe, this patch uses kpartx, which
works on both Fedora and Ubuntu.

Change-Id: Iac5cbac083e423425693c8210cd5d058ce4bce72
2013-05-30 17:32:13 -04:00
Jenkins
6fe4502058 Merge "Fix fedora element to work with qcow2 images." 2013-05-28 23:40:05 +00:00
Robert Collins
c713e44ad8 Move package install of dkms to install.d.
Change-Id: I04bebdc9162915e0789fc374c172adc73079a227
2013-05-27 12:12:47 +12:00
Clint Byrum
da02e05ff4 Fix fedora element to work with qcow2 images.
The images from mattdm were updated and also changed to qcow2 format.

Change-Id: I6560f177baa9a0e2d303364a3ad4eb216f1f2136
2013-05-25 06:24:08 -07:00
Dan Prince
a4c42954d3 Install dkms before using it.
Updates the new 99-dkms element so that it installs the package
before using it.

Fixes LP Bug #1183785.

Change-Id: Ia191ed3cae707a8c8591f849dc0c6293e849d64a
2013-05-24 07:56:11 -04:00
Chris Jones
be99db321b Build all dkms modules near the end of the image build.
Work around ordering issues that cause dkms modules to not always
be built for all installed kernels, add a post-install.d script to
the base element that will force the issue.
(Note that any module/kernel pairs with a pre-existing valid
module will not be rebuilt, so this should not impact performance
unnecessarily)

Change-Id: Iccea14c6318014cc7e1fec77e71c14a224f7b76e
2013-05-24 11:57:04 +01:00
Robert Collins
5695fbd39e Set correct mode for .ssh/authorized_keys files.
Per bug 1182648 we were not setting the mode and as a result couldn't
log in, defeating the purpose of having a local-config element :).

Change-Id: I4114b9536392f1517eac8f4bbe6f4b60ce1186a1
2013-05-24 12:01:57 +12:00
Jenkins
495381c2f5 Merge "Refactor the first boot routine." 2013-05-20 18:38:45 +00:00
Clint Byrum
92e420aaf0 Basic wall clock profiling per element script.
Change-Id: I43f90574ac716f2ef22949c0fe4fa2e7fc84348e
2013-05-20 11:14:52 -07:00
Jenkins
103bedacc7 Merge "Run fixfiles restore in chroot instead of firstboot." 2013-05-17 22:39:06 +00:00
Chris Jones
7abd158346 Force text mode console in base element.
Apply kernel command line parameters to force Linux to remain in text
mode. Typical distro kernels quickly switch into a graphical screenmode
and this is incompatible with common Lights Out Management hardware
which is able to intercept text mode consoles to display them remotely.

Change-Id: Id553972c4fd87e78c9e6fe344331a399913d965e
2013-05-16 20:04:12 +01:00
Lucas Alvares Gomes
02ee161e81 Refactor the first boot routine.
Setting up a routine to run at first time the system boot may vary from
distribution to distribution. This patch will remove the logic from the
diskimage-builder code and put it into the elements.

The base element will now deploy a dib-first-boot script and each OS
element will ensure that this script runs at rc.local time. By doing
that we will put the OS specific stuff in the OS elements and remove
the embedded code out of the img-function file.

Change-Id: I24c5d1b1185de5693f145347fe912245f1ba7dfe
2013-05-16 15:50:10 +01:00
Steve Baker
6561ed2ce8 Run fixfiles restore in chroot instead of firstboot.
Boot time was 30 seconds shorter in an all-in-one devstack
environment.

Thanks to Ghe Rivero for a pointer to the solution
https://bugzilla.redhat.com/show_bug.cgi?id=208275

Change-Id: I90d0c96d5659326ba67d6119b96d9a4113adf7fe
2013-05-16 15:23:58 +12:00
Jenkins
7e0fe78cf2 Merge "Fix for running /etc/rc.local on Fedora" 2013-05-15 22:35:19 +00:00
Jenkins
010fef9843 Merge "Trigger SELinux autorelabel on first boot." 2013-05-15 22:32:42 +00:00
Jenkins
958badb36f Merge "An element for putting SELinux in permissive mode" 2013-05-15 22:19:04 +00:00
Jenkins
2e244fb720 Merge "install redhat-lsb before pre-install.d baseline-tools" 2013-05-15 22:13:17 +00:00
Jenkins
606f67643b Merge "install redhat-lsb-core instead of redhat-lsb" 2013-05-15 22:13:08 +00:00
Steve Baker
d36ecfb75c Trigger SELinux autorelabel on first boot.
This adds about 30 seconds to my local boot time.

Fixes bug #1179730

Change-Id: I519bb9289236abd43f8eb784768dcab10e2e5754
2013-05-14 12:03:24 +12:00
Steve Baker
3bf171b2b5 An element for putting SELinux in permissive mode
This is useful for selinux debugging, so is most useful in its own
optional element.

Change-Id: I83532242eacbe211d3bb13e00436f682ca6d7e76
2013-05-14 11:56:28 +12:00
Steve Baker
c6da246b73 Fix for running /etc/rc.local on Fedora
With systemd rc.local lives in /etc/rc.d and is only run
if the rc-local service is enabled.

This change creates a /etc/rc.d/rc.local symlink, and modifies img-functions
prepare_first_boot to tolerate an initially missing /etc/rc.local.

Fixes bug #1179674

Change-Id: I7e6102b62224950c1de5d48205dc4feff60f9389
2013-05-14 11:48:58 +12:00
Steve Baker
04e8d1cc00 install redhat-lsb before pre-install.d baseline-tools
baseline-tools expects lsb_release (although tolerates it not being there)

Order needs to be 01-override-yum-arch, 02-lsb, 03-baseline-tools
hence the renames.

Possibly lsb_release isn't cared enough about to do this.

Change-Id: I03abffb1ab2f560e746ba4ffd407605de31f4930
2013-05-13 15:58:31 +12:00
Steve Baker
aea625d64d install redhat-lsb-core instead of redhat-lsb
The later pulls in most of a desktop. The former still pulls in a lot
but significantly less, and still provides lsb_release.

Change-Id: Ie27310f01c037b4a10feb5e380e6f5c4ecf21364
2013-05-13 15:55:51 +12:00
Steve Baker
3c3ee47e82 Enable serial console for fedora
Change-Id: Ic3695f643f3d00457fd97d18863793d60d3f211d
2013-05-13 11:15:59 +12:00
Clint Byrum
6b44b6d274 Fix fedora fstab so / is mounted rw properly.
Change-Id: I8001b3fdb3fecb70cda388450222c60a2bd0a58b
2013-05-10 00:05:56 -07: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
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
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
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
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