Bug 11050

Summary: kexec-tools fails to build with x32 as DEFAULTTUNE
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Saul Wold <sgw>
Component: coreAssignee: Flavio <flavio.santes>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: anibal.limon, flavio.santes, juan.m.cruz.alcaraz, leonardo.sandoval.gonzalez, meta.mr.watcher, meta.watcher
Version: 2.3   
Target Milestone: 2.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 3437    
Attachments:
Description Flags
qemux86 kexec test log
none
qemux86-64 x32 kexec test log
none
generic-x86-64 x32 kexec test log on minnowboard none

Description Saul Wold 2017-02-14 16:44:11 UTC
Using the following settings, kexec-tools fails to build

MACHINE="intel-corei7-64"
DEFAULTTUNE = "corei7-64-x32"
Comment 1 Aníbal Limón 2017-02-14 20:21:34 UTC
I created a patch for enable x32 builds and send to the kexec ML [1], the patch was integrated and then dropped because 
Yinghai Lu reported failures with OpenSUSE 13.1 64 bits without x32 [2].

I made the testing on OpenSUSE 13.1 and poky core-image-minimal with x32 and works,

The test was done with:

# kexec -l /boot/vmlinuz-linux --initrd=/boot/initramfs-linux.img --reuse-cmdline
# kexec -e

Futher investigation is needed.

[1] http://lists.infradead.org/pipermail/kexec/2015-March/013482.html 
[2] https://github.com/horms/kexec-tools/commit/5041d45b1c6b66a0e6c48f6121c24cd9be506c68
Comment 2 Flavio 2017-04-17 20:48:53 UTC
It seems  the issue comes from the removal of the kexec x32 patch originally submitted to enable x32 and located at meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch. The removal was made by ec1f1c4abe1d40708fefd56f01c58fff38f28960.

On master, the x32 ABI can be activated following these steps:

a) Revert ec1f1c4abe1d40708fefd56f01c58fff38f28960

b) In file meta/recipes-kernel/kexec/kexec-tools_2.0.14.bb, add this line to SRC_URI: file://kexec-x32.patch

c) In file meta/recipes-kernel/linux/linux-yocto/kexec.cfg, add the following line: CONFIG_KEXEC=y 

Note: create the linux-yocto directory and the file kexec.cfg in case they do not exist.

d) In file meta/recipes-kernel/linux/linux-yocto_4.10.bb add the following line to SRC_URI: file://kexec.cfg

Please let me know if this works for you.

Regards,
Flavio
Comment 3 Aníbal Limón 2017-04-19 20:41:34 UTC
Created attachment 3738 [details]
qemux86 kexec test log

The local.conf file:

MACHINE ??= "qemux86"
CORE_IMAGE_EXTRA_INSTALL += "kernel-image kexec-tools"

Also needs to enable CONFIG_KEXEC in the kernel:

Fle meta/recipes-kernel/linux/linux-yocto/kexec.cfg

CONFIG_KEXEC=y

And the modify linux-yocto recipe to add the config fragment.

SRC_URI += "file://kexec.cfg"
Comment 4 Aníbal Limón 2017-04-19 20:44:53 UTC
Created attachment 3739 [details]
qemux86-64 x32 kexec test log


The local.conf file:

MACHINE ??= "qemux86-64"
DEFAULTTUNE = "x86-64-x32"
baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) \
         or 'INVALID'), True) or 'lib'}"
CORE_IMAGE_EXTRA_INSTALL += "kernel-image kexec-tools"

Also needs to enable CONFIG_KEXEC in the kernel:

Fle meta/recipes-kernel/linux/linux-yocto/kexec.cfg

CONFIG_KEXEC=y

And the modify linux-yocto recipe to add the config fragment.

SRC_URI += "file://kexec.cfg"

Search for the line "kexec_core: Starting new kernel"
Comment 5 Aníbal Limón 2017-04-19 21:12:11 UTC
Created attachment 3740 [details]
generic-x86-64 x32 kexec test log on minnowboard

The local.conf file:

MACHINE ??= "genericx86-64"
DEFAULTTUNE = "x86-64-x32"
baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) \
         or 'INVALID'), True) or 'lib'}"
CORE_IMAGE_EXTRA_INSTALL += "kexec-tools kernel-image"

Also needs to enable CONFIG_KEXEC in the kernel:

Fle meta/recipes-kernel/linux/linux-yocto/kexec.cfg

CONFIG_KEXEC=y

And the modify linux-yocto recipe to add the config fragment.

SRC_URI += "file://kexec.cfg"

Search for the line "kexec_core: Starting new kernel"