Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gentoo on WRAP
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
vvoid
n00b
n00b


Joined: 19 Jan 2007
Posts: 6

PostPosted: Mon Jan 22, 2007 2:00 am    Post subject: gentoo on WRAP Reply with quote

Hi!

In case someone is interested...
(I know it is not really an Alternative Architecture...)

I am running a regular x86 gentoo on a WRAP SBC (http://www.pcengines.ch/). This is a AMD Geode based 586 mmx SBC with 128 MB RAM and a CF slot. Installaion was pretty straightforward. Used another gentoo PC and followed the usual chroot method to get a system. Partitioned my 1GB CF and transfered the system to the CF via rsync. Updates/upgrades are also installed using the PC and rsync. The system is used as a DSL router/firewall (Ethernet/WLAN) and is running 24h a day. First boots/logins via serial port now always via ssh.

Pro.:
power consumption <10 W
small approximately 15cm/15cm/3cm
fanless/noiseless
extendable via 2x mini PCI ( 1 used for WLAN) and USB
stability, had no issues so far
maintainability, login via ssh and see what is going on...
full featured x86 linux router with endless software options:
like: iptables, fwbuilder, QOS, dnsmask, apache, ssh, hostapd, ddclient, syslog-ng, vlan, vpn, network capture, nfs, ...

Con.:
price, more than of the shelf router (ca. 200€)
work, you have to set it up...
atheros/hostapd has problems with some WLAN devices...
limited resources compared to a real PC...
slow boot, ca. 5 min for my system, boot scripts are slow...

cu.
Back to top
View user's profile Send private message
vvoid
n00b
n00b


Joined: 19 Jan 2007
Posts: 6

PostPosted: Mon Jan 29, 2007 12:47 am    Post subject: WRAP Front Panel LED Reply with quote

Hi!

If you want to use the front panel LEDs of the WRAP consider using the following code:

--- SNIP: led.c ---
/*
WRAP LED access via ports
see usage() for documantation
author: Daniel Kirschner
mail: rundablage@vvoid.dyndns.org

licence: GPLv3 only
*/

#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>

// constants
/**
LED access:

LED 1/2
/dev/port offset 62464
LED 1: bit 4 active low logic
LED 2: bit 3 active low logic

LED 3:
/dev/port offset 62466
LED 3: bit 3 active low logic

*/

const int LED_PORT[4] = {
0,
62464,
62464,
62466
};
const int LED_BIT[4] = {
0,
3,
4,
3
};
const int LED_MASK_IN[4] = {
0,
0x04,
0x08,
0x04
};
const int LED_MASK_OUT[4] = {
0,
0xFB,
0xF7,
0xFB
};
void usage(void) {
printf("\n");
printf("usage:\n");
printf("\n");
printf("led <LED=1|2|3> <ON/OFF=0|1>\n");
printf("\n");
printf("\n");
}

void fail(void) {
printf("ERROR\n");
usage();
exit(-1);
}

char RB[0];
char WB[0];

char read_port(int fd, int port) {
lseek(fd, port, SEEK_SET);
read(fd, RB, 1);
return RB[0];
}

void write_port(int fd, int port, char octet) {
WB[0]=octet;
lseek(fd, port, SEEK_SET);
write(fd, WB, 1);
}
int main(int argc, char **argv) {

if(argc != 3) fail();
int led = atoi(argv[1]);
int off = atoi(argv[2]);

if(led<=0) fail();
if(led>=4) fail();
if(off<=-1) fail();
if(off>=2) fail();

// get port
int fd;
fd = open("/dev/port", O_RDWR);

char state = read_port(fd, LED_PORT[led]);

if(off==0) {
state = (state & LED_MASK_OUT[led]);
state = state + LED_MASK_IN[led];
}else{
state = state & LED_MASK_OUT[led];
}

write_port(fd, LED_PORT[led], state);

close(fd);
return 0;
}
--- SNIP ---

Try it in this for example:

-- SNIP: led_con_blink.sh ---
#!/bin/bash

LED=$1
INTERFACE=$2
HOST=$3
INTERVAL=$4

while true;
do

/gwrap/led/led $LED 0
if ping -q -w 0.5 -c 1 -B -I $INTERFACE $HOST &>/dev/null
then
/gwrap/led/led $LED 1
fi

sleep $INTERVAL

done;
-- SNIP ---

Have fun and let me know if you have a problem with this code.
Back to top
View user's profile Send private message
svf
n00b
n00b


Joined: 01 Feb 2005
Posts: 50

PostPosted: Wed Feb 21, 2007 1:20 pm    Post subject: Reply with quote

hi,

i'm actually thinking about doing the same thing - maybe trying GNAP. Do you habe any max. throughput values? I found something on the m0n0wall list (from 2004) saying that they get a max troughput of ~40Mbps.

cheers,

nico
_________________
uchafu!
Back to top
View user's profile Send private message
vvoid
n00b
n00b


Joined: 19 Jan 2007
Posts: 6

PostPosted: Sat Mar 10, 2007 10:14 pm    Post subject: Network performance Reply with quote

Hi!

I checked the network performance:

## iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 4] local 10.0.0.254 port 5001 connected with 10.0.0.1 port 50217
[ 4] 0.0-10.0 sec 49.2 MBytes 41.3 Mbits/sec
[ 4] local 10.0.0.254 port 5001 connected with 10.0.0.1 port 56828
[ 4] 0.0-10.0 sec 47.4 MBytes 39.7 Mbits/sec
[ 4] local 10.0.0.254 port 5001 connected with 10.0.0.1 port 51013
[ 4] 0.0-10.0 sec 49.2 MBytes 41.3 Mbits/sec
------------------------------------------------------------

## ping -f -c 10000 cerberos
PING cerberos.nowhere (10.0.0.254) 56(84) bytes of data.
.
--- cerberos.nowhere ping statistics ---
10000 packets transmitted, 9999 received, 0% packet loss, time 9711ms
rtt min/avg/max/mdev = 0.404/0.890/15.032/0.920 ms, pipe 2, ipg/ewma 0.971/0.816 ms


It is more than sufficient for a DSL router (6MBit uplink).

cu
Back to top
View user's profile Send private message
svf
n00b
n00b


Joined: 01 Feb 2005
Posts: 50

PostPosted: Sun Apr 01, 2007 11:40 am    Post subject: Reply with quote

thanks for the testing :)

i thought about putting a NFS-Server into an own DMZ (recently got my new shiny wrap ;) but with these values i will reconsider and focus on getting my base system running.

thanks again.
_________________
uchafu!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum