Building the Kernel

From Linux PARISC Wiki
Jump to: navigation, search
IMPORTANT: The content of this page is outdated. Please check draft version instead.

If you are only interested in using Linux/PARISC then please see the software information web page.

We no longer advise using the pre-built cross compiler to build a parisc kernel on an x86 linux host. Native compiler/linker tools are better maintained. The old mini-howto describes how to cross-build kernels for Net Boot. Please only bother with this if you have a very slow parisc machine and very fast x86 machine.

Prerequisites For Building Kernels

How To Build a Kernel

Here are details developers care about in order to modify, build, test parisc-linux kernels. Note that just because a kernel option can be select, does NOT mean it works. Trial and error is usually the only sure way to find out. Reports of such adventures are always welcome on the parisc-linux mailing list.

  1. Install tools
    apt-get install kernel-package gcc binutils lib6-dev
    
  2. Obtain kernel source: Stable kernel sources are available via apt-get install linux-source-XX (where XX is something like "2.4.25-32" or "2.6.6-32").
  3. Configure Kernel Options
    cd /usr/src/linux-2.6
    # clone the nearest _config to start with
    cp arch/parisc/configs/b180_config .config
    # You can also "make config" or "make menuconfig" here
    # to adjust the .config if kernel defaults don't suit you.
    make oldconfig
    
  4. Build Kernel Executables
    # current
    make
    
    # 2.4.x needs several steps instead:
    #	make -j2 dep && make vmlinux && make modules
     
    # must be root user
    make modules_install
    
  5. Installing the kernel The resulting kernel image is /usr/src/linux-2.6/vmlinux. Normally, x86-linux will save the existing vmlinux and install the new kernel with make install. The "dpkg -i" steps above do about the same thing. Here is one way to do it manually:
    cd /boot
    mv vmlinux vmlinux.old
    mv System.map System.map.old
    cd /usr/src/linux-2.6
    cp System.map vmlinux /boot/
    sync
    reboot
    

    NOTE: One does not need to run palo when replacing an existing kernel.

    Another way is to rename vmlinux with revision info, reboot, interrupt autoboot and specify interactive boot, specify the new kernel via palo, and finally once the new kernel is booted, modify /etc/palo.conf to match (and run palo again). Start with something like:

    cp vmlinux /boot/vmlinux-2.6.6-pa1
    cp System.map /boot/System.map-2.6.6-pa1
    cp .config /boot/config-2.6.6-pa1
    sync
    reboot
    ...
    
Personal tools