Replacing EDF’s Imported Layers With Upstream
EDF fetches its layers with repo, from a manifest hosted
in the yocto-manifests repository. Some of those layers are AMD’s
own. Others are imported: they are AMD-hosted copies of layers that
the Yocto Project, OpenEmbedded, and other communities maintain
upstream.
This page describes how to point an imported layer back at the community repository that it mirrors, keeping the rest of the EDF flow intact. That is a layer-level change. To override the source of a single component instead, without changing the origin of any layer, see Building Components From Source – that is the recipe-level equivalent and is usually the smaller change.
Warning
Repointing a layer that carries AMD-only commits discards them. The build still succeeds, and nothing reports what was lost. Read Check Before You Repoint before changing any layer.
Why EDF Hosts Its Own Copies
A release has to be reproducible. If EDF fetched each layer from its community repository at build time, the content of a release would change whenever an upstream branch moved, and a build run a month after release would not match the one that was tested.
To avoid that, AMD hosts a copy of each imported layer and the manifest pins every project to an exact commit. A release is therefore a fixed set of revisions rather than a set of branch names.
Hosting a copy also allows AMD to carry changes that are not upstream yet: a fix that is still in review, or hardware enablement that has no upstream home. Layers differ in how much of that they carry, which is what makes repointing safe for some layers and lossy for others.
Check Before You Repoint
The Imported Layers table in Yocto Layer Repositories is regenerated every release and records, per layer, how far the EDF copy has diverged from its community upstream. Find the row for the layer you intend to repoint and apply two tests to it, in that order.
First, check the Upstream Source column. For most layers it names a community repository. For a few it names an AMD one, because that is what the OpenEmbedded Layer Index lists as canonical. Those layers have no community upstream and cannot be repointed, whatever the rest of their row says. A note above the table identifies them for the current release. Stop here for those layers.
Then read the Ahead / Behind pair. Both are commit counts, not a single signed offset: Ahead counts what the EDF copy has that upstream does not, Behind counts the reverse, and neither is ever negative. Ahead decides whether a repoint is lossy, and Behind gives the amount of upstream work a repoint would bring.
Ahead / Behind |
State of the EDF copy |
Effect of repointing |
|---|---|---|
|
Identical to the upstream tip. |
Safe, and it changes nothing today. It puts the layer on the moving upstream branch, so later upstream work arrives on the next sync. |
|
A clean snapshot; upstream has advanced by N commits. |
Safe. This is the case repointing addresses: the layer gains those N commits. |
|
Carries N AMD-only commits and already contains the upstream tip. |
Lossy: all N are discarded. Do not repoint without a plan to carry them forward. |
|
Diverged: N AMD-only commits on an upstream base that is M commits old. |
Lossy, and the hardest case. Repointing discards the N AMD commits and simultaneously moves the layer forward by M upstream commits, so a later build failure can have either cause. |
To see the commits a repoint would discard, compare the two repositories directly. The Upstream Source and Upstream Branch columns of the same table give the second remote:
$ cd sources/<layer>
$ git remote add upstream <Upstream Source from the table>
$ git fetch upstream
$ git log --oneline upstream/<Upstream Branch>..HEAD
Every commit that command lists is AMD-only and would be lost. If the list is empty, the layer is a clean snapshot regardless of what the table says, and the table is the stale party.
Repointing a Layer
Do not edit the manifest in .repo/manifests. It is managed by
repo and your changes are discarded on the next sync. Use a local
manifest instead: repo reads every .repo/local_manifests/*.xml
file in alphabetical order and applies it on top of the client’s
original manifest.
<extend-project> changes named attributes of a project that
already exists, leaving the rest of its definition alone. That is
what makes it the right element here: when the next release renames a
path or adds a project, a local manifest written this way keeps
working, where one that replaced the whole project definition would
not.
A repoint needs two attributes changed. The remote attribute
selects the server supplying the project, and the revision
attribute selects which content is taken from that server. Both must
change together, because the release manifest pins revision to a
commit that exists only in the AMD copy.
Create .repo/local_manifests/upstream-layers.xml, declaring the
community server as a new remote and extending the project to use it:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="yocto" fetch="https://git.yoctoproject.org"/>
<extend-project name="meta-arm"
remote="yocto"
revision="wrynose"/>
</manifest>
meta-arm is an example, not a recommendation: confirm its Ahead
value for your release first. The name in extend-project must
match the project’s name attribute in the release manifest, which
is the bare layer name rather than a path.
Note what the two values are. The fetch address of the new remote
is the community server, and the layer name is appended to it, so
meta-arm above resolves to
https://git.yoctoproject.org/meta-arm. The revision is the
upstream branch for the Yocto release underlying EDF, which
is Wrynose for EDF v26.11. It is not
the EDF branch name: the community repository has no branch of
that name, and the sync fails if you use one.
Apply the change:
$ repo sync sources/meta-arm
Then confirm the layer is where you expect, rather than assuming the sync did what you wanted:
$ git -C sources/meta-arm remote -v
$ git -C sources/meta-arm log --oneline -1
Repeat the extend-project element for each additional layer. One
local manifest can carry as many as you need.
After Repointing
A repointed layer tracks a moving upstream branch, so the properties a pinned release gave you are now yours to maintain:
Builds are no longer reproducible by revision alone. The manifest no longer pins the layer to a commit, so two syncs on different days can produce different content. Record the commit you built from if you need to reproduce a build later.
Upstream and AMD layers can disagree. EDF’s own layers are developed against the pinned revisions. A newer upstream may change a recipe, a class, or a variable on which an AMD layer depends, and the resulting failure appears at build time in a layer you did not change.
The change is invisible in the build output. Nothing in a BitBake log states that a layer has been repointed. Anyone reproducing your build needs the local manifest, so keep it under version control with the rest of your project.
To go back, delete the file from .repo/local_manifests/ and run
repo sync for the affected layers. Nothing else records the
override.
What This Does Not Change
Repointing an imported layer replaces the source of community content. It does not move you off EDF: the distribution, images, machine definitions, and the AMD layers that provide hardware support are unchanged, and the build flow is the same one documented throughout this chapter.
Layers that EDF originates have no community upstream and are outside the scope of this page. Replacing those means building your own distribution rather than adapting this one.
For the wider question of what moving to production involves, of which this is one step, see Moving Toward Production.