Let's compile a Linux kernel. To build a kernel, I installed the following packages:
- binutils
- gcc-4.4
- libglade2-dev for "make gconfig"
- libqt3-mt-dev or libqt4-dev for "make xconfig"
- make
- module-init-tools
- patch
libglade2-dev is needed to configure the kernel by running “make gconfig”. In addition, I am going to include the following features.
- unionfs is a union filesystem that allows me to merge several filesystems into a single logical one. It has several uses, such as Live CD's and modifiable read-only filesystem.
- ndiswrapper allows me to use many network devices by installing native Windows drivers.
I downloaded the kernel source and unpacked it.
tar xjvf linux-2.6.38.tar.bz2
cd linux-2.6.38
Then, I applied the unionfs patch.
gzip -dc ../unionfs-2.5.3_for_2.6.18.8.diff.gz | patch -p1 -l
Then, I configured the kernel with a GTK configuration tool.
cp /boot/config-2.6.31.5 .config
make gconfig
Open Makefile with an editor and define EXTRAVERSION if necessary.
Now let's compile the kernel.
make bzImage
make install
make modules
make modules_install
depmod -e -F /boot/System.map-2.6.38 -m 2.6.38
Set the default root device and ramdisk size for the new kernel.
cd /boot
rdev vmlinuz-2.6.38 1,0
ramsize vmlinuz-2.6.38 4096
Finally, compile ndiswrapper (Patches available here).
tar xzf ndiswrapper-1.55.tar.gz
cd ndiswrapper-1.55
KVERS=2.6.31.6 make uninstall
KVERS=2.6.31.6 make
KVERS=2.6.31.6 make install
Generate modules.* files.
depmod -e -m -F /boot/System.map-2.6.31.6 2.6.31.6
No comments:
Post a Comment