I am trying to compile the vmlinuz-5.4.288 so I can install it in the /boot directory and make it available as one of the advanced options to boot to so that I can install some graphics drivers that are not available with the newer kernel versions.
I am trying to follow the answer given in: Download and extract the source code of the kernel you wish to build
I downloaded the tarball linux-5.4.288.tar.xz and then extracted it in a dedicated directory using:
xz -cd linux-5.4.288.tar.xz | tar xvf -
I am able to extract the tarball by first creating the directory in the same folder:
mkdir linux-5.4.288
After going to the linux-5.4.288 directrory, when I try
sudo apt-get install libqt4-dev pkg-config
But then I get stuck with the compiler error:
E: Unable to locate package libqt4-dev
I am following the article "E: Unable to locate package libqt4-dev" while trying to install torch (Ubuntu 22.04), for which the answer recommends I do and I try:
$sudo add-apt-repository ppa:ubuntuhandbook1/ppa
This results in the following errors:
stephen@stephen-All-Series:~$ sudo add-apt-repository ppa:ubuntuhandbook1/ppa
[sudo] password for stephen:
Repository: 'Types: deb
URIs: https://ppa.launchpadcontent.net/ubuntuhandbook1/ppa/ubuntu/
Suites: oracular
Components: main
'
Description:
Qt4-x11 packages that are no longer officially supported! Use it at your own risk!
More info: https://launchpad.net/~ubuntuhandbook1/+archive/ubuntu/ppa
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
Found existing deb entry in /etc/apt/sources.list.d/ubuntuhandbook1-ubuntu-ppa-oracular.sources
Hit:1 http://security.ubuntu.com/ubuntu oracular-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu oracular InRelease
Hit:3 http://archive.ubuntu.com/ubuntu oracular-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu oracular-backports InRelease
Hit:5 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu oracular InRelease
Ign:6 https://ppa.launchpadcontent.net/ubuntuhandbook1/ppa/ubuntu oracular InRelease
Err:7 https://ppa.launchpadcontent.net/ubuntuhandbook1/ppa/ubuntu oracular Release
404 Not Found [IP: 185.125.190.80 443]
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/ubuntuhandbook1/ppa/ubuntu oracular Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
stephen@stephen-All-Series:~$
I ignore these error messages, following the article, and then try:
$sudo apt-get update
This results in the following:
stephen@stephen-All-Series:~$ sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu oracular InRelease
Hit:2 http://security.ubuntu.com/ubuntu oracular-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu oracular-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu oracular-backports InRelease
Hit:5 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu oracular InRelease
Ign:6 https://ppa.launchpadcontent.net/ubuntuhandbook1/ppa/ubuntu oracular InRelease
Err:7 https://ppa.launchpadcontent.net/ubuntuhandbook1/ppa/ubuntu oracular Release
404 Not Found [IP: 185.125.190.80 443]
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/ubuntuhandbook1/ppa/ubuntu oracular Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
stephen@stephen-All-Series:~$
The article What can I do if a repository/PPA does not have a Release file? seems that it might be relevant, but I am not understanding how to apply it in this case.
and then I try:
$sudo apt-get install qt4-dev-tools libqt4-dev libqtcore4 libqtgui4
However this results in some error messages:
stephen@stephen-All-Series:~$ sudo apt-get install qt4-dev-tools libqt4-dev libqtcore4 libqtgui4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libqtcore4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
qtchooser:i386 qtchooser
Package libqtgui4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Unable to locate package qt4-dev-tools
E: Unable to locate package libqt4-dev
E: Package 'libqtcore4' has no installation candidate
E: Package 'libqtgui4' has no installation candidate
stephen@stephen-All-Series:~$
I keep on going, ignoring the previous error messages:
stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288# make oldconfig
I select all the default options by pressing the return tab over and over until I get to the command line. Then I run:
stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288# make
The compiler keeps on going with object .o files, but gets stuck with the following errors:
certs/system_keyring.o
make[1]: *** No rule to make target 'debian/canonical-certs.pem', needed by 'certs/x509_certificate_list'. Stop.
make: *** [Makefile:1750: certs] Error 2
I look up this error message and find the relevant article:
Compiling kernel 5.11.11 and later
It suggests that I run the following:
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288/scripts# ./config --disable SYSTEM_TRUSTED_KEYS
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288/scripts# ./config --disable SYSTEM_REVOCATION_KEYS
These steps work without error. So I go back to make issuing the command:
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288# make
I get the same error messages, so I edit the .config file directly in the scripts directory again following Compiling kernel 5.11.11 and later so that the .config file contents are:
CONFIG_SYSTEM_TRUSTED_KEYS=""
CONFIG_SYSTEM_REVOCATION_KEYS=""
I am still stuck with the errors, upon make in the linux-5.4.288 directory:
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288# make
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
CHK include/generated/compile.h
CHK kernel/kheaders_data.tar.xz
make[1]: *** No rule to make target 'debian/canonical-certs.pem', needed by 'certs/x509_certificate_list'. Stop.
make: *** [Makefile:1750: certs] Error 2
Also, if I continue and run the next steps, I am left still with just errors.
How can I compile the linux-5.4 kernel under Ubuntu 24.10 operating system?
I am stuck still with the following errors and I have no idea how to proceed:
stephen@stephen-All-Series:~/Documents/Kernel/Version5b/linux-5.4.288$ sudo make
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
CHK include/generated/compile.h
CHK kernel/kheaders_data.tar.xz
make[1]: *** No rule to make target 'debian/canonical-certs.pem', needed by 'certs/x509_certificate_list'. Stop.
make: *** [Makefile:1750: certs] Error 2
stephen@stephen-All-Series:~/Documents/Kernel/Version5b/linux-5.4.288$ sudo apt-get install qt4-dev-tools libqt4-dev libqtcore4 libqtgui4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libqtcore4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
qtchooser:i386 qtchooser
Package libqtgui4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Unable to locate package qt4-dev-tools
E: Unable to locate package libqt4-dev
E: Package 'libqtcore4' has no installation candidate
E: Package 'libqtgui4' has no installation candidate
stephen@stephen-All-Series:~/Documents/Kernel/Version5b/linux-5.4.288$
Update January 8th, 2025:
I was very fortunate to find this link Compiling kernel gives error No rule to make target 'debian/certs/debian-uefi-certs.pem'. One way of looking at the direct error message
make[1]: *** No rule to make target 'debian/canonical-certs.pem', needed by 'certs/x509_certificate_list'. Stop.
was that something was mis-configured. I had a hard time finding out where one of the configuration files might be. Finally, I had the insight to try and check the ".config" file showing:
#
# Certificates for signature checking
#
CONFIG_MODULE_SIG_KEY="certs/signing_key.pem"
CONFIG_SYSTEM_TRUSTED_KEYRING=y
#SE CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem"
CONFIG_SYSTEM_EXTRA_CERTIFICATE=y
CONFIG_SYSTEM_EXTRA_CERTIFICATE_SIZE=4096
CONFIG_SECONDARY_TRUSTED_KEYRING=y
CONFIG_SYSTEM_BLACKLIST_KEYRING=y
CONFIG_SYSTEM_BLACKLIST_HASH_LIST=""
CONFIG_SYSTEM_REVOCATION_LIST=y
# end of Certificates for signature checking
I was just so tired of the compiler error that as above I commented out the line:
#SE CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem"
Just to be clear, I put the tarball in the folder
~stephen/Documents/Kernel/Version5b
and the ".config" file was in the directory, where the tarball was expanded into the linux-5.4.288 folder (after backing up .config with cp to SEconfig):
root@stephen-All-Series:~# ls ~stephen/Documents/Kernel/Version5b/linux-5.4.288/.config
/home/stephen/Documents/Kernel/Version5b/linux-5.4.288/.config
I ran the make file command:
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288# make -f ./Makefile all
Currently everything is still compiling without error. I hope to install the NVIDIA graphics driver that can only be install on Kernel 5 booting to advanced options after I install the kernel in the /boot directory. But first the compilation needs to complete and I am not there yet as the compilation is thank G-d still in progress.
Just to emphasize, I am not recommending this approach for any security possible sensitive configurations. Rather I am trying to get to a test platform where I might more effectively solve or file bug reports on the 24.10 NVIDIA graphics card drivers to get full implementation on not just the DVI, but also the HDMI and DP ports that are not working as yet with the Canonical driver (since for the older cards the NVIDIA driver does not even install with the newer Ubuntu 24.10) to try and solve that mystery for the very many NVIDIA graphics cards there that right now do not have full support.
Update: July 9, 2025
The kernel compilation ran all night until it encountered the following error:
MODINFO modules.builtin.modinfo
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make: *** [Makefile:1116: vmlinux] Error 1
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288#
I ran:
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288# nano ./.config
And I set:
#SE CONFIG_DEBUG_INFO_BTF=y set to n instead below
CONFIG_DEBUG_INFO_BTF=n
And I wrote the output, and issued the command:
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288# make -f ./Makefile
Compilation continued, and I am still waiting for the result of the compilation.
That compilation completes successfully, but then I cannot find the kernel file. So I found these articles Linux kernel release 6.x http://kernel.org/ and How to quickly build a trimmed Linux kernel. I ran:
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288# make install
That yielded:
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288# make install
sh ./arch/x86/boot/install.sh 5.4.288 arch/x86/boot/bzImage \
System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/dkms 5.4.288 /boot/vmlinuz-5.4.288
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.4.288 /boot/vmlinuz-5.4.288
update-initramfs: Generating /boot/initrd.img-5.4.288
W: zstd compression (CONFIG_RD_ZSTD) not supported by kernel, using gzip
run-parts: executing /etc/kernel/postinst.d/kdump-tools 5.4.288 /boot/vmlinuz-5.4.288
kdump-tools: Generating /var/lib/kdump/initrd.img-5.4.288
W: zstd compression (CONFIG_RD_ZSTD) not supported by kernel, using gzip
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 5.4.288 /boot/vmlinuz-5.4.288
run-parts: executing /etc/kernel/postinst.d/update-notifier 5.4.288 /boot/vmlinuz-5.4.288
run-parts: executing /etc/kernel/postinst.d/xx-update-initrd-links 5.4.288 /boot/vmlinuz-5.4.288
I: /boot/initrd.img.old is now a symlink to initrd.img-6.11.0-13-generic
I: /boot/initrd.img is now a symlink to initrd.img-5.4.288
run-parts: executing /etc/kernel/postinst.d/zz-shim 5.4.288 /boot/vmlinuz-5.4.288
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 5.4.288 /boot/vmlinuz-5.4.288
Sourcing file /etc/default/grub' Sourcing file/etc/default/grub.d/kdump-tools.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.11.0-13-generic
Found initrd image: /boot/initrd.img-6.11.0-13-generic
Found linux image: /boot/vmlinuz-6.11.0-12-generic
Found initrd image: /boot/initrd.img-6.11.0-12-generic
Found linux image: /boot/vmlinuz-5.4.288
Found initrd image: /boot/initrd.img-5.4.288
Found memtest86+ 64bit EFI image: /boot/memtest86+x64.efi
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288#
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288# ls /boot
config-5.4.288 initrd.img initrd.img.old System.map-5.4.288 vmlinuz-6.11.0-12-generic
config-6.11.0-12-generic initrd.img-5.4.288 memtest86+ia32.bin System.map-6.11.0-12-generic vmlinuz-6.11.0-13-generic
config-6.11.0-13-generic initrd.img-6.11.0-12-generic memtest86+ia32.efi System.map-6.11.0-13-generic vmlinuz.old
efi initrd.img-6.11.0-13-generic memtest86+x64.bin vmlinuz
grub initrd.img-6.11.0-8-generic memtest86+x64.efi vmlinuz-5.4.288
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288#
So the kernel seems correctly installed. Just, on the safe side, I want to make sure that GRUB is updated successfully so I run update-grub as follows:
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288# update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/kdump-tools.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.11.0-13-generic
Found initrd image: /boot/initrd.img-6.11.0-13-generic
Found linux image: /boot/vmlinuz-6.11.0-12-generic
Found initrd image: /boot/initrd.img-6.11.0-12-generic
Found linux image: /boot/vmlinuz-5.4.288
Found initrd image: /boot/initrd.img-5.4.288
Found memtest86+ 64bit EFI image: /boot/memtest86+x64.efi
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
root@stephen-All-Series:/home/stephen/Documents/Kernel/Version5b/linux-5.4.288#
Thank G-d that everything is looking very promising so far. As to the article title, it seems complete. But I want to make sure that this version is able to use NVIDIA drivers after a reboot still.
Update: I was able to select from the Grub advanced menu kernel linux-5.4.288; however, I got the error message Ubuntu Error Bad Shim Signature as detailed in the article Ubuntu Error Bad Shim Signature | Resolved; I tried the attempted resolution to disable Secure Boot in the BIOS, and it resolved the shim error message. However the boot itself was completely frozen and not useful.
The article UEFI Secure Boot:- bad shim signature article seems like it might be relevant, but I am not understanding how I apply this with the .config file settings and other settings for the Kernel 5.4.288 compilation yet. There is also this article Bad shim signature - you need to load the kernel first which seems insightful, but I need some time to consider it carefully.
If I disable Safe Boot then booting does not work for the Version 5.4.288 kernel. Even with Safe Boot Enabled, I can boot fine selecting my Ubuntu 24.10 system with its details below:
# System Details Report
---
Report details
- Date generated: 2025-01-09 14:20:27
Hardware Information:
- Hardware Model: ASUS All Series
- Memory: 4.0 GiB
- Processor: Intel® Core™ i3-4170 × 4
- Graphics: Software Rendering
- Disk Capacity: 1.0 TB
Software Information:
- Firmware Version: 1103
- OS Name: Ubuntu 24.10
- OS Build: (null)
- OS Type: 64-bit
- GNOME Version: 47
- Windowing System: Wayland
- Kernel Version: Linux 6.11.0-13-generic
I am still left with the question here of, "What then can be done then to get the linux-5.4.288 kernel to boot with Secure Boot under advanced options for the Grub Boot Menu?"