The exercises inlude kernel patching, compilation and installation as well as practicing with loadable modules.
cd /usr/src tar -xjvf linux-2.6.19.tar.bz2 ln -s /usr/src/linux-2.6.19 /usr/src/linux cd /usr/src/linux cp /usr/src/patch-2.6.19.2.bz2 . bzip2 -d patch-2.6.19.2.bz2 patch -p1 < patch-2.6.19.2 |
apt-get install kernel-package libdb3-dev libncurses-dev initrd-tools |
lspci |
make mrproper |
make menuconfig |
make dep make clean make bzImage make modules make modules_install |
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.19.2 cp System.map /boot/System.map-2.6.19.2 mkinitrd -o /boot/initrd.img-2.6.19.2 2.6.19.2 |
update-grub |
default 0 timeout 5 color cyan/blue white/blue title Debian GNU/Linux, kernel 2.6.19.2 root (hd0,0) kernel /boot/vmlinuz-2.6.19.2 root=/dev/hda1 ro initrd /boot/initrd.img-2.6.19.2 savedefault boot title Debian GNU/Linux, kernel 2.6.19.2 (recovery mode) root (hd0,0) kernel /boot/vmlinuz-2.6.19.2 root=/dev/hda1 ro single initrd /boot/initrd.img-2.6.19.2 savedefault boot title Debian GNU/Linux, kernel 2.6.18-3-686 root (hd0,0) kernel /boot/vmlinuz-2.6.18-3-686 root=/dev/hda1 ro initrd /boot/initrd.img-2.6.18-3-686 savedefault boot |
uname -r |
cp /usr/src/linux/.config /boot/config-2.6.19.2 |
cd /boot/grub dd if=stage1 of=/dev/fd0 bs=512 count=1 dd if=stage2 of=/dev/fd0 bs=512 seek=1 |
lsmod |
insmod /lib/modules/2.6.19.2/kernel/net/netfilter/x_tables.ko |
rmmod x_tables.ko |
insmod /lib/modules/2.6.19.2/kernel/net/ipv4/netfilter/ip_tables.ko |
modinfo ip_tables |
insmod /lib/modules/2.6.19.2/kernel/net/netfilter/x_tables.ko insmod /lib/modules/2.6.19.2/kernel/net/ipv4/netfilter/ip_tables.ko |
rmmod ip_tables rmmod x_tables |
modprobe ip_tables |