Add a post-root.d phase

While trying to get docker image pre-caching to work we couldn't get a
docker daeomon to run within the chrooted environment. However we got
docker running with the help of bwrap outside of the chrooted
environment. The only option so far for this is the block-device.d
phase. But this has the problem that it runs after the image size has
been calculated. This leads to broken builds if the docker images
being pulled are big.

This can be solved by adding a post-root.d phase that runs outside the
chroot but before the image size calculation.

Change-Id: I36c2a81e2d9f5069f18ce5b0d52c5f1c7212c3ae
This commit is contained in:
Tobias Henkel 2018-10-18 16:49:40 +02:00
parent ec025ff03d
commit eff5b2312b
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2
3 changed files with 17 additions and 0 deletions

View File

@ -345,6 +345,7 @@ run_d_in_target pre-install
run_d_in_target install
do_extra_package_install
run_d_in_target post-install
run_d post-root
# ensure we do not have a lost+found directory in the root folder
# that could cause copy to fail (it will be created again later
# when creating the file system, if it needs such directory)

View File

@ -69,7 +69,9 @@ The phases are:
#. ``pre-install.d``
#. ``install.d``
#. ``post-install.d``
#. ``post-root.d``
#. ``block-device.d``
#. ``pre-finalise.d``
#. ``finalise.d``
#. ``cleanup.d``
@ -124,6 +126,13 @@ The phases are:
* runs: **in chroot**
``post-root.d``
Run code outside the chroot. This is a good place to perform tasks that
cannot run inside the chroot and must run after installing things. The
root filesystem content is rooted at ``$TMP_BUILD_DIR/mnt``.
* runs: **outside chroot**
``block-device.d``
Customise the block device that the image will be made on (for example to
make partitions). Runs after the target tree has been fully populated but

View File

@ -0,0 +1,7 @@
---
features:
- |
A ``post-root`` stage is added that runs outside the chroot and
before the image size calculation. For example, this may be useful
for running things that copy much data into the image and need to be
outside of the chroot and after install stages which run inside the chroot.