Commits on Dec 5, 2013
  1. Add support for building openSUSE images

    tserong and rhafer committed Oct 11, 2013
    This is currently experimental/incomplete.  See
    elements/opensuse/ for details.
    Change-Id: Ie5bcab15c9703cf15ceb642fb986a8afc34f96fb
    Co-Authored-By: Ralf Haferkamp <>
Commits on Oct 10, 2013
  1. Move /tmp/ccache setup to base element

    tserong committed Oct 8, 2013
    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
Commits on Oct 8, 2013
  1. Use --numeric-owner when extracting base image

    tserong committed Oct 8, 2013
    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
  2. Mount /dev/pts in chroot

    tserong committed Oct 8, 2013
    Mounting /dev/pts fixes mildly irritating errors during image creation,
    i.e.: "Can not write log, openpty() failed (/dev/pts not mounted?)"
    emitted by apt-get.
    Change-Id: I4106bc584f1b29ce9283a20064bb5ae447f17fbe
Commits on Jul 24, 2013
  1. Enable running disk-image-create on SUSE Linux

    tserong committed Jul 22, 2013
    - Ensures /sbin and friends are in $PATH when invoked (without this,
      various sudo invocations fail in exciting ways).
    - Use dib-run-parts in lib/common-functions instead of run-parts
      (neither SLES nor openSUSE ship run-parts).
    - Ensure dib-run-parts doesn't descend into subdirectories (same
      behaviour as run-parts).
    - Move dib-run-parts from root.d to bin (cleaner, consistent with
      other elements with separate bin scripts).
    - Tested by building Ubuntu image on openSUSE 12.3.
    - Note: this doesn't add support for creating SUSE images, it just
      lets you run disk-image-create on SUSE-based distros.
    Change-Id: I906c6bc3cf51cdf2c4415adeae1ca250faac25e1