Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sysroot auto cleanup #2511

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Jan 7, 2022

  1. sysroot: Add auto cleanup API

    This is a wrapper around `ostree_sysroot_cleanup` that only performs the
    cleanup when the `.cleanup` file exists. When the cleanup has completed,
    the file is deleted. The purpose of this API is to allow other routines
    to indicate that cleanup is needed when they're not in a good position
    to initiate the cleanup themselves. This API can then be run at a more
    opportune time without actually initiating the expensive cleanup
    operations unless they were needed.
    dbnicholson committed Jan 7, 2022
    Configuration menu
    Copy the full SHA
    0be7ef4 View commit details
    Browse the repository at this point in the history
  2. admin/cleanup: Add --auto option

    This provides a convenient method to run `ostree_sysroot_auto_cleanup`
    rather than `ostree_sysroot_cleanup`.
    dbnicholson committed Jan 7, 2022
    Configuration menu
    Copy the full SHA
    d32dd29 View commit details
    Browse the repository at this point in the history
  3. deploy: Touch auto cleanup file when finalizing staged deployment

    Currently finalizing a staged deployment skips the pruning that
    typically happens when writing out a deployment since it would block the
    shutdown path. In order to leave an indication that a cleanup should be
    run at a more opportune time, touch the `.cleanup` file after the staged
    deployment is written out. The `ostree_sysroot_auto_cleanup` API can
    then be used to perform the pruning at a better time without fear that
    it will initiate an unnecessary prune.
    dbnicholson committed Jan 7, 2022
    Configuration menu
    Copy the full SHA
    85dc35d View commit details
    Browse the repository at this point in the history
  4. boot: Add systemd unit to cleanup sysroot automatically

    This unit makes use of the `--auto` option of `ostree admin cleanup` to
    cleanup the sysroot when the `/sysroot/.cleanup` file is left behind
    when finalizing a staged deployment. The purpose of this service is to
    restore pruning of deleted deployments when a staged deployment is
    written out during shutdown of the previous boot. The unit is optional
    as the cleanup can be run at another time or not at all.
    
    Cleaning the sysroot will prune the repo, and this can be a slow and IO
    intensive operation. To keep the system from blocking, the default
    `Before` dependency on `multi-user.target` has been removed. Since the
    service will then run in the background, the IO scheduling class has
    been lowered to `idle` to keep the system's primary tasks more
    responsive.
    dbnicholson committed Jan 7, 2022
    Configuration menu
    Copy the full SHA
    951d5d7 View commit details
    Browse the repository at this point in the history