~smoser/curtin:cleanup/drop-root-image-usage

Last commit made on 2018-02-05
Get this branch:
git clone -b cleanup/drop-root-image-usage https://git.launchpad.net/~smoser/curtin
Only Scott Moser can upload to this branch. If you are Scott Moser please log in for upload directions.

Branch merges

Branch information

Name:
cleanup/drop-root-image-usage
Repository:
lp:~smoser/curtin

Recent commits

54f0393... by Scott Moser

vmtest: Drop use of root-image.gz and maas2roottar.

The root-image.gz and its conversion into a root-tgz file are no
longer necessary. Dropping the legacy code has numerous benefits:
 a.) no longer download root-image.gz files to local mirror
 b.) do not uncompressing these.
 c.) do not use maas2roottar which required sudo to create the root-tgz.

Overall a big win.

aa560a1... by Scott Moser

in-target: use ChrootableTarget so that unshare pid is used.

Because in-target was using 'chroot' directly, the unshare pid
logic was not getting utilized.

This fixes that up so that we use the ChrootableTarget.subp.
Also it fixes the interactive path to exit with the command's
exit code in python 3.4+.

d31e27a... by Scott Moser

tools/curtainer: check that binary and source version are the same.

We saw a puzzling failure of vmtest against the daily archive.
The reason for failure was that the source package that was retrieved
via 'apt-get source' differed in version from the version installed.

This adds a check in curtainer that will exit failure if that is the case.

LP: #1747077

15c15c7... by Ryan Harper

Add zfsroot as a filesystem type

Enable simpler use of zfsroot by tagging the root filesystem format with
'zfsroot'. Curtin will then automatically construct zpool and zfs commands
to create a ZFS on Root setup. Some validation of the config included:
 * only one 'zfsroot' type is allowed.
 * zfsroot entry must be referenced by the / mount.

6d23a6f... by Scott Moser

fix modeline for shell syntax files.

The header/footer re-work added a vi modline with 'syntax=shell' for
sh or bash files. The correct syntax for vim is 'sh', not 'shell'.

The result was no syntax highlighting in vim on these files.

1cb417c... by Chad Smith

error logs: Create error_tarfile path if path does not exist

When curtin's configured error_tarfile path does not exist in the
ephermeral environment, create it.

LP: #1746363

6a68396... by Ryan Harper

zfs: only load zfs on xenial+ skip artful/bionic zfs env export

The zfs module is only available on xenial+, so guard against modprobing it on
precise and trusty.

Xenial is the only release which curtin is exporting an environment variable to
aid grub to find zfs devices, therefor we should only check if the environment
has the exported value on xenial, skiptest otherwise.

dcc7fcc... by Chad Smith

error logs: automatically collect and tar curtin logs upon error.

If 'curtin install' errors, create a tarfile of curtin configuration, logs
and system info. This tarfile is simplifies triage and/or filing curtin
bugs. By default, the tarfile is written to
/var/log/curtin/curtin-error-logs.tar and can be configured by setting the
install:error_tarfile value.

This branch also:
  - uses deepcopy for CONFIG_BUILTIN to avoid manipulating a shared dict
    in unit tests
  - fixes a workingd variable declaration before raising errors to avoid
    undeclared variable errors

29fc9cf... by Scott Moser

vmtests: Support skipping skip_by_date tests based on environment.

Curtin's vmtest code has a function 'skip_by_date' which is used to
skip tests based until a certain date so developers can add a test
for a bug that is not yet fixed in another package. Each skip_by_date
call lists a bug by its bug number.

It serves to allow us to ignore known failures for a limited time but
remind us later to push to get fixes into other packages. The cost is
that someone has to "touch" code at a point in the future to bump the
skip_by_date values or remove them. That works well enough for trunk
where developers can easily make this change.

It causes issues though, in places where the code is not so easily
changed. An example is when we run tests on the version of ubuntu
in the archive. That packaged code is not so easily modified and
any skipby tests are basically time-bombs.

The solution here is to allow the runner of the test to specify
a comma separated list of bugs to skip in the environment variable
 CURTIN_VMTEST_SKIP_BY_DATE_BUGS
The special value '*' indicates all skip_by_date bugs should be skipped.

We expect to run tests on packaged code with this environment variable
set to '*'.

f4ac975... by Ryan Harper

Add zpool, zfs storage commands for experimental support of ZFS on root.

curtin/block
 - Add get_dev_disk_byid() to return a mapping of devname to disk/by-id
 - Add zfs and zpool to install deps dictionary

curtin/block/clear_holders
 - Add modprobe zfs

curtin/block/zfs
 - implement zpool_create, zfs_create, zfs_list, zfs_export and zfs_mount
   commands

curtin/dep
 - Add zfs, zfsutils-linux to ephemeral environment as needed
 - Introduce a check for required kernel modules (zfs)

curtin/commands/block_meta
 - implement handlers for type: zpool and zfs
 - add get_poolname resolver

curtin/commands/curthooks
 - On xenial, apt-mark hold zfs-dkms in target to prevent installation
   to work around bug 1742560.
 - Add an injection of a zfs environment variable required for ZFS on
   rootfs to work with grub; allows grub to extract the path to the zfs
   vdevs full path rather than just the devname (/dev/disk/by-id/foo vs
   disk/by-id/foo) to work around bug 1527727.

curtin/commands/install
 - Export ZPOOL_VDEV_NAME_PATH=1 into target environment to allow grub to
   work with zfs on root

doc/topics/storage.rst
 - Add documentation for zpool, zfs commands and experimental ZFS-on-Root

helpers/common
 - Update install_grub to skip block-device check if target is zfs.

tests/unittests/test_block
 - Add test for disk_byid methods

tests/unittests/test_block_zfs
 - Add coverage for block.zfs

tests/unittests/test_clear_holders
 - Update test to account for modprobe zfs

tests/vmtests/test_zfsroot
 - Add initial zfsroot install and test