Subject: Re: Newer linux-vserver patches?
From: Tor Rune Skoglund <trs@swi.no>
Date: Sat, 9 Apr 2016 10:19:03 +0200
Sat, 9 Apr 2016 10:19:03 +0200
To answer my own question here in case it might help someone else: I 
make this short writeup and also added the same info to the wiki. Please 
feel free to correct and change.

******

As of april 2016 there is no current maintainer for linux-vserver 
kernels on Gentoo. The Gentoo maintainers seem to have adapted a more 
"aggressive" approach related to removing unmaintained Gentoo packages, 
so they have deleted all "old" vserver pre-patched kernels from portage. 
This means that one has to install the vserver patch manually.

However, this is a fairly simple process, depending on whether you find 
a kernel source in portage that has an available linux-vserver kernel 
patch also.

This is what you need to do:

Have a look at Bertl's kernel patches. These are found on 
http://vserver.13thfloor.at/Experimental/ and named "patch-" + the 
kernel version the patch applies for. ("Experimental" is slightly 
misleading...)

You'll then have to find kernel sources for which there is a patch 
available. Take a look into /usr/portage/sys-kernel/vanilla-sources/. 
This is what I've got currently:

amd64 ~ # ls -l /usr/portage/sys-kernel/vanilla-sources/
totalt 228
-rw-r--r-- 1 portage portage 23681 april 6 17:34 ChangeLog
-rw-r--r-- 1 portage portage 104895 nov. 9 04:28 ChangeLog-2013
-rw-r--r-- 1 portage portage 43787 nov. 9 05:11 ChangeLog-2015
-rw-r--r-- 1 portage portage 11396 april 6 17:34 Manifest
-rw-r--r-- 1 portage portage 642 jan. 25 00:06 metadata.xml
-rw-r--r-- 1 portage portage 456 mars 17 10:58 vanilla-sources-3.10.101.ebuild
-rw-r--r-- 1 portage portage 456 mars 18 23:03 vanilla-sources-3.12.57.ebuild
-rw-r--r-- 1 portage portage 456 mars 17 10:58 vanilla-sources-3.14.65.ebuild
-rw-r--r-- 1 portage portage 456 april 6 12:49 vanilla-sources-3.18.30.ebuild
-rw-r--r-- 1 portage portage 456 april 1 12:31 vanilla-sources-3.2.79.ebuild
-rw-r--r-- 1 portage portage 456 mars 22 14:42 vanilla-sources-3.4.111.ebuild
-rw-r--r-- 1 portage portage 456 april 6 12:49 vanilla-sources-4.1.21.ebuild
-rw-r--r-- 1 portage portage 456 mars 17 10:58 vanilla-sources-4.4.6.ebuild
-rw-r--r-- 1 portage portage 456 mars 17 10:58 vanilla-sources-4.5.0.ebuild

Unfortunately, at this time of writing no patch exists for any of the 
most recent kernels from that list.*If* it did, then install that 
version and skip the next step and use the chosen kernel as the kernel 
to install and patch later in this short writeup.

There is also a "gentoo-sources" kernel source alternative. These kernel 
are slightly patched with Gentoo updates. However, it is my impression 
that these kernels are not so heavily patched by Gentoo that they 
couldn't accept the linux-vserver patch also.

Here is my Gentoo-sources:

amd64 ~ # ls -l /usr/portage/sys-kernel/gentoo-sources/
totalt 500
-rw-r--r-- 1 portage portage 36798 april 6 17:34 ChangeLog
-rw-r--r-- 1 portage portage 91971 nov. 9 04:28 ChangeLog-2007
-rw-r--r-- 1 portage portage 101665 nov. 9 04:28 ChangeLog-2012
-rw-r--r-- 1 portage portage 119486 nov. 9 05:11 ChangeLog-2015
-rw-r--r-- 1 portage portage 766 mars 17 00:18 gentoo-sources-3.10.101.ebuild
-rw-r--r-- 1 portage portage 757 jan. 24 12:50 gentoo-sources-3.10.95.ebuild
<...several kernels deleted to save space...>
-rw-r--r-- 1 portage portage 770 okt. 26 13:05 gentoo-sources-4.0.9.ebuild
-rw-r--r-- 1 portage portage 787 jan. 10 11:32 gentoo-sources-4.1.12.ebuild
-rw-r--r-- 1 portage portage 786 mars 21 12:45 gentoo-sources-4.1.15-r1.ebuild
-rw-r--r-- 1 portage portage 794 mars 18 19:57 gentoo-sources-4.1.20.ebuild
-rw-r--r-- 1 portage portage 794 april 6 15:49 gentoo-sources-4.1.21.ebuild
-rw-r--r-- 1 portage portage 793 mars 17 00:56 gentoo-sources-4.4.6.ebuild
-rw-r--r-- 1 portage portage 793 mars 29 14:53 gentoo-sources-4.5.0-r1.ebuild
-rw-r--r-- 1 portage portage 40428 april 6 17:34 Manifest
-rw-r--r-- 1 portage portage 705 jan. 25 00:06 metadata.xml

There is a match. http://vserver.13thfloor.at/Experimental/ has a patch 
for 4.1.12, so let's install the 4.1.12 gentoo-sources and try the 
linux-vserver patch on it.

amd64 ~ # emerge -v =sys-kernel/gentoo-sources-4.1.12

Then download the corresponding patch from 13thfloor and save it into 
the same directory as the emerged kernel sources which in this case is 
/usr/src/gentoo-sources-4.1.12 .

cd into that source directory and install the linux-vserver kernel patch:

amd64 ~ # cd /usr/src/linux-4.1.12-gentoo/

amd64 linux-4.1.12-gentoo # patch -p1 < patch-4.1.12-vs2.3.8.3.diff
patching file Documentation/vserver/debug.txt
patching file Makefile
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej
patching file arch/alpha/Kconfig
patching file arch/alpha/kernel/systbls.S
patching file arch/alpha/kernel/traps.c
patching file arch/arm/Kconfig
<...further output deleted...>

Hopefully there shouldn't be any serious rejects. The only reject I got 
was the makefile itself. By looking at the .rej file, it is just the 
EXTRAVERSION that failed since EXTRAVERSION is already set to "-gentoo" 
by gentoo-sources. So you can rather just edit EXTRAVERSION line the 
makefile manually to whatever you like or keep it as it is.

Makefile.rej:

--- Makefile 2015-10-29 09:20:01.000000000 +0000
+++ Makefile 2015-10-30 14:51:48.000000000 +0000
@@ -1,7 +1,7 @@
  VERSION = 4
  PATCHLEVEL = 1
  SUBLEVEL = 12
-EXTRAVERSION =
+EXTRAVERSION = -vs2.3.8.3
  NAME = Series 4800
  
  # *DOCUMENTATION*

Then configure the kernel as you like using e.g. make menuconfig, then 
make and make modules_install and install the kernel itself your usual way.




Den 30. mars 2016 17:12, skrev Tor Rune Skoglund:
> Hi List,
>
> I ran into an issue with network namespaces that seems to be fixed in a
> newer kernel (4.1.15) than the linux-3.18.7-vserver-2.3.7.4 which was
> included as the last one in Gentoo (until recently - as there is no
> Gentoo Vserver maintainer atm, that one also seem to be gone now).
>
> Anyway, any recommendation on patchset for newer kernels than the above?
>
> BR,
> Tor Rune Skoglund
>



To answer my own question here in case it might help someone else: I make this short writeup and also added the same info to the wiki. Please feel free to correct and change.

******

As of april 2016 there is no current maintainer for linux-vserver kernels on Gentoo. The Gentoo maintainers seem to have adapted a more "aggressive" approach related to removing unmaintained Gentoo packages, so they have deleted all "old" vserver pre-patched kernels from portage. This means that one has to install the vserver patch manually.

However, this is a fairly simple process, depending on whether you find a kernel source in portage that has an available linux-vserver kernel patch also. 

This is what you need to do:

Have a look at Bertl's kernel patches. These are found on http://vserver.13thfloor.at/Experimental/ and named "patch-" + the kernel version the patch applies for. ("Experimental" is slightly misleading...)

You'll then have to find kernel sources for which there is a patch available. Take a look into /usr/portage/sys-kernel/vanilla-sources/. This is what I've got currently:

amd64 ~ # ls -l /usr/portage/sys-kernel/vanilla-sources/
totalt 228
-rw-r--r-- 1 portage portage 23681 april 6 17:34 ChangeLog
-rw-r--r-- 1 portage portage 104895 nov. 9 04:28 ChangeLog-2013
-rw-r--r-- 1 portage portage 43787 nov. 9 05:11 ChangeLog-2015
-rw-r--r-- 1 portage portage 11396 april 6 17:34 Manifest
-rw-r--r-- 1 portage portage 642 jan. 25 00:06 metadata.xml
-rw-r--r-- 1 portage portage 456 mars 17 10:58 vanilla-sources-3.10.101.ebuild
-rw-r--r-- 1 portage portage 456 mars 18 23:03 vanilla-sources-3.12.57.ebuild
-rw-r--r-- 1 portage portage 456 mars 17 10:58 vanilla-sources-3.14.65.ebuild
-rw-r--r-- 1 portage portage 456 april 6 12:49 vanilla-sources-3.18.30.ebuild
-rw-r--r-- 1 portage portage 456 april 1 12:31 vanilla-sources-3.2.79.ebuild
-rw-r--r-- 1 portage portage 456 mars 22 14:42 vanilla-sources-3.4.111.ebuild
-rw-r--r-- 1 portage portage 456 april 6 12:49 vanilla-sources-4.1.21.ebuild
-rw-r--r-- 1 portage portage 456 mars 17 10:58 vanilla-sources-4.4.6.ebuild
-rw-r--r-- 1 portage portage 456 mars 17 10:58 vanilla-sources-4.5.0.ebuild

Unfortunately, at this time of writing no patch exists for any of the most recent kernels from that list. If it did, then install that version and skip the next step and use the chosen kernel as the kernel to install and patch later in this short writeup.

There is also a "gentoo-sources" kernel source alternative. These kernel are slightly patched with Gentoo updates. However, it is my impression that these kernels are not so heavily patched by Gentoo that they couldn't accept the linux-vserver patch also. 

Here is my Gentoo-sources:

amd64 ~ # ls -l /usr/portage/sys-kernel/gentoo-sources/
totalt 500
-rw-r--r-- 1 portage portage 36798 april 6 17:34 ChangeLog
-rw-r--r-- 1 portage portage 91971 nov. 9 04:28 ChangeLog-2007
-rw-r--r-- 1 portage portage 101665 nov. 9 04:28 ChangeLog-2012
-rw-r--r-- 1 portage portage 119486 nov. 9 05:11 ChangeLog-2015
-rw-r--r-- 1 portage portage 766 mars 17 00:18 gentoo-sources-3.10.101.ebuild
-rw-r--r-- 1 portage portage 757 jan. 24 12:50 gentoo-sources-3.10.95.ebuild
<...several kernels deleted to save space...>
-rw-r--r-- 1 portage portage 770 okt. 26 13:05 gentoo-sources-4.0.9.ebuild
-rw-r--r-- 1 portage portage 787 jan. 10 11:32 gentoo-sources-4.1.12.ebuild
-rw-r--r-- 1 portage portage 786 mars 21 12:45 gentoo-sources-4.1.15-r1.ebuild
-rw-r--r-- 1 portage portage 794 mars 18 19:57 gentoo-sources-4.1.20.ebuild
-rw-r--r-- 1 portage portage 794 april 6 15:49 gentoo-sources-4.1.21.ebuild
-rw-r--r-- 1 portage portage 793 mars 17 00:56 gentoo-sources-4.4.6.ebuild
-rw-r--r-- 1 portage portage 793 mars 29 14:53 gentoo-sources-4.5.0-r1.ebuild
-rw-r--r-- 1 portage portage 40428 april 6 17:34 Manifest
-rw-r--r-- 1 portage portage 705 jan. 25 00:06 metadata.xml

There is a match. http://vserver.13thfloor.at/Experimental/ has a patch for 4.1.12, so let's install the 4.1.12 gentoo-sources and try the linux-vserver patch on it.

amd64 ~ # emerge -v =sys-kernel/gentoo-sources-4.1.12

Then download the corresponding patch from 13thfloor and save it into the same directory as the emerged kernel sources which in this case is /usr/src/gentoo-sources-4.1.12 .

cd into that source directory and install the linux-vserver kernel patch:

amd64 ~ # cd /usr/src/linux-4.1.12-gentoo/
amd64 linux-4.1.12-gentoo # patch -p1 < patch-4.1.12-vs2.3.8.3.diff 
patching file Documentation/vserver/debug.txt
patching file Makefile
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej
patching file arch/alpha/Kconfig
patching file arch/alpha/kernel/systbls.S
patching file arch/alpha/kernel/traps.c
patching file arch/arm/Kconfig
<...further output deleted...>

Hopefully there shouldn't be any serious rejects. The only reject I got was the makefile itself. By looking at the .rej file, it is just the EXTRAVERSION that failed since EXTRAVERSION is already set to "-gentoo" by gentoo-sources. So you can rather just edit EXTRAVERSION line the makefile manually to whatever you like or keep it as it is.

Makefile.rej:

--- Makefile 2015-10-29 09:20:01.000000000 +0000
+++ Makefile 2015-10-30 14:51:48.000000000 +0000
@@ -1,7 +1,7 @@
 VERSION = 4
 PATCHLEVEL = 1
 SUBLEVEL = 12
-EXTRAVERSION =
+EXTRAVERSION = -vs2.3.8.3
 NAME = Series 4800
 
 # *DOCUMENTATION*

Then configure the kernel as you like using e.g. make menuconfig, then make and make modules install and install the kernel itself your usual way.




Den 30. mars 2016 17:12, skrev Tor Rune Skoglund:
Hi List,

I ran into an issue with network namespaces that seems to be fixed in a
newer kernel (4.1.15) than the linux-3.18.7-vserver-2.3.7.4 which was
included as the last one in Gentoo (until recently - as there is no
Gentoo Vserver maintainer atm, that one also seem to be gone now).

Anyway, any recommendation on patchset for newer kernels than the above?

BR,
Tor Rune Skoglund