public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* Rapios Wic Image
@ 2022-03-09 18:57 Jonas Reindl
  2022-03-10  7:30 ` Jan Kiszka
  2022-03-10  8:04 ` Henning Schild
  0 siblings, 2 replies; 5+ messages in thread
From: Jonas Reindl @ 2022-03-09 18:57 UTC (permalink / raw)
  To: isar-users

Hey everyone,

I'm currently trying to build a raspios image as "wic-img" and get a 
python import error.

kas-version: 3.0.2

isar-version: 0.8

I'm using kas-container to build the images with multiconfig for that.

```

     MACHINE ?= "rpi-arm"
     DISTRO ?= "raspios-bullseye"

     IMAGE_FSTYPES = "wic-img"

```

Error:

Exception: bb.process.ExecutionError: Execution of 
'/build/tmp/work/raspios-bullseye-armhf/my-image-base-rpi-arm-wic-img/1.0-r0/temp/run.generate_wic_image.285' 
failed with exit code 1:
Traceback (most recent call last):
   File "/work/layers/isar/scripts/wic", line 27, in <module>
     from distutils import spawn
ImportError: cannot import name 'spawn' from 'distutils' 
(/usr/lib/python3.9/distutils/__init__.py)
WARNING: exit code 1 from a shell command.

If I enter the build environment with the kas shell and execute python3 
I'm able to import spawn. I also rebuild the docker container to 
explicitly include python3-distutils. Maybe I misunderstood something, 
but I don't know how I should further debug that.

In case needed I can provide the fullstack trace and the sh script which 
tried to generate the wic.

Best regards,

Jonas




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Rapios Wic Image
  2022-03-09 18:57 Rapios Wic Image Jonas Reindl
@ 2022-03-10  7:30 ` Jan Kiszka
  2022-03-10  8:04 ` Henning Schild
  1 sibling, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2022-03-10  7:30 UTC (permalink / raw)
  To: Jonas Reindl, isar-users

On 09.03.22 19:57, Jonas Reindl wrote:
> Hey everyone,
> 
> I'm currently trying to build a raspios image as "wic-img" and get a
> python import error.
> 
> kas-version: 3.0.2
> 
> isar-version: 0.8
> 
> I'm using kas-container to build the images with multiconfig for that.
> 
> ```
> 
>     MACHINE ?= "rpi-arm"
>     DISTRO ?= "raspios-bullseye"
> 
>     IMAGE_FSTYPES = "wic-img"
> 
> ```
> 
> Error:
> 
> Exception: bb.process.ExecutionError: Execution of
> '/build/tmp/work/raspios-bullseye-armhf/my-image-base-rpi-arm-wic-img/1.0-r0/temp/run.generate_wic_image.285'
> failed with exit code 1:
> Traceback (most recent call last):
>   File "/work/layers/isar/scripts/wic", line 27, in <module>
>     from distutils import spawn
> ImportError: cannot import name 'spawn' from 'distutils'
> (/usr/lib/python3.9/distutils/__init__.py)
> WARNING: exit code 1 from a shell command.
> 
> If I enter the build environment with the kas shell and execute python3
> I'm able to import spawn. I also rebuild the docker container to
> explicitly include python3-distutils. Maybe I misunderstood something,
> but I don't know how I should further debug that.

kas-isar:3.0.2 container python3-distutils already. So that is not the
issue. It may rather come from some missing

WIC_IMAGER_INSTALL += "python3-distutils"

for your raspios-bullseye distro config. Compare that to regular
debian-bullseye.conf - or include that if it fits.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Rapios Wic Image
  2022-03-09 18:57 Rapios Wic Image Jonas Reindl
  2022-03-10  7:30 ` Jan Kiszka
@ 2022-03-10  8:04 ` Henning Schild
  2022-03-14 13:59   ` Jonas Reindl
  1 sibling, 1 reply; 5+ messages in thread
From: Henning Schild @ 2022-03-10  8:04 UTC (permalink / raw)
  To: Jonas Reindl; +Cc: isar-users

Hey Jonas,

Am Wed, 9 Mar 2022 19:57:02 +0100
schrieb Jonas Reindl <jonas.reindl@kilobaser.com>:

> Hey everyone,
> 
> I'm currently trying to build a raspios image as "wic-img" and get a 
> python import error.
> 
> kas-version: 3.0.2
> 
> isar-version: 0.8

You might in fact want to try "next" instead. Isar master and releases
are often slow to move, maybe your issue is fixed already.

 
> I'm using kas-container to build the images with multiconfig for that.
> 
> ```
> 
>      MACHINE ?= "rpi-arm"
>      DISTRO ?= "raspios-bullseye"
> 
>      IMAGE_FSTYPES = "wic-img"
> 
> ```
> 
> Error:
> 
> Exception: bb.process.ExecutionError: Execution of 
> '/build/tmp/work/raspios-bullseye-armhf/my-image-base-rpi-arm-wic-img/1.0-r0/temp/run.generate_wic_image.285' 
> failed with exit code 1:
> Traceback (most recent call last):
>    File "/work/layers/isar/scripts/wic", line 27, in <module>
>      from distutils import spawn
> ImportError: cannot import name 'spawn' from 'distutils' 
> (/usr/lib/python3.9/distutils/__init__.py)
> WARNING: exit code 1 from a shell command.
> 
> If I enter the build environment with the kas shell and execute
> python3 I'm able to import spawn. I also rebuild the docker container
> to explicitly include python3-distutils. Maybe I misunderstood
> something, but I don't know how I should further debug that.

In fact wic is not executed in that container, but in a chroot in there.

I think we currently lack a wic raspi example in isar itself, maybe
there is something broken indeed. But it is possible and wic will be
much better than "rpi-sdimg" which is currently questioned a lot and
also might be broken at the moment.

https://github.com/siemens/jailhouse-images

has rpi4 with wic in it

regards,
Henning
 
> In case needed I can provide the fullstack trace and the sh script
> which tried to generate the wic.
> 
> Best regards,
> 
> Jonas
> 
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Rapios Wic Image
  2022-03-10  8:04 ` Henning Schild
@ 2022-03-14 13:59   ` Jonas Reindl
  2022-03-14 14:58     ` Jan Kiszka
  0 siblings, 1 reply; 5+ messages in thread
From: Jonas Reindl @ 2022-03-14 13:59 UTC (permalink / raw)
  To: Henning Schild; +Cc: isar-users

[-- Attachment #1: Type: text/plain, Size: 3008 bytes --]


On 3/10/22 09:04, Henning Schild wrote:
> Hey Jonas,
>
> Am Wed, 9 Mar 2022 19:57:02 +0100
> schrieb Jonas Reindl<jonas.reindl@kilobaser.com>:
>
>> Hey everyone,
>>
>> I'm currently trying to build a raspios image as "wic-img" and get a
>> python import error.
>>
>> kas-version: 3.0.2
>>
>> isar-version: 0.8
> You might in fact want to try "next" instead. Isar master and releases
> are often slow to move, maybe your issue is fixed already.

First of all thanks for the help.

Upgrading to next didn't had a direct impact on the install. The 
suggestion from Jan Kiszka with

WIC_IMAGER_INSTALL += "python3-distutils"

helped to get the wic imager to start. But now I'm stuck with the problem, that wic is looking for the kernel in /boot/vmlinux.
Raspios installs the kernel with kernel.img. So I assumend I would need to set
IMAGE_BOOT_FILES = " \
      /kernel.img;vmlinuz \
      "

to remap the kernel. This still ends in the error message:

ERROR: kernel /build/tmp/work/raspios-bullseye-armhf/myimage-image-base-rpi-arm-wic-img/1.0-r0/rootfs/boot/vmlinux not found

Would you have any ideas to get that working.

>   
>> I'm using kas-container to build the images with multiconfig for that.
>>
>> ```
>>
>>       MACHINE ?= "rpi-arm"
>>       DISTRO ?= "raspios-bullseye"
>>
>>       IMAGE_FSTYPES = "wic-img"
>>
>> ```
>>
>> Error:
>>
>> Exception: bb.process.ExecutionError: Execution of
>> '/build/tmp/work/raspios-bullseye-armhf/my-image-base-rpi-arm-wic-img/1.0-r0/temp/run.generate_wic_image.285'
>> failed with exit code 1:
>> Traceback (most recent call last):
>>     File "/work/layers/isar/scripts/wic", line 27, in <module>
>>       from distutils import spawn
>> ImportError: cannot import name 'spawn' from 'distutils'
>> (/usr/lib/python3.9/distutils/__init__.py)
>> WARNING: exit code 1 from a shell command.
>>
>> If I enter the build environment with the kas shell and execute
>> python3 I'm able to import spawn. I also rebuild the docker container
>> to explicitly include python3-distutils. Maybe I misunderstood
>> something, but I don't know how I should further debug that.
> In fact wic is not executed in that container, but in a chroot in there.
>
> I think we currently lack a wic raspi example in isar itself, maybe
> there is something broken indeed. But it is possible and wic will be
> much better than "rpi-sdimg" which is currently questioned a lot and
> also might be broken at the moment.
>
> https://github.com/siemens/jailhouse-images

I tried to follow the wic configuration as good as possible from the jailhouse-image, but jailhouse uses native debian, which will install

the kernel differently as raspios does. Changing to debian native is not possible for me as I need that image to be able to boot on different raspberries.


>
> has rpi4 with wic in it
>
> regards,
> Henning
>   
>> In case needed I can provide the fullstack trace and the sh script
>> which tried to generate the wic.
>>
>> Best regards,
>>
>> Jonas
>>
>>
>>
BR,

Jonas

[-- Attachment #2: Type: text/html, Size: 4487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Rapios Wic Image
  2022-03-14 13:59   ` Jonas Reindl
@ 2022-03-14 14:58     ` Jan Kiszka
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2022-03-14 14:58 UTC (permalink / raw)
  To: Jonas Reindl, Henning Schild; +Cc: isar-users

On 14.03.22 14:59, Jonas Reindl wrote:
> 
> On 3/10/22 09:04, Henning Schild wrote:
>> Hey Jonas,
>>
>> Am Wed, 9 Mar 2022 19:57:02 +0100
>> schrieb Jonas Reindl <jonas.reindl@kilobaser.com>:
>>
>>> Hey everyone,
>>>
>>> I'm currently trying to build a raspios image as "wic-img" and get a 
>>> python import error.
>>>
>>> kas-version: 3.0.2
>>>
>>> isar-version: 0.8
>> You might in fact want to try "next" instead. Isar master and releases
>> are often slow to move, maybe your issue is fixed already.
> 
> First of all thanks for the help.
> 
> Upgrading to next didn't had a direct impact on the install. The
> suggestion from Jan Kiszka with
> 
> WIC_IMAGER_INSTALL += "python3-distutils"
> 
> helped to get the wic imager to start. But now I'm stuck with the problem, that wic is looking for the kernel in /boot/vmlinux.
> Raspios installs the kernel with kernel.img. So I assumend I would need to set 
> IMAGE_BOOT_FILES = " \
>      /kernel.img;vmlinuz \
>      "

This only works together with populating a boot partition ("--source
bootimg-partition"). What are you using?

> 
> to remap the kernel. This still ends in the error message:
> 
> ERROR: kernel /build/tmp/work/raspios-bullseye-armhf/myimage-image-base-rpi-arm-wic-img/1.0-r0/rootfs/boot/vmlinux not found
> 
> Would you have any ideas to get that working.
> 

Can you share the complete log of the failing task? Is it
do_copy_boot_files?

>>  
>>> I'm using kas-container to build the images with multiconfig for that.
>>>
>>> ```
>>>
>>>      MACHINE ?= "rpi-arm"
>>>      DISTRO ?= "raspios-bullseye"
>>>
>>>      IMAGE_FSTYPES = "wic-img"
>>>
>>> ```
>>>
>>> Error:
>>>
>>> Exception: bb.process.ExecutionError: Execution of 
>>> '/build/tmp/work/raspios-bullseye-armhf/my-image-base-rpi-arm-wic-img/1.0-r0/temp/run.generate_wic_image.285' 
>>> failed with exit code 1:
>>> Traceback (most recent call last):
>>>    File "/work/layers/isar/scripts/wic", line 27, in <module>
>>>      from distutils import spawn
>>> ImportError: cannot import name 'spawn' from 'distutils' 
>>> (/usr/lib/python3.9/distutils/__init__.py)
>>> WARNING: exit code 1 from a shell command.
>>>
>>> If I enter the build environment with the kas shell and execute
>>> python3 I'm able to import spawn. I also rebuild the docker container
>>> to explicitly include python3-distutils. Maybe I misunderstood
>>> something, but I don't know how I should further debug that.
>> In fact wic is not executed in that container, but in a chroot in there.
>>
>> I think we currently lack a wic raspi example in isar itself, maybe
>> there is something broken indeed. But it is possible and wic will be
>> much better than "rpi-sdimg" which is currently questioned a lot and
>> also might be broken at the moment.
>>
>> https://github.com/siemens/jailhouse-images
> 
> I tried to follow the wic configuration as good as possible from the jailhouse-image, but jailhouse uses native debian, which will install
> 
> the kernel differently as raspios does. Changing to debian native is not possible for me as I need that image to be able to boot on different raspberries.
> 

That may limit the scope to using a different kernel - or are you
relying on Raspios-specific tools? Raspios is a maker distro, so -
unless that is your scope - it might be worth to invest understanding
what you actually need and why Debian cannot provide that. If it should
be just the kernel for some fancy, never properly upstream features of
older Raspis, then you could still replace that one with a custom build
(like we had in jailhouse-images for jailhouse-reasons).

BTW, here is another, slightly simpler recent integration, but also only
Raspi4:
https://github.com/siemens/mtda/commit/4eefd306dfe4a801be4240d13557506080093c25

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-14 14:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09 18:57 Rapios Wic Image Jonas Reindl
2022-03-10  7:30 ` Jan Kiszka
2022-03-10  8:04 ` Henning Schild
2022-03-14 13:59   ` Jonas Reindl
2022-03-14 14:58     ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox