You are not logged in.
Warning: Do not do this on a production machine.
If it breaks you get to keep all pieces. No support for this in the Crunchbang Forums!
It works like this:
0. Prerequisites:
apt-get install git build-essential
1. Get a copy of the linux-stable tree:
git clone -o stable \
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git \
linux
cd linux
Or, if you already have a clone of the kernel:
git remote add -f stable \
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git \
linux
cd linux
2. Now for the latest version:
git checkout stable/linux-3.2.y
cp /boot/config-$(uname -r) .config;
# current configuration
make localmodconfig;
# optional: minimize configuration
Go with the default for every question asked - just <enter>
make deb-pkg;
# optionally with -j<num> for parallel build
dpkg -i ../<name of package>
Do this for the kernel package and the firmware package
reboot
into the new kernel
Enjoy
Last edited by xaos52 (2012-02-25 15:08:49)
bootinfoscript - emacs primer - wireless problems- I ♥ #!
Offline
thank you xaos!
Offline
Curious, How to best un-compile as well -
I have compiled Kernels with apt and want to completely remove all related files for some Kernels as no longer needed - for this I used aptitude. However, I noticed /lib/modules and /usr/share still have related files after this removal:
:~$ sudo aptitude remove linux-image-3.2.0-6.dmz.1-liquorix-686 linux-headers-3.2.0-5.dmz.1-liquorix-686
So, how does one complete a better clean-up if desired to remove all Kernel files after install?
Offline
As far as I know, you can not compile a kernel with apt nor aptitude. Both tools install the binary packages.
For removing a package completely use the command
sudo apt-get --purge remove <package name>
I am not sure if removing and purging a kernel removes the associated /lib/modules/kernel-version.
I would have to test if it does.
What I am sure of is that you can remove the directory manually with
sudo rm -rf /lib/modules/<kernel-version-you-want-to-remove>
hth
bootinfoscript - emacs primer - wireless problems- I ♥ #!
Offline
Xaos, how about putting all terminal commands in code tags? That would make this good guide clear to follow
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
I am a #! forum moderator. Feel free to send me a PM with any question you have!
Offline
Compiling allows you to test newer kernels that are not available as binary packages yet. Normally there is no advantage, except if you have brand new hardware that is not, or not well supported in the binary package yet.
bootinfoscript - emacs primer - wireless problems- I ♥ #!
Offline
I am not sure if removing and purging a kernel removes the associated /lib/modules/kernel-version.
I would have to test if it does.
well, getting different results:
- -purge remove....
does remove the /lib/modules/kernel-version as well as /usr/share/bug/kernel-version unless it returns this error:
rmdir: failed to remove `/lib/modules/2.6.33.7.2-rt30-1-686': Directory not empty
dpkg: warning: while removing linux-image-2.6.33.7.2-rt30-1-686, directory '/lib/modules/2.6.33.7.2-rt30-1-686' not empty so not removed.
Offline
I do not know if this is a bug or if it is a safety measure to prevent you from removing the modules inadvertently.
If you are sure you want these removed, then do:
sudo rm -rf /lib/modules/2.6.33.7.2-rt30...
sudo apt-get --purge remove ....
hth
bootinfoscript - emacs primer - wireless problems- I ♥ #!
Offline
In 2 steps:
1. If you installed the new kernel, then remove it like you would with any other kernel. Itwas installed with dpkg -i , so it follows the rules as if it was installed with apt.
2. if you want to get rid of all sources:
remove the top level linux directory:
cd to the directory where you executed the git command
sudo rm -rf linux
sudo rm -rf .git
Last edited by xaos52 (2012-02-25 17:57:54)
bootinfoscript - emacs primer - wireless problems- I ♥ #!
Offline
There are all ready pre-compiled debian packages of the latest liquorix kernels available that always work well for me. You could download the vanilla 3.2.7-1 kernel and then apply the liquorix patch before you compile it, the patch can be found here: http://liquorix.net/sources/3.2.7-1.patch.gz. Alternatively, you could apply the ZEN, SMP, and PREEMPT patches yourself and you would have a kernel that is pretty close to liquorix. There's also some other cool patches you could try out, like the BFS scheduler, that optimize your machine for desktop use.
Offline
This is a good lesson. But, I find it funny that we could compile kernel modules using aptitude such as the Broadcom in the past yet, they have no aptitude .deb setup which would invoke automatically as you've suggested. Break for menu and so on.....
Maybe Debian wouldn't do this but, perhaps in the future Crunch Bang could. It could be one of their MARKS.
Offline
I ended up adding apt source for Kernels: (running 3.2.0-0.bpo.1-486)
## Liquorix Kernel by damentz http://www.liquorix.net/ .
# Secure Apt: apt-get install '^liquorix-([^-]+-)?keyring.?'
# Latest "stable" kernel
deb http://liquorix.net/debian/ sid main
# RC/Beta kernels
#deb http://liquorix.net/debian/ sid main future
applied the keyring - updated
and installed:
3.2.0-7.dmz.1-liquorix-686
so far so good
Offline
Pretty awesome! I've now rolled my own kernel and am using it as we speak.
I did follow a slightly different procedure though, as git was unbearably slow for me (20-30KB/s).
I downloaded the most recent mainline 3.3 from kernel.org, unzipped it in a folder, put a terminal in that folder and then followed the commands you wrote
cp /boot/config-$(uname -r) .config
make localmodconfig
make -j4 deb-pkg
I just installed the deb packages by double-clicking them. A habit from the old days, I guess.
I wonder though, if you don't mind my asking, what does "cp /boot/config-$(uname -r) .config" actually do? Am I right in guessing it just copies the config of the currently installed kernel to the source directory? How does its presence/absence influence the make process?
Offline
Your guess is correct.
It influences the localmodconfig: Only questions that are not answered in the current config are asked.
bootinfoscript - emacs primer - wireless problems- I ♥ #!
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat