~raharper/curtin:bug/fix-curtin-exit-code

Last commit made on 2018-02-23
Get this branch:
git clone -b bug/fix-curtin-exit-code https://git.launchpad.net/~raharper/curtin
Only Ryan Harper can upload to this branch. If you are Ryan Harper please log in for upload directions.

Branch merges

Branch information

Name:
bug/fix-curtin-exit-code
Repository:
lp:~raharper/curtin

Recent commits

a6145f9... by Ryan Harper

fix /usr/bin/curtin exit code in install failure

When curtin encounters an error during the 'install' stage, the default
configuration enables collecting of system logs. The collect_logs function
'create_log_tarfall' included a sys.exit(0) which should only be part of the
'collect_logs_main' method; this resulted in failed installs exiting with a
return code of 0. The fix is to move the sys.exit(0) up to the main method.

LP: #1751176

82622f1... by Ryan Harper

docs: Document use of format command with fstype: zfsroot

Add documentation for use of 'zfsroot' in the format command.
Note that zfsroot support is experimental. Include an example
zfsroot configuration.

91d01f2... by Scott Moser

docs: Add HACKING.rst doc to top level dir and readthedocs.

This adds a general 'HACKING.rst' document to the top level curtin
directory and also publishes that content into readthedocs.io.

Also drops the obsolete 'development.rst'.

e9d183e... by Ryan Harper

vmtest: fix centos root-tgz image sync

Remove all remaining uses of vmtest.root-tgz as part of our local mirror.
This fixes syncing of centos images which use ftype: root-tgz.

7c42923... by Scott Moser

block_meta: Ensure offset input to sgdisk are integers.

Looking at a install log, I saw commands executed like this:
   sgdisk --new 2:1050624.0:7342079.0 --typecode=2:8300 /dev/vda

This change fixes both of the '.0'. All other values that were used
in the math were already integers.

26beeac... by Scott Moser

Fix error in url_helper and vmtest from previous commit.

Previous commit had 2 issues:
a.) it pushed the majority of tests down "install from url" path,
    which was not intended. The intent was to use 'cp://' whenever
    the booted environment was the same as the target. The problem
    occurred when target_release was the default None.
    The fix here is just to cover target_release == None case.
b.) url_helper.download was broken for python2.7.
    The isue was just that we expected the bytes written to be returned
    from file().write. Python 2 file.write has no return value.
    A unit test is added to test that code.

fb11a56... by Scott Moser

tools: fix curtainer to specify source version to apt-get source.

We were seeing version skew from the binary package to the source
package, and had recently added code to exit failure if we saw
that case.

This change will make curtainer explicitly request the version
of source that it has the binary for. It is possible that the
ppa would not have that version (if it had been supersceeded),
but hopefully the archive holds onto source for current binary
packages.

063b9fe... by Scott Moser

Add support for installing sources that are a filesystem image.

This adds support for sources that are a 'filesystem image' via local
file path or via http or https. It will work for any filesystem
image type that is mountable by the running kernel.

The end result is that this works:
  sudo ./bin/curtin install --config=my.yaml \
    http://cloud-images.ubuntu.com/..../some.squashfs

To accomplish this:
 a.) if the source is a http/https url, then download it to temporary file.
 b.) mount the file loopback (mount -o loop,ro).
 c.) copy the contents to the target
 d.) unmount
 e.) if downloaded remove the file.

In order to do this we needed some mechanism for downloading a url
in pieces rather than all into memory as 'geturl' uses. So I've
added UrlReader and 'download'.

Also here, a fix for the default headers to include the actual curtin
version per version.version_string() rather than '.1'.

MAAS 2.3 and 2.4 plan to use this functionality to install Ubuntu 12.04
while booted in 16.04. There are two tests added that excercise that
path that will be enabled later. To support testing hwe here,
also have added explicit setting of target_kernel_package in the class.

LP: #1746348

358fca4... by Ryan Harper

clear-holders: detect and remove devices from kernel swap as needed.

During testing of subiquity the ephemeral environment may activate
existing swap partitions which then prevent curtin from using a device
during storage configuration. This branch introduces a change to TestBasic
to add a swap partition and a command to the dirty-disk mode to forcibly
enable the swap device to reproduce the error. The fix involves having
clear_holders detect and remove the device (disk or partition) from the
kernel swap via use of swapoff.

LP: #1743643

08e1725... by Scott Moser

tests: remove xfs filesystem from basic uefi test.

The test_uefi_basic.py file reports to be 'basic' test of uefi.
However, it also tests xfs filesystem support.
In order to make it more basic, just drop the xfs.

The real motivation here is to later enable a precise (12.04)
installation test done inside a 14.04 or 16.04 environment.
Each of those scenarios cause mounting problems of the xfs partition
when the 12.04 kernel boots. That is because the mkfs.xfs command
enabled options that were not supported in the older kernel.