Commit Graph

103 Commits

Author SHA1 Message Date
Tim Miller
7ef33c51db Source img-functions into common-functions.
A recent commit added a call to function cleanup_dirs to
the common-functions file, but this function is not in scope
for all code paths.

The problem can be reproduced like so:
  bin/ramdisk-image-create deploy -o /tmp/foo

Which results in the error:
  bin/../lib/common-functions: line 35: cleanup_dirs: command not found

This change causes cleanup_dirs to be in scope when calling ramdisk-image-create.

Change-Id: Iaf01beb9dd42a9d810d8aed1aa4ce19a5854c09b
2013-04-30 19:36:37 -07:00
Jenkins
39152c1b30 Merge "Improve Fedora build host support: architectures." 2013-05-01 01:52:10 +00:00
Robert Collins
cb62bae9b8 Build images using loopdev instead of qemu-nbd.
Qemu-nbd does not perform well with older versions of qemu due to
the lack of writeback caching mode. It also only builds qcow2 images
and there is a desire for raw image support. Finally, qemu-nbd makes
it very difficult to build images concurrently due to the somewhat
opaque nature of how it selects a /dev/nbd# device. losetup, on
the other hand, makes this process very straight forward.

Change-Id: I309fad8af4fd1e8d1720c17b65e1897a76d5e897
Co-Author: Clint Byrum <clint@fewbar.com>
2013-04-30 08:56:12 -07:00
Chris Jones
be48317fc3 Improve Fedora build host support: architectures.
Instead of blindly calling dpkg, we will now perform an appropriate test
and fall back on uname with some subsequent massaging of uname's output
on amd64 and ARM build hosts.

Based on a patch from Lucas Alvares Gomes

Change-Id: I363addd9f8b4d748d50b69f4509ce627aa5676aa
2013-04-25 11:04:02 +01:00
Devananda van der Veen
8a22115c6d Allow build dir to be changed from /tmp
Adds an env var TMP_DIR which will override mktemp's default location.

Fixes bug 1168432

Change-Id: I60c63389bb2a639f948e7e96bf9aaea0ea73e27d
2013-04-12 07:43:53 -07:00
Chris Jones
bd1bae7c58 Introduce the DIB_ namespace for build-time config.
Document the use of DIB_ as a prefix on environmental variables that can
be overridden at build time.

Introduce the first such variable by migrating IMAGE_SIZE to
DIB_IMAGE_SIZE.

Change-Id: Ie36b734991b913a23f37f2add47d470d7c1576e4
2013-04-12 09:50:34 +01:00
Robert Collins
24c89932be Always include the in-tree elements directory.
Change-Id: I5a79fbf0568f5755dd14824ed147093387170b3f
2013-04-08 10:26:44 +12:00
Ghe Rivero
4f8040c7a4 Fix elements_path default path.
Change-Id: I0cf94813bd23edac8e25a55bbe58db6f126a2294
2013-02-27 11:11:26 +01:00
Ghe Rivero
308eee2827 Use multiple locations for elements dir.
Using ELEMENTS_DIR env variable, you can specify multiple dirs containint your elements.
It must be a ":" separated elements list.

When an element is seen in one of those lists, it will be chosen and will continue with the next element.

Change-Id: I18eca27d943139cd6ca1ebd232b419e502d7b048
2013-02-27 10:48:55 +01:00
Jenkins
619153bdf4 Merge "Support multiple outputs disk formats" 2013-02-27 00:02:26 +00:00
Devananda van der Veen
c5203262d7 Fix ramdisk-image-create
ELEMENTS_DIR env var was not being set by lib/ramdisk-defaults.
This caused ramdisk-image-create to fail.

Change-Id: I25ec43feddb8ef546dba83a77b8488fee98d4a17
2013-02-25 16:29:28 -08:00
Ghe Rivero
a05629b9f4 Support multiple outputs disk formats
Using the IMAGE_TYPE env variable, you can select which ouput disk format you want for your image.
Only qcow2 format supports compression.

Change-Id: Ia01d9079c354dbd3cfcf870d86f97ee57bd9d479
2013-02-21 09:26:44 +01:00
Tim Miller
5544da4605 first-boot.d scripts log to a file:
Log first-boot.d script output to a file, to ease troubleshooting,
since the first-boot scripts are removed from the system after
running, even in case of failure.

Change-Id: I07d5c782dd918a804e054bf08efce89ed9442e0c
2013-02-15 10:04:50 -08:00
Jenkins
7ae4fb5c1c Merge "Make populate_libs() more generic." 2013-02-15 02:19:05 +00:00
Clint Byrum
91c30f6ab2 Use dib-run-parts for running scripts in target
Also modified dib-run-parts to apply a more workable solution for
filtering out unwanted files such as editor backups and VCS.

The script is installed in its own element, depended on by the OS
specific ubuntu element. This is  because the ubuntu element (and
later other OS's) are responsible for populating the root filesystem.
If we try to install this in base, the root filesystem will look to
be populated already and we will skip automatically choosing ubuntu.

Change-Id: I017646748c1a8360299106289b57d976d45875a8
2013-02-14 10:48:10 -08:00
Arata Notsu
826c9c7935 Make populate_libs() more generic.
It can handle "path to path" output of ldd, such as
    /a/b/c.so => /x/y/z.so (0x123456789)

Change-Id: I68d1096694835818c9129212a02796e1ce1c181d
2013-02-14 20:50:27 +09:00
Robert Collins
7f77729ec5 Move the dpkg specific stuff to a dpkg element rather than being hardcoded.
This includes the install-packages implementation for dpkg, apt http proxy
config, daemon blocking and unblocking.

Change-Id: I8f159021d2b223d7003cec067de3aa605ad06974
2013-02-14 11:16:12 +13:00
Robert Collins
3860af4be5 Change run-parts usage to be compatible with Fedora.
Change-Id: I7a4e1252b0ced940cd4d8fa2fbd096c016933954
2013-02-14 11:16:12 +13:00
Tim Miller
56e50ee5cf Consolidate common OS installation into a script:
Move common openstack service installation operations
into a new script `os-svc-install`, which simplifies
the elements for openstack services.

Change-Id: Ied8ac3278e7fe8af76e24748ec4e598a84afa03c
2013-02-13 11:06:00 -08:00
Robert Collins
8220c00095 Bad code landed, causing ubuntu to be always landed.
Change-Id: Ia77073563fde70140169dbbc5a7448aad54295e2
2013-02-13 13:58:35 +13:00
Arata Notsu
9386a35e47 ramdisk-image-create shows a failed binary dependency
This patch fixes a problem: if a binary is not found, the script
exits without a message informs what is needed (because of 'set -e').

Change-Id: I00b8917918f0e6eddf8506d6548432077eb4bf14
2013-02-12 17:07:09 +09:00
Robert Collins
8f9d433917 The default ARCH was broken due to $ARCH not being exported.
Change-Id: I84f2b60c391d90ed285bd30669260c8483a3c76f
2013-02-12 19:23:34 +13:00
Robert Collins
1ee3a01447 Move initial root contents into a hook.
This is a necessary but not complete step towards supporting Fedora and Suse
distributions. Further work is needed (e.g. to quiesce daemons on
installation).

Change-Id: If3ea6093d41a21de755db52328226b84b5a3ede6
2013-02-11 17:01:36 +13:00
Robert Collins
3d95bf81c5 Export the ELEMENTS_DIR so that dependencies work.
Change-Id: I544b0762f8a13a11564cf02c5fdbe3cb521f63b3
2013-02-05 14:39:38 +13:00
Tim Miller
4688804bbc Improve error message for missing element.
Change-Id: I80beae77874e36d7f47880b030c225100b102e95
2013-01-30 16:07:02 -08:00
Ghe Rivero
11b4a5501d Create install-packages as a binary.
Only supports Debian family distribution so far.

Change-Id: I9fa0b833c34a614fe498c6c6ae599733a69c1309
2013-01-31 00:08:58 +01:00
Chris Jones
0f73578721 Allow manual installation of packages.
Rather than force creation of an element for a single package install,
allow people to do this from the command line.

Change-Id: I63e2e7e50c4a7dbb8a8e198581dfadce91773621
2012-12-21 17:46:44 +00:00
Robert Collins
d03825b504 Add the ability to break into a shell during builds.
Change-Id: I87af952d892f8622e4c916085fc896c735a35438
2012-12-14 20:17:29 +13:00
Robert Collins
012116cad6 Move everything 'common' into base, making it avoidable for tests.
Change-Id: I87edd00f6e0edcd609856192c2c98604ef3274f0
2012-12-14 13:41:57 +13:00
Robert Collins
e8a8e99a08 Make it possible to not recompress the qcow2 image at the end.
Change-Id: Icca922853ee583dcccb6d3970d080fbec11edac7
2012-12-14 13:25:18 +13:00
Ghe Rivero
258185b7a2 Added true to avoid exit on error
disk-image-create just died without any warning

Change-Id: Ia5da4188d64bb22540b57d01184b91faa59149e7
2012-12-13 18:32:34 +01:00
Arata Notsu
1d3ca33ce7 Add copyright to lib/ramdisk-*
Change-Id: I6b48205858f3bc6e55b3dd6efc3e038dd6c42127
2012-12-11 18:14:19 +09:00
Monty Taylor
1eff4a436e Rename flavour to element.
Flavour is overloaded in openstack due to it being used by nova. Element
seems to have the same feeling of combinability without using a term already
in active use in the openstack community.

Change-Id: Ia4c028d4062a8f69c66665821c94dd4bcdf06031
2012-12-05 14:04:58 -08:00
Jenkins
7ccf5282ed Merge "Use system resolv.conf file when available" 2012-12-03 21:38:54 +00:00
Darragh Bailey
e5cda1f731 Use system resolv.conf file when available
Where possible use the system configured resolv.conf file
to to support resolution of internal servers such as proxies.
Use previous hardcoded google dns nameserver as fallback

Change-Id: Ibc1e8a3b96e733a2f7fbcdd4b2c5d3e8926424c4
2012-12-03 15:18:09 +00:00
Arata Notsu
0b81a3e0e8 Remove udev stuff from the source tree
Pick udev stuff from the running evironment instead.

Change-Id: I90a004d0a2b83d3451e73ae351cf474a7bfd62ee
2012-11-29 12:32:06 +09:00
Ghe Rivero
38dc7680c9 Jenkins image fixed
- Removed http_proxy option
- Added sudoers entry to cp first-bot.d
- Fixed typo on 11-jenkins-plugins
- Restored trap exit on run-parts
2012-11-27 18:37:57 +01:00
Ghe Rivero
a3f9f12a4a Untrap EXIT before run-parts 2012-11-26 19:05:12 +01:00
Devananda van der Veen
d935fc0e07 be smarter about mounting qcow images
some images have partition tables, some don't
2012-11-21 19:00:53 -08:00
NoBodyCam
2b879aea6a adding dhclient support 2012-11-20 14:04:40 -08:00
Devananda van der Veen
d0d372ad78 mount_qcow_image should mount p1 2012-11-20 05:21:53 -08:00
NoBodyCam
f7fdec55a8 added lsmod to default busybox links 2012-11-19 16:01:40 -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
chriskrelle
37253564d3 move tgtd & tgtadm to bin-deps of deploy and remove from lib/ramdisk-functions 2012-11-16 16:30:11 -08:00
Robert Collins
4b7cdb4fdc Fix copyrights for HP work. 2012-11-15 16:20:32 +13:00
Chris Jones
f7091cb2fc Add support for flavours to ship udev rules.d files and port over the mellanox variant to use this 2012-11-12 16:57:13 +00:00
Robert Collins
9ecbe14d9c Default to 2G in size - 1G is just too small. 2012-11-12 20:12:46 +13:00
Robert Collins
4c3c7ea9ba Fix handling of parameters that are not set by any flavour for eval_run_d. 2012-11-12 13:45:57 +13:00
Robert Collins
40e954735c Make it possible to set a size from within a flavour, and use that for devstack. 2012-11-12 11:47:26 +13:00
Chris Jones
13d65413e1 Remove some whitespace 2012-11-09 22:16:08 +00:00
Chris Jones
6fb8b19b7c Update ramdisk building to support init hooks for flavours 2012-11-09 22:15:05 +00:00
Chris Jones
eb584f14ed Port old baremetal-mkinitrd.sh to the new image creation standards 2012-11-10 10:50:15 +13:00
Robert Collins
5cc195e391 Bring across disk image code. 2012-11-10 00:04:13 +13:00