@@ -11,10 +11,8 @@ components. This document describes the key aspects of the multiple package repo
1111 repositories, enabling the OS Image Composer tool to access and pull custom
1212 packages that are unavailable in the base repository.
1313- ** Package conflict priority consideration** : Outlines how the tool determines
14- which package to use when duplicates exist across repositories using
15- per-repository ` priority ` .
16- - ** Allow-list support** : Describes ` allowPackages ` (white list) to restrict
17- which packages are indexed from a repository.
14+ which package to use when duplicates exist across repositories, prioritizing
15+ the user-specified order and base repository integrity.
1816- ** Architectural design** : Describes how the design extends the tool's package
1917 and dependency pre-download framework to resolve dependencies without relying
2018 on package managers like APT or
@@ -40,7 +38,6 @@ components. This document describes the key aspects of the multiple package repo
4038 - [ Example 4: Unresolvable dependency] ( #example-4-unresolvable-dependency )
4139 - [ Example 5: Conflicting dependency versions] ( #example-5-conflicting-dependency-versions )
4240 - [ Benefits of Repository Affinity] ( #benefits-of-repository-affinity )
43- - [ AllowPackages White List] ( #allowpackages-white-list )
4441- [ Architectural Design] ( #architectural-design )
4542 - [ Single Repository Support] ( #single-repository-support )
4643 - [ Multiple Repositories Support] ( #multiple-repositories-support )
@@ -53,27 +50,16 @@ You can specify additional package repositories in the OS Image Composer user
5350template. Here's an example:
5451
5552``` yaml
56- packageRepositories :
57- - codename : " repoA"
58- url : " https://repo.example.com/os/base"
59- pkey : " https://repo.example.com/keys/RPM-GPG-KEY"
60- priority : 1001
61- allowPackages :
62- - kernel-6.17.11
63- - kernel-drivers-gpu-6.17.11
64- - libva*
65- - wayland*
66-
67- - codename : " repoB"
68- url : " https://repo2.example.com/os/extra"
69- pkey : " https://repo2.example.com/keys/RPM-GPG-KEY"
70- priority : 500
71-
72- systemConfig :
73- packages :
74- - kernel-6.17.11
75- - libva-utils
76- - my-custom-package
53+ ...
54+ additionalrepo :
55+ intel1 : " https://www.intel.com/repo1" # Add new package repo URL
56+ intel2 : " https://www.intel.com/repo2" # Add another new package repo URL
57+
58+ packages :
59+ - intelpackage01 # Package from intel1 repo
60+ - intelpackage02 # Package from intel2 repo
61+ - systemd-boot # Package from base repo
62+ ...
7763```
7864
7965Each repository must follow the standard Debian or RPM structure, including all
@@ -87,78 +73,61 @@ setup references:
8773## Package Conflict Priority Consideration
8874
8975When multiple repositories contain packages with the same name, the OS Image
90- Composer tool uses repository ` priority` to select candidates .
76+ Composer tool uses a simple two-rule priority system for package selection .
9177
9278### Priority Rules
9379
94- The OS Image Composer tool follows these rules :
80+ The OS Image Composer tool follows these straightforward rules to resolve
81+ package conflicts:
9582
96- 1. **Higher numeric priority wins** : repositories with higher `priority`
97- values are preferred.
98- 2. **Version tie-breaker** : when candidates are in the same priority class,
99- the resolver picks the most suitable version (usually the newest one that
100- satisfies constraints).
101- 3. **Repository affinity for dependencies** : when possible, dependencies are
102- chosen from the same repository family as the parent package.
83+ 1 . ** Version Priority** : If the same package exists in multiple repositories
84+ with different versions, the tool always selects the package with the latest
85+ version number, regardless of which repository contains it.
10386
104- Debian resolver supports additional APT-like priority behavior :
87+ 2 . ** Repository Order Priority** : If the same package exists in multiple
88+ repositories with identical versions, the OS Image Composer tool follows
89+ the following priority order:
10590
106- - `priority < 0` : block packages from that repository
107- - `priority = 990` : prefer over default repos
108- - `priority = 1000` : install even if version is lower
109- - `priority > 1000` : force preference
91+ - Base OS repository (highest priority)
92+ - Additional repositories in the order they appear in configuration
11093
11194### Resolution Process
11295
11396Decision Flow:
11497
115- 1. Gather all matching candidates across configured repositories.
116- 2. Apply repository `priority` rules.
117- 3. Apply version constraints from dependency metadata.
118- 4. Select candidate with best priority/constraint fit; use repository affinity
119- for transitive dependencies when available.
98+ 1 . Check if package versions differ → Select latest version
99+ 2 . If versions are identical → Follow repository priority order:
100+
101+ - Base OS repository
102+ - intel1 (first additional repo in config)
103+ - intel2 (second additional repo in config)
104+ - ... (subsequent repos in config order)
120105
121106### Conflict Resolution Examples
122107
123108#### Example 1: Different versions across repositories
124109
125- - repoA (`priority : 1001`) contains: `curl-7.68.0`
126- - repoB (`priority : 500`) contains: `curl-8.0.1`
127- - **Result**: repoA candidate is preferred because repository priority is
128- higher.
110+ - Base repo contains: ` curl-7.68.0 `
111+ - intel1 repo contains: ` curl-8.0.1 `
112+ - ** Result** : The tool selects ` curl-8.0.1 ` from intel1 (latest version rule).
129113
130114#### Example 2: Same version in multiple repositories
131115
132- - repoA (`priority : 900`) contains: `mypackage-1.0.0`
133- - repoB (`priority : 900`) contains: `mypackage-1.0.0`
134- - **Result**: resolver uses tie-breakers (version/equivalent candidate and
135- repository affinity when resolving dependencies).
116+ - Base repo contains: ` mypackage-1.0.0 `
117+ - intel1 repo contains: ` mypackage-1.0.0 `
118+ - intel2 repo contains: ` mypackage-1.0.0 `
119+ - ** Result** : The tool selects ` mypackage-1.0.0 ` from base repo (repository
120+ order priority).
136121
137122#### Example 3: Mixed scenario
138123
139- - repoA (`priority : -1`) contains: `testpackage-2.0.0`
140- - repoB (`priority : 500`) contains: `testpackage-1.5.0`
141- - **Result**: repoA package is blocked due to negative priority; repoB package
142- is selected.
143-
144- These priority semantics provide explicit control for pinning, preference, and
145- blocking behavior in multi-repo builds.
146-
147- # # AllowPackages White List
148-
149- ` allowPackages` is an optional per-repository white list in
150- ` packageRepositories` .
151-
152- - If omitted or empty, all packages from that repository metadata are eligible.
153- - If provided, only matching package names are indexed from that repository.
154- - Matching supports :
155- - exact names (for example `spice-server`)
156- - prefix/version pin patterns (for example `kernel-6.17.11`)
157- - glob patterns (for example `libva*`, `wayland*`)
124+ - intel1 repo contains: ` testpackage-2.0.0 `
125+ - intel2 repo contains: ` testpackage-1.5.0 `
126+ - ** Result** : The tool selects ` testpackage-2.0.0 ` from intel1 (latest version
127+ rule).
158128
159- This filtering happens during repository metadata parsing, before package
160- matching and dependency resolution. It is useful for tightening repository
161- scope and reducing accidental package selection.
129+ This simplified priority system ensures you always get the most recent package
130+ versions while maintaining predictable behavior for identical versions.
162131
163132### Dependencies Package
164133
0 commit comments