Commit Graph

71 Commits

Author SHA1 Message Date
Dirk Mueller
3bff0ab543 Fix capitalization of openSUSE
Change-Id: I10b9875633d29f4cc0b4e00c13bb5998a71bfc17
2014-09-02 17:55:28 +02:00
Robert Collins
4319730357 Add a ramdisk-install.d hook path.
We need to be able to do install.d like things for ramdisks
themselves, but install.d runs outside the ramdisk context - and its
likely to break peoples brains if we mangle the two together - so this
adds a new hook point, ramdisk-install, specifically for installing
things into the ramdisk.

Change-Id: I37d1660309cda6e28bd0b316b08f61db4e080613
2014-07-16 19:23:50 +12:00
Jenkins
6f7af6f5a2 Merge "Detail 'other' directories in the README" 2014-07-15 14:52:12 +00:00
Jenkins
348a281795 Merge "Allow overwriting old images" 2014-07-15 14:52:06 +00:00
Jon-Paul Sullivan
9be9ca8df8 Detail 'other' directories in the README
Elements can use arbitrary directories in diskimage-builder, so
ensure we make mention of that, and give an example of such a use.

Change-Id: I0e57ece82629c1be4e0f9612c2a565802b222687
2014-07-10 14:06:20 +01:00
Jenkins
4e97def3d5 Merge "Correction: if then statement code style." 2014-07-10 07:38:49 +00:00
Steve Kowalik
84b2ac45de Allow overwriting old images
The two duplicated functions, save_image and finish_image will move
an existing image out of the way if it exists, but it isn't
configurable. Check an environment variable is 0 before doing so.

Switch save_image to just calling finish_image, rather than
duplicating its code exactly.

Change-Id: I26a5a8fa4b6e853c9440bffab195b0bc3728be40
2014-07-08 14:08:10 +10:00
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
Tim Potter
096b6c8e04 Update README regarding Debian and OpenSUSE support
Change-Id: Ib66525f25cb138358f854492fbd665814d060cda
2014-06-17 11:55:21 +10:00
Jenkins
6c6c839fc3 Merge "Replacing deploy to deploy-baremetal in README.md" 2014-06-13 16:23:46 +00:00
Derek Higgins
e7d105a751 Add tar as an output type
Add support for d-i-b to create tarballs, the primary consumer for
tarball images would be linux containers.

Change-Id: I27d67401f3e4415226a4a51e1dde46f739c0220a
2014-06-11 10:48:50 +01:00
Om Kumar
538b978701 Replacing deploy to deploy-baremetal in README.md
Now that deploy has been renamed to deploy-baremetal, README.md needs
to be updated to refer to the new elements.

Change-Id: I7c0d5bfe158628ea1faf2c2914ee7f532d172a28
2014-06-04 03:48:24 +00:00
Dan Prince
c55539b142 Add pkg-map element.
Adds a new pkg-map element which can be used to install
packages based on an in element 'pkg-map' JSON config
file format.

As part of this change we expose DIB's IMAGE_ELEMENT variable
so that we can have access to the element names which are being
installed in a clean manner.

This change is intended to decouple elements from DIB
and allow new elements to support multiple distributions
(with various package naming schemes) without having to
constantly maintain DIB's various bin/map-packages files.

Change-Id: Ic0a061995e2ae708c95a535cba6237bff58f7d93
2014-05-28 12:21:44 -04:00
Gonéri Le Bouder
3c5eabceb3 doc: indentation rules for element
This change defines indentation rules for the elements. It enforces
the use of 4 spaces which is already the devstack standard.

Change-Id: I072cf8bf6748d0c910fecffdf2282bcc4656d038
2014-04-05 21:22:36 +02:00
Jan Provaznik
604926b38f Adds "element-provides" support to element dependencies
An element can define a list of elements provided by itself. This allows
using an alternative element and keeping element dependencies at the
same time. This will be needed for example for mariadb element which will be
an alternative to mysql element - mysql dependency can be kept everywhere
but user can choose mariadb explicitly as a replacement by putting "mysql"
into "element-provides" file.

Change-Id: I7f193612f279dd71d9f1f1edfc60009838a00c5a
2014-03-25 15:35:52 +01:00
James Slagle
b46930aeff Correct README.md markdown errors
Fixes a few syntax errors in the markdown rendering related to the new
verbage about install types. Also gives a better example of using a
DIB_INSTALLTYPE_* environment variable.

Change-Id: I4b60f458adc08b601e9d913f3e448bcf620314db
2014-03-17 11:51:37 -04:00
James Slagle
b4dfa6cb90 Move install type enablement into base element
Move whether the package or source install type is enabled out of the
source-repositories element and into the base element.
source-repositories wasn't a great fit for this functionality to begin
with.

Specify the install type for an element via the
DIB_INSTALLTYPE_<install_dir_prefix> environment variable.

Additionally with this approach, any new install type can be added
in an element, without having to update source-repositories or anything
in dib.

You could just write your install type implementation under
nova-foo-install, then define DIB_INSTALLTYPE_nova=foo in your
environment, and the scripts under nova-foo-install would get run during
the image build.

Source installs (any scripts under <install_dir_prefix>-source-install)
is the default install type for all elements.

Change-Id: I9414aca360c41e030e27d3d0c0a52d9d8e13d8b1
2014-03-14 12:25:11 -04:00
Dustin J. Mitchell
c60ed49e2e Update README formatting and content
This orders the phase subdirectories by execution order, adds
subheadings, and fixes some markdown formatting issues. This also
replaces all double-spaces after full-stops with single spaces.

Change-Id: I2d5526cbe4a902067fa9cad1456c35d13f81e183
2014-02-27 12:10:06 -05:00
tanlin
d8d81922da Rename Openstack to OpenStack
Change-Id: I65a0af76132fa1375bca25889b90d381fd038988
2014-02-12 17:52:55 +08: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
Dan Prince
255387a288 Drop default distribution root element support
Converts our existing default root element code to be just a check
which exits with a failure message if no root/distribution element
is found.

Change-Id: I954a6abfd7871d5807b1a171a03fa98932410cff
2013-12-02 11:01:29 -05: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
Clint Byrum
d07921eca5 Deprecate first-boot.d
Print a message and pause the build for 10 seconds to ensure interactive
users see the message.

Fixes bug #1212080

Change-Id: Ia388a54892c479e428b0ed7b8c70d64d65010e21
2013-09-27 09:42:51 -07:00
Monty Taylor
5e3b5320e4 Remove github references
OpenStack runs git.openstack.org which is more reliable and responsive
when projects operate within OpenStack Infra. Replace all of the
references to github with referneces to git.openstack.org.

Change-Id: Ib3ece85aba6451801487b0bdbd83147e39d9e155
2013-09-18 08:17:10 -05:00
Monty Taylor
d18891d952 Update stackforge references to openstack
Change-Id: I17e896eddf6fe84f4784cac8231552ee3d21aa39
2013-08-17 22:58:26 -04:00
Robert Collins
97bc5d7853 Allow using a pypi mirror to install via pip.
Using a custom pypi mirror can be very convenient, making image builds
substantially faster - because we create multiple virtual
environments we benefit more than single-virtualenv users would.

Change-Id: I997daf1f9477c447e1fb30818aea9e80a49b31a6
2013-08-10 22:07:30 +12:00
Robert Collins
c7d80ddeed Cleanup mount points automatically.
Manually listing the mount points that need cleanup is not
maintainable and makes it hard to write elements that use bind
mounting to inject resources into the build environment.

Change-Id: I7c9ade444f4ebe42552f8e321f257a7ec0a674ef
2013-08-09 22:53:32 +12:00
Jenkins
39d4d9b941 Merge "Remove explicit sudoers requirement." 2013-08-06 20:57:33 +00:00
Jenkins
585a155d17 Merge "Document the dangers of co-existing elements." 2013-08-06 20:55:50 +00:00
Chris Jones
357c2de681 Remove explicit sudoers requirement.
Most of our build process runs as root and the overhead of explicitly
tracking sudo commands in the shipped sudoers.d file, plus the
operational overhead of keeping the sudoers.d file updated on build
hosts over time, is now considered to be unnecessary.
Instead, we now document that the build process will expect sudo
commands to work and the operator must make this happen (either by
running as root, via sudo -E, or allowing passwordless sudo for the
build user).

Change-Id: If2628e7d0c7efde0fb99c84a217523ba29b1b38d
2013-08-06 16:08:35 +12:00
Chris Jones
3708e40051 Document the dangers of co-existing elements.
Add a potent example (and simply remedy) of how element authors can
unwittingly conflict with each other in ways that it is almost
impossible for us to guard against with low level policy/mechanism in
di-b. Fixes bug 1181309.

Change-Id: I51e845065702911371e448521327143495c3b405
2013-08-06 16:07:09 +12:00
Robert Collins
950fa15d64 Improve caching documentation.
It was a little weak, and folk need enough detail to reason about
performance.

Change-Id: I67f81ab5a206b3d42dd1e4e1eb52af88ac1a3adc
2013-08-02 22:48:51 +12:00
Derek Higgins
4651913e55 Add a new break on error
A user running di-b several times while developing an element may not
want to drop to a shell in all cases but may only want to do so if one
of their in target hooks failed.

This patch gives them the ability to do so, If break=after-error is set
then a user will be provided a in target shell taking over from where the
last failed command left off.

Change-Id: Ia2f7ac4c21b64b971f87f4ae9cb867981b13eb5e
2013-08-01 17:08:54 +01:00
Clint Byrum
f57e8c66c2 Provide hint for what package contains qemu-img
While following install instructions in README.md it should be more
clear how to install qemu-img on your system.

Change-Id: Ibb8828806bf46716b91b83a4eea696f4fe478206
2013-07-27 17:05:20 +00:00
Robert Collins
f33c4ebdde Update TripleO incubator URL reference.
The old location has been deleted and 404's.

Change-Id: I29f3b534e28e8c0efe94736dcdc7f4c453738676
2013-07-23 15:18:05 +12:00
Robert Collins
b2f1d4e2af Document an interface for offline operation.
Complex image builds can download hundreds of MB of data from the
internet with many separate lookups. It would be nice to allow users
to ask for a fast build where those lookups are entirely avoided,
using locally cached resources (where possible). This new interface
allows users to signal to elements that they wish to operate without
updating cached resources, which will in turn allow us to avoid
checking for stale data at all.

As part of this I've also documented where we cache data, so that
things like the ccache cache dir and image cache files are not a
surprise to users.

Change-Id: I27f5de6ceaa4e9c6390721b7c434fe0908df84f5
2013-07-18 09:17:01 +12:00
Robert Collins
d1a24cab16 Move end user docs higher up in README.md.
Most folk probably don't need the massive design details, so they
should come later.

Change-Id: I94067196e664b37c05fbd8882d259ffc3d95c50f
2013-07-18 00:36:54 +12:00
Robert Collins
1a172683a5 Remove excess whitespace in README.md.
Change-Id: I664cfe4aa8d05c4cc53eeb2ee5f5a200f0d41110
2013-07-18 00:00:01 +12:00
Chris Jones
8d1ce9c0c3 Build ramdisks in an image chroot.
Ramdisks are now built inside a chroot which is built by the normal
image build process. Doing so improves our independence of the
precise state of the build host.

This fixes bug 1194055.

Change-Id: Ibc254fbb9e7b404b5f38c1b35bcde8a4136e8e28
2013-07-12 11:09:35 +01:00
Jenkins
8c5888e853 Merge "Adding docs for the source-repositories element" 2013-07-10 20:45:09 +00:00
Derek Higgins
195053108b Adding docs for the source-repositories element
Change-Id: I57244a5cc2f563b2e69eb49388c3c6b49202c9eb
2013-07-10 13:04:39 +01:00
Clint Byrum
3464064a87 Add environment.d hook to setup environment.
Before each phase dib-run-parts will pick these up to setup the
environment for the commands it runs.

Change-Id: I56697d7bc370918d4063eee67a1c35d4988a5359
2013-07-09 15:01:33 -07:00
Robert Collins
cbfd5a9a62 Document some dependencies.
Change-Id: Ibe925bd48cf8dd1a5318361ab972c5734aeee3c1
2013-06-07 15:20:21 +12:00
Robert Collins
fb246a02eb Ensure that the ext4 fs can be rebuilt up to 1PB in size.
Change-Id: I16c5fe4eb0a9951d44745d6a46450f70d33b3481
2013-05-18 13:08:06 +12: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
Clint Byrum
d9a2211d14 Only use tmpfs if build machine has 4GB+ RAM.
For machines with low RAM (or no access to /proc/meminfo) the builder
will still run, but will just build inside the filesystem that is
hosting /tmp. This will result in a slower build (especially if there
are a lot of .deb packages installed).

Fixes bug #1175453

Change-Id: I79f2672058c11e377548820df0ab4fad8f47ffdc
2013-05-03 06:55:53 -07: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
Lucas Alvares Gomes
45173ccdb5 Adds support for post-install scripts.
Post install scripts are useful because they can perform tasks you want
to handle after the OS/application install but before the first boot
of the image. e.g: Clean the cache left by the package manager reducing
the size of the image.

Change-Id: I03e77f602192bbdce29c02999d1b57fac8051ddc
Fixes: Bug #1145786
2013-04-17 09:47:51 +01: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
5ada82a59c Add armhf support.
ARM doesn't have a generic Linux image due to the soc-specific nature of Linux
kernels today, so we drop the manual installation of that package, replacing it
with a dist-upgrade instead. This involved tweaks to the dpkg and fedora
install-package scripts.

Change-Id: I97924b80ca87781307e1087b9fe4b18215770e84
2013-04-09 08:17:22 +12:00