Commit Graph

333 Commits

Author SHA1 Message Date
Jenkins
9eb2719998 Merge "Add mapping for gearmand" 2013-11-18 22:06:59 +00:00
Chris Jones
a19d8ceee7 Document ramdisk troubleshooting.
We now document how to trigger a troubleshooting shell when booting a
di-b ramdisk.

Change-Id: Ief44347893fa81a7f2669143e1746a5ee99599af
2013-11-18 19:45:59 +00:00
Jenkins
45a0082fa7 Merge "Add troubleshooting override to deploy ramdisk." 2013-11-18 19:08:45 +00:00
Chris Jones
1f328087d9 Add troubleshooting override to deploy ramdisk.
We now allow operators to drop into a troubleshooting shell while
booting a deploy ramdisk, without having to have pre-configured their
desire to do so ahead of time, by means of a 10 second pause for them to
press a key.

Change-Id: I05ffa1ebaa95c83dee7bd2a2f52ba4c08928bb10
2013-11-18 17:22:26 +00:00
Derek Higgins
257a9dd139 Add mapping for gearmand
The ubuntu gearman-job-server package maps to the Red Hat gearmand
package.

Change-Id: I3ec90b2759498488fce2ecaed03effc18313d1e6
2013-11-18 16:44:14 +00:00
Jenkins
6f7eae51b2 Merge "Split network bringup out of base ramdisk init." 2013-11-18 11:38:43 +00:00
Jenkins
6fb7a22166 Merge "/bin/bash all the things." 2013-11-18 09:36:01 +00:00
Jenkins
670f1f7312 Merge "Don't block the upstart daemon if it doesn't exist" 2013-11-18 09:35:03 +00:00
Victor Lowther
dbacf3e8df Make pxe_mac accurate in two common cases.
If we are booting pxe booting using syslinux, and it has IPAPPEND 2 in
the boot stanza, then it will append the mac address of the device we
are booting from to the kernel parameters where we can get at it
pretty easily.

If we are booting physical hardware via UEFI over the network, we can
rely on the BootCurrent EFI variable to point at the boot entry for
the NIC we booted from, which will include the MAC address of that
nic.

If neither of those cases are in play, we can just fall back to the
all-physical-devices-with-links code.

This currently uses the Bash 4 support for associative arrays to handle
the netboot-in-UEFI case, if needed I can rewrite it to be Bash 3 compatible.

Change-Id: I5e50e30c60d6d732a09ab61251cbb9be08bb6113
2013-11-17 21:43:59 -06:00
Victor Lowther
43b70ce224 /bin/bash all the things.
Since we are using bash syntax in some of the element fragments,
we should make sure we use bash for all of them, so that things don't
break on systems where /bin/sh != /bin/bash.

Change-Id: If2f043c57aa4e1492b7f9839213ef6123f683612
2013-11-17 16:59:31 -06:00
Chris Jones
c9f432d45b Split network bringup out of base ramdisk init.
We now run the network bringup portion of the ramdisk init from an
init.d script, thus allowing image builders to inject code into the init
script before that point (e.g. configure network hardware).
The environment variables used by the network bringup code are retained
in the base init script so they can be overridden by init.d fragments.

Change-Id: I1ef0bb21e7f26c0ff3f02266f853ce5402bcb94d
Closes-Bug: #1252023
2013-11-17 20:37:26 +00:00
Russell Sim
b9348447b9 Don't block the upstart daemon if it doesn't exist
Check if Upstart exists before blocking the daemon.  Not all dpkg based
OS's have Upstart installed so this should help increase compatibility.

Closes-Bug: #1251949
Change-Id: I2dcb1ff3641778b5653ca5762a728398adb57da1
2013-11-17 14:46:14 +11:00
Chris Jones
5387b01af9 Make sorting of ramdisk init elements explicit.
We assemble the init script of ramdisks with the fragments from included
elements, alphabetically.
We now place leading numbers on all of the fragments we ship, to make it
more obvious to element authors and downstream users, how the process
works.

Closes-Bug: #1251706

Change-Id: I56b0d42971c8c462eddcfe1769f8124405e1233c
2013-11-15 17:18:34 +00:00
Roman Podoliaka
b01c73aadc Provide a way of determining init system used
dib-init-system script is installed into $PATH. Called
without arguments it will print the name of init system
used to stdout.

Additionally, set DIB_INIT_SYSTEM environment variable to
the init system used.

Tested on ubuntu+upstart, centos+upstart, fedora+systemd,
debian+sysv.

Closes-Bug: #1251610

Change-Id: I29668079091f6060dab66d8259890384d3bbd653
2013-11-15 17:10:38 +02:00
Derek Higgins
726a816cac Add mapping for libffi-dev
libffi header files are needed to pip install xattr, which is a
requirement of swift.

Change-Id: I69560425f7106c35ec432825eab94ca8424eb89e
2013-11-12 20:32:52 +00:00
Derek Higgins
64f4323ae7 Allow heat-admin to sudo without tty
This is needed to run scripts from devtest, in particular so that
swift ring files can be distributed.

Change-Id: Icbe8c5b24a0d494730357983f230a37a7f078de7
2013-11-12 20:26:11 +00:00
Jan Provaznik
f6f4e808d1 Remove BUSYBOX variable from ramdisk-defaults
ramdisk-defaults file is sourced before chroot to an image being created
is executed. Busybox path should be set inside chroot instead.

Change-Id: Ic0e1d3093ca9d489dd96b14157e93b336cf0baee
2013-11-11 14:36:15 +01:00
iberezovskiy
f23babe971 Check existence of directory 'lost+found'
The command `sudo rmdir $TARGET_ROOT/lost+found` will fail
if `$TARGET_ROOT/lost+found` directory doesn't exist,
e.g. when you use non-default image.

Fixes bug #1245856

Change-Id: I48c8f2f201b29912a726249023ca7d20893cc958
2013-10-29 18:51:49 +04:00
Derek Higgins
d91ececa06 Remove mapping of atftpd to tftpd-server
These are different tftp implementations, tftpd-hpa and tftpd-server are
equivalent, this mapping was added in a previous commit.

Change-Id: Idd1f554d4ee8e1d3c515d5f2f191e90abe0ff396
2013-10-25 12:27:39 +01:00
Jenkins
0e4ddaa586 Merge "Add redhat mapping from tftpd-hpa to tftp-server" 2013-10-25 11:24:20 +00:00
Derek Higgins
4508a685de Remove dependency on dracut-network
Now that we have moved onto neutron-dhcp-agent. dracut-network is no
longer needed, infact it was getting in the way. Dracut wasn't
requesting the classless-static-routes dhcp parameter but was
configuring networking. Removing this causes the network service to
redo dhcp and set the appropriate static route (specifically so
overcloud nodes are routed to the correct metadata server). This element
is still required for undercloud nodes so needs to be included there.

Change-Id: Ic23560164aff7791dd87ed2c3ad008efd248ae93
2013-10-25 09:15:40 +01:00
Derek Higgins
66b293af1c Add redhat mapping from tftpd-hpa to tftp-server
This will be needed by a patch I'll be submitting to t-e-i to
change the tftp implementation used by ubuntu, so that both
Ubuntu and Fedora can use the same implementation.

Change-Id: Ie9581265dfa2c37342e01162fe580b1948dd3e03
2013-10-24 14:55:22 +01:00
Jenkins
3144cc63be Merge "Allow for bad Fedora image mirrors" 2013-10-23 23:10:29 +00:00
Tomas Sedovic
1c132f6aa5 Add apache and mod_wsgi to Fedora's package map
We need this for the Horizon element (which should work both on debian and
fedora-based distros).

Change-Id: I3a1dacbd1823abe051ba977b92b67ed27423f405
Signed-off-by: Tomas Sedovic <tsedovic@redhat.com>
2013-10-23 15:23:42 +02:00
Derek Higgins
9947cdebd9 Allow for bad Fedora image mirrors
I am getting a lot of http 404's from Fedora mirrors, in particular in
the US. Alternatively we could get cache-url to use previously existing
files if they exist and there is an error but this may not be the
correct thing todo in all cases.

So for now we do a retry if HTTP 404 is returned to the request for a
Fedora image.

Change-Id: I7634aeac3bdfe6930fafe6d276186c09fc8587b5
2013-10-23 10:49:29 +01:00
Derek Higgins
1adb4072b8 exit 44 if http 404 is returned
This will allow the fedora element to know that there was a http 404 so
it can retry.

Change-Id: I42100a175e42af1c53909508245695ac82204fc0
2013-10-23 10:44:47 +01:00
Jenkins
194df26096 Merge "Remove old-kernels for fedora" 2013-10-17 21:01:34 +00:00
Lucas Alvares Gomes
f707a6bd82 Dracut regenerate initrd w/ the right kernel
When picking the latest version of the kernel on i386 we should prioritize
PAE kernels. Debug kernels will be ignored.

Change-Id: Ic0fc5907074ee2a5ddfbbb1db2f1c8a6060cae9f
Related-Bug: #1240873
2013-10-17 13:50:54 +01:00
Lucas Alvares Gomes
0181b177c2 Remove old-kernels for fedora
Remove the old kernels on fedora to save some space in the image.

Change-Id: Ia7ace63c286052713ac1ef3092373cc2712db11a
2013-10-17 11:51:44 +01:00
Derek Higgins
d23ba2a8a8 Conditionally add dhcp-all-interfaces
If the /etc/init drectory gets created on Fedora, it causes
os-svc-daemon to add upstart init scripts instead of systemd.
As a result none of the openstack services can start.

Partial-Bug: #1239880

Change-Id: Iec317baa3eb9ff651fa66c582d2f614993cde45e
2013-10-15 13:43:50 +13:00
Jenkins
a019fcf470 Merge "Specify distro release in fedora image name" 2013-10-14 11:51:22 +00:00
Jenkins
52956a2c3a Merge "Allow for redirects to ftp servers" 2013-10-12 15:38:39 +00:00
Clint Byrum
f96f705559 Remove \r chars from dhcp-all-interfaces
For some reason we are adding CR's to/etc/network/interfaces, but it
does not require them. They are a bit annoying to see in an editor and
serve no known purpose there.

Change-Id: I9aeeff5533f418f09fcf33edd42e5d85cd486d23
2013-10-11 11:06:16 -07:00
Clint Byrum
28190d5954 Make dhcp-all-interfaces block all interfaces
Previously dhcp-all-interfaces was only blocking the first network
interface to come up. We add an instance stanza to make it run one
instance of generate-interfaces-file per interface. We then use flock to
serialize runs of generate-interfaces-file.

Fixes bug #1233577

Change-Id: Ib16bed6b37ce0789e315ef57e05ac561470a6f2a
2013-10-11 11:06:16 -07:00
Clint Byrum
2129d78124 Fix ifquery call in dhcp-all-interfaces
Ifquery does not print anything for interfaces which only have a single
iface line. It does, however, return non-zero if the interface is not
configured at all, so we can use that to indicate whether or not there
is a configuration.

Fixes bug #1233579

Change-Id: Ia2fdafbea57e806eba99ae8ddaf395ebdcc306e1
2013-10-11 11:06:16 -07:00
Derek Higgins
b67b850a7e Allow for redirects to ftp servers
The Fedora image can redirect to a ftp server, in which case outputs a
213 if not modified.

Change-Id: I714fc3562bf188994357e1918af309d8edeecde5
2013-10-11 10:16:51 +01:00
Derek Higgins
11b116977c Specify distro release in fedora image name
The fedora element downloads the latest available image so presumably
will jump to F20 once available. Probably causing several days (weeks?)
of busted stuff. Of course it will be impossible to know when all users
of the elements are ready to switch but the least we can do is allow a
little time as a buffer.

This commit ties it down to a specific version which can then be updated
when the consumers of this element are ready. This allso follows the
same pattern as the ubuntu element.

Change-Id: I15c8e15a66e8af1bd152c27144acbc55af9da88e
2013-10-10 08:21:52 +01:00
Tim Serong
43c0082aa7 Move /tmp/ccache setup to base element
Commit c7d80dd (Cleanup mount points automatically) removed the unmount
of $TMP_MOUNT_PATH/tmp/ccache in run_d_in_target() and moved the
"rm /tmp/ccache" to elements/base/finalise.d/02-remove-ccache.  There
are two problems with this:

1) Not unmounting at the end of run_d_in_target() results in tmp/ccache
   being bind mounted muliple times on top of itself (three times, if you
   just run `disk-image-create base`).  It is eventually unmounted, but
   somehow the auto unmount code is confused, and tries to unmount it
   one more time than it was mounted, which results in an error like
   "umount: /tmp/image.THQkZxQa/mnt/tmp/ccache: not mounted".
   This doesn't actually break anything, but it's a little messy.

2) "rm /tmp/ccache" in elements/base/finalise.d/02-remove-ccache never
   succeeds in removing /tmp/ccache, because that hook is invoked by
   run_d_in_target(), *while* /tmp/ccache is mounted.

This present commit solves the above by moving the ccache setup glue out
of img-functions and into the base element's root.d.  This has the
following implications:

1) lib/img-functions is a little cleaner.

2) /tmp/ccache is available in the chroot during the root, extra-data,
   pre-install, install and post-install stages.  It is not available
   during block-device, finalise and cleanup stages as it will have been
   automatically unmounted by then.

3) /tmp/ccache won't be setup if you're building an image that doesn't
   include the base element.

Change-Id: Ief4c0a6f4ec622db6c6f652776215684178d8943
2013-10-10 16:27:09 +11:00
Jenkins
126099cd6d Merge "Use --numeric-owner when extracting base image" 2013-10-08 22:54:08 +00:00
Tim Serong
6da49c6d49 Use --numeric-owner when extracting base image
When extracting the base image without --numeric-owner, user and group
names in the tarball are mapped to uid/gid by the host.  This can cause
problems when building an image for some other distro than you're
running yourself.  For example, building an Ubuntu image on openSUSE
ends up with /var/cache/man in the image owned by 'proxy' (uid 13)
instead of 'man' (uid 6), because the host (openSUSE) uses uid 13 for
the 'man' user.  This particular man/proxy discrepancy results in
"fopen: Permission denied" errors when apt-get does its "Processing
triggers for man-db" thing in the Ubuntu system.  I wouldn't be
surprised if there were other kinks caused by this uid/gid mapping
discrepancy too, but that's the one I found so far.

The same thing can also happen with Fedora, but seems to be less likely,
or at least less obvious to me when building Fedora images on openSUSE.
But, IMO, it's better to be safe and just use --numeric-owner on all
base image untarring outside the chroot.

Change-Id: I9da5ac66dd182e7278fe4fee932093f61d35673a
2013-10-08 22:45:51 +11:00
Matthew Farrellee
ddef437cd2 Make RHEL subscription optional
The code to handle unregister of RHEL subscriptions was buggy and
broke if no subscription credentials were supplied.

Change-Id: Iac29c45f207725e31eac6487a87367fcd3d34d49
2013-10-07 14:46:57 -04:00
Jenkins
21a81d8b79 Merge "Fix mellanox module loading." 2013-10-07 03:49:46 +00:00
Jenkins
59db52aa80 Merge "Ignore empty files returned by curl" 2013-10-07 00:36:55 +00:00
Chris Jones
8c17a5d040 Fix mellanox module loading.
My previous attempt at forcing the mellanox module to load was
completely bogus. This should not be (although I lack hardware to be
100% sure).

Change-Id: I22ff88181c9c9f0c024e021eeb7f16d79715241a
Closes-Bug: #1233949
2013-10-04 09:53:03 +01:00
Derek Higgins
50ea375154 Ignore empty files returned by curl
In cases where servers ignore the Modified time, curl cancels the
download, outputs a http 200 and leaves the output file untouched, we
don't want this empty file.

Fixes bug #1234926

Change-Id: I05b0dd95dcd53ca50d88ec07f2f1ee9958b6adb7
2013-10-04 09:26:43 +01:00
Clint Byrum
4a751ba162 Generate interfaces file before cloud-init runs
Cloud-init needs to query the metadata server after the network
interfaces are configured. The upstart job "cloud-init-nonet" is
specifically in place to provide a hook to block cloud-init from
running while we rearrange network interface configurations.

Fixes bug #1233577

Change-Id: Ib5cf75d858fdb670b2abcc082e912c4644d6b169
2013-10-03 16:00:19 -07:00
Robert Collins
2684cddd3d Fix typo in dhcp-all-interfaces.
It is meant to write to /etc/network/interfaces, not
/etc/network/interfaces].

Change-Id: I15ea677edf7129ffd222c39627f7f76356f68e11
2013-10-01 20:32:40 +13:00
Tomas Sedovic
d5afe2b1fa Set locale for the profiling printf command
When LC_NUMERIC is set to a format that doesn't use a decimal point,
`printf` will fail.

Change-Id: Ie6c4d075928f47b17cc413d537fc31c9d0734bdb
Signed-off-by: Tomas Sedovic <tsedovic@redhat.com>
2013-09-30 12:10:07 +02:00
Clint Byrum
f120e122bc Add mapping for atftpd in fedora/rhel
Upcoming tripleo-image-elements changes will need this.

Change-Id: I775dda78aaee892c8b47999707574054c3d9a95b
2013-09-26 10:38:44 -07:00
Jenkins
d744f7697c Merge "Make RHEL subscriptions optional" 2013-09-25 09:47:30 +00:00