Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on Alternative Architectures
  • Search

gentoo on WRAP

Post here for other supported architectures, or if you are interested in porting Gentoo to a currently unsupported architecture.
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
vvoid
n00b
n00b
Posts: 6
Joined: Fri Jan 19, 2007 11:15 am

gentoo on WRAP

  • Quote

Post by vvoid » Mon Jan 22, 2007 2:00 am

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.
Top
vvoid
n00b
n00b
Posts: 6
Joined: Fri Jan 19, 2007 11:15 am

WRAP Front Panel LED

  • Quote

Post by vvoid » Mon Jan 29, 2007 12:47 am

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.
Top
svf
n00b
n00b
Posts: 50
Joined: Tue Feb 01, 2005 12:22 am

  • Quote

Post by svf » Wed Feb 21, 2007 1:20 pm

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!
Top
vvoid
n00b
n00b
Posts: 6
Joined: Fri Jan 19, 2007 11:15 am

Network performance

  • Quote

Post by vvoid » Sat Mar 10, 2007 10:14 pm

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
Top
svf
n00b
n00b
Posts: 50
Joined: Tue Feb 01, 2005 12:22 am

  • Quote

Post by svf » Sun Apr 01, 2007 11:40 am

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!
Top
Post Reply

5 posts • Page 1 of 1

Return to “Gentoo on Alternative Architectures”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic