User Tools

Site Tools


doc:appunti:hardware:la_fonera_openwrt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
doc:appunti:hardware:la_fonera_openwrt [2013/10/01 20:18] – [Flashing La Fonera] niccolodoc:appunti:hardware:la_fonera_openwrt [2013/10/01 20:38] – [Flash dell'immagine OpenWrt Backfire] niccolo
Line 198: Line 198:
 ====== OpenWrt ====== ====== OpenWrt ======
  
-Attualmente esistono due versioni di OpenWrt: **White Russian** (stabile) e **Kamikaze** (sperimentale). Per La Fonera bisogna utilizzare:+Sulla Fonera si possono installare due versioni di OpenWrt: **Kamikaze** e **Backfire**, occorre il build per Atheros:
  
-  * **[[http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/|OpenWrt base per chip Atheros]]** +  * [[http://downloads.openwrt.org/kamikaze/8.09.2/atheros/]] 
-  * **[[http://downloads.openwrt.org/kamikaze/packages/mips/|Pacchetti aggiuntivi per architettura Mips]]**+  * [[http://downloads.openwrt.org/backfire/10.03.1/atheros/]] 
 + 
 +===== Compilazione ===== 
 + 
 +**ATTENZIONE:** Operazione da fare solo in casi particolari, la distribuzione binaria precompilata va più che bene.
  
 ==== OpenWrt Download ==== ==== OpenWrt Download ====
Line 263: Line 267:
 ^ 64k, 128k, ... | Most 4M flash chips use a block size of 64k while most 8M chips tend to use a 128k block size. The jffs2 partition needs to be formatted for the correct block size. | ^ 64k, 128k, ... | Most 4M flash chips use a block size of 64k while most 8M chips tend to use a 128k block size. The jffs2 partition needs to be formatted for the correct block size. |
  
-===== Flash dell'immagine OpenWrt Kamikaze =====+===== Flash dell'immagine OpenWrt Backfire =====
  
-Prelevati i file **openwrt-atheros-2.6-vmlinux.lzma** e **openwrt-atheros-2.6-root.squashfs** da [[http://downloads.openwrt.org/kamikaze/]] e resi disponibili sul server **tftp** all'indirizzo IP **169.254.255.46**.+Scaricati i file **openwrt-atheros-vmlinux.lzma** e **openwrt-atheros-root.squashfs** dal [[http://downloads.openwrt.org/backfire/10.03.1/atheros/|repository]] e resi disponibili sul server **tftp** all'indirizzo IP **169.254.255.46**.
  
-Avviata La Fonera e raggiunto il prompt RedBoot dalla console seriale. Configurata la Ethernet specificando anche l'indirizzo del server tftp: +Avviata La Fonera e raggiunto il prompt RedBoot dalla console seriale, con **''fis list''** si possono vedere le immagini caricate in flash:
- +
-<code> +
-RedBoot> ip_address -l 169.254.255.1/24 -h 169.254.255.46 +
-IP: 169.254.255.1/255.255.255.0Gateway: 0.0.0.0 +
-Default server: 169.254.255.46 +
-</code> +
- +
-Si carica l'immagine del kernel dal server tftp. L'immagine viene caricata in RAM allo stesso indirizzo (-b 0x80041000) a cui risultava la precedente:+
  
 <code> <code>
Line 285: Line 281:
 FIS directory     0xA87E0000  0xA87E0000  0x0000F000  0x00000000 FIS directory     0xA87E0000  0xA87E0000  0x0000F000  0x00000000
 RedBoot config    0xA87EF000  0xA87EF000  0x00001000  0x00000000 RedBoot config    0xA87EF000  0xA87EF000  0x00001000  0x00000000
 +</code>
  
-RedBoot> load -r -b 0x80041000 openwrt-atheros-2.6-vmlinux.lzma+Si carica in RAM l'immagine del kernel via tftp, quindi si copia in flash memory specificando a che indirizzo dovrà essere caricata in RAM (**-r**) e specificando anche l'entry point (**-e**) a cui iniziare l'esecuzione (si mantengono gli stessi valori del kernel Fon): 
 + 
 +<code> 
 +RedBoot> ip_address -h 169.254.255.46 -l 169.254.255.1/24 
 +IP: 169.254.255.1/255.255.255.0, Gateway: 0.0.0.0 
 +Default server: 169.254.255.46 
 + 
 +RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-vmlinux.lzma
 Using default protocol (TFTP) Using default protocol (TFTP)
-Raw file loaded 0x80041000-0x800f0fff, assumed entry at 0x80041000 +Raw file loaded 0x80040800-0x801207ff, assumed entry at 0x80040800
-</code>+
  
-Si crea la nuova immagine nella memoria FLASH specificando a che indirizzo dovrà essere caricata in RAM (**-r**) e specificando anche l'entry point (**-e**) a cui iniziare l'esecuzione (si mantengono gli stessi valori del kernel Fon):+RedBoot> fis init 
 +About to initialize [format] FLASH image system - continue (y/n)? y 
 +*** Initialize FLASH Image System 
 +... Erase from 0xa87e0000-0xa87f0000: . 
 +... Program from 0x80ff0000-0x81000000 at 0xa87e0000.
  
-<code> 
 RedBoot> fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7 RedBoot> fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7
-An image named 'vmlinux.bin.l7' exists - continue (y/n)? y +... Erase from 0xa8030000-0xa8110000.............. 
-... Erase from 0xa8730000-0xa87e0000: ........... +... Program from 0x80040800-0x80120800 at 0xa8030000..............
-... Program from 0x80041000-0x800f1000 at 0xa8730000: ...........+
 ... Erase from 0xa87e0000-0xa87f0000: . ... Erase from 0xa87e0000-0xa87f0000: .
 ... Program from 0x80ff0000-0x81000000 at 0xa87e0000: . ... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
 </code> </code>
  
-Si carica in RAM anche l'immagine del root filesystem, questa volta si usa l'indirizzo libero più basso della RAM (variabile FREEMEMLO) invece del valore memorizzato nella vecchia immagine FLASH:+Si carica in RAM via ftp l'immagine del root filesystem (nella posizione più bassa della RAMvariabile FREEMEMLO) e si copia in flash alla prima posizione libera:
  
 <code> <code>
-RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-2.6-root.squashfs+RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-root.squashfs
 Using default protocol (TFTP) Using default protocol (TFTP)
-Raw file loaded 0x80040800-0x801607ff, assumed entry at 0x80040800+Raw file loaded 0x80040800-0x802207ff, assumed entry at 0x80040800 
 + 
 +RedBoot> fis create rootfs 
 +... Erase from 0xa8110000-0xa82f0000: .............................. 
 +... Program from 0x80040800-0x80220800 at 0xa8110000: .............................. 
 +... Erase from 0xa87e0000-0xa87f0000:
 +... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
 </code> </code>
  
-Si crea la nuova immagine FLASH, tutti i valori predefiniti sono dedotti dal comando **load** dato in precedenza, si indica solo l'entry point nullo (**-e**) in quanto non si tratta di file eseguibile.+Si verifica la configurazione di bootper sicurezza la si riscrive:
  
 <code> <code>
-RedBoot> fis create -e 0 rootfs +RedBoot> fconfig --n 
-An image named 'rootfs' exists continue (y/n)? y +boot_script: true 
-... Erase from 0xa8030000-0xa8730000: .................................. +boot_script_data:  
-... Program from 0x80040800-0x80160800 at 0xa8030000: ..................+.. fis load -l vmlinux.bin.l7 
 +.. exec 
 + 
 +boot_script_timeout:
 +bootp: false 
 +bootp_my_gateway_ip: 0.0.0.
 +bootp_my_ip: 0.0.0.
 +bootp_my_ip_mask: 255.255.255.255 
 +bootp_server_ip: 0.0.0.
 +console_baud_rate: 9600 
 +gdb_port: 9000 
 +info_console_force: false 
 +net_debug: false 
 + 
 +RedBoot> fconfig boot_script_data 
 +boot_script_data:  
 +.. fis load -l vmlinux.bin.l7 
 +.. exec 
 +Enter script, terminate with empty line 
 +>> fis load -l vmlinux.bin.l7 
 +>> exec 
 +>>  
 +Update RedBoot non-volatile configuration - continue (y/n)? y
 ... Erase from 0xa87e0000-0xa87f0000: . ... Erase from 0xa87e0000-0xa87f0000: .
 ... Program from 0x80ff0000-0x81000000 at 0xa87e0000: . ... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
 </code> </code>
  
-Come si vede l'immagine FLASH nuova ha un indirizzo //Mem addr// diverso da quello della vecchia immagine, ma funziona bene lo stesso: +Infine si riavvia:
- +
-<code> +
-RedBoot> fis list +
-Name              FLASH addr  Mem addr    Length      Entry point +
-RedBoot           0xA8000000  0xA8000000  0x00030000  0x00000000 +
-rootfs            0xA8030000  0x80040800  0x00700000  0x00000000 +
-vmlinux.bin.l7    0xA8730000  0x80041000  0x000B0000  0x80041000 +
-FIS directory     0xA87E0000  0xA87E0000  0x0000F000  0x00000000 +
-RedBoot config    0xA87EF000  0xA87EF000  0x00001000  0x00000000 +
-</code>+
  
 <code> <code>
 RedBoot> reset RedBoot> reset
 </code> </code>
- 
- 
- 
- 
- 
- 
 ====== Configurare OpenWrt ====== ====== Configurare OpenWrt ======
  
doc/appunti/hardware/la_fonera_openwrt.txt · Last modified: 2013/10/01 20:50 by niccolo