@@ -194,29 +194,24 @@ func GetArchitectureFirmwarePairsForUsage(hostArch int, usage FirmwareUsage) ([]
194
194
for _ , installation := range GetArchitectureInstallations (hostArch ) {
195
195
usage , found := installation .Usage [usage ]
196
196
if found {
197
- searchPath := installation .Path
198
-
199
- // If listed path doesn't exist, consider EDK2 override path.
200
- if ! util .PathExists (searchPath ) {
201
- if incusEdk2Path == "" {
202
- // No fallback path, skip entirely.
197
+ // Prefer the EDK2 override path if provided.
198
+ for _ , searchPath := range []string {incusEdk2Path , installation .Path } {
199
+ if searchPath == "" || ! util .PathExists (searchPath ) {
203
200
continue
204
201
}
205
202
206
- searchPath = incusEdk2Path
207
- }
208
-
209
- for _ , firmwarePair := range usage {
210
- codePath := filepath .Join (searchPath , firmwarePair .Code )
211
- varsPath := filepath .Join (searchPath , firmwarePair .Vars )
212
- if ! util .PathExists (codePath ) || ! util .PathExists (varsPath ) {
213
- continue
203
+ for _ , firmwarePair := range usage {
204
+ codePath := filepath .Join (searchPath , firmwarePair .Code )
205
+ varsPath := filepath .Join (searchPath , firmwarePair .Vars )
206
+ if ! util .PathExists (codePath ) || ! util .PathExists (varsPath ) {
207
+ continue
208
+ }
209
+
210
+ firmwares = append (firmwares , FirmwarePair {
211
+ Code : codePath ,
212
+ Vars : varsPath ,
213
+ })
214
214
}
215
-
216
- firmwares = append (firmwares , FirmwarePair {
217
- Code : codePath ,
218
- Vars : varsPath ,
219
- })
220
215
}
221
216
}
222
217
}
0 commit comments