Kernel question

New to Debian (Or Linux in general)? Ask your questions here!

Kernel question

Postby imgr8 » 2010-04-10 04:19

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.
imgr8
 
Posts: 3
Joined: 2010-04-10 04:04

Re: Kernel question

Postby AdrianTM » 2010-04-10 04:27

I think it's installed, the message that you get "dpkg: warning:" is just that, a "warning".
Ubuntu hate is a mental derangement.
User avatar
AdrianTM
 
Posts: 2520
Joined: 2004-09-19 01:08

Re: Kernel question

Postby imgr8 » 2010-04-10 04:31

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?
imgr8
 
Posts: 3
Joined: 2010-04-10 04:04

Re: Kernel question

Postby AdrianTM » 2010-04-10 04:37

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.
User avatar
AdrianTM
 
Posts: 2520
Joined: 2004-09-19 01:08

Re: Kernel question

Postby imgr8 » 2010-04-10 04:45

Thanks! Will try that now :)
imgr8
 
Posts: 3
Joined: 2010-04-10 04:04

Re: Kernel question

Postby stevepusser » 2010-04-11 04:58

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.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Calibre 3.48.0, QMPlay2 19.09.03, wine-staging 4.16, Telegram-desktop 1.8.8, Pale Moon 28.7.1, Waterfox 56.2.14
User avatar
stevepusser
 
Posts: 11097
Joined: 2009-10-06 05:53

Re: Kernel question

Postby AdrianTM » 2010-04-11 05:04

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
AdrianTM
 
Posts: 2520
Joined: 2004-09-19 01:08

Re: Kernel question

Postby nadir » 2010-04-11 05:11

And if I build in my home the /lib/modules will point there instead of /usr/src/linux...

viewtopic.php?f=10&t=48897&start=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
nadir
 
Posts: 5964
Joined: 2009-10-05 22:06
Location: away

Re: Kernel question

Postby AdrianTM » 2010-04-11 05:15

nadir wrote:
And if I build in my home the /lib/modules will point there instead of /usr/src/linux...

viewtopic.php?f=10&t=48897&start=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
AdrianTM
 
Posts: 2520
Joined: 2004-09-19 01:08

Re: Kernel question

Postby nadir » 2010-04-11 05:23

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
nadir
 
Posts: 5964
Joined: 2009-10-05 22:06
Location: away

Re: Kernel question

Postby stevepusser » 2010-04-12 06:19

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.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Calibre 3.48.0, QMPlay2 19.09.03, wine-staging 4.16, Telegram-desktop 1.8.8, Pale Moon 28.7.1, Waterfox 56.2.14
User avatar
stevepusser
 
Posts: 11097
Joined: 2009-10-06 05:53


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 1 guest

fashionable