LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS: Error during Linux-3.5.2 kernel compilation (LFS 7.2, Section 8.3) (http://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-error-during-linux-3-5-2-kernel-compilation-lfs-7-2-section-8-3-a-4175439453/)

erkant 11-30-2012 09:31 AM

LFS: Error during Linux-3.5.2 kernel compilation (LFS 7.2, Section 8.3)
 
3 Attachment(s)
I'm having a problem while compiling the kernel. I configured it, and closed as many options as I could (at least I think so). But when I try to build it I get an error that there isn't enough space. I have allocated about 4GB space for my LFS, because I read that just 2.8GB would be enough, but unfortunately I can't compile it. I attached some screenshots, just in order for you to see my problem. Please note that I'm using /mnt/lfs-full directory for my LFS. Also note that in my source directory I have deleted all the untarred folder, so the only untarred folder there is linux-3.5.2, the one of the kernel. Picture with Gparted shows the available space before compiling the kernel.

What if I compile the kernel in my host machine and then just copy the needed files over to my LFS directory?

Keith Hedger 11-30-2012 10:08 AM

It seems your sources folder has taken all the space, after you untar an archive and build and install it are you removing the untared folder? if not this would help.

erkant 11-30-2012 10:30 AM

Yes, after installing the tools, I remove the untared folder. At the moment the only untared folder is linux-3.5.2. If you also look at the picture with Gparted, there you can see the free space I have when linux-3.5.2 is untared. But I don't know why it takes that much space while compiling.

Keith Hedger 11-30-2012 10:44 AM

I just had a look at my kernel folder after compilation and without doing a make clean ( so all the object files are still there ) the folder size is 779,780 bytes, looks like something is haywire, maybe some sort of recursion? Delete the unarchived folder and preferably the archive itself and try again ( you might want to keep the config file ).

spiky0011 11-30-2012 10:47 AM

Hi

Another way untar the tarball in ubuntu then move the untarred dir to lfs as root

The tar ball is 70mb

druuna 11-30-2012 11:32 AM

The linux 3.5.2 build is +/- 5.8 Gb after a make (using defaults gathered by running make mrproper and starting and save/stopping make menuconfig).

The book mentions the size to be anywhere between 540 and 800 Mb, which is wrong.

You might consider the following to reduce the size of the kernel build and create extra disk space:
- unsetting the kernel options that you don't need,
- make the options static instead of modular,
- deleting all, but the linux package from your sources directory. After untarring the linux package, also delete this file.

Not sure if you are going to get it done with the amount of disk-space you have available.....

druuna 11-30-2012 11:43 AM

Update on my previous reply:

Try the following:
Code:

$ cd /sources
untar kernel tarbal if needed
$ cd linux-3.5.2
$ make mrproper
$ make defconfig
$ make (and follow the rest of the book chapter)

The linux build directory tops out at +/- 780 Mb when I do the above.

You probably do have to adjust the options to your liking (which might increase the size).

erkant 11-30-2012 11:45 AM

If the size of linux kernel is about 5.8GBs, I will never be able to get it. I have about 2.2GB of free space initially, even if I delete the packages in my source directory they will save about ~400MB. I also unsetted a lof of the options that I don't need. I even put it in my host machines /usr/src directory and did "make bzImage" command, and the created kernel image was about 3.4MBs. I will try the above mentioned methods and let you know. Thanks.

Keith Hedger 11-30-2012 12:52 PM

Quote:

Originally Posted by druuna (Post 4840314)
The linux 3.5.2 build is +/- 5.8 Gb after a make (using defaults gathered by running make mrproper and starting and save/stopping make menuconfig)....

Really? That big? - Wow never noticed as I always use a big old partition just in case! You live and learn!

P.S. Just found this:http://www.freebsd.org/doc/faq/kerne...why-kernel-big
have a look

druuna 11-30-2012 01:20 PM

Quote:

Originally Posted by Keith Hedger (Post 4840368)
Really? That big? - Wow never noticed as I always use a big old partition just in case! You live and learn!

If you activate all the available options and make them modular there's a whole lot that needs to be build nowadays :)

I did mention that the book was wrong, but I do wonder if the authors had a reasonably tuned kernel in mind. Building a lean and mean kernel is part of the LFS build after all ;)

Quote:

P.S. Just found this:http://www.freebsd.org/doc/faq/kerne...why-kernel-big
have a look
This talks about the kernel itself (the bzImage/vmlinuz file in Linux). And although the general information is correct for Linux, its a freeBSD site.

erkant 11-30-2012 02:44 PM

Make defconfig solved the problem. Thanks druuna!


All times are GMT -5. The time now is 12:23 AM.