diff --git a/diskimage_builder/lib/disk-image-create b/diskimage_builder/lib/disk-image-create index 189a0798d..8400ae709 100644 --- a/diskimage_builder/lib/disk-image-create +++ b/diskimage_builder/lib/disk-image-create @@ -486,6 +486,7 @@ sudo cp -ra ${TMP_BUILD_DIR}/built/* $TMP_BUILD_DIR/mnt sudo rm -fr ${TMP_BUILD_DIR}/built/* mount_proc_dev_sys +run_d pre-finalise run_d_in_target finalise finalise_base diff --git a/doc/source/developer/developing_elements.rst b/doc/source/developer/developing_elements.rst index 2ce884fe3..d37bc09c1 100644 --- a/doc/source/developer/developing_elements.rst +++ b/doc/source/developer/developing_elements.rst @@ -137,6 +137,16 @@ The phases are: * outputs: ``$IMAGE_BLOCK_DEVICE={path}`` +``pre-finalise.d`` + + Final tuning of the root filesystem, outside the chroot. Filesystem + content has been copied into the final file system which is rooted + at ``$TMP_BUILD_DIR/mnt``. You might do things like re-mount a + cache directory that was used during the build in this phase (with + subsequent unmount in ``cleanup.d``). + + * runs: **outside chroot** + ``finalise.d`` Perform final tuning of the root filesystem. Runs in a chroot after the root filesystem content has been copied into the mounted filesystem: this is an diff --git a/releasenotes/notes/pre-finalise-stage-574ae7886274bcba.yaml b/releasenotes/notes/pre-finalise-stage-574ae7886274bcba.yaml new file mode 100644 index 000000000..f580d0e54 --- /dev/null +++ b/releasenotes/notes/pre-finalise-stage-574ae7886274bcba.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + A ``pre-finalise`` stage is added that runs outside the chroot and + before the ``finalise`` stage. For example, this may be useful + for mounting external resources that are used inside the chroot + during the ``finalise`` stage, but do not need to be distributed + in the final image such as build-time caches.