czwartek, 21 maja 2009

INET QoS - przygotowanie systemu dla routera - kompilacja kernela, iptables, iproute

Odnośnie kompilacji jądra, fajny materiał jest pod adresem:
http://www.eioba.pl/a69850/kompilacja_jadra_linux

Dodatkowa pomoc:
http://jarekm3.ovh.org/index.php?menu=Code_maturity_level_options&grupa=0&strona=opis_konfiguracji.php&odw=1
http://www.linuxbox.pl/index.php?go=kernel

Poniższe przerobione z sukcesem na Debianie (wg http://dziennik-it.blogspot.com/2009/05/instalator-debiana-na-pamieci-flash.html)

apt-get update
apt-get upgrade
apt-get install mc
apt-get install ssh

Odtąd już można zdalnie przez ssh:

apt-get install bzip2 gcc g++ build-essential kernel-package libncurses5-dev
apt-get install zlib1g-dev libssl-dev
apt-get install dh-make
apt-get install fakeroot
apt-get install bison
apt-get install flex
apt-get install libdb4.6++-dev
apt-get install pciutils
apt-get install autotools-dev

cd /root

wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.7.tar.bz2
wget http://www.inet.one.pl/download/system/system-source-2.6.24.7-1.tar.gz

cp linux-2.6.24.7.tar.bz2 /usr/src

cd /usr/src
tar -jxvf linux-2.6.24.7.tar.bz2
ln -s linux-2.6.24.7 linux

cd /root
cp system-source-2.6.24.7-1.tar.gz /usr/src
cd /usr/src
tar xvf system-source-2.6.24.7-1.tar.gz
cp system-source-2.6.24.7-1/kernel/kernel-2.6.24.7.diff /usr/src/linux

cd /usr/src/linux

patch -p1 < kernel-2.6.24.7.diff

cd /usr/src/
cp system-source-2.6.24.7-1/kernel/.config /usr/src/linux

cd /usr/src/linux
make menuconfig

- - - Load alternative configuration file -> .config

- - - General setup ---> Prompt for development and/or incomplete code/drivers (odznaczone)

- - - Processor type and features -> Core2 / newer XEON
- - - Device Drivers -> Multiple devices driver support (RAID and LVM) -> wszystkie zaznaczone w podgałęziach
- - - Serial ATA (prod) and Parallel ATA (experimental) drivers --->
- - - - - - AHCI SATA support
- - - - - - Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support
- - - Character devices ---> IPMI top-level message handler ---> zaznaczone wszystkie jak leci
- - - Device Drivers -> I2C support -> wszystkie jak leci + chyba że wyraźnie nie dotyczą Intela
- - - Device Drivers -> HID Devices ---> wszystkie jak leci
- - - Device Drivers -> DMA Engine support ---> wszystkie jak leci

- - - General setup ---> Prompt for development and/or incomplete code/drivers (zaznaczone)

- - - Networking -> Networking Options -> Network packet filtering framework (Netfilter) -> wszystkie gałęzie
co się da jako moduł / reszta na *

make
make-kpkg --revision 1.0 --append-to-version -router -initrd --initrd kernel_image
cd ..
dpkg -i linux-image-2.6.24.7-router_1.0_i386.deb

reboot

cd /usr/src/system-source-2.6.24.7-1/iptables/iptables-1.4.0
make clean
make
dh_make -s -f ../iptables-1.4.0.tar.bz2
dpkg-buildpackage -rfakeroot
dpkg -i ../iptables_1.4.0-1_i386.deb

cd /usr/src/system-source-2.6.24.7-1/iproute2/iproute2-2.6.25
make clean
./configure
make
dh_make -s -f ../iproute2-2.6.25.tar.bz2
dpkg-buildpackage -rfakeroot
dpkg -i ../iproute2_2.6.25-1_i386.deb

cd /root
wget http://www.inet.one.pl/download/config/+20090215.tar.gz
tar xvf +20090215.tar.gz
cp /root/+20090215/rc.* /sbin

cd /root
wget http://sunet.dl.sourceforge.net/sourceforge/l7-filter/l7-protocols-2009-05-10.tar.gz
tar xvf l7-protocols-2009-05-10.tar.gz
mkdir /etc/l7-protocols
cp /root/l7-protocols-2009-05-10/protocols/* /etc/l7-protocols/


--- dodatki ---

Testowe sprawdzenie czy nie ma błędów:
/sbin/rc.firewall start > /root/firewall.log && /sbin/rc.firewall stop

Ewentualna deinstalacja po ponownej rekompilacji przed nową instalacją:
dpkg -P linux-image-2.6.24.7-router


--- odnośnie sprzętu ---


lspci -k

00:00.0 Host bridge: Intel Corporation 82X38/X48 Express DRAM Controller
00:01.0 PCI bridge: Intel Corporation 82X38/X48 Express Host-Primary PCI Express Bridge
Kernel driver in use: pcieport-driver
00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 02)
Kernel driver in use: uhci_hcd
00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 02)
Kernel driver in use: uhci_hcd
00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 02)
Kernel driver in use: ehci_hcd
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 02)
Kernel driver in use: pcieport-driver
00:1c.4 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 (rev 02)
Kernel driver in use: pcieport-driver
00:1c.5 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 6 (rev 02)
Kernel driver in use: pcieport-driver
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 02)
Kernel driver in use: uhci_hcd
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 02)
Kernel driver in use: uhci_hcd
00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 02)
Kernel driver in use: uhci_hcd
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 02)
Kernel driver in use: ehci_hcd
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 92)
00:1f.0 ISA bridge: Intel Corporation 82801IR (ICH9R) LPC Interface Controller (rev 02)
00:1f.2 SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA AHCI Controller (rev 02)
Kernel driver in use: ahci
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 02)
Kernel driver in use: i801_smbus
01:00.0 Ethernet controller: Intel Corporation 82572EI Gigabit Ethernet Controller (Copper) (rev 06)
Kernel driver in use: e1000
Kernel modules: e1000
02:00.0 Ethernet controller: Intel Corporation 82575EB Gigabit Network Connection (rev 02)
02:00.1 Ethernet controller: Intel Corporation 82575EB Gigabit Network Connection (rev 02)
03:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G200e [Pilot] ServerEngines (SEP1) (rev 02)

lsusb

lsmod na oryginalnym jądrze:

ipv6 235364 16
loop 12748 0
snd_pcm 62596 0
snd_timer 17800 1 snd_pcm
snd 45604 2 snd_pcm,snd_timer
soundcore 6368 1 snd
snd_page_alloc 7816 1 snd_pcm
i2c_i801 7920 0
i2c_core 19828 1 i2c_i801
pcspkr 2432 0
iTCO_wdt 9508 0
button 6096 0
evdev 8000 0
ext3 105512 2
jbd 39444 1 ext3
mbcache 7108 1 ext3
dm_mirror 15104 0
dm_log 8484 1 dm_mirror
dm_snapshot 14340 0
dm_mod 46184 8 dm_mirror,dm_log,dm_snapshot
sd_mod 22200 3
usb_storage 77024 0
usbhid 35904 0
hid 33184 1 usbhid
ff_memless 4392 1 usbhid
ahci 23596 2
libata 140416 1 ahci
scsi_mod 129324 3 sd_mod,usb_storage,libata
dock 8304 1 libata
igb 61476 0
ehci_hcd 28396 0
uhci_hcd 18672 0
usbcore 118224 5 usb_storage,usbhid,ehci_hcd,uhci_hcd
e1000e 84612 0
thermal 15228 0
processor 32544 1 thermal
fan 4164 0
thermal_sys 10856 3 thermal,processor,fan

Brak komentarzy:

Prześlij komentarz

Archiwum bloga