KIWI Question: How to set Target architecture?

Morning all,

this question is somewhere in between from OBS and Studio. In both systems you can easily set the target architecture of your build (32 or 64bit).
So I took a 32bit openSUSE 13.1 build from Studio, put it locally on my Leap installation, and after some modifications I could build it with Kiwi. Unfortunately it came up as 64bit image…and I could not find the switch to tell ‘build 32bit’.
The idea to build on 13.1 came up as well, but the Kiwi version available for 13.1 is quite aged and issues a lot of other errors. So, not really an option.
Any ideas?

Sounds to me that your

Are you following a guide/documentation?
Have you looked at the following?
https://doc.opensuse.org/projects/kiwi/doc/

The way I’ve used Kiwi, I start with a base image and then if the image needs any modification, I either make the changes manually or update it from within (defining its own sources). Done that way, the image remains isolated from everything around it. If your 32-bit is becoming 64-bit, I might start with asking how you’re mounting your image… Are you implementing any bind mountpoints on a 64-bit machine, essentially “polluting” your image with possibly inappropriate parts of your Host machine?

I’d also suggest taking a closer look at whatever you’re doing to update your image. 13.1 is so old, I don’t think there are updates to parts of it so however you’re handling those situations might be relevant

TSU

Of course…

The way I’ve used Kiwi, I start with a base image and then if the image needs any modification, I either make the changes manually or update it from within (defining its own sources). Done that way, the image remains isolated from everything around it. If your 32-bit is becoming 64-bit, I might start with asking how you’re mounting your image… Are you implementing any bind mountpoints on a 64-bit machine, essentially “polluting” your image with possibly inappropriate parts of your Host machine?

I’d also suggest taking a closer look at whatever you’re doing to update your image. 13.1 is so old, I don’t think there are updates to parts of it so however you’re handling those situations might be relevant

13.1 is old, true, but currently the 32bit application that will probably be supported longest (except TW). I need it for a special purpose.
13.1 is as well still mentioned in kiwi-desc-isoboot - the config.kiwi contains the correct setting (boot=‘isoboot/suse-13.1’)

More by chance I found in between the setting
–target-arch
which drives the used architecture for the image packages in zypper.conf.
When this frag is set, kiwi isses a comment in the log-file, which gives the solution:

Nov-01 09:51:11 <2> : --target-arch option set:
  This option influences the behavior of zypper
  Thus it has no effect on other package managers !
  This option is used to force the installation of packages
  for a specific architecture and is not the right choice when
  a complete image should be build for a specific architecture
  Building 32bit images on a 64bit host should be done by
  prefixing the kiwi call with 'linux32'. Cross building
  images for other architectures requires a build root
  environment of the target architecture and a virtualization
  layer handling the binary format. The qemu-binfmt-conf.sh
  and the openSUSE buildservice tool osc helps you here

So, if kiwi is called as
linux32 kiwi --build suse-13.1 --target-arch i586 -c /root/image/result/root -d /root/image/result/iso
it builds a i586 image.
This hint I could not find in the Kiwi documentation