Questa è una vecchia versione del documento!
Compilazione di Smesh per architettura MIPS
Toolchain
Questo sarà lo strumento essenziale per poter compilare i sorgenti per architettura MIPS. L'ho ricavato da una compilazione di OpenWrt, quindi è testato e funzionante ed in più sfrutta le uClibc generando eseguibili molto contenuti. Lo allego qui così che sia già disponibile senza dover ricompilare OpenWrt.
Preparazione alla compilazione
- Creare una cartella ed estrarci il toolchain
- Ora ci serve anche libpcap che non ha bisogno di modifiche dall'originale perciò si può copiare già compilato direttamente nella cartella di Smesh
- Per chiarezza ecco come devono essere le cartelle:
Modifica dei sorgenti
Ora dobbiamo applicare le nostre modifiche per poter far girare le trame di controllo di SMesh e Spines su un'interfaccia diversa dal wifi, mentre Smesh continua a gestire i suoi client su wifi.
- Scaricare le nostre patches e copiare smesh.patch in smesh-src-v2.3 e spines.patch in spines
- Ora entrare rispettivamente in smesh-src-v2.3 e poi in spines per testare le patches con i seguenti comandi
patch --dry-run --verbose -p1 -i smesh.patch patch --dry-run --verbose -p1 -i spines.patch
- Se l'output è questo
Hmm... Looks like a unified diff to me... The text leading up to this was: -------------------------- |--- smesh-src-v2.3-ORIG/smesh_proxy/smesh_proxy.c 2008-05-17 00:05:37.000000000 +0200 |+++ smesh_proxy/smesh_proxy/smesh_proxy.c 2010-06-04 10:16:46.000000000 +0200 -------------------------- Patching file smesh_proxy/smesh_proxy.c using Plan A... Hunk #1 succeeded at 78. Hunk #2 succeeded at 93. Hunk #3 succeeded at 233. Hunk #4 succeeded at 875. Hunk #5 succeeded at 1344. Hunk #6 succeeded at 1387. Hunk #7 succeeded at 1501. done
e questo
Hmm... Looks like a unified diff to me... The text leading up to this was: -------------------------- |diff -Naur spines-src-3.2-ORIG/configure spines/configure |--- spines-src-3.2-ORIG/configure 2008-11-18 02:10:11.000000000 +0100 |+++ spines/configure 2010-06-03 09:56:37.171851000 +0200 -------------------------- Patching file configure using Plan A... Hunk #1 succeeded at 6090. Hmm... The next patch looks like a unified diff to me... The text leading up to this was: -------------------------- |diff -Naur spines-src-3.2-ORIG/daemon/kernel_routing.c spines/daemon/kernel_routing.c |--- spines-src-3.2-ORIG/daemon/kernel_routing.c 2009-05-13 21:05:52.000000000 +0200 |+++ spines/daemon/kernel_routing.c 2010-06-10 10:49:55.351420000 +0200 -------------------------- Patching file daemon/kernel_routing.c using Plan A... Hunk #1 succeeded at 62. Hunk #2 succeeded at 85. Hunk #3 succeeded at 145. Hmm... The next patch looks like a unified diff to me... The text leading up to this was: -------------------------- |diff -Naur spines-src-3.2-ORIG/daemon/spines.c spines/daemon/spines.c |--- spines-src-3.2-ORIG/daemon/spines.c 2009-05-13 21:05:52.000000000 +0200 |+++ spines/daemon/spines.c 2010-06-10 11:21:08.646420000 +0200 -------------------------- Patching file daemon/spines.c using Plan A... Hunk #1 succeeded at 95. Hunk #2 succeeded at 608. done
allora possiamo eseguire il comando non in dry-mode
patch --verbose -p1 -i smesh.patch patch --verbose -p1 -i spines.patch
Compilazione
- Copiare quest'altra patch in 'smesh_proxy' e testarla
patch --dry-run --verbose -p1 -i build.patch
se questo è l'output
Hmm... Looks like a unified diff to me... The text leading up to this was: -------------------------- |--- smesh-src-v2.3-ORIG/build 2008-05-16 23:19:34.000000000 +0200 |+++ smesh_proxy/build 2010-06-14 10:18:22.142070306 +0200 -------------------------- Patching file build using Plan A... Hunk #1 succeeded at 16. Hunk #2 succeeded at 30. Hunk #3 succeeded at 209. done
allora possiamo dare il comando non in dry-mode
patch --verbose -p1 -i build.patch
- Ora bisogna apportare un'ulteriore modifica al file build
export CROSS="/INSERIRE_PATH_ASSOLUTA/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin"
dove in INSERIRE_PATH_ASSOLUTA si deve inserire la path completa del toolchain scaricato prima