@@ -217,17 +217,23 @@ func manifestFromCobra(cmd *cobra.Command, args []string, pbar progress.Progress
217
217
}
218
218
}
219
219
220
- if targetArch != "" && arch .FromString (targetArch ) != arch .Current () {
221
- // TODO: detect if binfmt_misc for target arch is
222
- // available, e.g. by mounting the binfmt_misc fs into
223
- // the container and inspects the files or by
224
- // including tiny statically linked target-arch
225
- // binaries inside our bib container
226
- fmt .Fprintf (os .Stderr , "WARNING: target-arch is experimental and needs an installed 'qemu-user' package\n " )
227
- if slices .Contains (imgTypes , "iso" ) {
228
- return nil , nil , fmt .Errorf ("cannot build iso for different target arches yet" )
220
+ if targetArch != "" {
221
+ target , err := arch .FromString (targetArch )
222
+ if err != nil {
223
+ return nil , nil , err
224
+ }
225
+ if target != arch .Current () {
226
+ // TODO: detect if binfmt_misc for target arch is
227
+ // available, e.g. by mounting the binfmt_misc fs into
228
+ // the container and inspects the files or by
229
+ // including tiny statically linked target-arch
230
+ // binaries inside our bib container
231
+ fmt .Fprintf (os .Stderr , "WARNING: target-arch is experimental and needs an installed 'qemu-user' package\n " )
232
+ if slices .Contains (imgTypes , "iso" ) {
233
+ return nil , nil , fmt .Errorf ("cannot build iso for different target arches yet" )
234
+ }
235
+ cntArch = target
229
236
}
230
- cntArch = arch .FromString (targetArch )
231
237
}
232
238
// TODO: add "target-variant", see https://github.com/osbuild/bootc-image-builder/pull/139/files#r1467591868
233
239
0 commit comments