Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actually use the system's installation time (if known) as the reference point, instead of the first-ever countme event recorded for the given repo. This is what the dnf.conf(5) man page has been saying all along, the code just never lived up to it. This fixes the following issues: 1. Systems that only reach out to the repos after an initial period of time after their installation appear "younger" than they really are. 2. Prebuilt OS images may include repo persistdirs with countme cookies in them that were created at build time, making all instances spawned from those images (physical machines, VMs or containers) appear much "older" than they really are. 3. System upgrades cause the bucket to be effectively reset to 1 due to the fact that a changed $releasever value causes a new persistdir to be created. Use the machine-id(5) file's mtime to infer the installation time. This file is typically tied to the system's installation or first boot where it's populated by an installer tool or init system, respectively, and is never changed afterwards. Keep the "relative" epoch (first countme event) as a fallback method, though. This is useful on those systems that don't have a machine-id file (such as OCI containers) but are still used long-term. In those cases, system upgrades aren't really a thing so the above point 3 does not apply. Some containers may also choose to bind-mount the machine-id file from the host (such as what toolbox(1) does), in which case their age will be the same as that of the host. Conveniently, that's also what we want, since the purpose of such containers is to blend with the host as much as possible. Fixes: rpm-software-management#1611
- Loading branch information