APUDebian

Z HKfree wiki
Přejít na: navigace, hledání

Zakladni cil

  • Nainstalovat debian testing(jessie) na Alix-APU s SSD diskem a pripravit navod pro ostatni
  • Diky tomu ze hardware nove APU desky je pomerne vykony, neni problem na nem rozbehnout prome klasickeho routovani(ospf) i dalsi sluzby(DNS, mail, jednoduchy web, statistiky prenosu...)
  • Procesor je x86(konkretne architektura amd64), 2xcore 1GHz
  • Jde pripojit SSD disk pres mSATA, nebo klasicky disk pres SATA - idealni na klasickou instalaci linuxu(zadne omezeni readonly CF).
  • Klasicky disk pres SATA se nevejde do krabicky, tak jsem zvolil mSATA od pcengines s kapacitou 16GB
  • V pripade potreby neni problem koupit vetsi mSATA napr. u alza.cz - az 500GB
  • Cely navod je hodne detailni, experti se snad neurazi :-). Pro zkusenejsi: Jedina vetsi slozitost spociva v nastaveni bootloaderu a kernelelu tak aby produkoval vystup na RS323. Ostatni je standardni instalace linuxu(debianu).

Instalace HW

  • Nalepit chladic(kus plechu) podle navodu vyrobce, hlinikova krabicka pomaha taky chladit
  • Zastrcit SSD disk
  • soupnout do krabicky

Pripojeni pres seriovou linku

  • APU nema grafickou kartu, takze je potreba pripojit se seriovou linkou.
  • Pro ty mene stastnejsi z nas kteri uz nemaji v notebooku seriovy port je potreba neco jako: USB->RS232 a null-modem cable null-modem kabel
  • Nastaveni rychlosti serioveho portu 115200 8N1
  • Nalezeni spravneho cisla COM portu prirazeneho prevodniku. viz screenshot

Com number.png

  • Pres putty viz screenshot
  • Pres hyperterminal viz. screenshot

Pripraveni instalacniho USB

Nastroj na pripraveni instalacniho USB

Rucni pripraveni instalacniho USB v Linuxu

  • Vychazel jsem z navodu | 4.3.3. Manually copying files to the USB stick — the flexible way
  • Staci jakakoliv USB flashka s velikosti >>1GB
  • Predpokladam ze flashka je naformatovana na fat16 a oznacena flagem bootable. V pripade ze tomu tak neni, libovolnym nastrojem nastavime(cfdisk, fdisk,...)
  • Pro kontrolu overime(v mem pripade 4GB USB flashka)
 NPSWorkstation1:~# fdisk -l /dev/sdh
 Disk /dev/sdh: 4110 MB, 4110188544 bytes
 67 heads, 14 sectors/track, 8558 cylinders, total 8027712 sectors
 Units = sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk identifier: 0x00000000
 Device Boot      Start         End      Blocks   Id  System
 /dev/sdh1   *          62     8027711     4013825    6  FAT16
  • Nainstalujeme bootloader. Debian pouziva pro instalacni USB syslinux(jinak by sel pouzit i grub nebo lilo). Flashka nesmi byt primountovana.
 NPSWorkstation1:~# syslinux /dev/sdh1
  • Primountujeme USB flashku
  mount /dev/sdh1 /mnt/temp
  • Stahneme z zde soubory vmlinuz a initrd.gz
  • Stahneme z zde soubor debian-testing-i386-CD-1.iso
  • Vsechny 3 soubory nakopirujeme na USB flasku
  • Vytvorime na USB flashce soubor syslinux.cfg s nasledujicim obsahem:
 NPSWorkstation1:/mnt/temp# cat syslinux.cfg
 serial 0 115200
 DEFAULT linux
 LABEL linux 
 KERNEL vmlinuz
 APPEND initrd=initrd.gz console=ttyS0,115200n8
  • Obsah instalacni USB flasky by mel vypadat takto:
  coudek@NPSWorkstation1:/media/Debian Inst$ ll
  total 667420
  -rw-r--r-- 1 coudek coudek 672137216 Nov 17 06:30 debian-testing-i386-CD-1.iso
  -rw-r--r-- 1 coudek coudek   8290770 Nov 21 10:24 initrd.gz
  -r--r--r-- 1 coudek coudek    116512 Nov 21 11:39 ldlinux.c32
  -r--r--r-- 1 coudek coudek     61440 Nov 21 11:39 ldlinux.sys
  -rw-r--r-- 1 coudek coudek       111 Nov 21 09:12 syslinux.cfg
  -rw-r--r-- 1 coudek coudek   2818832 Nov 21 10:24 vmlinuz
  • odmountovat flashku
  • USB flaska je ted pripravena. Staci pripojit seriovy kabel k APU, pripojit USB flasku, zapnout napajeni a instalovat :-)


Fix MBR

  • V pripade ze apu nechce nabootovat z USB je mozna potreba opravit(nainstalovat) Master Boot Record
  • Udela se to poci toolu install-mbr z balicku mbr
  # install-mbr /dev/sdh

Rucni pripraveni instalacniho USB v prostredi Windows

Vlastni instalace Debianu

  • TODO... Klasicka instalace

Tipy

  • zkontrolovat FD/HD pres mii-tool a ethtool

Performance testing

  • vsechny testy bez NATu, ipv4
  • test pres iptraf TCP halfduplex v podstate cely 1Gbit/s
  • test pres iptraf TCP fullduplex zvladne tak kolem 500Mbit/s, cca 20 000pps. Pravdepodobne uz nestihaji irq/s --> Mozny tunning pres irqbalance a podobne??

Pripojit mobilku s androidem jako zdroj internetu

  • Na androidu Nastaveni --> Sdileni pripojeni --> enable sdileni pripojeni pres USB
  • Na APU
 root@hal:~# ip link show
 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
     link/ether 00:0d:b9:33:15:58 brd ff:ff:ff:ff:ff:ff
 3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
     link/ether 00:0d:b9:33:15:59 brd ff:ff:ff:ff:ff:ff
 4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
     link/ether 00:0d:b9:33:15:5a brd ff:ff:ff:ff:ff:ff
 5: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 1000
     link/ether fa:79:b8:31:51:1e brd ff:ff:ff:ff:ff:ff
  • zadat prikaz dhclient usb0

root@hal:~# ip addr show

 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
     inet 127.0.0.1/8 scope host lo
        valid_lft forever preferred_lft forever
     inet6 ::1/128 scope host 
        valid_lft forever preferred_lft forever
 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
     link/ether 00:0d:b9:33:15:58 brd ff:ff:ff:ff:ff:ff
     inet 172.23.205.147/22 brd 172.23.207.255 scope global eth0
        valid_lft forever preferred_lft forever
     inet6 2a00:1028:f:1001:20d:b9ff:fe33:1558/64 scope global dynamic 
        valid_lft 2591972sec preferred_lft 604772sec
     inet6 fe80::20d:b9ff:fe33:1558/64 scope link 
        valid_lft forever preferred_lft forever
 3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
     link/ether 00:0d:b9:33:15:59 brd ff:ff:ff:ff:ff:ff
 4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
     link/ether 00:0d:b9:33:15:5a brd ff:ff:ff:ff:ff:ff
 5: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
     link/ether fa:79:b8:31:51:1e brd ff:ff:ff:ff:ff:ff
     inet 192.168.42.189/24 brd 192.168.42.255 scope global usb0
        valid_lft forever preferred_lft forever
     inet6 fe80::f879:b8ff:fe31:511e/64 scope link 
        valid_lft forever preferred_lft forever
  • Vypis routovaci tabulky
 root@hal:~# route -n
 Kernel IP routing table
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
 0.0.0.0         172.23.204.10   0.0.0.0         UG    0      0        0 eth0
 172.23.204.0    0.0.0.0         255.255.252.0   U     0      0        0 eth0
 192.168.42.0    0.0.0.0         255.255.255.0   U     0      0        0 usb0
  • smazani default gw route del default gw 172.23.204.10
  • pridani jine dhclient usb0

root@hal:~# route -n

 Kernel IP routing table
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
 0.0.0.0         192.168.42.129  0.0.0.0         UG    0      0        0 usb0
 172.23.204.0    0.0.0.0         255.255.252.0   U     0      0        0 eth0
 192.168.42.0    0.0.0.0         255.255.255.0   U     0      0        0 usb0
 root@hal:~#