Commit Graph

14 Commits

Author SHA1 Message Date
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
Om Kumar
bccffc8bfd Refactor code to select boot kernel
The script to find best kernel from image (used by vm
and baremetal element) is duplicated and is not in sync
with each other. Moving the code to img-functions as a
function will reduce duplicated code and make it reusable
in future.

Since img-functions is not accessible in chroot env,
kernel selection is being moved from finalise.d to
cleanup.d in the vm element.

Change-Id: I8fbccc13a2c61a5191ef9ea5d2a8302a3e43b000
2014-06-13 11:46:39 +05:30
Monty Taylor
1c07d4ba1a Remove All Rights Reserved
The phrase is no longer needed as of August 23, 2000 with Nicaragua's
joining of the Berne Convention.

Additionally, in at least one instance,
elements/cache-url/bin/cache-url, its existence in the file between
Copyright lines is just weird and feels misleading, even though it is
not.

Remove all of the lines, because sanity.

Change-Id: I24fd76c2b4f66b8036010b5079db39ead729abee
2014-04-25 11:25:10 -07:00
Dirk Mueller
7dcbfba5a4 Fix kernel extraction on openSUSE
Change-Id: I4ceaff4e6a42fe8dcfe7447f128d7943889ffc3a
2014-02-06 23:46:28 +01:00
Steve Kowalik
58c755cf4c Create a new baremetal element
Rather than using a script to mount the image using nbd to extract the
kernel and ramdisk, make a new element called baremetal, which contains
a cleanup.d script that will copy them out to <image name>.{vmlinuz,initrd}.

Closes-Bug: 1224669
Change-Id: I8f3569aa12148d18b1c8242b6fbbd8857894b26f
2014-01-21 16:48:20 +11:00
Mark McLoughlin
af8b7f05a1 Quieten disk-image-get-kernel
disk-image-get-kernel is pretty noisy and you see e.g.:

  $> load-image overcloud-compute.qcow2
  XXX  -d '/tmp/image.lWGCgPoj' -o 'tmp' -i '/home/stack/overcloud-compute.qcow2' --
  Extracting kernel + ramdisk from /home/stack/overcloud-compute.qcow2 and writing them to /tmp/image.lWGCgPoj
  nbd                    17554  0
  nbd                    17554  0
  basename: missing operand
  Try 'basename --help' for more information.
  /dev/nbd0 disconnected
  tmp-vmlinuz,tmp-initrd

Clean all this up so we just get:

  $> load-image overcloud-compute.qcow2
  Extracting kernel + ramdisk from /home/stack/overcloud-compute.qcow2 to tmp-vmlinuz and tmp-initrd in /tmp/image.g6b0lG88

Change-Id: I8971ec0bbcd87157b07fc17254c56bb9f9f2a597
2013-12-09 13:39:29 +00:00
Ben Nemec
237fd64b47 Ignore basename failures
Commit 0210be22ae introduced the
possibility of basename being called on an empty string.  Because
that can happen in normal operation (such as an x86_64 kernel,
in which case the PAE check will find nothing), don't allow the
basename error to kill the script.  Also ignore failures in the
second basename call so the proper error message is echoed.

Change-Id: I38a18af09ab24fda9c98cbf3ace8fd7acc6faef5
2013-10-17 22:36:53 +00:00
Lucas Alvares Gomes
0210be22ae Fix disk-image-get-kernel for redhat
disk-image-get-kernel picks the wrong version of kernel and initramfs
if there's a PAE and non-PAE version present. Only affects i386 images.

Change-Id: I06e08fdf038988759b620f549261499cb0a69b34
Closes-Bug: #1240873
2013-10-17 12:20:04 +01:00
Jan Provaznik
0eaddbd214 Fixes files ordering when choosing newest image
For example if there are following kernels in undercloud/overcloud
image:
/boot/vmlinuz-3.9.5-301.fc19.i686.PAE
/boot/vmlinuz-3.10.10-200.fc19.i686.PAE
then disk-image-get-kernel picks vmlinuz-3.9.5. It should use the
newest one.

Change-Id: I7bbf06705e85370d66c7dd8a5d4f8d6c93b21c0c
Fixes: bug #1224365
2013-09-12 11:26:57 +02:00
Jeff Peeler
87fb533979 Modify relative paths of lib, elements for packaging
(Based on review https://review.openstack.org/#/c/36009)

Scripts test for existence of ../share/diskimage-builder and
fall-back to ../ if not found. This allows scripts to run unmodified
from a packaged installation or a local archive/repository.

Change-Id: I0cf4c1fdb8e42ec284c56860cb15818632b93b9e
2013-07-31 13:15:33 +12:00
Lucas Alvares Gomes
c28cb1b5d8 Add RedHat support for disk-image-get-kernel.
RedHat and Debian based systems have different binary names.

Change-Id: I5162204759fbc4ff167d1584294c9936ab7df4c8
2013-06-05 17:12:09 +01:00
Lucas Alvares Gomes
85b5ef0c8d Move the ensure_nbd function call.
Move the ensure_nbd function call from the disk-image-create to the
disk-image-get-kernel. The image creation process does not use qemu-nbd
anymore.

Change-Id: I8ff2ad54f322a9e33d52408fa4e253a7b45900c7
2013-05-20 11:59:21 +01:00
Devananda van der Veen
fb426153f4 remove force-xtrace in disk-image-get-kernel 2012-11-18 08:17:54 -08:00
Devananda van der Veen
e5fcb27790 add some tooling that baremetal-devstack wants
- add bin/disk-image-get-kernel to extract vmlinuz/initrd from .qcow2
- add corresponding methods to lib/common-functions
  - map_nbd
  - (un)mount_qcow_image
2012-11-18 07:20:27 -08:00