Skip to content

feat!: prefer packages from QLI repository - #576

Draft
Christopher Obbard (obbardc) wants to merge 9 commits into
qualcomm-linux:mainfrom
obbardc:wip/obbardc/prefer-qli-packages
Draft

feat!: prefer packages from QLI repository#576
Christopher Obbard (obbardc) wants to merge 9 commits into
qualcomm-linux:mainfrom
obbardc:wip/obbardc/prefer-qli-packages

Conversation

@obbardc

@obbardc Christopher Obbard (obbardc) commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Depends on #548

Policy change: packages from QLI now takes precedence over Debian, including security updates

Replacing the overlay is not a like-for-like swap of where packages come from; with this
PR we change the policy for which archive is used when the same package exists in more than
one. This needs wider discussion.

Before the overlay pinned a single source package:

Package: src:pipewire:any
Pin: release n=trixie-overlay
Pin-Priority: 950

Everything else came from Debian at the default priority. The pin was an
explicit allowlist and at 950 (< 1000) APT would never replace an
already installed Debian package with a lower version from the overlay.

This PR pins the entire archive:

Package: *
Pin: origin "deb.debusine.qualcomm.com"
Pin-Priority: 1001

Which results in:

  • Every package present in QLI becomes the candidate over an agreed set. The delta is whatever the archive happens to contain on the day of the build.
  • QLI outranks trixie (500), trixie-updates (500), trixie-security (500)
    and trixie-backports (900). Note that priority (not version) decides the
    candidate: once QLI is above 500, a Debian security update loses to the QLI
    version even when Debian's version is higher.
  • At 1001 APT will actively downgrade an installed Debian package to
    the QLI version. This is why 3cff730 has to add --allow-downgrades to the
    full-upgrade; the flag is a symptom of the pin, not an independent fix.
  • The pin matches on hostname, so it covers qli, qli-staging and any future
    archive served from deb.debusine.qualcomm.com. Separately, we should add Origin/Label to the debusine-generated repository Release file and use that matching here. See debusine.qualcomm.com: Add Origin/Label fields to qli/qli-staging APT repositories debusine-action#115

The effect of this is if QLI carries a package that Debian later issues a DSA for, images
keep shipping the unfixed QLI build until it is present in QLI repo.

A possible outcome could be that Debian security fixes should take priority over QLI changes, i.e. security updates should win.

Verification

To verify this, I built the rootfs recipe with the following cases:

  • qli repo disabled
  • qli repo enabled
  • qli-staging repo enabled
  • qli-staging repo enabled with a snapshot (covers qli with snapshots, too)

The `qsc-deb-releases` Artifactory repository is no longer used; the
package delta it carried is now available from the Qualcomm Linux (qli)
Debusine archive.

Remove the overlay and its keyring, the APT sources/preferences
generated from it and switch the default value of the overlays option
to `none`.

Closes: qualcomm-linux#536
Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
Packages which exist in both the Debian repository (incl. backports)
as well as the Qualcomm Linux APT repository should be installed from
the Qualcomm Linux APT repository.

Write APT preferences configuration to match the above intent.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
The initial packages are bootstrapped from Debian before the Qualcomm
Linux APT sources are configured. The subsequent full-upgrade applies
the QLI APT repository and is therefore the first point at which
installed Debian packages can be replaced by packages from the QLI APT
repository.

Where QLI provides a lower version than Debian (and the APT preferences
are set to prefer QLI) this package replacement is considered a
downgrade. APT refuses such downgrades when running with `-y`
unless `--allow-downgrades` is specified. Add `--allow-downgrades` to
the APT call to allow downgrading packages.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
Now that the QLI repository is pinned above Debian, a package which is
present in both the local repository and QLI would otherwise resolve to
the QLI version, defeating the point of installing it from a local APT
repository.

Pin the local repository at 1002 so packages from the local repository
are preferred over all other APT repositories.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
`qliaptrepo` was originally a boolean toggle to enable the QLI archive.
Turn it into the name of the Debusine archive to configure so the
staging archive can be selected without editing the recipe.

Accept `qli` (the new default), `qli-staging` and `false` to configure
no Qualcomm Linux sources at all; anything else causes the recipe to
fail.

Configure the QLI Staging APT repository (instead of the standard QLI
repository) when `qliaptrepo` is set to `qli-staging`.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
`qliaptrepo` was originally a boolean toggle to enable the QLI APT
repository. Turn it into the name of the repository to configure so the
QLI staging repository can be optionally configured.

Accept `qli` (the new default), `qli-staging` and `false` to configure
no Qualcomm Linux sources at all; anything else causes the recipe to
fail.

The QLI staging repository is layered on top of the QLI release
repository rather than replacing it, so `qli-staging` configures both:
packages which have not been rebuilt in staging still have to come from
`qli`. Derive the list of archives to configure from `qliaptrepo` up
early and loop over it when writing the sources and the snapshot URL
rewrite table.

Note that the two archives cannot be given different pin priorities:
the Debusine-generated Release files carry no Origin or Label and share
a hostname, so no pin expression can tell them apart. Both sit at
priority 1001, which makes the highest version the candidate; as
staging is where newer builds land first, its packages are preferred in
practice.

TODO: squash previous commit into this one.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
The Qualcomm Linux archives are only published for trixie and forky, so
fail the recipe early when they are enabled on any other suite instead
of silently skipping the sources. Builds of other suites now have to
pass `-t qliaptrepo:false` explicitly.

With that check in place, the sources no longer need to be guarded
against unstable.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
The QLI APT sources are only configured when `qliaptrepo` is not
disabled, so gating the fastrpc-tests installation on the same single
condition is enough; the extra suite check was redundant.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
The QLI APT sources are configured when `qliaptrepo` is not `false`;
gate the multimedia variant properly.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
# When both are enabled they sit at the same priority so the repository
# with the higher version wins.
Package: *
Pin: origin "deb.debusine.qualcomm.com"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to open an issue to modify the Debusine configuration to add Origin/Label fields to Release and rework this change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Origin/Label fields have been added to the QLI repositories now, so need to rework this.

@github-actions

Copy link
Copy Markdown

Test Results

  7 files  ±0   21 suites  ±0   16m 12s ⏱️ ±0s
 21 tests ±0   21 ✅ ±0  0 💤 ±0  0 ❌ ±0 
184 runs  ±0  184 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit a131b70. ± Comparison against base commit 64e2cca.

@github-actions

Copy link
Copy Markdown

@basak-qcom

Copy link
Copy Markdown
Contributor

To summarise my memory of a previous discussion:

I believe there are exactly two options to choose from in terms of user visible behaviour when a new package is published into Debian for which we have a delta in our overlay:

  1. Update to that package in Debian, regressing the functionality in our overlay. This may be a good thing if that package has a security update.
  2. Hold the package on the version in our overlay. This may be a bad thing if the update in Debian was for a security update.

In both cases, for security reasons, we should promptly update the delta package in our overlay if the new package in Debian is a security update.

Either: A) we have a suitable process for doing that promptly, thinking about monitoring, assignments and rotas, acceptable lag, vacation, etc,

or B) we don't.

We make no public commitment for A this since our overlay is for reference use by product creators and not for direct use. Regardless we should still try to do the right thing.

If A, then then option 2 is probably better, since by definition we'd be able to rebase promptly so the security vulnerability window would be small. If B, then I think 1 is better than attempting 2, but failing on updating promptly and leaving the window wide and indefinite.

My opinion is therefore that we go for 1 for the time being, if/until we have defined A in some way and have monitoring in place, even if that doesn't translate to a public commitment. I think this would fit current expectations around providing reference packages.

On the matter of pinning, I prefer to using versions to get the behaviour we want. I think to get 1 we can rely on that without needing pinning, and we only need pinning for 2. So for now, the above means I don't think we should pin for this purpose.

@basak-qcom

Copy link
Copy Markdown
Contributor

(further discussion welcome; this is just my opinion!)

@lool

Copy link
Copy Markdown
Contributor

Our current priorities meant #600 affected the images

Robie Basak (@basak-qcom) there might be further options than the one you list; we could distinguish the different classes of Debian updates, e.g. -security is something we're worried of gating, but I'm less worried about holding back on a new backport or a new stable update for a little bit. So we could keep fast tracking security updates, abandoning our QLI changes, but not other updates.

My personal preference remains to prioritize our QLI overlay all the time, even over security updates, and progressively adjust to integrate these faster.

Comment thread README.md
- `qliaptrepo`: which Qualcomm Linux APT repositories to configure in the root
filesystem; either `qli` (the default) for the release archive alone, or
`qli-staging` which configures both the staging archive and the release
archive it is layered on top of. Set it to `false` to leave the image with

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two spaces

@lool

Copy link
Copy Markdown
Contributor

We've been discussing special casing a set of packages (like we do for trixie-backports) and also how -backports might be a channel of security updates (of the backport).

In any case, we should capture our conclusion on policy in a visible place in our docs too.

@obbardc

Copy link
Copy Markdown
Contributor Author

We should probably pin QLI at the same priority as Debian backports (higher than debian non-backports?). That way, packages from QLI can be preferred when they are newer, but if we stop maintaining a package in QLI and a newer version appears in Debian backports, normal APT version ordering will allow Debian to take over rather than an older QLI package remaining preferred indefinitely.

Also, should we have this config even in the "vanilla" debian images in case someone sets the repo up later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants