kernel ppa is building amd64 files inside mainline ppc64el package

Bug #1665447 reported by Breno Leitão
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Incomplete
Wishlist
Canonical Kernel Team

Bug Description

Kernel PPA contains a files that are compiled against amd64 instead of ppc64el. This makes this kernel unusable:

Example:

PPA: http://kernel.ubuntu.com/~kernel-ppa/mainline/

Kernel: http://kernel.ubuntu.com/\~kernel-ppa/mainline/v4.10-rc8/linux-headers-4.10.0-041000rc8-generic_4.10.0-041000rc8.201702121731_ppc64el.deb

➜ ppa dpkg-deb -x linux-headers-4.10.0-041000rc8-generic_4.10.0-041000rc8.201702121731_ppc64el.deb .

➜ ppa find . -name fixdep
./usr/src/linux-headers-4.10.0-041000rc8-generic/scripts/basic/fixdep

➜ ppa file ./usr/src/linux-headers-4.10.0-041000rc8-generic/scripts/basic/fixdep
./usr/src/linux-headers-4.10.0-041000rc8-generic/scripts/basic/fixdep: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=438d1c0255e4943c4af1b9568a4cbe83d9034737, not stripped

affects: luajit (Ubuntu) → linux (Ubuntu)
Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1665447

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Changed in linux (Ubuntu):
assignee: nobody → Taco Screen team (taco-screen-team)
Revision history for this message
Michael Hohnbaum (hohnbaum) wrote : Re: [Bug 1665447] [NEW] kernel ppa is building amd64 files inside ppc64el package

Leann,

For the Kernel team....

                  Michael

On 02/16/2017 12:30 PM, Launchpad Bug Tracker wrote:
> Breno Leitão (breno-leitao) has assigned this bug to you for linux in Ubuntu:
>
> Kernel PPA contains a files that are compiled against amd64 instead of
> ppc64el. This makes this kernel unusable:
>
> Example:
>
> PPA: http://kernel.ubuntu.com/~kernel-ppa/mainline/
>
> Kernel: http://kernel.ubuntu.com/\~kernel-ppa/mainline/v4.10-rc8/linux-
> headers-4.10.0-041000rc8-generic_4.10.0-041000rc8.201702121731_ppc64el.deb
>
> ➜ ppa dpkg-deb -x linux-
> headers-4.10.0-041000rc8-generic_4.10.0-041000rc8.201702121731_ppc64el.deb
> .
>
> ➜ ppa find . -name fixdep
> ./usr/src/linux-headers-4.10.0-041000rc8-generic/scripts/basic/fixdep
>
> ➜ ppa file ./usr/src/linux-headers-4.10.0-041000rc8-generic/scripts/basic/fixdep
> ./usr/src/linux-headers-4.10.0-041000rc8-generic/scripts/basic/fixdep: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=438d1c0255e4943c4af1b9568a4cbe83d9034737, not stripped
>
> ** Affects: linux (Ubuntu)
> Importance: Undecided
> Assignee: Taco Screen team (taco-screen-team)
> Status: Incomplete
>

--
Michael Hohnbaum
OIL Program Manager
Power (ppc64el) Development Project Manager
Canonical, Ltd.

Tim Gardner (timg-tpi)
summary: - kernel ppa is building amd64 files inside ppc64el package
+ kernel ppa is building amd64 files inside mainline ppc64el package
Revision history for this message
Tim Gardner (timg-tpi) wrote :

This is a known problem with cross compiling. Mainline packages are "best" effort. Fortunately this does not happen on builders native to the architecture.

Changed in linux (Ubuntu):
assignee: Taco Screen team (taco-screen-team) → Canonical Kernel Team (canonical-kernel-team)
importance: Undecided → Wishlist
Revision history for this message
Manoj Iyer (manjo) wrote :
Download full text (5.0 KiB)

[ Installing debs on ppc64el works ]

root@lazy:/# wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10/linux-image-4.10.0-041000-generic_4.10.0-041000.201702191831_ppc64el.deb
--2017-02-23 21:16:49-- http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10/linux-image-4.10.0-041000-generic_4.10.0-041000.201702191831_ppc64el.deb
Resolving kernel.ubuntu.com (kernel.ubuntu.com)... 91.189.94.216
Connecting to kernel.ubuntu.com (kernel.ubuntu.com)|91.189.94.216|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 59612954 (57M) [application/x-debian-package]
Saving to: ‘linux-image-4.10.0-041000-generic_4.10.0-041000.201702191831_ppc64el.deb’

linux-image-4.10.0- 100%[===================>] 56.85M 2.23MB/s in 39s

2017-02-23 21:17:29 (1.45 MB/s) - ‘linux-image-4.10.0-041000-generic_4.10.0-041000.201702191831_ppc64el.deb’ saved [59612954/59612954]

root@lazy:/# dpkg -i linux-image-4.10.0-041000-generic_4.10.0-041000.201702191831_ppc64el.deb
Selecting previously unselected package linux-image-4.10.0-041000-generic.
(Reading database ... 54943 files and directories currently installed.)
Preparing to unpack linux-image-4.10.0-041000-generic_4.10.0-041000.201702191831_ppc64el.deb ...
Done.
Unpacking linux-image-4.10.0-041000-generic (4.10.0-041000.201702191831) ...
Setting up linux-image-4.10.0-041000-generic (4.10.0-041000.201702191831) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-041000-generic /boot/vmlinux-4.10.0-041000-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-041000-generic /boot/vmlinux-4.10.0-041000-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-041000-generic
Unsupported ioctl: cmd=0x5331
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.10.0-041000-generic /boot/vmlinux-4.10.0-041000-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.10.0-041000-generic /boot/vmlinux-4.10.0-041000-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.10.0-041000-generic /boot/vmlinux-4.10.0-041000-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinux-4.10.0-041000-generic
Found initrd image: /boot/initrd.img-4.10.0-041000-generic
Found linux image: /boot/vmlinux-4.9.0-15-generic
Found initrd image: /boot/initrd.img-4.9.0-15-generic
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
  Found Ubuntu Zesty Zapus (development branch) (17.04) on /dev/sda2
  Adding boot menu entry for EFI firmware configuration
  done
root@lazy:/#

root@lazy:/# wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10/linux-headers-4.10.0-041000-generic_4.10.0-041000.201702191831_ppc64el.deb
--2017-02-23 21:25:36-- http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10/linux-headers-4.10.0-041000-generic_4.10.0-041000.201702191831_ppc64el.deb
Resolving kernel.ubuntu.com (kernel.ubuntu.com)... 91.189.94.216
Connecting to kernel.ubuntu.com (kernel.ubuntu.com)|91.189.94.216|:80... connected.
HTTP request sent, awaiting response... 20...

Read more...

Revision history for this message
Manoj Iyer (manjo) wrote :

[ Fixing fixdep - from x86_64 to ppc64el ]

After you install the debs for kernel and headers do the following:

root@lazy:/# updatedb
root@lazy:/# locate fixdep
/usr/src/linux-headers-4.10.0-041000/scripts/basic/fixdep.c
/usr/src/linux-headers-4.10.0-041000-generic/scripts/basic/.fixdep.cmd
/usr/src/linux-headers-4.10.0-041000-generic/scripts/basic/fixdep
/usr/src/linux-headers-4.10.0-041000-generic/scripts/basic/fixdep.c
/usr/src/linux-headers-4.9.0-15/scripts/basic/fixdep.c
/usr/src/linux-headers-4.9.0-15-generic/scripts/basic/.fixdep.cmd
/usr/src/linux-headers-4.9.0-15-generic/scripts/basic/fixdep
/usr/src/linux-headers-4.9.0-15-generic/scripts/basic/fixdep.c
root@lazy:/#

root@lazy:/usr/src/linux-headers-4.10.0-041000-generic/scripts/basic# ls
bin2c bin2c.c fixdep fixdep.c Makefile
root@lazy:/usr/src/linux-headers-4.10.0-041000-generic/scripts/basic# file fixdep
fixdep: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=438d1c0255e4943c4af1b9568a4cbe83d9034737, not stripped

root@lazy:/usr/src/linux-headers-4.10.0-041000-generics# apt update; apt install -y make gcc

root@lazy:/usr/src/linux-headers-4.10.0-041000-generic# make scripts_basic
  HOSTCC scripts/basic/fixdep
  HOSTCC scripts/basic/bin2c
  HOSTCC scripts/kconfig/conf.o
  HOSTCC scripts/kconfig/zconf.tab.o
  HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
root@lazy:/usr/src/linux-headers-4.10.0-041000-generic#

root@lazy:/usr/src/linux-headers-4.10.0-041000-generic# file /usr/src/linux-headers-4.10.0-041000-generic/scripts/basic/fixdep
/usr/src/linux-headers-4.10.0-041000-generic/scripts/basic/fixdep: ELF 64-bit LSB shared object, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked, interpreter /lib64/ld64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=497f0dbcfa70be01e7057cfd674e361ccd6d035d, not stripped
root@lazy:/usr/src/linux-headers-4.10.0-041000-generic#

Revision history for this message
Breno Leitão (breno-leitao) wrote :

This continues to be a issue on recent kernel:

These are amd64 files on a ppc64el .deb package:

 /usr/src/linux-headers-4.19.0-041900-generic/scripts/basic/fixdep
 /usr/src/linux-headers-4.19.0-041900-generic/scripts/mod/mk_elfconfig
 /usr/src/linux-headers-4.19.0-041900-generic/scripts/mod/modpost
 /usr/src/linux-headers-4.19.0-041900-generic/scripts/scripts/sign-file

Revision history for this message
Manoj Iyer (manjo) wrote :

The mainline builds are all cross-built rather than native
built. Binaries like fixdep etc are used by the build process, and since its a
build on amd64 those binaries are complied for amd64. It is very resource
intensive to build these unsupported kernels native for each architecture.

Also note that these kernels are not intended for production systems, and are
made available for sneak peek/testing purposes only. These are unmodified
upstream kernels built using the ubuntu config files. Or in other words.. these
packages are "install at your own risk" and not supported in any way.

Revision history for this message
satmandu (satadru-umich) wrote :

I know that these mainline builds are unsupported in any way, but there have been some efforts to quickly patch this problem for cross-compiling.

Examples: https://bugs.launchpad.net/ubuntu/+source/linux-ti-omap4/+bug/666267/comments/16

Also, I wrote up a quick hacky post-install script to workaround this issue, which works for arm64 mainline builds, here:

https://gist.github.com/satmandu/b60a804fa2275615c88367bc68e4bad0

As a quick summary of the problem, it appears that these files are needed in the target architecture to build modules, but are in the cross-compile host architecture:

scripts/recordmcount
scripts/mod/modpost
scripts/basic/fixdep

"make scripts" does everything except make modpost, so I use "make modules_prepare" which errors out, but does make everything one needs.

Oh, and unfortunately the packaging scripts seem to leave out these header files which are needed for the aforementioned compile process:

security/selinux/include/classmap.h
security/selinux/include/initial_sid_to_string.h
tools/include/tools/be_byteshift.h
tools/include/tools/le_byteshift.h

So I download those first too.

If any of that process could be eliminated, it would be appreciated. :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.