public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* Support for generating bootx64.efi when distro arch is i386
@ 2021-02-09 20:45 Daniel Machon
  2021-02-10  8:56 ` Baurzhan Ismagulov
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Machon @ 2021-02-09 20:45 UTC (permalink / raw)
  To: isar-users


[-- Attachment #1.1: Type: text/plain, Size: 1754 bytes --]

Hi,

Would you consider a patch series that adds support for separating the DISTRO_ARCH from the generation of the grub image?

We have a use case where target userland is i386, but firmware only supports loading of 64bit EFI executables.
Currently the DISTRO_ARCH is also used to generate the grub image - if distro arch is i386, then grub image is bootia32.efi.

We fixed this by introducing a new variable used (in bootimg-efi-isar.py) to separately decide the grub image.

Best regards,
Daniel

Med venlig hilsen / Best regards

Daniel Machon
Embedded Linux Engineer
R&D Department
[cid:UR_New_Logo_266cf885-8c99-4fe9-bae0-ff88fedf0005.png]

Universal Robots A/S
Energivej 25
5260 Odense S

Phone: +45 89 93 89 89
Cell: +45 27 99 72 32

dama@universal-robots.com<mailto:dama@universal-robots.com>
www.universal-robots.com<http://www.universal-robots.com>



Please note that this message may contain confidential information. If you have received this message by mistake, please inform the sender of the mistake, then delete the message from your system without making, distributing or retaining any copies of it. Although we believe that the message and any attachments are free from viruses and other errors that might affect the computer or IT system where it is received and read, the recipient opens the message at his or her own risk. We assume no responsibility for any loss or damage arising from the receipt or use of this message.

If Universal Robots A/S processes personal data relating to physical persons, such processing will meet the requirements of applicable data protection legislation.Please see our Privacy Policy here.<https://www.universal-robots.com/about-universal-robots/privacy-policy/>


[-- Attachment #1.2: Type: text/html, Size: 4884 bytes --]

[-- Attachment #2: UR_New_Logo_266cf885-8c99-4fe9-bae0-ff88fedf0005.png --]
[-- Type: image/png, Size: 3508 bytes --]

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

* Re: Support for generating bootx64.efi when distro arch is i386
  2021-02-09 20:45 Support for generating bootx64.efi when distro arch is i386 Daniel Machon
@ 2021-02-10  8:56 ` Baurzhan Ismagulov
  2021-02-10 10:42   ` Henning Schild
  0 siblings, 1 reply; 6+ messages in thread
From: Baurzhan Ismagulov @ 2021-02-10  8:56 UTC (permalink / raw)
  To: isar-users

Hello Daniel,

On Tue, Feb 09, 2021 at 08:45:06PM +0000, Daniel Machon wrote:
> Would you consider a patch series that adds support for separating the DISTRO_ARCH from the generation of the grub image?
> 
> We have a use case where target userland is i386, but firmware only supports loading of 64bit EFI executables.
> Currently the DISTRO_ARCH is also used to generate the grub image - if distro arch is i386, then grub image is bootia32.efi.
> 
> We fixed this by introducing a new variable used (in bootimg-efi-isar.py) to separately decide the grub image.

IIRC, we've already had a similar use case (mixing i386 and amd64 userland), so
this one could be interesting as well. In any case, I'm looking forward to the
patches and discussion.

Why do you want to have i386 userland on amd64?

With kind regards,
Baurzhan.

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

* Re: Support for generating bootx64.efi when distro arch is i386
  2021-02-10  8:56 ` Baurzhan Ismagulov
@ 2021-02-10 10:42   ` Henning Schild
  2021-02-10 13:14     ` Daniel Machon
  0 siblings, 1 reply; 6+ messages in thread
From: Henning Schild @ 2021-02-10 10:42 UTC (permalink / raw)
  To: Baurzhan Ismagulov; +Cc: isar-users

Am Wed, 10 Feb 2021 09:56:16 +0100
schrieb Baurzhan Ismagulov <ibr@radix50.net>:

> Hello Daniel,
> 
> On Tue, Feb 09, 2021 at 08:45:06PM +0000, Daniel Machon wrote:
> > Would you consider a patch series that adds support for separating
> > the DISTRO_ARCH from the generation of the grub image?
> > 
> > We have a use case where target userland is i386, but firmware only
> > supports loading of 64bit EFI executables. Currently the
> > DISTRO_ARCH is also used to generate the grub image - if distro
> > arch is i386, then grub image is bootia32.efi.
> > 
> > We fixed this by introducing a new variable used (in
> > bootimg-efi-isar.py) to separately decide the grub image.  
> 
> IIRC, we've already had a similar use case (mixing i386 and amd64
> userland), so this one could be interesting as well. In any case, I'm
> looking forward to the patches and discussion.

I would not be against it but maybe as a more generic mixing pattern
than just that one.

For your current hack you should be able to do all that in a layer
instead of touching isar ... in case you are patching it.
 
> Why do you want to have i386 userland on amd64?

My guess would be legacy applications. And my suggestion would be ...
full on 64bit and just have the problematic applications be 32bit

Isar has support for this via ISAR_ENABLE_COMPAT_ARCH where "i386" is
the little brother of "amd64". Similar for arm32 and 64.

Henning

> With kind regards,
> Baurzhan.
> 


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

* RE: Support for generating bootx64.efi when distro arch is i386
  2021-02-10 10:42   ` Henning Schild
@ 2021-02-10 13:14     ` Daniel Machon
  2021-02-10 14:23       ` Henning Schild
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Machon @ 2021-02-10 13:14 UTC (permalink / raw)
  To: Henning Schild, Baurzhan Ismagulov; +Cc: isar-users


[-- Attachment #1.1: Type: text/plain, Size: 4324 bytes --]

It is indeed implemented in a separate layer.

In this particular case, it is only a question of being able to, explicitly, choose between i386/amd64 or arm64/arm32 grub images. I am not quite sure this can be implemented in a more generic way, than just introducing a variable, say FIRMWARE_ARCH, that defaults to DISTRO_ARCH - do you have anything in mind, Henning?

> My guess would be legacy applications. And my suggestion would be ...
> full on 64bit and just have the problematic applications be 32bit

It is indeed about legacy applications that needs to run in a 32bit userspace context.
Normally you would go with a multilib solutions to support the 32bit applications in a 64bit userspace, however, for specific (backwards compatibility) reasons, this is not a possibility.

/ Daniel

Med venlig hilsen / Best regards

Daniel Machon
Embedded Linux Engineer
R&D Department
[cid:UR_New_Logo_266cf885-8c99-4fe9-bae0-ff88fedf0005.png]

Universal Robots A/S
Energivej 25
5260 Odense S

Phone: +45 89 93 89 89
Cell: +45 27 99 72 32

dama@universal-robots.com<mailto:dama@universal-robots.com>
www.universal-robots.com<http://www.universal-robots.com>



Please note that this message may contain confidential information. If you have received this message by mistake, please inform the sender of the mistake, then delete the message from your system without making, distributing or retaining any copies of it. Although we believe that the message and any attachments are free from viruses and other errors that might affect the computer or IT system where it is received and read, the recipient opens the message at his or her own risk. We assume no responsibility for any loss or damage arising from the receipt or use of this message.

If Universal Robots A/S processes personal data relating to physical persons, such processing will meet the requirements of applicable data protection legislation.Please see our Privacy Policy here.<https://www.universal-robots.com/about-universal-robots/privacy-policy/>


-----Original Message-----
From: isar-users@googlegroups.com <isar-users@googlegroups.com> On Behalf Of Henning Schild
Sent: 10. februar 2021 11:43
To: Baurzhan Ismagulov <ibr@radix50.net>
Cc: isar-users@googlegroups.com
Subject: Re: Support for generating bootx64.efi when distro arch is i386


CAUTION - EXTERNAL EMAIL: Do not open attachments or links unless you recognize the sender and the content is safe.


Am Wed, 10 Feb 2021 09:56:16 +0100
schrieb Baurzhan Ismagulov <ibr@radix50.net>:

> Hello Daniel,
>
> On Tue, Feb 09, 2021 at 08:45:06PM +0000, Daniel Machon wrote:
> > Would you consider a patch series that adds support for separating
> > the DISTRO_ARCH from the generation of the grub image?
> >
> > We have a use case where target userland is i386, but firmware only
> > supports loading of 64bit EFI executables. Currently the DISTRO_ARCH
> > is also used to generate the grub image - if distro arch is i386,
> > then grub image is bootia32.efi.
> >
> > We fixed this by introducing a new variable used (in
> > bootimg-efi-isar.py) to separately decide the grub image.
>
> IIRC, we've already had a similar use case (mixing i386 and amd64
> userland), so this one could be interesting as well. In any case, I'm
> looking forward to the patches and discussion.

I would not be against it but maybe as a more generic mixing pattern than just that one.

For your current hack you should be able to do all that in a layer instead of touching isar ... in case you are patching it.

> Why do you want to have i386 userland on amd64?

My guess would be legacy applications. And my suggestion would be ...
full on 64bit and just have the problematic applications be 32bit

Isar has support for this via ISAR_ENABLE_COMPAT_ARCH where "i386" is the little brother of "amd64". Similar for arm32 and 64.

Henning

> With kind regards,
> Baurzhan.
>

--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20210210114244.439de40a%40md1za8fc.ad001.siemens.net.

[-- Attachment #1.2: Type: text/html, Size: 6313 bytes --]

[-- Attachment #2: UR_New_Logo_266cf885-8c99-4fe9-bae0-ff88fedf0005.png --]
[-- Type: image/png, Size: 3508 bytes --]

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

* Re: Support for generating bootx64.efi when distro arch is i386
  2021-02-10 13:14     ` Daniel Machon
@ 2021-02-10 14:23       ` Henning Schild
  2021-02-17 10:41         ` Baurzhan Ismagulov
  0 siblings, 1 reply; 6+ messages in thread
From: Henning Schild @ 2021-02-10 14:23 UTC (permalink / raw)
  To: Daniel Machon; +Cc: Baurzhan Ismagulov, isar-users

Am Wed, 10 Feb 2021 13:14:25 +0000
schrieb Daniel Machon <dama@universal-robots.com>:

> It is indeed implemented in a separate layer.

Ok than it should not be too hard for you to maintain it on your end,
if it does not end up in Isar.

> In this particular case, it is only a question of being able to,
> explicitly, choose between i386/amd64 or arm64/arm32 grub images. I
> am not quite sure this can be implemented in a more generic way, than
> just introducing a variable, say FIRMWARE_ARCH, that defaults to
> DISTRO_ARCH - do you have anything in mind, Henning?

bootimg-efi-isar is a fork of bootimg-efi from openembedded, a fork
that should be more "glue" than features

So in fact the feature should be proposed in OE and isar would inherit
it at some point in time.

Would i would try to do for this kind of exotic feature is try and use
dpkg-divert to have apt exchange the files for you. The package
configuring apt would have to be installed in the buildchroot before
grub is installed there.

So you would end up with a raw package placing a few apt conf files,
which becomes an imager depends.

Such things are board support and are found in many layers. If you ever
want robust firmware update you will fast find yourself dumping grub
and going for https://github.com/siemens/efibootguard or systemd, or
u-boot

https://gitlab.com/cip-project/cip-core/isar-cip-core/-/tree/master/recipes-bsp/efibootguard

I guess you can cross compile this from i386 to amd64 ... and be done.

Looking at real product layers grub is hardly ever used, and in the efi
case the systemd path does not seem to have the DISTRO_ARCH
switch-case. It might be valuable but you might also find yourself
wanting to ditch grub.

Efi has some sort of chainloading, that is how we hook our watchdogs
into systemd booting, maybe that can be used to load that 32bit efi
binary from debian from another 64bit one you prepend in a customer
imager step.

regards,
Henning

> > My guess would be legacy applications. And my suggestion would be
> > ... full on 64bit and just have the problematic applications be
> > 32bit  
> 
> It is indeed about legacy applications that needs to run in a 32bit
> userspace context. Normally you would go with a multilib solutions to
> support the 32bit applications in a 64bit userspace, however, for
> specific (backwards compatibility) reasons, this is not a possibility.
> 
> / Daniel
> 
> Med venlig hilsen / Best regards
> 
> Daniel Machon
> Embedded Linux Engineer
> R&D Department
> [cid:UR_New_Logo_266cf885-8c99-4fe9-bae0-ff88fedf0005.png]
> 
> Universal Robots A/S
> Energivej 25
> 5260 Odense S
> 
> Phone: +45 89 93 89 89
> Cell: +45 27 99 72 32
> 
> dama@universal-robots.com<mailto:dama@universal-robots.com>
> www.universal-robots.com<http://www.universal-robots.com>
> 
> 
> 
> Please note that this message may contain confidential information.
> If you have received this message by mistake, please inform the
> sender of the mistake, then delete the message from your system
> without making, distributing or retaining any copies of it. Although
> we believe that the message and any attachments are free from viruses
> and other errors that might affect the computer or IT system where it
> is received and read, the recipient opens the message at his or her
> own risk. We assume no responsibility for any loss or damage arising
> from the receipt or use of this message.
> 
> If Universal Robots A/S processes personal data relating to physical
> persons, such processing will meet the requirements of applicable
> data protection legislation.Please see our Privacy Policy
> here.<https://www.universal-robots.com/about-universal-robots/privacy-policy/>
> 
> 
> -----Original Message-----
> From: isar-users@googlegroups.com <isar-users@googlegroups.com> On
> Behalf Of Henning Schild Sent: 10. februar 2021 11:43
> To: Baurzhan Ismagulov <ibr@radix50.net>
> Cc: isar-users@googlegroups.com
> Subject: Re: Support for generating bootx64.efi when distro arch is
> i386
> 
> 
> CAUTION - EXTERNAL EMAIL: Do not open attachments or links unless you
> recognize the sender and the content is safe.
> 
> 
> Am Wed, 10 Feb 2021 09:56:16 +0100
> schrieb Baurzhan Ismagulov <ibr@radix50.net>:
> 
> > Hello Daniel,
> >
> > On Tue, Feb 09, 2021 at 08:45:06PM +0000, Daniel Machon wrote:  
> > > Would you consider a patch series that adds support for separating
> > > the DISTRO_ARCH from the generation of the grub image?
> > >
> > > We have a use case where target userland is i386, but firmware
> > > only supports loading of 64bit EFI executables. Currently the
> > > DISTRO_ARCH is also used to generate the grub image - if distro
> > > arch is i386, then grub image is bootia32.efi.
> > >
> > > We fixed this by introducing a new variable used (in
> > > bootimg-efi-isar.py) to separately decide the grub image.  
> >
> > IIRC, we've already had a similar use case (mixing i386 and amd64
> > userland), so this one could be interesting as well. In any case,
> > I'm looking forward to the patches and discussion.  
> 
> I would not be against it but maybe as a more generic mixing pattern
> than just that one.
> 
> For your current hack you should be able to do all that in a layer
> instead of touching isar ... in case you are patching it.
> 
> > Why do you want to have i386 userland on amd64?  
> 
> My guess would be legacy applications. And my suggestion would be ...
> full on 64bit and just have the problematic applications be 32bit
> 
> Isar has support for this via ISAR_ENABLE_COMPAT_ARCH where "i386" is
> the little brother of "amd64". Similar for arm32 and 64.
> 
> Henning
> 
> > With kind regards,
> > Baurzhan.
> >  
> 
> --
> You received this message because you are subscribed to the Google
> Groups "isar-users" group. To unsubscribe from this group and stop
> receiving emails from it, send an email to
> isar-users+unsubscribe@googlegroups.com. To view this discussion on
> the web visit
> https://groups.google.com/d/msgid/isar-users/20210210114244.439de40a%40md1za8fc.ad001.siemens.net.


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

* Re: Support for generating bootx64.efi when distro arch is i386
  2021-02-10 14:23       ` Henning Schild
@ 2021-02-17 10:41         ` Baurzhan Ismagulov
  0 siblings, 0 replies; 6+ messages in thread
From: Baurzhan Ismagulov @ 2021-02-17 10:41 UTC (permalink / raw)
  To: isar-users

On Wed, Feb 10, 2021 at 03:23:43PM +0100, Henning Schild wrote:
> Ok than it should not be too hard for you to maintain it on your end,
> if it does not end up in Isar.

Since mixing Debian's unmodified binary components works, making it easier to
configure that could help other users as well.


> Would i would try to do for this kind of exotic feature is try and use
> dpkg-divert to have apt exchange the files for you. The package
> configuring apt would have to be installed in the buildchroot before
> grub is installed there.

IMHO, dpkg-divert should be limited to very special cases. The bitness choices
of boot loader, kernel, and user space are almost orthogonal; one could just
have three levers for that as well...


With kind regards,
Baurzhan.

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

end of thread, other threads:[~2021-02-17 10:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 20:45 Support for generating bootx64.efi when distro arch is i386 Daniel Machon
2021-02-10  8:56 ` Baurzhan Ismagulov
2021-02-10 10:42   ` Henning Schild
2021-02-10 13:14     ` Daniel Machon
2021-02-10 14:23       ` Henning Schild
2021-02-17 10:41         ` Baurzhan Ismagulov

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