Unable to configure the Linux Kernel v3.8.9 source code

07
2014-04
  • Mr X

    I'm running Linux Mint with kernel version 3.8.0-29-generic. So I downloaded and extracted the Linux Kernel 3.8.9 source code and placed the folder in the main directory. Now using the command make menuconfig in the gnome-terminal I get the make error message:

    DALEK linux-3.8.9 # make menuconfig
      HOSTCC  scripts/basic/fixdep
    Segmentation fault
    make[1]: *** [scripts/basic/fixdep] Error 139
    make: *** [scripts_basic] Error 2
    

    So I did a memory test before booting up and there are no memory errors. So what's the problem? FTR I am using a Toshiba satellite L500 with x86_64 architecture. It was suggested by someone else that the kernel source is not configured for this architecture....And if that's the case where might I find a Linux kernel that works for x86_64?

    The reason I'm trying to do this is in preparation to build the kernel source in order to create a kernel module: Is that even necessary with the Kernel already installed???

  • Answers
  • Peter Horvath

    No, the kernel source is architecture-independant. Although some not really supported ancient architectures (f.e. 32bit MIPS) could need local patches, x86_64 isn't one of them.

    Try to increase verbosity to see, what this make does. Maybe the segfault happens not in the compiler, but in the just compiled fixdep binary.

    In both cases, there is a major problem with your kernel source or with your system.

    (You could yet give a try a complete new kernel source download/uncompress, if it broke somehow, then all will be ok)

  • Mr X

    So apparently I thought that the makefile script was using the headers in the /usr/src/linux-headers-3.8.0-29-generic/ folder but it also makes use of the GCC headers in /usr/lib/gcc/x86_64-linux-gnu/4.7.3/include/ folder. As it turns out, many others got the same error(segmentation fault: Error 139). And from the error messages is was the fixdep executable file which was a target of the makefile in the /scripts/basic/ folder whose source code is fixdep.c. One site said something about the "CONFIG_MODULE" listing and I noticed that uses the memcmp function. I had defined that function using some hackneyed inline assembly code I got from somewhere and placed in in the header. So I rewrote that using standard c code and that eliminated the segmentation error entirely!

    I guess that inline assembly code may have been trying to access protected memory which can cause a segmentation error.


  • Related Question

    Compiling the Linux kernel, how much size is needed?
  • ant2009

    I have downloaded the newest most stable Linux kernel, 2.6.33.2.

    I thought I would test this using VirtualBox. So I create a dynamically sized harddisk of 4 GB. And installed CentOS 5.3 with just the minimum packages.

    I setup the make menuconfig with just the default settings.

    After that I ran make and got the following error:

    net/bluetooth/hci_sysfs.o: final close failed: No space left on device
    make[2]: *** [net/bluetooth/hci_sysfs.o] Error 1
    make[1]: *** [net/bluetooth] Error 2
    make: *** [net] Error 2
    

    The amount of space I have left is:

    # df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
                          3.3G  3.3G     0 100% /
    /dev/hda1              99M   12M   82M  13% /boot
    tmpfs                 125M     0  125M   0% /dev/shm
    

    My virtual size is 4 GB, but the actual size is 3.5 GB.

    $ ls -hl
    total 7.5G
    -rw-------. 1 root root 3.5G 2010-04-13 14:08 LFS.vdi
    

    How much size should I give when compiling and installing a Linux kernel? Are there any guidelines to follow when doing this? This is my first time, so just experimenting with this.


  • Related Answers
  • Pro Backup

    An april 2010 linux kernel is about 60MB bzip2 archive, which after unpacking and compiling takes about 400-500MB.

    You can check your directory size with du -hs like:

    /mnt/storage/linux-2.6.33$ du -hs                               
    437M    .
    
  • ukanth

    From Guide,

    NOTE: If you do not have lot of disk space in /usr/src then you can unpack the kernel source package on any partition where you have free disk space (like /home). Because kernel compile needs lot of disk space for object files like *.o. For this reason the /usr/src/linux MUST be a soft link pointing to your source directory.