Rebuild kernel from source

Issues related to applications and software problems and general support
Post Reply
npelov
Posts: 5
Joined: 2007/07/29 10:50:31
Contact:

Rebuild kernel from source

Post by npelov » 2020/03/18 12:28:42

Hi,

Sometimes I need to rebuild the kernel to include some options I need. This time I wanted to include lz4 compression for zram and squashfs. What I usually do is go to sources and get the latest src.rpm from updates directory. However I can't find the src.rpm for the latest kernel on CentOS 8 - kernel-4.18.0-177.el8.x86_64 . I tried googling it and I got to this page:
https://koji.mbox.centos.org/koji/build ... ildID=6505
However when I click download next to the src.rpm I get 403 Request forbidden by administrative rules. Where can I download the latest kernel source rpm from?

pjwelsh
Posts: 2610
Joined: 2007/01/07 02:18:02
Location: Central IL USA

Re: Rebuild kernel from source

Post by pjwelsh » 2020/03/18 13:21:01

Any chance the elrepo kernel-ml (https://elrepo.org/tiki/kernel-ml) provides what you need minus the hard work?

sml
Posts: 113
Joined: 2020/01/17 09:01:44

Re: Rebuild kernel from source

Post by sml » 2020/03/18 13:42:58

@pjwelsh I don't think so: I don't see where kernel-ml-5.5.spec BuildRequires either lz4-devel or pkgconfig(liblz4).

@OP See this bug in the CentOS bug tracker.

(The command dnf --repo=\*-source download --source kernel still works, but tries to download the wrong kernel.)

Meanwhile, instead of dnf download --source kernel just download the kernel source package directly:
http://vault.centos.org/8.1.1911/BaseOS ... _1.src.rpm

User avatar
TrevorH
Forum Moderator
Posts: 28586
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Rebuild kernel from source

Post by TrevorH » 2020/03/18 14:33:51

That is the latest CentOS Stream kernel, well not even the latest, it's several revisions behind the current one. The latest CentSO 8 kernel is kernel-4.18.0-147.5.1.el8_1.x86_64
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

npelov
Posts: 5
Joined: 2007/07/29 10:50:31
Contact:

Re: Rebuild kernel from source

Post by npelov » 2020/03/18 15:44:30

elrepo - not sure about that. The previous bad experience with rpmforge makes me hold back on external repos. epel is the only one I use, hoping that because it's maintained by Fedora (if I understood correctly) it won't die anytime soon. OW btw EPEL managed to mess up my mail server by messing the package names of clamav. Then when they fixed it and I finallup updated clamd stopped working propery and my mail stopped for a day before I realize there was a problem.

Yes, I did install CentOS Stream in order to test/understand how it works and how it evolves. My expectations would be that it should give me what standard centos 8 cannot - so I was expecging already to have lz4 and xz in squashfs without. For now it just makes things harder. Maybe I'll use plain CentOS 8 with EPEL and rebuild the kernel that comes with CentOS 8 (currently kernel-4.18.0-147.5.1.el8_1.src.rpm)

Anyway why the stream source is not available? How is the Stream kernel different than CentOS 8 standard one? Does it have any additional patches or it's just the configuration?

User avatar
TrevorH
Forum Moderator
Posts: 28586
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Rebuild kernel from source

Post by TrevorH » 2020/03/18 16:10:20

You misunderstand what Stream is. It's a preview of what will be in the next RHEL point release at the present time. That still means it will be much the same as the original without new options or massive package version updates.

I believe that the plan is that when RHEL 9 gets nearer, there will be a _different_ Stream version previewing what will eventually make its way into RHEL 9. But that's not yet and not any time soon (RH announced that they will "try" to get major versions out every 3 years from now on so that would put 9 around 2022).

It's likely that you need to look in git.centos.org at the various branches and I suspect Stream will be in there.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

npelov
Posts: 5
Joined: 2007/07/29 10:50:31
Contact:

Re: Rebuild kernel from source

Post by npelov » 2020/03/19 13:53:23

Ow, I did misunderstood what stream is. I heard that description in a video on youtube and I didn't bother to read more about it. Well then I don' really want the source of a kernel that's not production ready. kernel-4.18.0-147.5.1.el8_1 is the one I'm looking for.

Thanks!

User avatar
TrevorH
Forum Moderator
Posts: 28586
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Rebuild kernel from source

Post by TrevorH » 2020/03/19 15:15:03

I would think that the SRPMs for that should be on vault.centos.org and if not, they are in git.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

npelov
Posts: 5
Joined: 2007/07/29 10:50:31
Contact:

Re: Rebuild kernel from source

Post by npelov » 2020/03/23 21:27:39

Does anyone know how to switch from Stream to standard (or how do you call non-stream one, naming is very confusing) linux? I did:

Code: Select all

dnf remove centos-release-stream
dnf distro-sync  --allowerasing
reboot
but many packages stayed in their "Stream-*" versions:

Code: Select all

vim-common.x86_64                   2:8.0.1763-13.el8          @Stream-AppStream
vim-enhanced.x86_64                 2:8.0.1763-13.el8          @Stream-AppStream
vim-filesystem.noarch               2:8.0.1763-13.el8          @Stream-AppStream
vim-minimal.x86_64                  2:8.0.1763-13.el8          @Stream-BaseOS
I did install from Stream CD, so maybe that's the problem. Also this is happening:

Code: Select all

# dnf list kernel
Last metadata expiration check: 0:05:56 ago on Mon 23 Mar 2020 11:19:17 PM EET.
Installed Packages
kernel.x86_64                                  4.18.0-147.5.1.el8_1                                  @BaseOS
kernel.x86_64                                  4.18.0-151.el8                                        @Stream-BaseOS
kernel-4.18.0-177.el8.x86_64 was removed when I did distro-sync, but 4.18.0-151.el8 is still there.

User avatar
TrevorH
Forum Moderator
Posts: 28586
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Rebuild kernel from source

Post by TrevorH » 2020/03/24 00:21:04

The vim packages are the same level in 8.1.1911 as they are in Stream so distro-sync won't touch them and you are stuck with those saying they came form Stream, at least until the next update in 8.1.1911. Not sure about the kernel but -151 is higher than any we have shipped with 8 so I'd just remove it.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 8 - General Support”