GitKernelBuild

Differences between revisions 8 and 9
Revision 8 as of 2008-01-10 20:25:59
Size: 5525
Editor: c-71-59-213-167
Comment: Added firmware bit
Revision 9 as of 2008-01-15 16:43:55
Size: 5532
Editor: c-67-160-148-53
Comment: link directly to git-bisect section
Deletions are marked like this. Additions are marked like this.
Line 66: Line 66:
   * http://www.kernel.org/doc/local/git-quick.html    * http://www.kernel.org/doc/local/git-quick.html#bisect

Many times patches for bugs are committed upstream but have yet to make their way down to the Ubuntu kernel. It is often helpful if users are able to verify if the upstream patches do indeed resolve the issue they are witnessing. Likewise, in the opposite situation, it is useful to know if a bug may still exist upstream.

The following document should help users build their own kernel from the upstream mainline kernel to help verify if a bug still exists or not. If a bug is still present in the upstream kernel, it is encouraged that the bug be reported to http://bugzilla.kernel.org . The bug submission process for http://bugzilla.kernel.org is outlined at the end of the document. Please note that the following steps are targeted towards Ubuntu users and focuses on building the mainline kernel from the git repository at http://git.kernel.org .

Prerequisites

There are a few tools that are necessary in order to build your own kernel(s). The 'git-core' package provides the git revision control system which will be used to clone the mainline git repository. The 'kernel-package' provides the make-kpkg utility which automatically build your kernel and generate the linux-image and linux-header .deb files which can be installed. You will need to install both of these packages.

sudo apt-get install git-core kernel-package fakeroot

Kernel Build and Installation

  1. Change to the directory where you want to clone the git tree. In this example we will use /usr/src
    • {{{ cd /usr/src

}}}

  1. Clone the mainline kernel git tree.
    • {{{ sudo git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

}}}

  1. Change to linux-2.6 directory.
    • {{{ cd linux-2.6

}}}

  1. Copy the kernel config file from your existing system to the kernel tree.
    • {{{ sudo cp /boot/config-uname -r .config

}}}

  1. Bring the config file up to date. (Answer any questions that get prompted).
    • {{{ sudo make oldconfig

}}}

  1. (optional) If you need to make any kernel config changes, do the following and save your changes when prompted:
    • {{{ sudo make menuconfig

}}}

  1. Clean the kernel source directory.
    • {{{ sudo make-kpkg clean

}}}

  1. Build the linux-image and linux-header .deb files.
    • {{{ sudo fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers

}}}

  1. Change to one directory level up (this is where the linux-image and linux-header .deb files were put)
    • {{{ cd ..

}}}

  1. Now install the .deb files. In this example, the files are linux-image-2.6.24-rc5-custom_2.6.24-rc5-custom-10.00.Custom_i386.deb and linux-headers-2.6.24-rc5-custom_2.6.24-rc5-custom-10.00.Custom_i386.deb. You may receive warnings about '/lib/firmware/2.6.24-rc5-custom/' - this is expected and will only be problematic if the driver you are trying to test requires firmware.
    • {{{ sudo dpkg -i linux-image-2.6.24-rc5-custom_2.6.24-rc5-custom-10.00.Custom_i386.deb

sudo dpkg -i linux-headers-2.6.24-rc5-custom_2.6.24-rc5-custom-10.00.Custom_i386.deb }}}

  1. You are now ready to boot into your new kernel. Just make sure you select the new kernel when you boot.
    • {{{ sudo reboot

}}}

Reporting Bugs Upstream

Unfortunately it is sometimes the case that bugs can still exist in the mainline kernel. The mainline kernel has their own bugtracking system at http://bugzilla.kernel.org . It would be helpful if you would also report your bug there. It is often the case that once a bug is escalated upstream there is a quick resolution through the help and support of the mainline kernel community. Bug reports in Launchpad can also be set up to monitor bugs reported in other bugtracking systems. The following steps should help you report your bug upstream and monitor it in Launchpad:

  1. Go to http://bugzilla.kernel.org

  2. Verify your bug does not already exist in the upstream bugtracking system.
    1. If it does exist, please add any useful information that may be lacking in the current report.
      • Link your Launchpad report to the upstream kernel bug report (see step 5).
    2. If your bug does not exist, proceed to the next step.
  3. Enter your bug report at http://bugzilla.kernel.org/enter_bug.cgi . Follow the instructions on that page.

  4. When creating your bug report be sure to _attach_ any relevant information. This will usually include:
    1. the version of the kernel you are running (uname -r)
    2. dmesg output.
    3. lspci -vvnn output.
    4. If the bug is about interrupts, then /proc/interrupts is also helpful.
    5. If a BIOS issue is suspected, dmidecode output is also helpful.
    6. If the bug is regarding memory oddities, /proc/mtrr info is also helpful.
    7. Most importantly, if this is a regression, the best information you can provide the kernel developers is the information from doing a git bisect. This will hopefully narrow down the exact patch that is causing the regression. The following link will help you through this process.
  5. After you've reported your bug to the kernel bugzilla, remember to set up your Launchpad bug report to monitor the upstream bugzilla report.
    1. On your Launchpad bug report page, look in the "Actions" area on the left hand side of the page.
    2. Click the "Also affects project" link.
    3. Enter the URL of your bugzilla report.
    4. Click the "Add to Bug Report" button.
    5. Your Launchpad report is now monitoring your upstream bugzilla report.

KernelTeam/GitKernelBuild (last edited 2021-04-10 11:22:56 by pmaydell)