0

Some background

I've successfully patched a Linux kernel with the PREEMPT_RT patch, configured it, built it, and booted from it. The steps I took:

Patched kernel 5.4.230 with PREEMPT_RT

# Get kernel source
wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.4.230.tar.xz

# Get PREEMPT_RT patch
wget https://www.kernel.org/pub/linux/kernel/projects/rt/5.4/patch-5.4.230-rt80.patch.xz

# Patch the kernel
xz -cd linux-5.4.230.tar.xz | tar xvf -
cd linux-5.4.230
xzcat ../patch-5.4.230-rt80.patch.xz | patch -p1

Built kernel

# Install prerequisite packages
sudo apt install build-essential flex bison pkg-config openssl libssl-dev libncurses-dev dwarves -y

# Copy existing configuration installed with Ubuntu 20.04 as a
# starting point
cp /boot/config-$(uname -r) .config

# Turn on fully preemptable kernel here
make oldconfig

# Build
make -j$(nproc)

Installed kernel

sudo make modules_install
sudo make install
sudo update-grub
sudo reboot

I also opted to use secure boot so I signed the kernel but that's not relevant here.

Where I need help

Next, I need to install a software package that requires that Linux headers are installed. I see there's a make target called headers_install in the kernel source directory but I'm a little confused on how kernel headers are organized. It looks like I should be putting the kernel headers from the make headers_install command in /usr/src/ which is all fine and good but I feel like there should be some extra steps after that. Like is there something I have to do after this to make these the new default or anything?

I saw one other similar question but it was mostly related to VMWare and seemed to be solved by installing kernel headers through apt. This is a custom(-ish) kernel so I don't think that will work for me unless I can happen to use the same kernel headers for the base kernel that I patched without problems.

Any help is appreciated. Thanks!

  • Please [edit] your question and add details how exactly you obtained, built and installed the kernel. According to the following sources, building the kernel in the Debian way should result in a few `.deb` packages you can install as usual: https://askubuntu.com/q/724900/1186757 or https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel – Bodo May 04 '23 at 21:02
  • @Bodo Thanks. I did attempt to use `make deb-pkg` but I ran into an error. I took the path of least resistance and ran `make` without creating the deb package which just worked. I'll try to work through the Debian package error and see if it lends any results. – branchwithlink May 04 '23 at 23:09

0 Answers0