1

I installed Ubuntu 24.04 server on a physical server. My kernel version is:

# uname -r
6.8.0-38-generic

Using the Ubuntu 24.04 I just installed, I followed the instructions at:

https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel

I obtained the source using apt rather than git. Here is what was downloaded:

# ls -al
total 226600
drwxrwxr-x  4 root root      4096 Jul 17 16:32 .
drwxrwxrwx  6 root root        65 Jul 17 15:08 ..
drwxr-xr-x 29 root root      4096 Jul 17 16:32 linux-6.8.0
-rw-r--r--  1 root root   1919488 Jun 10 10:49 linux_6.8.0-38.38.diff.gz
-rw-r--r--  1 root root      9222 Jun 10 10:49 linux_6.8.0-38.38.dsc
-rw-r--r--  1 root root 230060117 Mar 15 09:29 linux_6.8.0.orig.tar.gz
drwxr-xr-x  3 root root        83 Jul 17 17:01 linux-signed-6.8.0
-rw-r--r--  1 root root      2620 Jun 10 10:49 linux-signed_6.8.0-38.38.dsc
-rw-r--r--  1 root root     26760 Jun 10 10:49 linux-signed_6.8.0-38.38.tar.xz

I do not have to modify any configuration files.

Then I set the current directory to the root of the kernel directory I downloaded:

# cd linux-6.8.0

The next step does not work:

# fakeroot debian/rules binary-headers binary-generic binary-perarch
fakeroot: FAKEROOTKEY set to 724713999
fakeroot: nested operation not yet supported

I have not been able to figure out what I am doing wrong?

3
  • 3
    First the basic question: Why do you consider it necessary to build the kernel? Commented Jul 18, 2024 at 16:42
  • 2
    I'm coming back to Linux many years. I remember it being easy to build a kernel, though time consuming. First, I wanted to see how the process has changed with the introduction of things like Rust. Second, there is a security project that may involve verifying that what is downloaded can be reproduced from the source. At this point I am trying to gauge the needed effort and resources. Commented Jul 18, 2024 at 17:27
  • For What It's Worth (FWIW!): to compile a kernel is nothing a "normal user" does. So you will need to consider yourself something beyond that, so you may better find a Ubuntu programmer community / group to join to find a valid answer. Also note that those instructions mentions "Disco Dingo" as being "current" - which was released in April 2019 (wiki.ubuntu.com/Releases). I'd say a lot has changed since then. Commented Jul 19, 2024 at 19:05

1 Answer 1

1

This is what I did to build the kernel on ubuntu 24.04. From bash history:

 1000  cd linux-6.8.0/
 1002  chmod a+x debian/rules
 1003  chmod a+x debian/scripts/*
 1004  chmod a+x debian/scripts/misc/*
 1011  apt install libncurses-dev gawk flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf llvm
 1012  fakeroot debian/rules editconfigs
 1015  pico debian.master/changelog 
 1016  fakeroot debian/rules clean
 1017  fakeroot debian/rules binary-headers binary-generic binary-perarch
 1018  echo $?

Edited for clarity, hence the nonconsecutive line numbers. The pico command in line 1015 was to add a custom version string. For me the return code was zero, after a few hours of building on this old computer.

I agree you should be able to build the kernel. In my case I wanted to apply a patch to a wifi driver that was causing oops messages in dmesg and making the wifi/network stack stop working (I applied the broadcom patch in https://gist.github.com/joanbm/9cd5fda1dcfab9a67b42cc6195b7b269 ).

2
  • I have a similar situation - is it possible to only recompile a .ko file in this case and replace it? Commented Jan 16, 2025 at 9:20
  • 1
    Once you've built the kernel, then yes I think you should be able to rebuild only a .ko file that you've modified. With a different driver there should be instructions about how to build/rebuild and install the driver modules. For example this README for a driver I use is very helpful about how to do this: github.com/lwfinger/rtw89/blob/main/README.md Commented Feb 24, 2025 at 23:50

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.