The exercises inlude kernel compilation and installation as well as practicing with loadable modules.
cd /usr/src tar -xjvf linux-2.6.24.tar.bz2 ln -s /usr/src/linux-2.6.24 /usr/src/linux cd /usr/src/linux |
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.24 cp System.map /boot/System.map-2.6.24 mkinitrd -o /boot/initrd.img-2.6.24 2.6.24 |
update-grub |
default 0 timeout 5 color cyan/blue white/blue title Debian GNU/Linux, kernel 2.6.24 root (hd0,0) kernel /boot/vmlinuz-2.6.24 root=/dev/hda1 ro initrd /boot/initrd.img-2.6.24 savedefault boot title Debian GNU/Linux, kernel 2.6.24 (recovery mode) root (hd0,0) kernel /boot/vmlinuz-2.6.24 root=/dev/hda1 ro single initrd /boot/initrd.img-2.6.24 savedefault boot title Debian GNU/Linux, kernel 2.6.18-6-686 root (hd0,0) kernel /boot/vmlinuz-2.6.18-6-686 root=/dev/hda1 ro initrd /boot/initrd.img-2.6.18-6-686 savedefault boot |
uname -r |
cp /usr/src/linux/.config /boot/config-2.6.24 |
cd /boot/grub dd if=stage1 of=/dev/fd0 bs=512 count=1 dd if=stage2 of=/dev/fd0 bs=512 seek=1 |
lsmod |
rmmod iptable_filter ip_tables x_tables |
insmod /lib/modules/2.6.24/kernel/net/netfilter/x_tables.ko |
rmmod x_tables.ko |
insmod /lib/modules/2.6.24/kernel/net/ipv4/netfilter/ip_tables.ko |
modinfo ip_tables |
insmod /lib/modules/2.6.24/kernel/net/netfilter/x_tables.ko insmod /lib/modules/2.6.24/kernel/net/ipv4/netfilter/ip_tables.ko |
rmmod ip_tables rmmod x_tables |
modprobe ip_tables |
![]() | ![]() |