Problem with getting the original MAC is solved. Simply compile MTD support into the kernel and you get two mtd devices. mtd2 contains lot of positions where the original MAC can be found by directly reading from the NAND via nanddump (not very elegantly, but it works).
Here is my c program "dc01mac" that reads the MAC from the byte stream generated by nanddump and calls "macchanger", a small utility available in the web, for setting the MAC.
$this->bbcode_second_pass_code('', '#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#define TRYLENGTH 100
int try_mac (unsigned char *str)
{
char buf[256];
unsigned char *p, *q;
int i;
for (i=0, p=str; i < TRYLENGTH; ++i, ++p)
{
if (isxdigit (p[0]) && isxdigit (p[1]) &&
(p[2] == ':') && isxdigit (p[3]) && isxdigit (p[4]) &&
(p[5] == ':') && isxdigit (p[6]) && isxdigit (p[7]) &&
(p[8] == ':') && isxdigit (p[9]) && isxdigit (p[10]) &&
(p[11] == ':') && isxdigit (p[12]) && isxdigit (p[13]) &&
(p[14] == ':') && isxdigit (p[15]) && isxdigit (p[16]))
{
sprintf (buf, "/usr/local/bin/macchanger -m %c%c:%c%c:%c%c:%c%c:%c%c:%c%c eth0",
toupper (p[0]), toupper (p[1]), toupper (p[3]), toupper (p[4]),
toupper (p[6]), toupper (p[7]), toupper (p[9]), toupper (p[10]),
toupper (p[12]), toupper (p[13]), toupper (p[15]), toupper (p[16]));
system (buf);
exit (0);
}
}
}
int main (int argc, char *argv[])
{
char pattern[] = { "Eth" };
unsigned char buf[4096 + 200], *p;
unsigned char c;
int i, len, patlen;
patlen = 3;
for (len=4096; len; )
{
len = read (0, buf, 4096);
for (p=buf, i=len-patlen; i>0; ++p, --i)
if (strncmp (p, pattern, patlen) == 0)
try_mac (p);
}
return 0;
}')
In my debian install I do call this directly before dhclient starts asking the router for a mac-based IP address. Receving the MAC from NAND is only executed on the first run. Script is located in "/etc/dhcp/dhclient-enter-hooks.d/".
$this->bbcode_second_pass_code('', '#!/bin/sh
if [ -f "/var/run/macset" ]
then
echo -n ""
else
/usr/sbin/nanddump /dev/mtd2 2>/dev/null | /home/meteohub/dc01mac >/var/run/mac
set
cat /var/run/macset
fi')
Problem with LEDs and RAM size still not solved for me.
Regarding the LEDs I did find the "proled" script that directly pokes into memory to get some GPIO lines toggled that affect the LED, but the used memory positions from pogoplug v3 don't match with dc01.
The other way to get LEDs accessible the gentlemen way via a kernel module oxnas-led did also bring me to a stop, as I can't find module sources for it and the compiled 2.6.31.6 module is not compatible to my kernel compilation.
Any hint would be highly welcome.