Size: 2934
Comment:
|
Size: 3014
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
This is a worked example of building a Linux 3.3 kernel in May 2012. It does not try to list all possibilities, but should provide the reader with a clear, specific path to build a modern Linux kernel. I include timing info (and system specs) to give you an idea how long to expect the steps to take. | This is a worked example of building a Linux 3.3 kernel in May 2012. It does not try to list all possibilities, but should provide the reader with a clear, specific path to build a modern Linux kernel. I include timing info (and system specs) to give you an idea how long to expect the steps to take on your system. |
Line 7: | Line 7: |
Note that building a single kernel from scratch (using this method) will use about 10GiB of disk. Be sure you have disk space available before starting. (32GiB provided room for the base system plus two kernel trees. | Note that building a single kernel from scratch (using this method) will use about 10GiB of disk. Be sure you have disk space available before starting. (32GiB provided room for the base system plus two kernel trees). |
Line 11: | Line 11: |
Scratch-installing the CD on the VM took about an hour. This led to a booting system. | Scratch-installing the CD on the VM took about an hour. This led to a system that boots. |
Line 20: | Line 20: |
cd ~/Downloads tar xf linux-3.3.6.tar.bz2 }}} | cd ~/Downloads tar xf linux-3.3.6.tar.bz2 }}} |
Line 27: | Line 29: |
sudo apt-get install build-essential }}} | sudo apt-get install build-essential }}} |
Line 34: | Line 37: |
sudo apt-get install libncurses5-dev }}} | sudo apt-get install libncurses5-dev }}} |
Line 39: | Line 43: |
cd linux-3.3.6/ make menuconfig }}} | cd linux-3.3.6/ make menuconfig }}} |
Line 64: | Line 69: |
sudo make modules_install sudo make install | sudo make modules_install sudo make install |
Line 66: | Line 72: |
These take about 4 and 2 minutes respectively. |
"DRAFT" DaveHolt 20120516
This is a worked example of building a Linux 3.3 kernel in May 2012. It does not try to list all possibilities, but should provide the reader with a clear, specific path to build a modern Linux kernel. I include timing info (and system specs) to give you an idea how long to expect the steps to take on your system.
I started with an uninitialized (VMware) virtual machine (1GB Memory, 2 processors (2.8MHz i5 760), and 32GB disk). I downloaded using a nominal 6Mbps ADSL.
Note that building a single kernel from scratch (using this method) will use about 10GiB of disk. Be sure you have disk space available before starting. (32GiB provided room for the base system plus two kernel trees).
Downloading the CD image of Ubuntu 12.04 LTS (desktop 32bit edition) from http://www.ubuntu.com took about an hour.
Scratch-installing the CD on the VM took about an hour. This led to a system that boots.
I ran "Update Manager" from "Dash Home" and let it update. That also took about an hour. You may need to let the system reboot once. You now have a current Ubuntu 12.04 system.
Next, I ran firefox, directing it to http://kernel.org . Clicking on "Latest Stable Kernel" caused the 3.3.6 tree to download (default target ~/Downloads/).
I then did
cd ~/Downloads tar xf linux-3.3.6.tar.bz2
which extracted the source tree in ~/Downloads/Linux-3.3.6/
Next I installed a recommended package for kernel building (sudo for privilege required to install software on system - it may prompt for your password).
sudo apt-get install build-essential
Hit return to tell it to continue.
I then installed ncurses to allow the most basic "graphical" config interface (menuconfig).
sudo apt-get install libncurses5-dev
Now go to the kernel tree, and begin the configuration process.
cd linux-3.3.6/ make menuconfig
In the "General setup" section, select "Local version". Add something to your customized kernel (e.g. initials).
Here are three pictures showing the process:
attachment:3.3.6_view_1.png
attachment:3.3.6_view_2.png
attachment:3.3.6_view_3.png
Exit menuconfig, saving (which writes the hidden file .config ).
Next, begin making the kernel (takes ~90 minutes) with
make
Now elevate your privileges with sudo to install the kernel:
sudo make modules_install sudo make install
These take about 4 and 2 minutes respectively.
Note that this automatically does other necessary updates, including initrd, and updating the grub2 configuration.
After you reboot, as with a command like
sudo shutdown -r now
you will come up running your new kernel, which you can verify with
uname -a
You will see your initials in the name of the running kernel.
Congratulations - you just built a modified Linux kernel!
Now that you have the basic process working, start making more interesting changes.