Esther Fuhrmann: Difference between revisions

From
Jump to navigation Jump to search
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Toolchain ==
== Toolchain ==


* Siehe [http://intwiki/BRN::Development::Toolchain BRN::Development::Toolchain] (Mathias' Method)
* Siehe [[BRN:Dev:Toolchain]] (Mathias' Method)


== Kernel ==
== Kernel ==


* Siehe [http://intwiki/BRN::Development::Kernel BRN::Development::Kernel]
* Siehe [[BRN:Dev:Kernel]]
* ab dem zweiten Mal: schneller compilieren<br>
* ab dem zweiten Mal: schneller compilieren<br>
build.sh editieren<br>
build.sh editieren<br>
Line 83: Line 83:


== How to (temporarily) set up a SDP independent from the running one ==
== How to (temporarily) set up a SDP independent from the running one ==
* First build everything for the new SDP. To do so, follow [[SDP_user's_guide | Bernhard's description]], '''BUT''' there are two important differences:
** Change BRN_NEIGHBOR_BEACON_MAGIC in ''<YOUR_BUILD_DIR>/click/include/clicknet/brn.h'' to a unique value. (Otherwise there will be problems with an existing SDP!)
** Don't deploy your new package in the last step

* Then the following has to be done for every node that is part of the new SDP infrastructure

Put the new software onto the WGT
scp -r <YOUR_BUILD_DIR>/sdp/package/library/0 root@<wgt_to_be_changed>:/tmp/sdp/library/

Then telnet to the WGT and execute the following commands
cd /tmp/sdp
killall S90sdp
/usr/sbin/rcclick stop
killall click
echo 0 > /tmp/sdp/current_id
rm /tmp/sdp/current
ln -s /tmp/sdp/library/0 /tmp/sdp/current
/usr/sbin/rcclick start /tmp/sdp

For convenience we took all these steps using a (strange) script
<pre>
ssh -XT localhost "/bin/bash -c 'SSH_ASKPASS=/home/brn/brn/unserpassword.sh \
scp -r ~/brn/sdp/openwrt/sdp/package/library/0 root@wgt24:/tmp/sdp/library/'"

ssh -XT localhost "/bin/bash -c \"SSH_ASKPASS=/home/brn/brn/unserpassword.sh ssh -n root@wgt24 '\
killall S90sdp ;\
/usr/sbin/rcclick stop ;\
killall click; \
echo 0 > /tmp/sdp/current_id ;\
rm /tmp/sdp/current ;\
ln -s /tmp/sdp/library/0 /tmp/sdp/current; \
/usr/sbin/rcclick start /tmp/sdp '\""
</pre>
where unserpassword.sh is another script, that outputs the password for the WGT (for obvious reasons not recommended if anyone else has access to the script!) and returns 0.


Now the new SDP should be running and you should be able to deploy software on "your" nodes without affecting the other ones. To get rid of it and restore the original SDP (the SDP the rest of the testbed is running) just reboot the WGT.

== IP auf WGT setzen ==

Mit diesem Skript erzeugt man aus dem Edit-Abschnitt im Wiki eine IP-Liste, die auf die Knoten verteilt wird.
<pre>
#!/bin/sh
# https://sarwiki.informatik.hu-berlin.de/wiki/index.php?title=BerlinRoofNet&action=edit&section=2
sed 's/\s//g' | sed -n '/^|wgt/p' | awk -F'|' '{print $22, $10}' > ipmac.txt
</pre>

Dieses Skript bestimmt die wlan-mac eines bestimmten Knotens und setzt eine IP auf dem wlan-interface (die zu setzende IP wird aus der IP-List geholt, die von obigem Skript erzeugt wurde).
<pre>
#!/bin/sh
# Verzeichnis bestimmen, in dem Skript liegt (klappt nicht, wenn Aufruf ueber PATH-Variable
DIR=`dirname $0`
# Wlan-MAC bestimmen
WLANMAC=`ifconfig -a | grep wlan0 | awk '{print $5}'`
# IP fuer die MAC aus Datei bestimmen
MYIP=`cat $DIR/ipmac.txt | grep $WLANMAC | awk '{print $1}'`
# IP setzen
ifconfig wlan0 add $MYIP netmask 255.255.255.0
</pre>

== Alles Click beenden ==

<pre>
#!/bin/sh
killall S90sdp
killall click
umount /tmp/click
rmmod click
rmmod proclikefs
echo done
</pre>

== Kernelclick mit brn_kernel_gateway.click starten ==

<pre>
#!/bin/sh
cd /tmp
rm -rf /tmp/expl
mkdir expl
cd expl
wget http://merkur/svn/brn/platform/wgt634u/brn/startup/iptables.sh
#cp /mnt/efuhrman/knoten/brn_kernel_gateway.click .
wget http://merkur/svn/brn/platform/wgt634u/brn/startup/brn_kernel_gateway.click
wget http://merkur/svn/brn/platform/wgt634u/brn/startup/startup.sh
#cp /tmp/sdp/current/click.ko.gz /tmp/expl # fuer version 22
cp /mnt/efuhrman/knoten/click.ko.gz /tmp/expl
cp /mnt/efuhrman/knoten/proclikefs.ko /tmp/expl
echo Copy beendet
gunzip click.ko.gz
insmod proclikefs.ko
echo proclikefs geladen
insmod click.ko
echo click geladen
mkdir /tmp/click
mount -t click none /tmp/click
echo /tmp/click gemountet
click-align brn_kernel_gateway.click > aligned.click
cat aligned.click > /tmp/click/config
echo fertig

</pre>

evtl. muss man noch startup.sh hinterher ausführen???

== startup.sh für Interface-Name wlan0 anpassen ==
cat startup.sh | sed 's/ath0/wlan0/' > wlan.sh

(und dann wlan.sh ausführen statt startup.sh)

== arping ==
In busybox enthalten
cd /tmp
ln -s /bin/busybox arping

== nfs-student mounten ==
mount -o soft,nolock 192.168.4.3:/home /mnt/nfs/

== Dokumentation aus Quelltext von Clickelementen extrahieren ==
Im Verzeichnis mit den entsprechend kommentierten Sourcen
click-elem2man -l -d <Ausgabeverzeichnis> -f * -P DEFAULT
Im Verzeichnis, in das man die Doku hat ausgeben lassen
nroff -man <file.n> | less

(das geht sicher auch besser)

== configure erzeugen ==
wenn kein configure, aber configure.in
autoconf

== syslog ==
syslog -C 16 -R <ip:bansin> -L

== todo1 ==
* 2 funktionierende Knoten mit Sichtkontakt
* wie geht brn-ping (brn2brn und laptop2brn)
* sniffer auf wgt (clickelement)

== todo2 ==
* VC - Subversion (tigris.org)
* IDE - Eclipse mit CDT, KDevelop, Sun C++ Studio
* BUILD
** configure (conf_*.sh)
** make (build.sh)
* do_env...
** click
*** elements
**** brn
***** x.hh
***** c.hh
* .../brn/startup -> iptables.sh

Latest revision as of 14:32, 8 March 2006

Toolchain

Kernel

build.sh editieren
wichtig ist das "ccache\ "

#! /bin/sh

make CROSS_COMPILE=mipsel-linux- CC=ccache\ mipsel-linux-gcc

madwifi.stripped

  • build.sh
#!/bin/sh

make TARGET=mips-le-elf KERNELPATH=$HOME/projects/brn/madmax/mips/kernel CC=ccache\ mipsel-linux-gcc

Click Kernelmodul bauen

  • Kernel kompilieren (build.sh)
  • Click kompilieren (erst conf_mips.sh, Warning ignorieren, cd linuxmodule/, make)
  • im Verzeichnis linuxmodule: build.sh editieren
#! /bin/sh

make TARGET=mips-le-elf CROSS_COMPILE=mipsel-linux- CC=ccache\ mipsel-linux-gcc

Click Modular Router


Wer macht ähnliches?

checkout.sh

#!/bin/sh

path=$HOME

echo "Creating directories"
mkdir -p $path/projects/brn/openwrt
mkdir -p $path/projects/brn/madmax
mkdir -p $path/projects/brn/madmax/mips/click
mkdir -p $path/projects/brn/madmax/mips/kernel
mkdir -p $path/projects/brn/madmax/mips/madwifi
mkdir -p $path/projects/brn/madmax/mips/madwifi.stripped
mkdir -p $path/projects/brn/madmax/mips/brn
mkdir -p $path/projects/brn/madmax/x86

# checkout
echo "Checking out"
svn co svn://merkur/brn/archives/click-20051012/ $path/projects/brn/madmax/mips/click
svn co svn://merkur/brn/platform/wgt634u/brn/src $path/projects/brn/madmax/mips/click/elements/brn

svn co svn://merkur/brn/archives/madwifi-20051013/ $path/projects/brn/madmax/mips/madwifi

svn co svn://merkur/brn/archives/madwifi_stripped-20051015/ $path/projects/brn/madmax/mips/madwifi.stripped

svn co svn://merkur/brn/archives/linux-kernel-2.6.12-rc3/ $path/projects/brn/madmax/mips/kernel

svn co svn://merkur/brn/platform/wgt634u/brn/ $path/projects/brn/madmax/mips/brn

echo "Copying sources to x86 directory"
cp -a $path/projects/brn/madmax/mips/click/ $path/projects/brn/madmax/x86/
#cp -a $path/projects/brn/madmax/mips/kernel $path/projects/brn/madmax/x86/
cp -a $path/projects/brn/madmax/mips/madwifi/ $path/projects/brn/madmax/x86/
cp -a $path/projects/brn/madmax/mips/madwifi.stripped/ $path/projects/brn/madmax/x86/
cp -a $path/projects/brn/madmax/mips/brn/ $path/projects/brn/madmax/x86/

How to (temporarily) set up a SDP independent from the running one

  • First build everything for the new SDP. To do so, follow Bernhard's description, BUT there are two important differences:
    • Change BRN_NEIGHBOR_BEACON_MAGIC in <YOUR_BUILD_DIR>/click/include/clicknet/brn.h to a unique value. (Otherwise there will be problems with an existing SDP!)
    • Don't deploy your new package in the last step
  • Then the following has to be done for every node that is part of the new SDP infrastructure

Put the new software onto the WGT

scp -r <YOUR_BUILD_DIR>/sdp/package/library/0 root@<wgt_to_be_changed>:/tmp/sdp/library/

Then telnet to the WGT and execute the following commands

cd /tmp/sdp
killall S90sdp
/usr/sbin/rcclick stop
killall click
echo 0 > /tmp/sdp/current_id
rm /tmp/sdp/current
ln -s /tmp/sdp/library/0 /tmp/sdp/current
/usr/sbin/rcclick start /tmp/sdp

For convenience we took all these steps using a (strange) script

ssh -XT localhost "/bin/bash -c 'SSH_ASKPASS=/home/brn/brn/unserpassword.sh \
  scp -r ~/brn/sdp/openwrt/sdp/package/library/0 root@wgt24:/tmp/sdp/library/'"

ssh -XT localhost "/bin/bash -c \"SSH_ASKPASS=/home/brn/brn/unserpassword.sh ssh -n root@wgt24 '\
killall S90sdp ;\
/usr/sbin/rcclick stop ;\
killall click; \
echo 0 > /tmp/sdp/current_id ;\
rm /tmp/sdp/current ;\
ln -s /tmp/sdp/library/0 /tmp/sdp/current; \
/usr/sbin/rcclick start /tmp/sdp '\""

where unserpassword.sh is another script, that outputs the password for the WGT (for obvious reasons not recommended if anyone else has access to the script!) and returns 0.


Now the new SDP should be running and you should be able to deploy software on "your" nodes without affecting the other ones. To get rid of it and restore the original SDP (the SDP the rest of the testbed is running) just reboot the WGT.

IP auf WGT setzen

Mit diesem Skript erzeugt man aus dem Edit-Abschnitt im Wiki eine IP-Liste, die auf die Knoten verteilt wird.

#!/bin/sh
# https://sarwiki.informatik.hu-berlin.de/wiki/index.php?title=BerlinRoofNet&action=edit&section=2
sed  's/\s//g' | sed -n '/^|wgt/p' | awk -F'|' '{print $22, $10}' > ipmac.txt

Dieses Skript bestimmt die wlan-mac eines bestimmten Knotens und setzt eine IP auf dem wlan-interface (die zu setzende IP wird aus der IP-List geholt, die von obigem Skript erzeugt wurde).

#!/bin/sh
# Verzeichnis bestimmen, in dem Skript liegt (klappt nicht, wenn Aufruf ueber PATH-Variable
DIR=`dirname $0`
# Wlan-MAC bestimmen
WLANMAC=`ifconfig -a | grep wlan0 | awk '{print $5}'`
# IP fuer die MAC aus Datei bestimmen
MYIP=`cat $DIR/ipmac.txt | grep $WLANMAC | awk '{print $1}'`
# IP setzen
ifconfig wlan0 add $MYIP netmask 255.255.255.0

Alles Click beenden

#!/bin/sh
killall S90sdp
killall click
umount /tmp/click
rmmod click
rmmod proclikefs
echo done

Kernelclick mit brn_kernel_gateway.click starten

#!/bin/sh
cd /tmp
rm -rf /tmp/expl
mkdir expl
cd expl
wget http://merkur/svn/brn/platform/wgt634u/brn/startup/iptables.sh
#cp /mnt/efuhrman/knoten/brn_kernel_gateway.click .
wget http://merkur/svn/brn/platform/wgt634u/brn/startup/brn_kernel_gateway.click
wget http://merkur/svn/brn/platform/wgt634u/brn/startup/startup.sh
#cp /tmp/sdp/current/click.ko.gz /tmp/expl # fuer version 22
cp /mnt/efuhrman/knoten/click.ko.gz /tmp/expl
cp /mnt/efuhrman/knoten/proclikefs.ko /tmp/expl
echo Copy beendet
gunzip click.ko.gz
insmod proclikefs.ko
echo proclikefs geladen
insmod click.ko
echo click geladen
mkdir /tmp/click
mount -t click none /tmp/click
echo /tmp/click gemountet
click-align brn_kernel_gateway.click > aligned.click
cat aligned.click > /tmp/click/config
echo fertig

evtl. muss man noch startup.sh hinterher ausführen???

startup.sh für Interface-Name wlan0 anpassen

cat startup.sh | sed 's/ath0/wlan0/' > wlan.sh

(und dann wlan.sh ausführen statt startup.sh)

arping

In busybox enthalten

cd /tmp
ln -s /bin/busybox arping

nfs-student mounten

mount -o soft,nolock 192.168.4.3:/home /mnt/nfs/

Dokumentation aus Quelltext von Clickelementen extrahieren

Im Verzeichnis mit den entsprechend kommentierten Sourcen

click-elem2man -l -d <Ausgabeverzeichnis> -f * -P DEFAULT

Im Verzeichnis, in das man die Doku hat ausgeben lassen

nroff -man <file.n> | less

(das geht sicher auch besser)

configure erzeugen

wenn kein configure, aber configure.in

 autoconf

syslog

syslog -C 16 -R <ip:bansin> -L

todo1

  • 2 funktionierende Knoten mit Sichtkontakt
  • wie geht brn-ping (brn2brn und laptop2brn)
  • sniffer auf wgt (clickelement)

todo2

  • VC - Subversion (tigris.org)
  • IDE - Eclipse mit CDT, KDevelop, Sun C++ Studio
  • BUILD
    • configure (conf_*.sh)
    • make (build.sh)
  • do_env...
    • click
      • elements
        • brn
          • x.hh
          • c.hh
  • .../brn/startup -> iptables.sh