Click to See Complete Forum and Search --> : Can i delete this Folder after Kernel Compile
soulestream
01-04-2005, 12:29 AM
i updated to 2.6.10 kernel. i followed the instructions and after a few hickups everthing went well. i untared the kernel into my home directory and compiled it there. i copied the files to my boot directory and everything is okay. can i now delete the linux2.6.10 folder and contents that were created when i untarred the kernel.
soule
gehidore
01-04-2005, 01:10 AM
Originally posted by soulestream
i updated to 2.6.10 kernel. i followed the instructions and after a few hickups everthing went well. i untared the kernel into my home directory and compiled it there. i copied the files to my boot directory and everything is okay. can i now delete the linux2.6.10 folder and contents that were created when i untarred the kernel.
As far as I know that is a bad idea, but it is also a bad idea to untar it to /home again, as far as I know.
what howto told you to untar your kernel to anywhere but /usr/src/ ?
soulestream
01-04-2005, 01:38 AM
johnT
link (http://www.geocities.com/jtarin47/)
soule
davisfactor
01-04-2005, 01:44 AM
It's best to download your kernel tarballs to /usr/src and then uncompress them. After you have uncompressed it, you'll want to symlink it to /usr/src/linux
For example (let's say your kernel file is called kernel-2.6.10):
mv kernel-2.6.10.tgz /usr/src/
cd /usr/src/
tar zxvf kernel-2.6.10.tgz
ln -s kernel-2.6.10 linux
so if you ls -l /usr/src/linux, it will point to /usr/src/kernel-2.6.10
But, to answer your question, no you do not want to delete the directory you compiled your kernel from. The reason for this is because you will want to recompile it again later to add something new, and you'll want that old directory there. This is especially the case if you didn't copy your .config file to /boot/config
And here's my little tip of the day :)
Keep all recent copies of your kernel in boot so you can easily go back to one if a recompile fails.
For example:
1 davis@linux:[~]: ls -l /boot
total 31824
-rw-r--r-- 1 root root 512 2002-07-29 04:30 boot.0200
-rw-r--r-- 1 root root 512 2002-07-23 09:50 boot.0300
-rw-r--r-- 1 root root 512 2004-06-14 00:47 boot.2200
-rw-r--r-- 1 root root 3 2002-11-20 13:39 bootmess.txt
-rw-r--r-- 1 root root 20635 2004-10-17 17:05 config-2.6.5-smp-r10
-rw-r--r-- 1 root root 21568 2004-11-06 16:12 config-2.6.5-smp-r11
-rw-r--r-- 1 root root 21464 2004-11-06 16:41 config-2.6.5-smp-r12
-rw-r--r-- 1 root root 21438 2004-12-28 22:39 config-2.6.5-smp-r13
-rw------- 1 root root 88064 2004-12-28 22:40 map
-rw-r--r-- 1 root root 694270 2004-10-17 17:05 System.map-2.6.5-smp-r10
-rw-r--r-- 1 root root 740772 2004-11-06 16:11 System.map-2.6.5-smp-r11
-rw-r--r-- 1 root root 833613 2004-11-06 16:41 System.map-2.6.5-smp-r12
-rw-r--r-- 1 root root 835237 2004-12-28 22:40 System.map-2.6.5-smp-r13
-rw-r--r-- 1 root root 1532777 2004-10-17 17:05 vmlinuz-2.6.5-smp-r10
-rw-r--r-- 1 root root 1627390 2004-11-06 16:11 vmlinuz-2.6.5-smp-r11
-rw-r--r-- 1 root root 1864231 2004-11-06 16:41 vmlinuz-2.6.5-smp-r12
-rw-r--r-- 1 root root 1872509 2004-12-28 22:39 vmlinuz-2.6.5-smp-r13
2 davis@linux:[~]:
My -r10, -r11 ...etc are my revisions. So -r13 is my 13th kernel compile.
And also keep these in your lilo.conf or your menu.lst (grub) so they will be accessible in your boot menu.
Hope this helps you
-df
cybertron
01-04-2005, 03:04 AM
I think the simple answer to your question is that your computer will still function if you delete that directory, but if you don't need to you shouldn't. Deleting it will make it a royal PIA if you want to recompile at some point in the future. At the very least, if you do delete it back up the .config file so you still have your current configuration saved and don't have to recreate it later.
bwkaz
01-04-2005, 08:02 PM
TOO MUCH MISINFORMATION! GAAH! :D
Sorry, I'm OK now... :)
Originally posted by soulestream
can i now delete the linux2.6.10 folder and contents that were created when i untarred the kernel. If you won't be building external kernel modules, and you don't want to quickly rebuild the kernel with a slightly different configuration later, and you back up your current .config file, yes, you can delete it.
Originally posted by gehidore
As far as I know that is a bad idea, but it is also a bad idea to untar it to /home again, as far as I know. It's not a bad idea unless you need nVidia or ATI drivers or something like that -- stuff that builds into kernel modules requires the source to be in the state that it's in right now. Nothing else requires the kernel sources, at all.
As far as untarring it into /home again, there's no problem doing that anymore either. Kernels now unpack into a directory containing their version number, so you won't step on old versions when you unpack new versions. (Back with 2.4, they all unpacked into a directory named "linux", so you had to be sure you moved the old source before unpacking a new one. But not anymore.)
Originally posted by davisfactor
It's best to download your kernel tarballs to /usr/src and then uncompress them. No it's not. /usr/src is only writable by root, so if you "download them to /usr/src", that means you're running a web browser as root. That's a HORRIBLE idea. The reason IE is so bad on Windows is because everybody runs it as root, so the slightest buffer overflow (witness the <IFRAME> madness a couple months ago) means total machine compromise.
And once the tarballs aren't being saved to /usr/src, there's no reason to be there when you compile them. (Actually, there's ample reason not to -- and it's the same reason. If you build the kernel inside /usr/src, you have to be root to do it. That's a bad idea -- you want to use root as little as possible, to minimize the threat from untrusted people.)
ln -s kernel-2.6.10 linux This is also a bad idea. NOTHING requires that symlink at all, except broken source packages (in other words, cdrecord -- though actually if you don't have the symlink, cdrecord will be better off than if you have it and it's wrong).
Normal userspace source packages do not require it, because they should be using the headers provided by glibc, not the ones provided by the kernel. Kernel modules do need access to the kernel source tree, but they get it through the /lib/modules/<kernel version>/build symlink (which is the reason you don't want to remove the kernel sources if you plan on compiling external modules later).
That covers everything in existence -- it's either kernel modules or userspace, and both of them have alternatives to /usr/src/linux that work better.
Then there's cdrecord (and a very few other programs that do the same thing). By all rights it should be using the glibc headers, but the author swears up and down that the values he's pulling from the kernel headers change between kernels. The problem is, if that's the case, he shouldn't be pulling them from header files (because they will change out from under his program when the user upgrades kernels) -- he should be pulling them from the kernel itself at runtime. (I'm not sure if there's a way to do that though -- I don't know what he's pulling from the headers.)
If they don't actually change, then he needs to be declaring them in a header file that's private to cdrecord.
Originally posted by cybertron
Deleting it will make it a royal PIA if you want to recompile at some point in the future. True, but it will also make it totally impossible to build compliant kernel modules (ones that use /lib/modules/<version>/build). ;)
gehidore
01-04-2005, 08:14 PM
Originally posted by bwkaz
TOO MUCH MISINFORMATION! GAAH! :D
Sorry, I'm OK now... :)
I was hoping he would drop by soon.
je_fro
01-04-2005, 08:16 PM
He has that fit about once a week by my reckoning...
Bwkaz, why don't you just keep a copy of that speech on your clipboard or something...
gehidore
01-04-2005, 08:35 PM
Originally posted by je_fro
He has that fit about once a week by my reckoning...
Bwkaz, why don't you just keep a copy of that speech on your clipboard or something...
Heh, at least I get to be the one who feels like an idiot later :p
cybertron
01-04-2005, 08:53 PM
Originally posted by je_fro
Bwkaz, why don't you just keep a copy of that speech on your clipboard or something...
I suspect he already does;)
BTW, has anyone ever considered compiling all of bwkaz's posts? He's probably written several books worth of Linux information in posts already:)
gehidore
01-04-2005, 08:57 PM
Originally posted by cybertron
I suspect he already does;)
BTW, has anyone ever considered compiling all of bwkaz's posts? He's probably written several books worth of Linux information in posts already:)
Don't you mean "just plain computer info"? :p
davisfactor
01-04-2005, 09:30 PM
Those are good tips, bwkaz, thanks! I didn't realize that the kernel compiles could be performed as a non-root user.
cybertron
01-04-2005, 09:38 PM
Originally posted by gehidore
Don't you mean "just plain computer info"? :p
Ah, of course how silly of me:)
I think I need to stay away from this thread. I seem to be getting corrected a lot in it;)
soulestream
01-05-2005, 12:23 AM
First off this is what i love about linux and the community. there is always a right, a wrong, and a kinda right but maybe wrong way of doing everything. one word FREEDOM. :D
being as a forgot stuff,(my first full nonrpm kernel build) oh about 5 times(ieee,scsi stuff,etc) and had to rebuild, im going to leave it where it is for now. i glad to know i can delete it if i need the room, but between this pc and my servers/other PC im only using like 80 gig of about 400, so it aint going to hurt to leave it for now. thanks to everybody who posted
soule
bwkaz
01-05-2005, 07:59 PM
Originally posted by je_fro
He has that fit about once a week by my reckoning... It's not a fit, it's a...
Aw crap, there I go again. :p You're right, it is. What can I say? ;)
(I'm just glad I wasn't the one that brought the subject of adding a note about the /usr/src/linux former-symlink up on the lfs-dev list a couple days ago. I don't feel quite so weird about it when somebody else is the one saying we should add a note about the kernel docs being out of date (and wrong) where that's concerned.)
As far as keeping it on the clipboard, well... I can't, because it would be overwritten by various URLs that I copy in here to link to things (sometimes even parts of that speech... but not usually). :D Nah, the speech is pretty much committed to memory (though you may notice some differences when I post it -- that's my memory changing, so I insert and delete some comments every time I say it).
cybertron -- a lot of my posts actually don't have much useful information. A lot of them are duplicates, also (I'm not sure how many times I've explained the namespace crusade in my sig to people ;)). There isn't as much information there as you'd think just by looking at the post count, in other words. :)
cybertron
01-05-2005, 10:37 PM
Originally posted by bwkaz
cybertron -- a lot of my posts actually don't have much useful information. A lot of them are duplicates, also (I'm not sure how many times I've explained the namespace crusade in my sig to people ;)). There isn't as much information there as you'd think just by looking at the post count, in other words. :)
Maybe true, but even counting duplicates (which I myself haven't seen many of) you've posted a ton of information here. However, I will accept your humility and not bug you about being a Linux genius anymore:)