Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hi, I'm new in this linux base system. I try to compile a kernel due to my project on PMIPv6 which needed several parameter to add on for experiment. I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2012
    Posts
    13

    Build and compiling a kernel


    Hi,

    I'm new in this linux base system. I try to compile a kernel due to my project on PMIPv6 which needed several parameter to add on for experiment. I use Ubuntu 10.04 LTS and my kernel is linux-source-2.6.32.

    This is the way how i compile and configure my kernel :-


    $ apt-get update
    $ apt-get install linux-source
    $ cd /usr/src/
    $ tar xjf linux-source-2.6.32
    $ ln -s /usr/src/linux-source-2.6.32 /usr/src/linux

    Configure them.

    $ apt-get install qt3-apps-dev g++
    $ cd /usr/src/linux-source-XX.XX.XX
    $ make xconfig

    Setting is needed for PMIPv6 Openairinterface :-

    CONFIG_EXPERIMENTAL=y (GENERAL SETUP -> PROMPT FOR DEV AND OR INCOMPLETE DRIVERS)
    CONFIG_SYSVIPC=y (GENERAL SETUP -> SYSTEM V IPC)
    CONFIG_PROC_FS=y
    CONFIG_NET=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> TCP/IP NETWORKING)
    CONFIG_INET=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> TCP/IP NETWORKING)
    CONFIG_IPV6=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> TCP/IP NETWORKING)
    CONFIG_IPV6_MIP6=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> IPV6 PROTOCOL)
    CONFIG_XFRM=y
    CONFIG_XFRM_USER=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> TRANSFORMATION USER CONFIGURATION INTERFACE)
    CONFIG_XFRM_SUB_POLICY=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> TRANSFORMATION SUB POLICY SUPPORT)
    CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> IPV6 PROTOCOL -> IPV6: MIPV6 ROUTE OPTIMISATION MODE)


    CONFIG_IPV6_TUNNEL=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> IPV6 PROTOCOL -> IPV6: IPV6 IN IPV6 TUNNEL)
    CONFIG_IP_ADVANCED_ROUTER=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> IP: ADVANCED ROUTER)
    CONFIG_IPV6_MULTIPLE_TABLES=y


    CONFIG_IPV6_SUBTREES=y


    CONFIG_ARPD=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> IP: ARP DAEMON SUPPORT)


    CONFIG_INET6_ESP=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> IPV6 PROTOCOL -> IPV6 ESP TRANSFORMATION)


    CONFIG_NET_KEY=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> PF_KEY SOCKETS)
    CONFIG_NET_KEY_MIGRATE=y (NETWORKING SUPPORT -> NETWORKING OPTIONS -> PF_KEY SOCKETS -> PF_KEY MIGRATE)
    Do not turn CONFIG_IPV6_MIP6_DEBUG on

    To check my kernel
    $ ./chkconf_kernel.sh /usr/src/linux-source-2.6.32

    Kernel recompilation

    $ cd /usr/src/linux-source-XX.XX.XX
    $ make && make modules_install && make install
    $ mkinitramfs -o /boot/initrd.img-XX.XX.XX XX.XX.XX
    $ update-grub
    $ reboot

    After this step and method.. I always get KERNEL PANIC in result. Can anyone suggest me any tips? or did i do something wrong?

    I did try other method too. How to install UMIP (kernel and userland) .. but still.. a kernel panic. Anyone can help me??

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    have you tried using the existing kernel config file as a baseline for the new kernel? use the "make oldconfig" command to try it out. see the README in the root dir of the kernel source for more details on that command.

  3. #3
    Just Joined!
    Join Date
    Jul 2012
    Posts
    13
    where is the README of the kernel file? btw, i have try use make oldconfig too. will try again and update u my progress

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by lieyza View Post
    where is the README of the kernel file?
    it should be in the root directory of wherever your kernel source was installed/untarred...perhaps:

    Code:
    /usr/src/linux-source-2.6.32/README
    here i think is an online copy of it:

    https://www.assembla.com/code/olipad...-kernel/README

  5. #5
    Just Joined!
    Join Date
    Jul 2012
    Posts
    13
    oo.. thx alot! ermm... i try to compile 'sudo make oldconfig' and everything ok. no error found. but when i try to change with my configuration. the kernel still panic! can u help me what did i do wrong with my step above?

  6. #6
    Just Joined!
    Join Date
    Jul 2012
    Posts
    13
    btw, did every installation will be create the 'menu.lst' file automatically? because when i want to recompile my kernel, i check the 'menu.lst' file and it's empty.

  7. #7
    Just Joined!
    Join Date
    Jul 2012
    Posts
    13
    Quote Originally Posted by atreyu View Post
    it should be in the root directory of wherever your kernel source was installed/untarred...perhaps:

    Code:
    /usr/src/linux-source-2.6.32/README
    here i think is an online copy of it:
    when i recompile my kernel.. i execute

    sudo make
    sudo make modules_install

    and sudo make install i got this
    root@utmmimos:/usr/src/linux-source-2.6.32# sudo make install
    sh /usr/src/linux-source-2.6.32/arch/x86/boot/install.sh 2.6.32.59+drm33.24 arch/x86/boot/bzImage \
    System.map "/boot"
    root@utmmimos:/usr/src/linux-source-2.6.32#
    is this error??

  8. #8
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    i don't think so. to be sure, you can evaluate the $? env var (if using bash as your shell) to show the exit code of the last command run ("make install" in your case). Typically, a "0" means success and a "1" (or anything else) means it did not complete successfully. E.g.:

    Code:
    # /bin/true
    # echo $?
    0
    # /bin/false
    # echo $?
    1
    #
    you can also check the /boot directory for your new kernel, eg.:

    Code:
    ls -ltr /boot/*2.6.32*
    there should also be a directory containing the kernel modules, e.g.:

    Code:
    ls -ltrd /lib/modules/*2.6.32*

  9. #9
    Just Joined!
    Join Date
    Jul 2012
    Posts
    13
    Thank you again atreyu! you really try to help me to fix my kernel panic problem.

    Here i already try again n again to compile my kernel. I already follow your suggestion

    utmmimos@utmmimos:~$ sudo -s
    [sudo] password for utmmimos:
    root@utmmimos:~# /bin/true
    root@utmmimos:~# echo $
    $
    root@utmmimos:~# echo $?
    0
    root@utmmimos:~# /bin/false
    root@utmmimos:~# echo $?
    1

    you can also check the /boot directory for your new kernel, eg.:

    Code:
    ls -ltr /boot/*2.6.32*
    root@utmmimos:~# sudo ls -ltr /boot/*2.6.32*
    -rw-r--r-- 1 root root 4029792 2010-04-16 21:01 /boot/vmlinuz-2.6.32-21-generic
    -rw-r--r-- 1 root root 1687378 2010-04-16 21:01 /boot/System.map-2.6.32-21-generic
    -rw-r--r-- 1 root root 115847 2010-04-16 21:01 /boot/config-2.6.32-21-generic
    -rw-r--r-- 1 root root 640617 2010-04-16 21:01 /boot/abi-2.6.32-21-generic
    -rw-r--r-- 1 root root 1196 2010-04-16 21:03 /boot/vmcoreinfo-2.6.32-21-generic
    -rw-r--r-- 1 root root 4050752 2012-06-13 20:41 /boot/vmlinuz-2.6.32-41-generic
    -rw-r--r-- 1 root root 1694221 2012-06-13 20:41 /boot/System.map-2.6.32-41-generic
    -rw-r--r-- 1 root root 116014 2012-06-13 20:41 /boot/config-2.6.32-41-generic
    -rw-r--r-- 1 root root 652956 2012-06-13 20:41 /boot/abi-2.6.32-41-generic
    -rw-r--r-- 1 root root 1196 2012-06-13 20:42 /boot/vmcoreinfo-2.6.32-41-generic
    -rw-r--r-- 1 root root 8350802 2012-07-19 15:31 /boot/initrd.img-2.6.32-41-generic
    -rw-r--r-- 1 root root 4091232 2012-07-19 19:15 /boot/vmlinuz-2.6.32.59+drm33.24.old
    -rw-r--r-- 1 root root 1667129 2012-07-19 19:15 /boot/System.map-2.6.32.59+drm33.24.old
    -rw-r--r-- 1 root root 115970 2012-07-19 19:15 /boot/config-2.6.32.59+drm33.24.old
    -rw-r--r-- 1 root root 4091232 2012-07-19 23:35 /boot/vmlinuz-2.6.32.59+drm33.24
    -rw-r--r-- 1 root root 1667129 2012-07-19 23:35 /boot/System.map-2.6.32.59+drm33.24
    -rw-r--r-- 1 root root 115970 2012-07-19 23:35 /boot/config-2.6.32.59+drm33.24
    -rw-r--r-- 1 root root 8316755 2012-07-19 23:55 /boot/initrd.img-2.6.32-21-generic

    and the last one

    Code:
    ls -ltrd /lib/modules/*2.6.32*
    [/QUOTE]


    root@utmmimos:~# sudo ls -ltrd /lib/modules/*2.6.32*
    drwxr-xr-x 4 root root 4096 2012-07-19 14:37 /lib/modules/2.6.32-41-generic
    drwxr-xr-x 3 root root 4096 2012-07-19 23:34 /lib/modules/2.6.32.59+drm33.24
    drwxr-xr-x 4 root root 4096 2012-07-19 23:47 /lib/modules/2.6.32-21-generic
    Here i want to tell you that when i run the command

    Code:
     root@utmmimos:/usr/src/linux-source-2.6.32# sudo make modules_install
    at the last result at the terminal i get like this :

    INSTALL ubuntu/rfkill/pbe5.ko
    INSTALL ubuntu/rtl8192se/r8192se_pci.ko
    DEPMOD 2.6.32.59+drm33.24
    root@utmmimos:/usr/src/linux-source-2.6.32#

    what is the DEPMOD mean? btw, as i know, the 2.6.32.59+drm33.24 will be my new kernel to choose at my started boot rite? because i check the configuration file in /boot all the kernel config file and i check my kernel config-2.6.32-21-generic and also my config-2.6.32-41-generic also still same as the old kernel setting. (i didnt configure my 2.6.32-41 kernel, it already exist in my system). The config-2.6.32.59+drm33.24 is the new configuration but when i reboot my laptop, and choose the new kernel configuration.. it still show a command of kernel panic! i feel FRUSTUATED because i already follow every step by step of compiling a new kernel.. still got kernel panic Can i solve my problem

    Please help me. I dont have any clue now. I try everything.. but still kernel panic

  10. #10
    Just Joined!
    Join Date
    Jul 2012
    Posts
    13
    BTW, did my code is right?

    Code:
    root@utmmimos:/boot# sudo mkinitramfs -o initrd.img-2.6.32-21-generic 2.6.32-21-generic
    should i write it like that? or should i write a new kernel initrd.img? but only two file initrf.img exist in my /boot which initrd.img-2.6.32-21-generic and initrd.img-2.6.32-41-generic

    and another one.. you did mention that ubuntu 10.04 used grub2. so should i used
    sudo update-grub
    or
    sudo update-grub2
    ? because when i execute both command, the result are same.

    root@utmmimos:/boot# sudo update-grub2
    Generating grub.cfg ...
    Found linux image: /boot/vmlinuz-2.6.32.59+drm33.24
    Found linux image: /boot/vmlinuz-2.6.32.59+drm33.24.old
    Found linux image: /boot/vmlinuz-2.6.32-41-generic
    Found initrd image: /boot/initrd.img-2.6.32-41-generic
    Found linux image: /boot/vmlinuz-2.6.32-21-generic
    Found initrd image: /boot/initrd.img-2.6.32-21-generic
    Found memtest86+ image: /boot/memtest86+.bin
    Found Windows Vista (loader) on /dev/sda1
    Found Windows Vista (loader) on /dev/sda3
    done
    root@utmmimos:/boot# sudo update-grub
    Generating grub.cfg ...
    Found linux image: /boot/vmlinuz-2.6.32.59+drm33.24
    Found linux image: /boot/vmlinuz-2.6.32.59+drm33.24.old
    Found linux image: /boot/vmlinuz-2.6.32-41-generic
    Found initrd image: /boot/initrd.img-2.6.32-41-generic
    Found linux image: /boot/vmlinuz-2.6.32-21-generic
    Found initrd image: /boot/initrd.img-2.6.32-21-generic
    Found memtest86+ image: /boot/memtest86+.bin
    Found Windows Vista (loader) on /dev/sda1
    Found Windows Vista (loader) on /dev/sda3
    done
    root@utmmimos:/boot#
    as you can see.. there is only two initrd.img " initrd.img-2.6.32-41-generic and initrd.img-2.6.32-21-generic ". is this the problem of the kernel panic?? i dont have any idea. what else should i do??

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •