Editing
Installation on Linux 2.6
(section)
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Getting the Sources === You'll need the vanilla kernel sources (i.e. those from [http://www.kernel.org kernel.org]) and (of course) a Linux-VServer patch for the kernel version you intend to use. You can find links to both files in our [[Downloads]] section. (Note that for recent kernels, only development versions of the vserver patch exist. You can obtain these from [http://vserver.13thfloor.at/Experimental http://vserver.13thfloor.at/Experimental].) In this document we will use Linux 2.6.22.19 with Linux-VServer 2.2.0.7. First, you have to create a directory for the sources, if you already have one, feel free to skip this step and/or adjust the paths to your needs. <pre> # Create a directory for our sources mkdir ~/src # Switch to that directory cd ~/src </pre> Now that we have a place to store our sources, we need to fetch them. We start with the vanilla sources. <pre> # Get Linux 2.6.22.19 sources wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.19.tar.bz2 # Extract them tar xjf linux-2.6.22.19.tar.bz2 </pre> Now it is time to get the Linux-VServer patch and apply it to the sources. While we're at it, I tell you a nice trick I learned from Bertl, that allows you to keep a lot of source trees on your disk without using up lots of disk space (and this also speeds up 'diff' a lot, which is really nice if you do kernel-hacking). What we do is creating a hard-linked copy of our sources and patch this copy with the Linux-VServer patch. That way, only the patched files use additional disk space (and because hard-linked files are equal by definition, diff doesn't need to compare them). <pre> # Get the Linux-VServer 2.2.0.7 patch wget http://ftp.linux-vserver.org/pub/kernel/vs2.2/patch-2.6.22.19-vs2.2.0.7.diff # Create a hard-linked copy of the vanilla sources, this will get the Linux-VServer patch applied cp -la linux-2.6.22.19 linux-2.6.22.19-vs2.2.0.7 # Switch to that new directory cd linux-2.6.22.19-vs2.2.0.7 # Patch the sources cat ../patch-2.6.22.19-vs2.2.0.7.diff | patch -p1 </pre> Now you have two sources, the vanilla sources for 2.6.22.19 and the Linux-VServer sources for 2.6.22.19-vs2.2.0.7. You might ask "Why do I need two source trees at all? I only want one kernel!" and that's a good question. Here's one answer: Updates! If a new vanilla kernel is released, you can just download the patch from your version to the new version. Otherwise, if you would have applied the patch to your one and only vanilla source tree, you would not be able to do this. The same applies for new Linux-VServer releases. That is, if a new Linux-VServer patch is available, you can simply create another hardlinked copy of your vanilla sources and apply the new patch using the copy. This can really save you time (and bandwidth), since you can keep everything you might need, without wasting a lot of disk space. But be aware that this needs some discipline when hacking the source. Because hard-linked files share the same data on the disk, you need to make sure that your editor does ''The Right Thing'', otherwise you might mess up all your source trees... An even better way of dealing with this, if using more disk space is not a big issue, is to use a version control system. [http://git-scm.com/ Git], for example, is specifically designed for dealing with a project with many different but similar versions, and is in fact used to handle the source code of the Linux kernel itself. Rather than downloading and extract a tarfile, it's possible to directly copy the kernel sources from the Git repository at [git.kernel.org] into your own local repository.
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information