Ubuntu 21.10.
I am building kernels as documented at https://help.ubuntu.com/community/Kernel/Compile and https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel.
DEB_BUILD_OPTIONS=parallel=$(getconf _NPROCESSORS_ONLN) AUTOBUILD=1 NOEXTRAS=1 \
fakeroot debian/rules binary-arch
This compilation command has the same result:
make --jobs=$(getconf _NPROCESSORS_ONLN) bindeb-pkg \
LOCALVERSION=-custom-$(git describe | tr '[:upper:]' '[:lower:]')
This creates some .deb
packages:
$ ls -hal ../*.deb
-rw-r--r-- 1 amedee amedee 8,2M feb 26 02:17 ../linux-headers-5.13.19-ubuntu-5.13.0-22.22_5.13.19-ubuntu-5.13.0-22.22-6_amd64.deb
-rw-r--r-- 1 amedee amedee 70M feb 26 02:18 ../linux-image-5.13.19-ubuntu-5.13.0-22.22_5.13.19-ubuntu-5.13.0-22.22-6_amd64.deb
-rw-r--r-- 1 amedee amedee 1,2M feb 26 02:17 ../linux-libc-dev_5.13.19-ubuntu-5.13.0-22.22-6_amd64.deb
I install them like this:
sudo dpkg --install \
../linux-headers-5.13.19-ubuntu-5.13.0-22.22_5.13.19-ubuntu-5.13.0-22.22-6_amd64.deb \
../linux-image-5.13.19-ubuntu-5.13.0-22.22_5.13.19-ubuntu-5.13.0-22.22-6_amd64.deb
This is then the content of /boot
:
$ ls -hal /boot/*5.13*
-rw-r--r-- 1 root root 252K nov 5 10:21 /boot/config-5.13.0-22-generic
-rw-r--r-- 1 root root 251K feb 26 02:15 /boot/config-5.13.19-ubuntu-5.13.0-22.22
-rw-r--r-- 1 root root 40M feb 22 16:21 /boot/initrd.img-5.13.0-22-generic
-rw-r--r-- 1 root root 37M feb 26 02:20 /boot/initrd.img-5.13.19-ubuntu-5.13.0-22.22
-rw------- 1 root root 5,7M nov 5 10:21 /boot/System.map-5.13.0-22-generic
-rw-r--r-- 1 root root 5,6M feb 26 02:15 /boot/System.map-5.13.19-ubuntu-5.13.0-22.22
-rw------- 1 root root 9,8M nov 5 13:51 /boot/vmlinuz-5.13.0-22-generic
-rw-r--r-- 1 root root 8,5M feb 26 02:15 /boot/vmlinuz-5.13.19-ubuntu-5.13.0-22.22
Update initramfs (which strictly speaking isn't necessary because that has already been done, but for good measure):
$ sudo update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-5.13.19-ubuntu-5.13.0-22.22
update-initramfs: Generating /boot/initrd.img-5.13.0-22-generic
Then I run update-grub
:
amedee@kerbol:~/repos/ubuntu-impish$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.13.0-22-generic
Found initrd image: /boot/initrd.img-5.13.0-22-generic
Found linux image: /boot/vmlinuz-5.13.0-22-generic
Found initrd image: /boot/initrd.img-5.13.0-22-generic
Adding boot menu entry for UEFI Firmware Settings
done
My compiled kernel 5.13.19-ubuntu-5.13.0-22.22
is not added to the Grub menu by update-grub
. I know I can add it manually, but that has a risk of typos. I also need to compile a lot of kernels because I'm trying to locate a possible bug using git bisect
. The kernel issue that I'm troubleshooting does not occur in more recent mainline kernels, only in (some, but not all) Ubuntu 21.10 kernels, so I only do this to learn something and to satisfy my curiosity.
What do I need to do so that update-grub
adds my compiled kernel from the /boot
directory to the Grub menu?