Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Kernel question

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
imgr8
Posts: 3
Joined: 2010-04-10 04:04

Kernel question

#1 Post by imgr8 »

I am new to debian and linux. Basically I am taking an Operating System Design class and we were asked to download the source code for linux and compile it and boot ubuntu (ubuntu 9.10 on VMWare) with it. I downloaded the newest kernel source code available : linux-2.6.33.2 and compiled it by following instructions at http://www.howtogeek.com/howto/ubuntu/h ... tu-kernel/ It took 6 hours to compile and it created 2 debian files in /usr/src called linux-headers-2.6.31-custom_2.6.31-custom-10.00.Custom_i386.deb and linux-image-2.6.31-custom_2.6.31-custom-10.00.Custom_i386.deb

Now the problem I have is in the next step: The command

Code: Select all

dpkg -i linux-image-2.6.31-custom_2.6.31-custom-10.00.Custom_i386.deb
works fine and finishes without any errors but when I run

Code: Select all

dpkg -i linux-headers-2.6.31-custom_2.6.31-custom-10.00.Custom_i386.deb
It gives
(Reading database ... 173297 files and directories currently installed.)
Preparing to replace linux-headers-2.6.31-custom 2.6.31-custom-10.00.Custom (using linux-headers-2.6.31-custom_2.6.31-custom-10.00.Custom_i386.deb) ...
Unpacking replacement linux-headers-2.6.31-custom ...
Setting up linux-headers-2.6.31-custom (2.6.31-custom-10.00.Custom) ...
dpkg: warning: obsolete option '--print-installation-architecture', please use '--print-architecture' instead.
and it stops. Is there a way to get around this? I do see a linux-headers-2.6.31-custom folder created in the /usr/src directory.

User avatar
AdrianTM
Posts: 2499
Joined: 2004-09-19 01:08

Re: Kernel question

#2 Post by AdrianTM »

I think it's installed, the message that you get "dpkg: warning:" is just that, a "warning".
Ubuntu hate is a mental derangement.

imgr8
Posts: 3
Joined: 2010-04-10 04:04

Re: Kernel question

#3 Post by imgr8 »

But when I do a uname -r it says "2.6.31-20-generic" instead of saying custom. Should I manually switch to the custom one?

User avatar
AdrianTM
Posts: 2499
Joined: 2004-09-19 01:08

Re: Kernel question

#4 Post by AdrianTM »

imgr8 wrote:But when I do a uname -r it says "2.6.31-20-generic" instead of saying custom. Should I manually switch to the custom one?
No, because it's installed but you need to boot into it, you need first to add it to GRUB menu ("update-grub" might do the trick, if not you need to add it manually) and then reboot and select the new option.
Ubuntu hate is a mental derangement.

imgr8
Posts: 3
Joined: 2010-04-10 04:04

Re: Kernel question

#5 Post by imgr8 »

Thanks! Will try that now :)

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Kernel question

#6 Post by stevepusser »

It's also possible, even safer, to build your kernel debs as a regular user in any folder you pick in your home, instead of messing around in /usr/src. Just install fakeroot and add it to the kernel building command, i.e.:

Code: Select all

CONCURRENCY_LEVEL=`getconf _NPROCESSORS_ONLN` fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers
The stuff before fakeroot determines how many cores or cpus you have and uses them to maximum capacity...kind of useless if you only have one core or are using a virtual machine.
MX Linux packager and developer

User avatar
AdrianTM
Posts: 2499
Joined: 2004-09-19 01:08

Re: Kernel question

#7 Post by AdrianTM »

I still haven't found a valid explanation why is bad to use /usr/src I can add myself to src group and then be able to edit files there as simple user and build the kernel with fakeroot, why would building in my home be better?

And if I build in my home the /lib/modules will point there instead of /usr/src/linux...
Ubuntu hate is a mental derangement.

User avatar
nadir
Posts: 5961
Joined: 2009-10-05 22:06
Location: away

Re: Kernel question

#8 Post by nadir »

And if I build in my home the /lib/modules will point there instead of /usr/src/linux...
http://forums.debian.net/viewtopic.php? ... 15#p281296

Code: Select all

cd /lib/modules/<kernel-version>
ln -nsf /usr/src/linux-headers-<kernel-version> build
ln -nsf /usr/src/linux-headers-<kernel-version> source
I think, that's how i did understand it.
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

User avatar
AdrianTM
Posts: 2499
Joined: 2004-09-19 01:08

Re: Kernel question

#9 Post by AdrianTM »

nadir wrote:
And if I build in my home the /lib/modules will point there instead of /usr/src/linux...
http://forums.debian.net/viewtopic.php? ... 15#p281296

Code: Select all

cd /lib/modules/<kernel-version>
ln -nsf /usr/src/linux-headers-<kernel-version> build
ln -nsf /usr/src/linux-headers-<kernel-version> source
I think, that's how i did understand it.
Ok, that makes sense, but still, I don't see any problem with using /usr/src if you add yourself for src group and use fakeroot...
Ubuntu hate is a mental derangement.

User avatar
nadir
Posts: 5961
Joined: 2009-10-05 22:06
Location: away

Re: Kernel question

#10 Post by nadir »

Well: me know it neither, that's for sure.
There are some threads/posts about the why or rather why not, but i don't understand them. The users who advice so sound trustworthy.
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Kernel question

#11 Post by stevepusser »

It's relatively safe to build in /usr/src if you know what you are doing, but really, why do it in a system folder when you don't have to? I always had to create new links to the header folder instead of /usr/src/linux anyway, no matter where I built it. I think if you rename the build folder before installing the debs, the installer will create the correct links to the header files if it can't find the source folder...which is hundreds of times bigger than the headers folder, you have to use compiled source to build modules without the headers, I hear.
MX Linux packager and developer

Post Reply