TuxInvader / focal-mainline-builder

Docker container to build Ubuntu Mainline kernels for use on 20.04 LTS
BSD 2-Clause "Simplified" License
81 stars 21 forks source link

linux-tools does not contain any tool #6

Open sercxjo opened 3 years ago

sercxjo commented 3 years ago
# perf
WARNING: perf not found for kernel 5.12.10-051210

  You may need to install the following packages for this specific kernel:
    linux-tools-5.12.10-051210-generic
    linux-cloud-tools-5.12.10-051210-generic

  You may also want to install one of the following packages to keep up to date:
    linux-tools-generic
    linux-cloud-tools-generic
# apt-get install linux-tools-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  linux-tools-5.4.0-74 linux-tools-5.4.0-74-generic
The following NEW packages will be installed:
  linux-tools-5.4.0-74 linux-tools-5.4.0-74-generic linux-tools-generic
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 5623 kB of archives.
After this operation, 25.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

5.4.0 it is not current kernel version

# apt-get install linux-tools-5.12.10-051210-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-tools-5.12.10-051210-generic
E: Couldn't find any package by glob 'linux-tools-5.12.10-051210-generic'
E: Couldn't find any package by regex 'linux-tools-5.12.10-051210-generic'
# 

I found some similar names and tried to install linux-tools-common-5.12.10 linux-tools-host-5.12.10, but they does not contain binary files:

# dpkg -L linux-tools-common-5.12.10 linux-tools-host-5.12.10
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/linux-tools-common-5.12.10
/usr/share/doc/linux-tools-common-5.12.10/changelog.Debian.gz
/usr/share/doc/linux-tools-common-5.12.10/copyright

/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/linux-tools-host-5.12.10
/usr/share/doc/linux-tools-host-5.12.10/changelog.Debian.gz
/usr/share/doc/linux-tools-host-5.12.10/copyright

I am searching the following but for the new kernel:

# dpkg -L linux-tools-5.4.0-74-generic              
/.
/usr
/usr/lib
/usr/lib/linux-tools
/usr/lib/linux-tools/5.4.0-74-generic
/usr/share
/usr/share/doc
/usr/share/doc/linux-tools-5.4.0-74-generic
/usr/share/doc/linux-tools-5.4.0-74-generic/copyright
/usr/lib/linux-tools/5.4.0-74-generic/acpidbg
/usr/lib/linux-tools/5.4.0-74-generic/bpftool
/usr/lib/linux-tools/5.4.0-74-generic/cpupower
/usr/lib/linux-tools/5.4.0-74-generic/libperf-jvmti.so
/usr/lib/linux-tools/5.4.0-74-generic/perf
/usr/lib/linux-tools/5.4.0-74-generic/turbostat
/usr/lib/linux-tools/5.4.0-74-generic/usbip
/usr/lib/linux-tools/5.4.0-74-generic/usbipd
/usr/lib/linux-tools/5.4.0-74-generic/x86_energy_perf_policy
/usr/share/doc/linux-tools-5.4.0-74-generic/changelog.Debian.gz
sepatel commented 3 years ago

I'm afraid that the mainline kernel-ppa's never provided the linux-tools ever for any of the mainline builds. Thus the project by TuxInvader to make a version of the same mainline builds but actually using the correct libc libraries isn't going to change that fact likely.

Unfortunately the only way I've been able to solve that problem in the past is to build/compile the kernel myself when I needed turbostat before. Unless the author is planning to go above and beyond simply fixing the broken builds of the official mainline kernels I can't imagine he is going to be able and fix this particular issue.

TuxInvader commented 3 years ago

Hi,

As @sepatel says, the tools are explicitly disabled in mainline builds along with the comment: # Being used to build a mainline build -- turn off things which do not work.

They might be disabled due to missing build dependencies. if I override that then the tools can be built, but the additional dependencies take the container from 400MB in size to around 1.4GB. So I'm not sure if it's worth while adding the extra complexity, and if I did it would likely cause launchpad to run out of space during the build.

I might investigate building a container specifically to build the tools, but I don't think it's something I can add to the current container without causing issues on launchpad.

Cheers

sercxjo commented 3 years ago

Although if called from the old version (directly from /usr/lib/linux-tools/5.4.0-74-generic/), it seems to work

shaicoleman commented 3 years ago

You can run these commands to use old version of linux-tools:

sudo apt-get -yy install linux-tools-generic
for f in /usr/lib/linux-tools/*/*; do
  sudo ln -sf $f /usr/local/bin/$(basename $f)
done