Commit Graph

976 Commits

Author SHA1 Message Date
Monty Taylor
9cd5068854 Remove use of sudo from yum pre and post elements
sudo is not needed, since in-chroot elements are run in the context
of the root user. Furthermore, sudo in pre-install is problematic as
sudo may not have been installed yet (imagine a debootstrap build)

Change-Id: Ib5c7e176a90fe3b8fa9c3cd702d3d815df54f472
2014-11-28 11:01:40 -05:00
Jenkins
019196ef7f Merge "Add deprecation warning when using map-services" 2014-11-22 14:48:33 +00:00
Jenkins
d8b156dedf Merge "Add DIB_DEBOOTSTRAP_EXTRA_ARGS environment variable" 2014-11-21 13:32:06 +00:00
Jenkins
d506c42ec4 Merge "Deprecate map-packages, replaced by pkg-map" 2014-11-20 01:41:45 +00:00
Jenkins
04e8ce0ece Merge "Enable RHEL Registration" 2014-11-19 22:34:37 +00:00
Jenkins
a80ff47dec Merge "Simplify Dracut cmdline script" 2014-11-19 20:26:10 +00:00
Ryan Brady
4178c0c69d Deprecate map-packages, replaced by pkg-map
This patch writes a warning out to stderr to notify element authors
that may be using map-packages to migrate to pkg-map.  This patch
also prints out a warning during image-create that lists the specific
elements that are not using pkg-map.

Change-Id: I7e2a7611dd5650815736ce998aa94a7833193d06
2014-11-19 12:04:12 -05:00
Tim Potter
018b1d4147 Add DIB_DEBOOTSTRAP_EXTRA_ARGS environment variable
This allows extra arguments to be passed to the debootstrap
command when creating an image using the debian element.

Change-Id: I87eb856365ff6a17f051e2e56587235648328d57
Co-Authored-By: Ghe Rivero <ghe.rivero@gmail.com>
2014-11-19 11:22:16 +00:00
Jenkins
8986283d41 Merge "Remove duplicate binary-deps from dracut-ramdisk" 2014-11-19 09:59:37 +00:00
Ghe Rivero
830de28e96 deploy-kexec depends on deploy
It was depending only on deploy-baremetal. Changing it to 'deploy' could
be used with both baremetal and ironic deployments

Change-Id: Ia2600080b488f7d259a9baf111767e82b6cc933d
2014-11-18 15:29:53 +01:00
Ben Nemec
8ee66ec8ec Remove duplicate binary-deps from dracut-ramdisk
These are already listed in the respective deploy-* elements, and
if we include them here then they get added to every ramdisk built
with dracut.  That causes issues for elements that don't need
something like tgtd because it won't be installed and the
binary deps script will fail.

Change-Id: Ibdcf7d200d4f7136396b63404cd966f7557043e0
2014-11-14 12:43:49 -06:00
Yuriy Zveryanskyy
676b1b738d Add element for building ramdisk with ironic-python-agent
This element creates kernel and ramdisk files based on Fedora,
example:
disk-image-create -a i386 -o test fedora ironic-agent disable-selinux

Change-Id: Ifa133d1680b81cb87d32a405aa7d7b40fe91f835
2014-11-13 19:30:44 +02:00
Jenkins
ce67ce87ea Merge "Support installing packages by default" 2014-11-13 10:27:56 +00:00
Ben Nemec
f528aa316e Simplify Dracut cmdline script
We don't actually need a real value for the root kernel param, and
requiring one causes problems for things like the discovery ramdisk
that don't pass in a disk= parameter.  Dracut seems to be happy to
take /dev/zero as the value, so we can just always use that.

Change-Id: Ia724f0214c26aa18c6f8f41f2c48d7f25b52ee6c
2014-11-12 11:18:53 -06:00
Ryan Brady
1aecb41b7e Add deprecation warning when using map-services
This patch writes a warning out to stderr to notify element authors
that may be using map-services to migrate to svc-map.

Change-Id: Ic80db16c607958d025e89b3a4058a9cbb568938e
2014-11-12 17:03:49 +00:00
Derek Higgins
c26a9ee4b1 Install lsb_release from package
The URL we were using to download lsb_release from no longer works,
install from package so this is not affected by disappearing URL's
in future.

This was originally installed from a URL because the package dependencies
caused a 87M increase in the size of the base image. For fedora the
increase is now 27M which is a little more tolerable.

Change-Id: I6e56a4a81786b33c5c6b92df2bd8236cd3f19670
2014-11-10 11:28:49 +00:00
Ryan Brady
ac8514c089 Enable RHEL Registration
This patch documents the 00-rhsm script as <= RHEL6 as it doesn't
work with the latest release of Satellite.  The Red Hat Network
(RHN) method of registration is being phased out in favor of Red
Hat Customer Portal and Satellite 6.  The subscription-manager
command line tool is the preferred method of registration.

The registration of RHEL is required to enable repositories for
software installation during image creation time.

This element provides functionality for registering RHEL images
during the image build process with diskimage-builder's
disk-image-create script.  The RHEL image will register itself
with either the hosted Red Hat Customer Portal or Satellite to
enable software installation from official repositories. After
the end of the image creation process, the image will unregister
itself so an entitlement will not be decremented from the account.

Boot-time registration is supported through metadata.  Please see
the configuration in the README for more information.

Change-Id: Ia9ef377cc4ed9595633888bfb248a1224e04b542
2014-10-31 12:36:43 -04:00
Jenkins
cafad0a148 Merge "Update Debian repo to retrieve signed Release file" 2014-10-31 01:27:19 +00:00
Jenkins
d72435a86b Merge "Optimize speed of deletion in find command" 2014-10-30 12:53:28 +00:00
Jenkins
50085793cc Merge "Unset trap before dracut ramdisk build script exits" 2014-10-30 11:43:09 +00:00
Jenkins
1e5ec9adb3 Merge "Use binary-deps.d for dracut ramdisks" 2014-10-30 06:25:30 +00:00
Dan Prince
022cb2c1c2 Support installing packages by default
Adds new disk-image-create --install-type option which
can be used to enable alternate install types. The
default install type is 'source'.

The motivation is to eliminate elements like
enable-package-installs which require coupling and also
don't work with elements in multiple element repositories.

This patch does not prevent you from using the previous
DIB_INSTALLTYPE_ variables to customize the install type,
rather it just changes the default so you don't have to
set it so often when using things like packages.

Change-Id: Icee98440fc2251728f2dca30e7c4789a0fd89b93
2014-10-28 15:05:53 -04:00
AzherKhan
bb38d0e325 Optimize speed of deletion in find command
I would like to recommend to use + instead of \; in the find
command. As this will ensure the removal of all selected
directories in a single invocation.

Hence improve the speed of deletion.

Change-Id: I409fe11aae217afb6f790491591005c679264ed4
2014-10-27 21:04:09 -07:00
Jenkins
dbe2846264 Merge "package-installs assumes packages have a pkg-map" 2014-10-28 00:15:19 +00:00
Gregory Haynes
c27e32f769 package-installs assumes packages have a pkg-map
Our package-installs script fails when installing a package which does
not have a pkg-map but a pkg-map file exist for the element.

Change-Id: I3dab802e23bccfc916efcc1c70c6ce6c4a9ccf67
2014-10-27 09:42:58 -07:00
Jenkins
3c8cf6a724 Merge "Move busybox binary-dep to ramdisk element" 2014-10-27 08:30:48 +00:00
Jenkins
34c273d8df Merge "Make diskimage-builder work in Docker." 2014-10-24 20:13:45 +00:00
Jenkins
2d80e53186 Merge "iso element to use 'search --label' for grub" 2014-10-24 15:55:44 +00:00
Jenkins
9d252ba318 Merge "Handle extra spaces in merge-svc-map-files" 2014-10-24 07:42:02 +00:00
Ben Nemec
0db6b9b401 Unset trap before dracut ramdisk build script exits
A similar change was needed in the normal ramdisk element as part
of ae928057bd to avoid running
cleanup immediately after the ramdisk build completes.

Change-Id: Ia96e2d8011b88ed96cc6727914c5a5d2dea59757
2014-10-23 20:02:08 -05:00
Ramakrishnan G
8c9ee78ab5 iso element to use 'search --label' for grub
Current iso element uses 'search --file' to find the
grub root.  This is a wrong approach as it may find
some other partition containing /vmlinuz. Instead modify
it to search for grub root by the label of ISO image.

Closes-Bug: 1384826
Change-Id: Id4217be3420597bed2f80a96788928259ec91582
2014-10-23 23:04:17 +05:30
Ghe Rivero
4543294487 Update Debian repo to retrieve signed Release file
After bootstraping a Debian image, the repository keys
are installed to verify the packages signatures, but the
Release signature file is missing. Updating the repo,
will retrieve a new InRelease file (inline signed).

Change-Id: I14f0d22cc9c72be9b07f3708270359bc8cff112d
2014-10-23 07:38:31 +00:00
Jenkins
1e55938148 Merge "iso element to build bootable ISO images" 2014-10-23 06:05:34 +00:00
Ben Nemec
bb8126e887 Use binary-deps.d for dracut ramdisks
Instead of hard-coding a list of binaries to include in the dracut
ramdisk, use the existing binary-deps.d functionality to provide a
list.  This will allow other ramdisks (such as discovery) to add
the binaries they need.

Change-Id: Ib7ffa15e08db1cc45e93a8f2a5c01369772c93ff
2014-10-22 15:13:48 -05:00
Jenkins
2337532954 Merge "svc-map requires PyYAML" 2014-10-22 08:15:54 +00:00
Jenkins
602ec41dd7 Merge "Revert "introduce $SYSTEMD_SYSTEM_UNIT_DIR"" 2014-10-21 21:15:25 +00:00
Ben Nemec
088f0eb7ac Move busybox binary-dep to ramdisk element
Busybox should be installed and managed from the ramdisk element,
since that is common to all elements that need busybox.  In
addition, we do not want busybox installed when building Dracut
ramdisks, so it can't be in the deploy-* elements.

Change-Id: I2656d20b466138f7f6dfcf558ba90c6909151d3c
2014-10-21 16:05:19 -05:00
James Slagle
ccd292c10a svc-map requires PyYAML
svc-map requires PyYAML, so install it. It's not always installed on all base
images.

Change-Id: I7ce5325e8afa0047f67153baa1fc7d4a90196c88
2014-10-21 16:13:16 -04:00
Ramakrishnan G
13aed64e97 iso element to build bootable ISO images
This commit adds a new element named 'iso' to build a bootable
ISO image for the kernel/ramdisk emitted by the 'baremetal' or
'ramdisk' element.

Change-Id: I89d175a29e2d0bc64b47fe527f0d0f6875f6849a
2014-10-21 14:37:57 +05:30
Michael Kerrin
730e7bd76e Handle extra spaces in merge-svc-map-files
During internal testing we are getting the following error from
merge-svc-map-files
File "/tmp/image.K2MYCphY/hooks/extra-data.d/10-merge-svc-map-files", line 54, in main
    with open(data_path, 'r') as dataFile:
IOError: [Errno 21] Is a directory: '...diskimage-builder/elements/svc-map'

Somehow IMAGE_ELEMENT contains a extra white space that manifests itself
as an element without a name. It is very hard to find where this is coming from so
instead this patch makes merge-svc-map-files more robost to this situation

Change-Id: Id1500ead8a77d691408617dcdc4e095bc5775be8
2014-10-20 18:16:39 +01:00
Jenkins
8ba6a26e0a Merge "Allow source-repositories to be disabled completely" 2014-10-20 11:35:40 +00:00
Jenkins
bb07de7fe9 Merge "Enable dracut deploy ramdisks" 2014-10-20 11:03:54 +00:00
Ben Nemec
eed30adc48 Enable dracut deploy ramdisks
The element builds dracut from source on Ubuntu because the
Ubuntu dracut package is broken and very old, so it can't be
installed properly and causes a number of other issues that
are fixed by using a newer version of Dracut.

This initial version should work in virtualized environments.
Further validation of its suitability for real baremetal
deployments will need to be done in the future, but this should
be sufficient to enable that work.

Regarding Dracut specifically, in order to limit the changes
needed in the existing scripts this element continues to use a
cut down version of the /init script that we were building for the
existing ramdisk.  However, instead of running it as pid 0 it is
run as a Dracut pre-mount hook.  This allows Dracut to set up all
of the hardware and system bits, while falling early enough in the
Dracut sequence to complete the deployment before Dracut would try
to boot off the hard disk.

bp tripleo-juno-dracut-ramdisks
Change-Id: I144c8993fe040169f440bd4f7a428fdbe3d745cf
2014-10-17 21:44:09 -05:00
Gonéri Le Bouder
a9006ee1e7 Revert "introduce $SYSTEMD_SYSTEM_UNIT_DIR"
This reverts commit 4bf38a829a.

This variable is pointless since we can always replace it with
/lib/systemd.

Commit I459f7514ab35082d31607968252a9005fa25de2a will fix the issue
in tripleo-image-elements.

Change-Id: I524badb6836a0d04a5f6e6a5b5d95920fd923ef6
2014-10-17 10:29:34 +02:00
Jenkins
2b60bea961 Merge "Allow for multiple image outputs from raw source" 2014-10-16 21:56:28 +00:00
Jenkins
e289b31d12 Merge "Consolidate lsb_release source-repositories" 2014-10-16 21:14:05 +00:00
Jenkins
5b71da8899 Merge "Remove first-boot.d support" 2014-10-16 18:36:59 +00:00
Jenkins
4ec80ee1f0 Merge "Don't re-install cloud-init for centos7 images" 2014-10-16 17:39:20 +00:00
Ghe Rivero
873de01491 Remove first-boot.d support
After being deprecated two releases ago, finally remove any reference
for the support of first-boot.d

Change-Id: I08d67404ef48cad61db3b18fb86e970abfa5d2b6
2014-10-16 09:48:14 +00:00
Ben Nemec
0eccd2808c Allow source-repositories to be disabled completely
In our official image builds we are only allowed to use resources
that are "blessed" by the build system.  This means that external
things like git repos and tar files are not allowed.  Currently,
even in offline mode source-repositories expects those things to
be available in the cache, so we need a way to disable it entirely.

This change adds an environment variable NO_SOURCE_REPOSITORIES
that does so.  It can be set in an environment.d script so elements
that might rely on a source repository will know it's not available.
The 02-lsb script in redhat-common is one such example and is
updated to handle this case.

Change-Id: I0de63bee6ad79733d6711478c707a9b41593e85f
2014-10-15 12:24:50 -04:00