OpenWrt Forum Archive

Topic: Netgear EVG2000 (Yes, but needs b53 switch detection)

The content of this topic has been archived between 30 Mar 2018 and 22 Apr 2018. Unfortunately there are posts – most likely complete pages – missing.

Tried a build on Ubuntu 8.04.4 but got the same error, so what is required to build this old release?

Xotic750 wrote:

Changed feeds.conf.default

src-git packages git://git.openwrt.org/12.09/packages.git
src-svn xwrt http://x-wrt.googlecode.com/svn/trunk/package
src-git luci https://github.com/openwrt/luci.git;luci-0.11

And now ./scripts/feeds update -a works, but make menuconfig still fails

[graham@tyr openwrt]$ make menuconfig V=s
make[1]: Entering directory '/home/graham/Downloads/openwrt/scripts/config'
zconf.tab.o: In function `zconflex':
zconf.tab.c:(.text+0x21c1): undefined reference to `kconf_id_lookup'
zconf.tab.c:(.text+0x2313): undefined reference to `kconf_id_lookup'
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'conf' failed
make[1]: *** [conf] Error 1
make[1]: Leaving directory '/home/graham/Downloads/openwrt/scripts/config'
/home/graham/Downloads/openwrt/include/toplevel.mk:74: recipe for target 'scripts/config/mconf' failed
make: *** [scripts/config/mconf] Error 2

This looks like it will not compile on Fedora 22, so I am going to try an old version of Ubuntu (8.04.4), like with the factory build.


For that error test this patch

Index: scripts/config/lxdialog/Makefile
===================================================================
--- scripts/config/lxdialog/Makefile    (revision 40993)
+++ scripts/config/lxdialog/Makefile    (working copy)
@@ -6,7 +6,7 @@
 # Use reursively expanded variables so we do not call gcc unless
 # we really need to do so. (Do not call gcc as part of make mrproper)
 CFLAGS := $(shell sh check-lxdialog.sh -ccflags)
-LIBS := $(shell sh check-lxdialog.sh -ldflags gcc)
+LIBS := $(shell sh check-lxdialog.sh -ldflags $(CC))
 
 # workaround for OpenBSD, which does not use symlinks to libncurses.so
 OS := $(shell uname -s)
Index: scripts/config/zconf.hash.c_shipped
===================================================================
--- scripts/config/zconf.hash.c_shipped    (revision 40993)
+++ scripts/config/zconf.hash.c_shipped    (working copy)
@@ -159,7 +159,10 @@
 #define kconf_id_strings ((const char *) &kconf_id_strings_contents)
 #ifdef __GNUC__
 __inline
+#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
+__attribute__ ((__gnu_inline__))
 #endif
+#endif
 struct kconf_id *
 kconf_id_lookup (register const char *str, register unsigned int len)
 {

Thanks. "make menuconfig" built and is running on Fedora 22. Now building the standard brcm63xx image to make sure it compiles before I start to add my config.

Update: make failed on F22

[graham@tyr openwrt-12.09]$ make
 make[1] world
 make[2] tools/install
 make[3] -C tools/m4 compile
 make[3] -C tools/m4 install
 make[3] -C tools/sed compile
 make[3] -C tools/sed install
 make[3] -C tools/libtool compile
 make[3] -C tools/libtool install
 make[3] -C tools/autoconf compile
 make[3] -C tools/autoconf install
 make[3] -C tools/pkg-config compile
make -r world: build failed. Please re-run make with V=s to see what's going on
/home/graham/Downloads/openwrt-12.09/include/toplevel.mk:144: recipe for target 'world' failed
make: *** [world] Error 1
[graham@tyr openwrt-12.09]$ make V=s
make[1]: Entering directory '/home/graham/Downloads/openwrt-12.09'
make[2]: Entering directory '/home/graham/Downloads/openwrt-12.09'
+ mkdir -p /home/graham/Downloads/openwrt-12.09/staging_dir/target-mips_uClibc-0.9.33.2
+ cd /home/graham/Downloads/openwrt-12.09/staging_dir/target-mips_uClibc-0.9.33.2
+ mkdir -p bin lib include stamp
mkdir -p /home/graham/Downloads/openwrt-12.09/build_dir/target-mips_uClibc-0.9.33.2/stamp
touch /home/graham/Downloads/openwrt-12.09/staging_dir/target-mips_uClibc-0.9.33.2/.prepared
+ mkdir -p /home/graham/Downloads/openwrt-12.09/staging_dir/host
+ cd /home/graham/Downloads/openwrt-12.09/staging_dir/host
+ mkdir -p bin lib include stamp
mkdir -p /home/graham/Downloads/openwrt-12.09/build_dir/host/stamp /home/graham/Downloads/openwrt-12.09/staging_dir/host/include/sys
install -m0644 /home/graham/Downloads/openwrt-12.09/tools/include/*.h /home/graham/Downloads/openwrt-12.09/staging_dir/host/include/
install -m0644 /home/graham/Downloads/openwrt-12.09/tools/include/sys/*.h /home/graham/Downloads/openwrt-12.09/staging_dir/host/include/sys/
ln -sf lib /home/graham/Downloads/openwrt-12.09/staging_dir/host/lib64
touch /home/graham/Downloads/openwrt-12.09/staging_dir/host/.prepared
make[3]: Entering directory '/home/graham/Downloads/openwrt-12.09/tools/m4'
make[3]: Leaving directory '/home/graham/Downloads/openwrt-12.09/tools/m4'
make[3]: Entering directory '/home/graham/Downloads/openwrt-12.09/tools/m4'
make[3]: Leaving directory '/home/graham/Downloads/openwrt-12.09/tools/m4'
make[3]: Entering directory '/home/graham/Downloads/openwrt-12.09/tools/sed'
make[3]: Leaving directory '/home/graham/Downloads/openwrt-12.09/tools/sed'
make[3]: Entering directory '/home/graham/Downloads/openwrt-12.09/tools/sed'
make[3]: Leaving directory '/home/graham/Downloads/openwrt-12.09/tools/sed'
make[3]: Entering directory '/home/graham/Downloads/openwrt-12.09/tools/libtool'
make[3]: Leaving directory '/home/graham/Downloads/openwrt-12.09/tools/libtool'
make[3]: Entering directory '/home/graham/Downloads/openwrt-12.09/tools/libtool'
make[3]: Leaving directory '/home/graham/Downloads/openwrt-12.09/tools/libtool'
make[3]: Entering directory '/home/graham/Downloads/openwrt-12.09/tools/autoconf'
make[3]: Leaving directory '/home/graham/Downloads/openwrt-12.09/tools/autoconf'
make[3]: Entering directory '/home/graham/Downloads/openwrt-12.09/tools/autoconf'
make[3]: Leaving directory '/home/graham/Downloads/openwrt-12.09/tools/autoconf'
make[3]: Entering directory '/home/graham/Downloads/openwrt-12.09/tools/pkg-config'
make   -C /home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25  
make[4]: Entering directory '/home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25'
make  all-recursive
make[5]: Entering directory '/home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25'
Making all in glib-1.2.10
make[6]: Entering directory '/home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25/glib-1.2.10'
make  all-recursive
make[7]: Entering directory '/home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25/glib-1.2.10'
Making all in .
make[8]: Entering directory '/home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25/glib-1.2.10'
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT garray.lo -MD -MP -MF .deps/garray.Tpo -c -o garray.lo garray.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT garray.lo -MD -MP -MF .deps/garray.Tpo -c garray.c  -fPIC -DPIC -o .libs/garray.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT garray.lo -MD -MP -MF .deps/garray.Tpo -c garray.c -o garray.o >/dev/null 2>&1
mv -f .deps/garray.Tpo .deps/garray.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT gcompletion.lo -MD -MP -MF .deps/gcompletion.Tpo -c -o gcompletion.lo gcompletion.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gcompletion.lo -MD -MP -MF .deps/gcompletion.Tpo -c gcompletion.c  -fPIC -DPIC -o .libs/gcompletion.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gcompletion.lo -MD -MP -MF .deps/gcompletion.Tpo -c gcompletion.c -o gcompletion.o >/dev/null 2>&1
mv -f .deps/gcompletion.Tpo .deps/gcompletion.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT gdataset.lo -MD -MP -MF .deps/gdataset.Tpo -c -o gdataset.lo gdataset.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gdataset.lo -MD -MP -MF .deps/gdataset.Tpo -c gdataset.c  -fPIC -DPIC -o .libs/gdataset.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gdataset.lo -MD -MP -MF .deps/gdataset.Tpo -c gdataset.c -o gdataset.o >/dev/null 2>&1
mv -f .deps/gdataset.Tpo .deps/gdataset.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT gdate.lo -MD -MP -MF .deps/gdate.Tpo -c -o gdate.lo gdate.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gdate.lo -MD -MP -MF .deps/gdate.Tpo -c gdate.c  -fPIC -DPIC -o .libs/gdate.o
gdate.c: In function 'g_date_fill_parse_tokens':
gdate.c:463:5: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
   s = str;
     ^
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gdate.lo -MD -MP -MF .deps/gdate.Tpo -c gdate.c -o gdate.o >/dev/null 2>&1
mv -f .deps/gdate.Tpo .deps/gdate.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT gerror.lo -MD -MP -MF .deps/gerror.Tpo -c -o gerror.lo gerror.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gerror.lo -MD -MP -MF .deps/gerror.Tpo -c gerror.c  -fPIC -DPIC -o .libs/gerror.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gerror.lo -MD -MP -MF .deps/gerror.Tpo -c gerror.c -o gerror.o >/dev/null 2>&1
mv -f .deps/gerror.Tpo .deps/gerror.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT giounix.lo -MD -MP -MF .deps/giounix.Tpo -c -o giounix.lo giounix.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT giounix.lo -MD -MP -MF .deps/giounix.Tpo -c giounix.c  -fPIC -DPIC -o .libs/giounix.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT giounix.lo -MD -MP -MF .deps/giounix.Tpo -c giounix.c -o giounix.o >/dev/null 2>&1
mv -f .deps/giounix.Tpo .deps/giounix.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT gmain.lo -MD -MP -MF .deps/gmain.Tpo -c -o gmain.lo gmain.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gmain.lo -MD -MP -MF .deps/gmain.Tpo -c gmain.c  -fPIC -DPIC -o .libs/gmain.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gmain.lo -MD -MP -MF .deps/gmain.Tpo -c gmain.c -o gmain.o >/dev/null 2>&1
mv -f .deps/gmain.Tpo .deps/gmain.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT gmem.lo -MD -MP -MF .deps/gmem.Tpo -c -o gmem.lo gmem.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gmem.lo -MD -MP -MF .deps/gmem.Tpo -c gmem.c  -fPIC -DPIC -o .libs/gmem.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gmem.lo -MD -MP -MF .deps/gmem.Tpo -c gmem.c -o gmem.o >/dev/null 2>&1
mv -f .deps/gmem.Tpo .deps/gmem.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT gmessages.lo -MD -MP -MF .deps/gmessages.Tpo -c -o gmessages.lo gmessages.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gmessages.lo -MD -MP -MF .deps/gmessages.Tpo -c gmessages.c  -fPIC -DPIC -o .libs/gmessages.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gmessages.lo -MD -MP -MF .deps/gmessages.Tpo -c gmessages.c -o gmessages.o >/dev/null 2>&1
mv -f .deps/gmessages.Tpo .deps/gmessages.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT grel.lo -MD -MP -MF .deps/grel.Tpo -c -o grel.lo grel.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT grel.lo -MD -MP -MF .deps/grel.Tpo -c grel.c  -fPIC -DPIC -o .libs/grel.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT grel.lo -MD -MP -MF .deps/grel.Tpo -c grel.c -o grel.o >/dev/null 2>&1
mv -f .deps/grel.Tpo .deps/grel.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT gscanner.lo -MD -MP -MF .deps/gscanner.Tpo -c -o gscanner.lo gscanner.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gscanner.lo -MD -MP -MF .deps/gscanner.Tpo -c gscanner.c  -fPIC -DPIC -o .libs/gscanner.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gscanner.lo -MD -MP -MF .deps/gscanner.Tpo -c gscanner.c -o gscanner.o >/dev/null 2>&1
mv -f .deps/gscanner.Tpo .deps/gscanner.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT gstrfuncs.lo -MD -MP -MF .deps/gstrfuncs.Tpo -c -o gstrfuncs.lo gstrfuncs.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gstrfuncs.lo -MD -MP -MF .deps/gstrfuncs.Tpo -c gstrfuncs.c  -fPIC -DPIC -o .libs/gstrfuncs.o
gstrfuncs.c: In function 'g_strdown':
gstrfuncs.c:1139:5: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
   s = string;
     ^
gstrfuncs.c: In function 'g_strup':
gstrfuncs.c:1155:5: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
   s = string;
     ^
gstrfuncs.c: In function 'g_strchug':
gstrfuncs.c:1314:14: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
   for (start = string; *start && isspace (*start); start++)
              ^
gstrfuncs.c:1317:49: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness [-Wpointer-sign]
In file included from gstrfuncs.c:39:0:
/usr/include/string.h:398:15: note: expected 'const char *' but argument is of type 'guchar * {aka unsigned char *}'
 extern size_t strlen (const char *__s)
               ^
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gstrfuncs.lo -MD -MP -MF .deps/gstrfuncs.Tpo -c gstrfuncs.c -o gstrfuncs.o >/dev/null 2>&1
mv -f .deps/gstrfuncs.Tpo .deps/gstrfuncs.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT gstring.lo -MD -MP -MF .deps/gstring.Tpo -c -o gstring.lo gstring.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gstring.lo -MD -MP -MF .deps/gstring.Tpo -c gstring.c  -fPIC -DPIC -o .libs/gstring.o
gstring.c: In function 'g_string_down':
gstring.c:446:5: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
   s = string->str;
     ^
gstring.c: In function 'g_string_up':
gstring.c:465:5: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
   s = string->str;
     ^
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gstring.lo -MD -MP -MF .deps/gstring.Tpo -c gstring.c -o gstring.o >/dev/null 2>&1
mv -f .deps/gstring.Tpo .deps/gstring.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT gutils.lo -MD -MP -MF .deps/gutils.Tpo -c -o gutils.lo gutils.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gutils.lo -MD -MP -MF .deps/gutils.Tpo -c gutils.c  -fPIC -DPIC -o .libs/gutils.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -MT gutils.lo -MD -MP -MF .deps/gutils.Tpo -c gutils.c -o gutils.o >/dev/null 2>&1
mv -f .deps/gutils.Tpo .deps/gutils.Plo
/usr/bin/bash ./libtool --tag=CC   --mode=link gcc  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -version-info 0:10:0 -release 1.2 -export-dynamic -L/home/graham/Downloads/openwrt-12.09/staging_dir/host/lib  -o libglib.la  garray.lo gcache.lo gcompletion.lo gdataset.lo gdate.lo gerror.lo ghash.lo ghook.lo giochannel.lo giounix.lo glist.lo gmain.lo gmem.lo gmessages.lo gmutex.lo gnode.lo gprimes.lo grel.lo gscanner.lo gslist.lo gstrfuncs.lo gstring.lo gtimer.lo gtree.lo gutils.lo  
libtool: link: warning: `-version-info/-version-number' is ignored for convenience libraries
libtool: link: warning: `-release' is ignored for convenience libraries
libtool: link: rm -fr  .libs/libglib.a .libs/libglib.la
libtool: link: ar cru .libs/libglib.a .libs/garray.o .libs/gcache.o .libs/gcompletion.o .libs/gdataset.o .libs/gdate.o .libs/gerror.o .libs/ghash.o .libs/ghook.o .libs/giochannel.o .libs/giounix.o .libs/glist.o .libs/gmain.o .libs/gmem.o .libs/gmessages.o .libs/gmutex.o .libs/gnode.o .libs/gprimes.o .libs/grel.o .libs/gscanner.o .libs/gslist.o .libs/gstrfuncs.o .libs/gstring.o .libs/gtimer.o .libs/gtree.o .libs/gutils.o 
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libglib.a
libtool: link: ( cd ".libs" && rm -f "libglib.la" && ln -s "../libglib.la" "libglib.la" )
gcc -DHAVE_CONFIG_H -I. -DG_LOG_DOMAIN=g_log_domain_glib   -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT -MT testglib.o -MD -MP -MF .deps/testglib.Tpo -c -o testglib.o testglib.c
testglib.c: In function 'g_node_test':
testglib.c:86:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_depth (root) == 1 && g_node_max_height (root) == 1);
  ^
testglib.c:90:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, root->children == node_B);
  ^
testglib.c:98:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, root->children->next == node_F);
  ^
testglib.c:108:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_depth (root) == 1);
  ^
testglib.c:109:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_max_height (root) == 4);
  ^
testglib.c:110:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_depth (node_G->children->next) == 4);
  ^
testglib.c:111:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_n_nodes (root, G_TRAVERSE_LEAFS) == 7);
  ^
testglib.c:112:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_n_nodes (root, G_TRAVERSE_NON_LEAFS) == 4);
  ^
testglib.c:113:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_n_nodes (root, G_TRAVERSE_ALL) == 11);
  ^
testglib.c:114:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_max_height (node_F) == 3);
  ^
testglib.c:115:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_n_children (node_G) == 4);
  ^
testglib.c:116:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_find_child (root, G_TRAVERSE_ALL, C2P ('F')) == node_F);
  ^
testglib.c:117:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_find (root, G_LEVEL_ORDER, G_TRAVERSE_NON_LEAFS, C2P ('I')) == NULL);
  ^
testglib.c:118:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_find (root, G_IN_ORDER, G_TRAVERSE_LEAFS, C2P ('J')) == node_J);
  ^
testglib.c:123:6: warning: reading through null pointer (argument 5) [-Wformat=]
       TEST (NULL, P2C (node->data) == ('C' + i));
      ^
testglib.c:127:4: warning: reading through null pointer (argument 5) [-Wformat=]
     TEST (NULL, g_node_child_position (node_G, g_node_nth_child (node_G, i)) == i);
    ^
testglib.c:182:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_max_height (root) > 100);
  ^
testglib.c:183:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, g_node_n_nodes (root, G_TRAVERSE_ALL) == 1 + 2048);
  ^
testglib.c: In function 'main':
testglib.c:359:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, sizeof (gint8) == 1);
  ^
testglib.c:361:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, sizeof (gint16) == 2);
  ^
testglib.c:363:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, sizeof (gint32) == 4);
  ^
testglib.c:366:2: warning: reading through null pointer (argument 5) [-Wformat=]
   TEST (NULL, sizeof (gint64) == 8);
  ^
mv -f .deps/testglib.Tpo .deps/testglib.Po
/usr/bin/bash ./libtool --tag=CC   --mode=link gcc  -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall  -D_REENTRANT  -L/home/graham/Downloads/openwrt-12.09/staging_dir/host/lib  -o testglib testglib.o libglib.la 
libtool: link: gcc -O2 -I/home/graham/Downloads/openwrt-12.09/staging_dir/host/include -Wall -D_REENTRANT -o testglib testglib.o  -L/home/graham/Downloads/openwrt-12.09/staging_dir/host/lib ./.libs/libglib.a
./.libs/libglib.a(garray.o): In function `g_bit_nth_lsf':
garray.c:(.text+0x130): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(garray.o): In function `g_bit_nth_msf':
garray.c:(.text+0x160): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(garray.o): In function `g_bit_storage':
garray.c:(.text+0x1a0): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(ghash.o): In function `g_bit_nth_lsf':
ghash.c:(.text+0x230): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(ghash.o): In function `g_bit_nth_msf':
ghash.c:(.text+0x260): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(ghash.o): In function `g_bit_storage':
ghash.c:(.text+0x2a0): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(glist.o): In function `g_bit_nth_lsf':
glist.c:(.text+0x180): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(glist.o): In function `g_bit_nth_msf':
glist.c:(.text+0x1b0): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(glist.o): In function `g_bit_storage':
glist.c:(.text+0x1f0): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(gmem.o): In function `g_bit_nth_lsf':
gmem.c:(.text+0x50): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(gmem.o): In function `g_bit_nth_msf':
gmem.c:(.text+0x80): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(gmem.o): In function `g_bit_storage':
gmem.c:(.text+0xc0): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(gmessages.o): In function `g_bit_nth_lsf':
gmessages.c:(.text+0x670): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(gmessages.o): In function `g_bit_nth_msf':
gmessages.c:(.text+0x6a0): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(gmessages.o): In function `g_bit_storage':
gmessages.c:(.text+0x6e0): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(gmutex.o): In function `g_bit_nth_lsf':
gmutex.c:(.text+0x70): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(gmutex.o): In function `g_bit_nth_msf':
gmutex.c:(.text+0xa0): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(gmutex.o): In function `g_bit_storage':
gmutex.c:(.text+0xe0): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(gnode.o): In function `g_bit_nth_lsf':
gnode.c:(.text+0x860): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(gnode.o): In function `g_bit_nth_msf':
gnode.c:(.text+0x890): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(gnode.o): In function `g_bit_storage':
gnode.c:(.text+0x8d0): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(gprimes.o): In function `g_bit_nth_lsf':
gprimes.c:(.text+0x0): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(gprimes.o): In function `g_bit_nth_msf':
gprimes.c:(.text+0x30): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(gprimes.o): In function `g_bit_storage':
gprimes.c:(.text+0x70): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(grel.o): In function `g_bit_nth_lsf':
grel.c:(.text+0x290): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(grel.o): In function `g_bit_nth_msf':
grel.c:(.text+0x2c0): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(grel.o): In function `g_bit_storage':
grel.c:(.text+0x300): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(gslist.o): In function `g_bit_nth_lsf':
gslist.c:(.text+0xf0): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(gslist.o): In function `g_bit_nth_msf':
gslist.c:(.text+0x120): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(gslist.o): In function `g_bit_storage':
gslist.c:(.text+0x160): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(gstrfuncs.o): In function `g_bit_nth_lsf':
gstrfuncs.c:(.text+0x0): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(gstrfuncs.o): In function `g_bit_nth_msf':
gstrfuncs.c:(.text+0x30): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(gstrfuncs.o): In function `g_bit_storage':
gstrfuncs.c:(.text+0x70): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(gstring.o): In function `g_bit_nth_lsf':
gstring.c:(.text+0xa0): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(gstring.o): In function `g_bit_nth_msf':
gstring.c:(.text+0xd0): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(gstring.o): In function `g_bit_storage':
gstring.c:(.text+0x110): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(gtimer.o): In function `g_bit_nth_lsf':
gtimer.c:(.text+0x0): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(gtimer.o): In function `g_bit_nth_msf':
gtimer.c:(.text+0x30): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(gtimer.o): In function `g_bit_storage':
gtimer.c:(.text+0x70): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(gtree.o): In function `g_bit_nth_lsf':
gtree.c:(.text+0x930): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(gtree.o): In function `g_bit_nth_msf':
gtree.c:(.text+0x960): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(gtree.o): In function `g_bit_storage':
gtree.c:(.text+0x9a0): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
./.libs/libglib.a(gutils.o): In function `g_bit_nth_lsf':
gutils.c:(.text+0x0): multiple definition of `g_bit_nth_lsf'
testglib.o:testglib.c:(.text+0x100): first defined here
./.libs/libglib.a(gutils.o): In function `g_bit_nth_msf':
gutils.c:(.text+0x30): multiple definition of `g_bit_nth_msf'
testglib.o:testglib.c:(.text+0x130): first defined here
./.libs/libglib.a(gutils.o): In function `g_bit_storage':
gutils.c:(.text+0x70): multiple definition of `g_bit_storage'
testglib.o:testglib.c:(.text+0x170): first defined here
collect2: error: ld returned 1 exit status
Makefile:456: recipe for target 'testglib' failed
make[8]: *** [testglib] Error 1
make[8]: Leaving directory '/home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25/glib-1.2.10'
Makefile:531: recipe for target 'all-recursive' failed
make[7]: *** [all-recursive] Error 1
make[7]: Leaving directory '/home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25/glib-1.2.10'
Makefile:364: recipe for target 'all' failed
make[6]: *** [all] Error 2
make[6]: Leaving directory '/home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25/glib-1.2.10'
Makefile:536: recipe for target 'all-recursive' failed
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory '/home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25'
Makefile:309: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25'
Makefile:34: recipe for target '/home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25/.built' failed
make[3]: *** [/home/graham/Downloads/openwrt-12.09/build_dir/host/pkg-config-0.25/.built] Error 2
make[3]: Leaving directory '/home/graham/Downloads/openwrt-12.09/tools/pkg-config'
tools/Makefile:137: recipe for target 'tools/pkg-config/compile' failed
make[2]: *** [tools/pkg-config/compile] Error 2
make[2]: Leaving directory '/home/graham/Downloads/openwrt-12.09'
tools/Makefile:136: recipe for target '/home/graham/Downloads/openwrt-12.09/staging_dir/target-mips_uClibc-0.9.33.2/stamp/.tools_install_nnnnn' failed
make[1]: *** [/home/graham/Downloads/openwrt-12.09/staging_dir/target-mips_uClibc-0.9.33.2/stamp/.tools_install_nnnnn] Error 2
make[1]: Leaving directory '/home/graham/Downloads/openwrt-12.09'
/home/graham/Downloads/openwrt-12.09/include/toplevel.mk:144: recipe for target 'world' failed
make: *** [world] Error 2
[graham@tyr openwrt-12.09]$ 

Moved back over to Ubuntu 8.04.4 and trying there again. (built the latest GIT from source - required v1.6.5 or later - and installed. Building now and will take several hours if successful)

Update: got this far on Ubuntu 8.04.4

graham@graham-laptop-vm1:/media/disk/openwrt$ make
 make[1] world
 make[2] tools/install
 make[3] -C tools/m4 compile
 make[3] -C tools/m4 install
 make[3] -C tools/sed compile
 make[3] -C tools/sed install
 make[3] -C tools/libtool compile
 make[3] -C tools/libtool install
 make[3] -C tools/autoconf compile
 make[3] -C tools/autoconf install
 make[3] -C tools/pkg-config compile
 make[3] -C tools/pkg-config install
 make[3] -C tools/xz compile
 make[3] -C tools/xz install
 make[3] -C tools/automake compile
 make[3] -C tools/automake install
 make[3] -C tools/gmp compile
 make[3] -C tools/gmp install
 make[3] -C tools/mpfr compile
 make[3] -C tools/mpfr install
 make[3] -C tools/mpc compile
 make[3] -C tools/mpc install
 make[3] -C tools/libelf compile
 make[3] -C tools/libelf install
 make[3] -C tools/flex compile
 make[3] -C tools/flex install
 make[3] -C tools/bison compile
 make[3] -C tools/bison install
 make[3] -C tools/mklibs compile
 make[3] -C tools/mklibs install
 make[3] -C tools/sstrip compile
 make[3] -C tools/sstrip install
 make[3] -C tools/ipkg-utils compile
 make[3] -C tools/ipkg-utils install
 make[3] -C tools/genext2fs compile
 make[3] -C tools/genext2fs install
 make[3] -C tools/e2fsprogs compile
make -r world: build failed. Please re-run make with V=s to see what's going on
make: *** [world] Error 1

Will run with "V=s"

make[6]: Entering directory `/media/disk/openwrt/build_dir/host/e2fsprogs-1.42.4/lib/ss'
    SUBST mk_cmds
    COMPILE_ET ss_err.et
chmod: ss_err.h: new permissions are r-xrwxrwx, not r-xr-xr-x
chmod: ss_err.c: new permissions are r-xrwxrwx, not r-xr-xr-x
make[6]: *** [ss_err.c] Error 1
make[6]: Leaving directory `/media/disk/openwrt/build_dir/host/e2fsprogs-1.42.4/lib/ss'
make[5]: *** [all-libs-recursive] Error 1
make[5]: Leaving directory `/media/disk/openwrt/build_dir/host/e2fsprogs-1.42.4'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/media/disk/openwrt/build_dir/host/e2fsprogs-1.42.4'
make[3]: *** [/media/disk/openwrt/build_dir/host/e2fsprogs-1.42.4/.built] Error 2
make[3]: Leaving directory `/media/disk/openwrt/tools/e2fsprogs'
make[2]: *** [tools/e2fsprogs/compile] Error 2
make[2]: Leaving directory `/media/disk/openwrt'
make[1]: *** [/media/disk/openwrt/staging_dir/target-mips_r2_uClibc-0.9.33.2/stamp/.tools_install_nnnnn] Error 2
make[1]: Leaving directory `/media/disk/openwrt'
make: *** [world] Error 2

This is running on a USB HDD formatted as NTFS. This version of Ubuntu does not support ext4 and FAT does not support symbolic links (tried). So it is looking like an NTFS deficiency? Now reformatting as ext3 and trying again.

(It has now built past that problem) The toolchain has now completed.

(Last edited by Xotic750 on 24 Apr 2016, 00:28)

The test compile for brcm68xx got a long way, but it failed.

make[3]: Entering directory `/media/disk/openwrt-12.09/package/hotplug2'
mkdir -p /media/disk/openwrt-12.09/dl
echo "Checking out files from the svn repository..."; mkdir -p /media/disk/openwrt-12.09/tmp/dl && cd /media/disk/openwrt-12.09/tmp/dl && rm -rf hotplug2-201 && [ \! -d hotplug2-201 ] && ( svn help export | grep -q trust-server-cert && svn export --non-interactive --trust-server-cert -r201 http://svn.nomi.cz/svn/isteve/hotplug2 hotplug2-201 || svn export --non-interactive -r201 http://svn.nomi.cz/svn/isteve/hotplug2 hotplug2-201 ) && echo "Packing checkout..." &&     /bin/tar cfz /media/disk/openwrt-12.09/tmp/dl/hotplug2-201.tar.gz hotplug2-201 && mv /media/disk/openwrt-12.09/tmp/dl/hotplug2-201.tar.gz /media/disk/openwrt-12.09/dl/ && rm -rf hotplug2-201; 
Checking out files from the svn repository...
svn: PROPFIND request failed on '/svn/isteve/hotplug2'
svn: PROPFIND of '/svn/isteve/hotplug2': Could not resolve hostname `svn.nomi.cz': No address associated with hostname (http://svn.nomi.cz)
make[3]: *** [/media/disk/openwrt-12.09/dl/hotplug2-201.tar.gz] Error 1
make[3]: Leaving directory `/media/disk/openwrt-12.09/package/hotplug2'
make[2]: *** [package/hotplug2/compile] Error 2
make[2]: Leaving directory `/media/disk/openwrt-12.09'
make[1]: *** [/media/disk/openwrt-12.09/staging_dir/target-mips_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/media/disk/openwrt-12.09'
make: *** [world] Error 2

Possible solution? https://dev.openwrt.org/changeset/41503

Applied patch and compile continues.

(Last edited by Xotic750 on 24 Apr 2016, 21:30)

For a moment I actually thought that it was going to complete, it began creating images but then it threw and failed. I'm not sure why so many images are being produced with the .config setting that I chose?

# Neufbox4
# Generate the tagged image
/media/disk/openwrt-12.09/staging_dir/host/bin/imagetag -i /media/disk/openwrt-12.09/build_dir/linux-brcm63xx/vmlinux.lzma.cfe -f /media/disk/openwrt-12.09/build_dir/linux-brcm63xx/root.jffs2-64k --output /media/disk/openwrt-12.09/bin/brcm63xx/openwrt-NEUFBOX4-jffs2-64k-cfe.bin --boardid 96358VW --chipid 6358 --entry 0x80010000             --load-addr 0x80010000         --rsa-signature "OpenWRT-unknown" --info1 "-NEUFBOX4" --info2 jffs2-64k    
Broadcom 63xx image tagger - v2.0.0
Copyright (C) 2008 Axel Gembe
Copyright (C) 2009-2010 Daniel Dickinson
Licensed under the terms of the Gnu General Public License
Data alignment to 64k with 'deadc0de' appended
# Neufbox6
# Comtrend 6373
# Generate the tagged image
/media/disk/openwrt-12.09/staging_dir/host/bin/imagetag -i /media/disk/openwrt-12.09/build_dir/linux-brcm63xx/vmlinux.lzma.cfe -f /media/disk/openwrt-12.09/build_dir/linux-brcm63xx/root.jffs2-64k --output /media/disk/openwrt-12.09/bin/brcm63xx/openwrt-CT6373-jffs2-64k-cfe.bin --boardid CT6373-1 --chipid 6358 --entry 0x80010000             --load-addr 0x80010000         --rsa-signature "" --info1 "-CT6373" --info2 jffs2-64k    
Broadcom 63xx image tagger - v2.0.0
Copyright (C) 2008 Axel Gembe
Copyright (C) 2009-2010 Daniel Dickinson
Licensed under the terms of the Gnu General Public License
Data alignment to 64k with 'deadc0de' appended
# Comtrend 536, 5621
# Generate the tagged image
/media/disk/openwrt-12.09/staging_dir/host/bin/imagetag -i /media/disk/openwrt-12.09/build_dir/linux-brcm63xx/vmlinux.lzma.cfe -f /media/disk/openwrt-12.09/build_dir/linux-brcm63xx/root.jffs2-64k --output /media/disk/openwrt-12.09/bin/brcm63xx/openwrt-CT536_CT5621-jffs2-64k-cfe.bin --boardid 96348GW-11 --chipid 6348 --entry 0x80010000         --load-addr 0x80010000         --rsa-signature "" --info1 "+CT536_CT5621" --info2 jffs2-64k    
Broadcom 63xx image tagger - v2.0.0
Copyright (C) 2008 Axel Gembe
Copyright (C) 2009-2010 Daniel Dickinson
Licensed under the terms of the Gnu General Public License
Data alignment to 64k with 'deadc0de' appended
# Davolink DV201AMR
/media/disk/openwrt-12.09/scripts/brcmImage.pl -t -p -b DV201AMR -c 6348 -k /media/disk/openwrt-12.09/build_dir/linux-brcm63xx/vmlinux.lzma.cfe -r /media/disk/openwrt-12.09/build_dir/linux-brcm63xx/root.jffs2-64k -o /media/disk/openwrt-12.09/bin/brcm63xx/openwrt-DV201AMR-jffs2-64k-cfe.bin
Can't locate Compress/Zlib.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /media/disk/openwrt-12.09/scripts/brcmImage.pl line 31.
BEGIN failed--compilation aborted at /media/disk/openwrt-12.09/scripts/brcmImage.pl line 31.
make[5]: *** [install] Error 2
make[5]: Leaving directory `/media/disk/openwrt-12.09/target/linux/brcm63xx/image'
make[4]: *** [install] Error 2
make[4]: Leaving directory `/media/disk/openwrt-12.09/target/linux/brcm63xx'
make[3]: *** [install] Error 2
make[3]: Leaving directory `/media/disk/openwrt-12.09/target/linux'
make[2]: *** [target/linux/install] Error 2
make[2]: Leaving directory `/media/disk/openwrt-12.09'
make[1]: *** [/media/disk/openwrt-12.09/staging_dir/target-mips_uClibc-0.9.33.2/stamp/.target_install] Error 2
make[1]: Leaving directory `/media/disk/openwrt-12.09'
make: *** [world] Error 2

You're missing the zlib Perl extension(s).

Thanks. CPAN installed Compress::zlib and ran make, everything completed without issue.:)

Now I just need to figure out how to add a profile with the correct details and I should be able to produce an image that I can flash to the device. It will be interesting to see if the switch is detected. If it is detected, I'm wondering how to go forward with getting support/fix implemented in the trunk? Will it be possible to get some information from the unit to check that the details of the the switch are in b53 driver? First, create a profile.

If you're working off OpenWrt's git tree, you can just diff your changes against master and create a patch with 'git format-patch', then mail that to the OpenWrt development mailing list (you need to be registered). Git diff or git format-patch only works if you committed the changes already to your local tree, btw, as long as you haven't done that git diff or format-patch won't do anything.

I wish you good luck. For profiles it helps to look at existing ones for similar hardware.

There is a large change between AA and trunk, specifically the change that is of interest in this experiment is the change from "roboswitch" to the b53 driver. If "roboswitch" can detect it (which an experiment in 2013 shows), and it can be configured then there is something that has been missed or is broken in the move to the b53 driver. But this will probably fall well outside of my knowledge. Luckily danitool has provided me with his backport patch (he ported the b53 driver back into AA, so the config is more like trunk that what I'm trying to test) for the dgnd3700 that he made, otherwise there really is not much reference to these boards that that time.

(Last edited by Xotic750 on 24 Apr 2016, 16:39)

Maybe Zajec can be of help, he works on a lot of Broadcom hardware around here.

I hoping that there will be someone with the experience or knowledge that can help with that. Fisrt prove that it can work with "roboswitch", we have already shown that it is not working with the b53 driver that replaced it, collect any information (detection method, MDIO or SPI, any hardware addresses and the like) that may help to diagnose the deficiency in the b53 driver, get it fixed/implemented (a knowledgeable developer).

I have begun adding the configuration, and have (I believe) made the majority or required changes.

https://github.com/Xotic750/openwrt-1/commits/evg2000aa

danitool was kind enough to provide me with his patches as a reference for another unit. I have been following them, but there areas that I am uncertain of, and I don't understand the changes for the MTD, which it the most important. (have a copy on my machine but lost the URL for the original download)

Is this patch required for my unit with AA? In trunk I had .num_usbh_ports = 2 in board_bcm963xx.c

--- target/linux/brcm63xx/patches-3.3/901-ohci-bcm63xx.patch    (revision 0)
+++ target/linux/brcm63xx/patches-3.3/901-ohci-bcm63xx.patch    (working copy)
@@ -0,0 +1,11 @@
+--- a/drivers/usb/host/ohci-bcm63xx.c
++++ b/drivers/usb/host/ohci-bcm63xx.c
+@@ -20,8 +20,6 @@
+     struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+     int ret;
+ 
+-    ohci->num_ports = 1;
+-
+     ret = ohci_init(ohci);
+     if (ret < 0)
+         return ret;

I am at total loss with patching bcm63xxpart.c and the patch doesn't seem to match the code at source.

+--- a/drivers/mtd/bcm63xxpart.c
++++ b/drivers/mtd/bcm63xxpart.c
+@@ -163,7 +163,7 @@
+         rootfsaddr = 0;
+         spareaddr = cfelen;
+     }
+-    sparelen = master->size - spareaddr - nvramlen - caldatalen1 - caldatalen2;
++    sparelen = master->size - spareaddr - nvramlen - caldatalen1 - caldatalen2 - 0x1A0000;
+ 
+     /* Determine number of partitions */
+     if (rootfslen > 0)
+@@ -177,6 +177,8 @@
+ 
+     if (caldatalen2 > 0)
+         nrparts++;
++    
++    nrparts++;
+ 
+     /* Ask kernel for more memory */
+     parts = kzalloc(sizeof(*parts) * nrparts + 10 * nrparts, GFP_KERNEL);
+@@ -232,6 +234,11 @@
+         curpart++;
+     }
+ 
++    parts[curpart].name = "netgear_parts";
++    parts[curpart].offset = master->size - nvramlen - 0x1A0000;
++    parts[curpart].size = 0x1A0000;
++    curpart++;
++    
+     parts[curpart].name = "nvram";
+     parts[curpart].offset = master->size - nvramlen;
+     parts[curpart].size = nvramlen;
+@@ -241,7 +248,7 @@
+     parts[curpart].name = "linux";
+     parts[curpart].offset = cfelen;
+     parts[curpart].size = master->size - cfelen - nvramlen
+-                  - caldatalen1 - caldatalen2;
++                  - caldatalen1 - caldatalen2 - 0x1A0000;
+ 
+     for (i = 0; i < nrparts; i++)
+         pr_info("Partition %d is %s offset %llx and length %llx\n", i,

The original AA branch code bcm63xxpart.c .

/*
 * BCM63XX CFE image tag parser
 *
 * Copyright © 2006-2008  Florian Fainelli <florian@openwrt.org>
 *              Mike Albon <malbon@openwrt.org>
 * Copyright © 2009-2010  Daniel Dickinson <openwrt@cshore.neomailbox.net>
 * Copyright © 2011 Jonas Gorski <jonas.gorski@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/crc32.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>

#include <asm/mach-bcm63xx/bcm963xx_tag.h>
#include <asm/mach-bcm63xx/board_bcm963xx.h>

#define BCM63XX_EXTENDED_SIZE    0xBFC00000    /* Extended flash address */

#define BCM63XX_MIN_CFE_SIZE    0x10000        /* always at least 64KiB */
#define BCM63XX_MIN_NVRAM_SIZE    0x10000        /* always at least 64KiB */

#define BCM63XX_CFE_MAGIC_OFFSET 0x4e0

static int bcm63xx_detect_cfe(struct mtd_info *master)
{
    char buf[9];
    int ret;
    size_t retlen;

    ret = mtd_read(master, BCM963XX_CFE_VERSION_OFFSET, 5, &retlen,
               (void *)buf);
    buf[retlen] = 0;

    if (ret)
        return ret;

    if (strncmp("cfe-v", buf, 5) == 0)
        return 0;

    /* very old CFE's do not have the cfe-v string, so check for magic */
    ret = mtd_read(master, BCM63XX_CFE_MAGIC_OFFSET, 8, &retlen,
               (void *)buf);
    buf[retlen] = 0;

    return strncmp("CFE1CFE1", buf, 8);
}

static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
                    struct mtd_partition **pparts,
                    struct mtd_part_parser_data *data)
{
    /* CFE, NVRAM and global Linux are always present */
    int nrparts = 3, curpart = 0;
    struct bcm_tag *buf;
    struct mtd_partition *parts;
    int ret;
    size_t retlen;
    unsigned int rootfsaddr, kerneladdr, spareaddr;
    unsigned int rootfslen, kernellen, sparelen, totallen;
    unsigned int cfelen, nvramlen;
    int namelen = 0;
    int i;
    u32 computed_crc;

    if (bcm63xx_detect_cfe(master))
        return -EINVAL;

    cfelen = max_t(uint32_t, master->erasesize, BCM63XX_MIN_CFE_SIZE);
    nvramlen = max_t(uint32_t, master->erasesize, BCM63XX_MIN_NVRAM_SIZE);

    /* Allocate memory for buffer */
    buf = vmalloc(sizeof(struct bcm_tag));
    if (!buf)
        return -ENOMEM;

    /* Get the tag */
    ret = mtd_read(master, cfelen, sizeof(struct bcm_tag), &retlen,
               (void *)buf);

    if (retlen != sizeof(struct bcm_tag)) {
        vfree(buf);
        return -EIO;
    }

    computed_crc = crc32_le(IMAGETAG_CRC_START, (u8 *)buf,
                offsetof(struct bcm_tag, header_crc));
    if (computed_crc == buf->header_crc) {
        char *boardid = &(buf->board_id[0]);
        char *tagversion = &(buf->tag_version[0]);

        sscanf(buf->kernel_address, "%u", &kerneladdr);
        sscanf(buf->kernel_length, "%u", &kernellen);
        sscanf(buf->total_length, "%u", &totallen);

        pr_info("CFE boot tag found with version %s and board type %s\n",
            tagversion, boardid);

        kerneladdr = kerneladdr - BCM63XX_EXTENDED_SIZE;
        rootfsaddr = kerneladdr + kernellen;
        spareaddr = roundup(totallen, master->erasesize) + cfelen;
        sparelen = master->size - spareaddr - nvramlen;
        rootfslen = spareaddr - rootfsaddr;
    } else {
        pr_warn("CFE boot tag CRC invalid (expected %08x, actual %08x)\n",
            buf->header_crc, computed_crc);
        kernellen = 0;
        rootfslen = 0;
        rootfsaddr = 0;
        spareaddr = cfelen;
        sparelen = master->size - cfelen - nvramlen;
    }

    /* Determine number of partitions */
    namelen = 8;
    if (rootfslen > 0) {
        nrparts++;
        namelen += 6;
    }
    if (kernellen > 0) {
        nrparts++;
        namelen += 6;
    }

    /* Ask kernel for more memory */
    parts = kzalloc(sizeof(*parts) * nrparts + 10 * nrparts, GFP_KERNEL);
    if (!parts) {
        vfree(buf);
        return -ENOMEM;
    }

    /* Start building partition list */
    parts[curpart].name = "CFE";
    parts[curpart].offset = 0;
    parts[curpart].size = cfelen;
    curpart++;

    if (kernellen > 0) {
        parts[curpart].name = "kernel";
        parts[curpart].offset = kerneladdr;
        parts[curpart].size = kernellen;
        curpart++;
    }

    if (rootfslen > 0) {
        parts[curpart].name = "rootfs";
        parts[curpart].offset = rootfsaddr;
        parts[curpart].size = rootfslen;
        if (sparelen > 0)
            parts[curpart].size += sparelen;
        curpart++;
    }

    parts[curpart].name = "nvram";
    parts[curpart].offset = master->size - nvramlen;
    parts[curpart].size = nvramlen;

    /* Global partition "linux" to make easy firmware upgrade */
    curpart++;
    parts[curpart].name = "linux";
    parts[curpart].offset = cfelen;
    parts[curpart].size = master->size - cfelen - nvramlen;

    for (i = 0; i < nrparts; i++)
        pr_info("Partition %d is %s offset %lx and length %lx\n", i,
            parts[i].name, (long unsigned int)(parts[i].offset),
            (long unsigned int)(parts[i].size));

    pr_info("Spare partition is offset %x and length %x\n",    spareaddr,
        sparelen);

    *pparts = parts;
    vfree(buf);

    return nrparts;
};

static struct mtd_part_parser bcm63xx_cfe_parser = {
    .owner = THIS_MODULE,
    .parse_fn = bcm63xx_parse_cfe_partitions,
    .name = "bcm63xxpart",
};

static int __init bcm63xx_cfe_parser_init(void)
{
    return register_mtd_parser(&bcm63xx_cfe_parser);
}

static void __exit bcm63xx_cfe_parser_exit(void)
{
    deregister_mtd_parser(&bcm63xx_cfe_parser);
}

module_init(bcm63xx_cfe_parser_init);
module_exit(bcm63xx_cfe_parser_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Daniel Dickinson <openwrt@cshore.neomailbox.net>");
MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
MODULE_AUTHOR("Mike Albon <malbon@openwrt.org>");
MODULE_AUTHOR("Jonas Gorski <jonas.gorski@gmail.com");
MODULE_DESCRIPTION("MTD partitioning for BCM63XX CFE bootloaders");

And what does AA-magic.patch actually do, is this so that v12.09 release packages can be used with the build?

--- include/kernel-defaults.mk    (revision 39163)
+++ include/kernel-defaults.mk    (working copy)
@@ -107,7 +107,7 @@
     $(call Kernel/SetInitramfs)
     rm -rf $(KERNEL_BUILD_DIR)/modules
     [ -d $(LINUX_DIR)/user_headers ] || $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install
-    $(SH_FUNC) grep '=[ym]' $(LINUX_DIR)/.config | LC_ALL=C sort | md5s > $(LINUX_DIR)/.vermagic
+    echo 3e727c51e42e8034f8ada81e0e9fe681 > $(LINUX_DIR)/.vermagic
 endef
 
 define Kernel/CompileModules/Default

As I mentioned before, I have working build environment but I really need some assistance with finishing the configuration so that I can go and fry my unit (hopefully not). tongue

(Last edited by Xotic750 on 25 Apr 2016, 11:24)

You need the USB ohci patch if you want to have USB1.1 support on your 2nd USB port.

The mtd patch is equivalent to board_data partition in lastest trunk revisions. Required if you want to preserve the board data partitions for the OEM firmware. Replace 0x1A0000 with the size of board_data partition in trunk, or a bigger size.

The "magic" patch is indeed for making the firmware compatible with online kernel packages.

Ok. But I don't seem to have a drivers/usb/host/ohci-bcm63xx.c at all from the v12.09 tarball or from AA branch of the github repo (which is some commits ahead of the tarball)?

The bcm63xxpart.c from the v12.09 tarball or the AA branch also do not match for the given patch? I searched every file for "caldatalen1" and it wasn't found anywhere?

I'm beginning to wear a bald patch from scratching my head about these. tongue

Searched the github repo and the only references that I find for caldatalen1 are 4.1 patches.

and a search for ohci-bcm63xx.c didn't bring up anything.

I think I must be having a super dumb day.

Creating a diff of the current trunk and the AA head to see how much has changed. Maybe the trunk can be ported back? Or maybe it's just a case of working out what is needed to get the danitool patch into the file?

Looks like the kind of territory that if I can get it to compile then I could well end up with a brick.

--- /home/graham/Documents/bcm63xxpart.c    2016-04-25 16:25:27.385748818 +0200
+++ /home/graham/source_projects/openwrt/build_dir/toolchain-mips_mips32_gcc-5.3.0_musl-1.1.14/linux/drivers/mtd/bcm63xxpart.c    2016-04-25 16:21:47.302772300 +0200
@@ -4,7 +4,7 @@
  * Copyright © 2006-2008  Florian Fainelli <florian@openwrt.org>
  *              Mike Albon <malbon@openwrt.org>
  * Copyright © 2009-2010  Daniel Dickinson <openwrt@cshore.neomailbox.net>
- * Copyright © 2011 Jonas Gorski <jonas.gorski@gmail.com>
+ * Copyright © 2011-2013  Jonas Gorski <jonas.gorski@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,18 +27,19 @@
 #include <linux/crc32.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/sizes.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 
+#include <asm/mach-bcm63xx/bcm63xx_nvram.h>
 #include <asm/mach-bcm63xx/bcm963xx_tag.h>
 #include <asm/mach-bcm63xx/board_bcm963xx.h>
 
 #define BCM63XX_EXTENDED_SIZE    0xBFC00000    /* Extended flash address */
 
-#define BCM63XX_MIN_CFE_SIZE    0x10000        /* always at least 64KiB */
-#define BCM63XX_MIN_NVRAM_SIZE    0x10000        /* always at least 64KiB */
+#define BCM63XX_CFE_BLOCK_SIZE    SZ_64K        /* always at least 64KiB */
 
 #define BCM63XX_CFE_MAGIC_OFFSET 0x4e0
 
@@ -79,15 +80,20 @@ static int bcm63xx_parse_cfe_partitions(
     unsigned int rootfsaddr, kerneladdr, spareaddr;
     unsigned int rootfslen, kernellen, sparelen, totallen;
     unsigned int cfelen, nvramlen;
-    int namelen = 0;
+    unsigned int cfe_erasesize;
     int i;
     u32 computed_crc;
+    bool rootfs_first = false;
 
     if (bcm63xx_detect_cfe(master))
         return -EINVAL;
 
-    cfelen = max_t(uint32_t, master->erasesize, BCM63XX_MIN_CFE_SIZE);
-    nvramlen = max_t(uint32_t, master->erasesize, BCM63XX_MIN_NVRAM_SIZE);
+    cfe_erasesize = max_t(uint32_t, master->erasesize,
+                  BCM63XX_CFE_BLOCK_SIZE);
+
+    cfelen = cfe_erasesize;
+    nvramlen = bcm63xx_nvram_get_psi_size() * SZ_1K;
+    nvramlen = roundup(nvramlen, cfe_erasesize);
 
     /* Allocate memory for buffer */
     buf = vmalloc(sizeof(struct bcm_tag));
@@ -109,6 +115,7 @@ static int bcm63xx_parse_cfe_partitions(
         char *boardid = &(buf->board_id[0]);
         char *tagversion = &(buf->tag_version[0]);
 
+        sscanf(buf->flash_image_start, "%u", &rootfsaddr);
         sscanf(buf->kernel_address, "%u", &kerneladdr);
         sscanf(buf->kernel_length, "%u", &kernellen);
         sscanf(buf->total_length, "%u", &totallen);
@@ -117,10 +124,18 @@ static int bcm63xx_parse_cfe_partitions(
             tagversion, boardid);
 
         kerneladdr = kerneladdr - BCM63XX_EXTENDED_SIZE;
-        rootfsaddr = kerneladdr + kernellen;
+        rootfsaddr = rootfsaddr - BCM63XX_EXTENDED_SIZE;
         spareaddr = roundup(totallen, master->erasesize) + cfelen;
-        sparelen = master->size - spareaddr - nvramlen;
+
+        if (rootfsaddr < kerneladdr) {
+            /* default Broadcom layout */
+            rootfslen = kerneladdr - rootfsaddr;
+            rootfs_first = true;
+        } else {
+            /* OpenWrt layout */
+            rootfsaddr = kerneladdr + kernellen;
         rootfslen = spareaddr - rootfsaddr;
+        }
     } else {
         pr_warn("CFE boot tag CRC invalid (expected %08x, actual %08x)\n",
             buf->header_crc, computed_crc);
@@ -128,19 +143,15 @@ static int bcm63xx_parse_cfe_partitions(
         rootfslen = 0;
         rootfsaddr = 0;
         spareaddr = cfelen;
-        sparelen = master->size - cfelen - nvramlen;
     }
+    sparelen = master->size - spareaddr - nvramlen;
 
     /* Determine number of partitions */
-    namelen = 8;
-    if (rootfslen > 0) {
+    if (rootfslen > 0)
         nrparts++;
-        namelen += 6;
-    }
-    if (kernellen > 0) {
+
+    if (kernellen > 0)
         nrparts++;
-        namelen += 6;
-    }
 
     /* Ask kernel for more memory */
     parts = kzalloc(sizeof(*parts) * nrparts + 10 * nrparts, GFP_KERNEL);
@@ -156,35 +167,42 @@ static int bcm63xx_parse_cfe_partitions(
     curpart++;
 
     if (kernellen > 0) {
-        parts[curpart].name = "kernel";
-        parts[curpart].offset = kerneladdr;
-        parts[curpart].size = kernellen;
+        int kernelpart = curpart;
+
+        if (rootfslen > 0 && rootfs_first)
+            kernelpart++;
+        parts[kernelpart].name = "kernel";
+        parts[kernelpart].offset = kerneladdr;
+        parts[kernelpart].size = kernellen;
         curpart++;
     }
 
     if (rootfslen > 0) {
-        parts[curpart].name = "rootfs";
-        parts[curpart].offset = rootfsaddr;
-        parts[curpart].size = rootfslen;
-        if (sparelen > 0)
-            parts[curpart].size += sparelen;
+        int rootfspart = curpart;
+
+        if (kernellen > 0 && rootfs_first)
+            rootfspart--;
+        parts[rootfspart].name = "rootfs";
+        parts[rootfspart].offset = rootfsaddr;
+        parts[rootfspart].size = rootfslen;
+        if (sparelen > 0  && !rootfs_first)
+            parts[rootfspart].size += sparelen;
         curpart++;
     }
 
     parts[curpart].name = "nvram";
     parts[curpart].offset = master->size - nvramlen;
     parts[curpart].size = nvramlen;
+    curpart++;
 
     /* Global partition "linux" to make easy firmware upgrade */
-    curpart++;
     parts[curpart].name = "linux";
     parts[curpart].offset = cfelen;
     parts[curpart].size = master->size - cfelen - nvramlen;
 
     for (i = 0; i < nrparts; i++)
-        pr_info("Partition %d is %s offset %lx and length %lx\n", i,
-            parts[i].name, (long unsigned int)(parts[i].offset),
-            (long unsigned int)(parts[i].size));
+        pr_info("Partition %d is %s offset %llx and length %llx\n", i,
+            parts[i].name, parts[i].offset,    parts[i].size);
 
     pr_info("Spare partition is offset %x and length %x\n",    spareaddr,
         sparelen);
@@ -203,7 +221,8 @@ static struct mtd_part_parser bcm63xx_cf
 
 static int __init bcm63xx_cfe_parser_init(void)
 {
-    return register_mtd_parser(&bcm63xx_cfe_parser);
+    register_mtd_parser(&bcm63xx_cfe_parser);
+    return 0;
 }
 
 static void __exit bcm63xx_cfe_parser_exit(void)

(Last edited by Xotic750 on 25 Apr 2016, 18:42)

This is my attempt at a bcm63xxpart.c, based on the AA branch, the example patch provided by danitool, the current trunk file, and the current trunk patches that I found. I have a confidence level of 0% in what I've created, I haven't even tried to see it compiles yet (I have now compiled it without error). If it manages to build, is there a ways to see the partition structure from the .bin file create? I have no intention of flashing anything until I can be sure.

/*
 * BCM63XX CFE image tag parser
 *
 * Copyright © 2006-2008  Florian Fainelli <florian@openwrt.org>
 *              Mike Albon <malbon@openwrt.org>
 * Copyright © 2009-2010  Daniel Dickinson <openwrt@cshore.neomailbox.net>
 * Copyright © 2011 Jonas Gorski <jonas.gorski@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/crc32.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>

#include <asm/mach-bcm63xx/bcm963xx_tag.h>
#include <asm/mach-bcm63xx/board_bcm963xx.h>

#define BCM63XX_EXTENDED_SIZE    0xBFC00000    /* Extended flash address */

#define BCM63XX_MIN_CFE_SIZE    0x10000        /* always at least 64KiB */
#define BCM63XX_MIN_NVRAM_SIZE    0x10000        /* always at least 64KiB */
#define BCM63XX_CFE_BLOCK_SIZE    0x10000        /* always at least 64KiB */
#defined BOARD_DATA_SIZE  0x80000

#define BCM63XX_CFE_MAGIC_OFFSET 0x4e0

static int bcm63xx_detect_cfe(struct mtd_info *master)
{
    char buf[9];
    int ret;
    size_t retlen;

    ret = mtd_read(master, BCM963XX_CFE_VERSION_OFFSET, 5, &retlen,
               (void *)buf);
    buf[retlen] = 0;

    if (ret)
        return ret;

    if (strncmp("cfe-v", buf, 5) == 0)
        return 0;

    /* very old CFE's do not have the cfe-v string, so check for magic */
    ret = mtd_read(master, BCM63XX_CFE_MAGIC_OFFSET, 8, &retlen,
               (void *)buf);
    buf[retlen] = 0;

    return strncmp("CFE1CFE1", buf, 8);
}

static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
                    struct mtd_partition **pparts,
                    struct mtd_part_parser_data *data)
{
    /* CFE, NVRAM and global Linux are always present */
    int nrparts = 3, curpart = 0;
    struct bcm_tag *buf;
    struct mtd_partition *parts;
    int ret;
    size_t retlen;
    /*unsigned int rootfsaddr, kerneladdr, spareaddr;*/
    unsigned int rootfsaddr, kerneladdr, spareaddr, nvramaddr;
    unsigned int rootfslen, kernellen, sparelen, totallen;
    unsigned int cfelen, nvramlen;
    unsigned int cfe_erasesize;
    int namelen = 0;
    unsigned int caldatalen1 = 0, caldataaddr1 = 0;
    unsigned int caldatalen2 = 0, caldataaddr2 = 0;
    int i;
    u32 computed_crc;

    if (bcm63xx_detect_cfe(master))
        return -EINVAL;

    cfe_erasesize = max_t(uint32_t, master->erasesize, BCM63XX_CFE_BLOCK_SIZE);
    cfelen = max_t(uint32_t, master->erasesize, BCM63XX_MIN_CFE_SIZE);
    nvramlen = max_t(uint32_t, master->erasesize, BCM63XX_MIN_NVRAM_SIZE);
    nvramaddr = master->size - nvramlen;

    if (data) {
        if (data->caldata[0]) {
            caldatalen1 = cfe_erasesize;
            caldataaddr1 = rounddown(data->caldata[0], cfe_erasesize);
        }
        if (data->caldata[1]) {
            caldatalen2 = cfe_erasesize;
            caldataaddr2 = rounddown(data->caldata[1], cfe_erasesize);
        }
        if (caldataaddr1 == caldataaddr2) {
            caldataaddr2 = 0;
            caldatalen2 = 0;
        }
    }

    /* Allocate memory for buffer */
    buf = vmalloc(sizeof(struct bcm_tag));
    if (!buf)
        return -ENOMEM;

    /* Get the tag */
    ret = mtd_read(master, cfelen, sizeof(struct bcm_tag), &retlen,
               (void *)buf);

    if (retlen != sizeof(struct bcm_tag)) {
        vfree(buf);
        return -EIO;
    }

    computed_crc = crc32_le(IMAGETAG_CRC_START, (u8 *)buf,
                offsetof(struct bcm_tag, header_crc));
    if (computed_crc == buf->header_crc) {
        char *boardid = &(buf->board_id[0]);
        char *tagversion = &(buf->tag_version[0]);

        sscanf(buf->kernel_address, "%u", &kerneladdr);
        sscanf(buf->kernel_length, "%u", &kernellen);
        sscanf(buf->total_length, "%u", &totallen);

        pr_info("CFE boot tag found with version %s and board type %s\n",
            tagversion, boardid);

        kerneladdr = kerneladdr - BCM63XX_EXTENDED_SIZE;
        rootfsaddr = kerneladdr + kernellen;
        spareaddr = roundup(totallen, master->erasesize) + cfelen;
        sparelen = master->size - spareaddr - nvramlen
                - caldatalen1 - caldatalen2 - BOARD_DATA_SIZE;
        rootfslen = spareaddr - rootfsaddr;
    } else {
        pr_warn("CFE boot tag CRC invalid (expected %08x, actual %08x)\n",
            buf->header_crc, computed_crc);
        kernellen = 0;
        rootfslen = 0;
        rootfsaddr = 0;
        spareaddr = cfelen;
        sparelen = master->size - cfelen - nvramlen
                - caldatalen1 - caldatalen2 - BOARD_DATA_SIZE;
    }

    /* Determine number of partitions */
    namelen = 8;
    if (rootfslen > 0) {
        nrparts++;
        namelen += 6;
    }
    if (kernellen > 0) {
        nrparts++;
        namelen += 6;
    }

    nrparts++;

    /* Ask kernel for more memory */
    parts = kzalloc(sizeof(*parts) * nrparts + 10 * nrparts, GFP_KERNEL);
    if (!parts) {
        vfree(buf);
        return -ENOMEM;
    }

    /* Start building partition list */
    parts[curpart].name = "CFE";
    parts[curpart].offset = 0;
    parts[curpart].size = cfelen;
    curpart++;

    if (kernellen > 0) {
        parts[curpart].name = "kernel";
        parts[curpart].offset = kerneladdr;
        parts[curpart].size = kernellen;
        curpart++;
    }

    if (rootfslen > 0) {
        parts[curpart].name = "rootfs";
        parts[curpart].offset = rootfsaddr;
        parts[curpart].size = rootfslen;
        if (sparelen > 0)
            parts[curpart].size += sparelen;
        curpart++;
    }

    parts[curpart].name = "netgear_parts";
    parts[curpart].offset = master->size - nvramlen - BOARD_DATA_SIZE;
    parts[curpart].size = BOARD_DATA_SIZE;
    curpart++;

    parts[curpart].name = "nvram";
    parts[curpart].offset = master->size - nvramlen;
    parts[curpart].size = nvramlen;

    /* Global partition "linux" to make easy firmware upgrade */
    curpart++;
    parts[curpart].name = "linux";
    parts[curpart].offset = cfelen;
    parts[curpart].size = master->size - cfelen - nvramlen
                  - caldatalen1 - caldatalen2 - BOARD_DATA_SIZE;

    for (i = 0; i < nrparts; i++)
        pr_info("Partition %d is %s offset %lx and length %lx\n", i,
            parts[i].name, (long unsigned int)(parts[i].offset),
            (long unsigned int)(parts[i].size));

    pr_info("Spare partition is offset %x and length %x\n",    spareaddr,
        sparelen);

    *pparts = parts;
    vfree(buf);

    return nrparts;
};

static struct mtd_part_parser bcm63xx_cfe_parser = {
    .owner = THIS_MODULE,
    .parse_fn = bcm63xx_parse_cfe_partitions,
    .name = "bcm63xxpart",
};

static int __init bcm63xx_cfe_parser_init(void)
{
    return register_mtd_parser(&bcm63xx_cfe_parser);
}

static void __exit bcm63xx_cfe_parser_exit(void)
{
    deregister_mtd_parser(&bcm63xx_cfe_parser);
}

module_init(bcm63xx_cfe_parser_init);
module_exit(bcm63xx_cfe_parser_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Daniel Dickinson <openwrt@cshore.neomailbox.net>");
MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
MODULE_AUTHOR("Mike Albon <malbon@openwrt.org>");
MODULE_AUTHOR("Jonas Gorski <jonas.gorski@gmail.com");
MODULE_DESCRIPTION("MTD partitioning for BCM63XX CFE bootloaders");

I haven't concerned myself about the USB for now, it's not that important. I still want to get back to using the trunk as soon as possible.

All of these values worry to begin with. The device use 128K sectors. So I'm feeling that these should be 0x20000. Or is that what is handled in the target/linux/brcm63xx/image/Makefile with the settings --image-offset 0x20000,--block-size 0x20000

#define BCM63XX_MIN_CFE_SIZE    0x10000        /* always at least 64KiB */
#define BCM63XX_MIN_NVRAM_SIZE    0x10000        /* always at least 64KiB */
#define BCM63XX_CFE_BLOCK_SIZE    0x10000        /* always at least 64KiB */

And what does this value represent? If it should be changed, what value should I be using?

#define BCM63XX_EXTENDED_SIZE    0xBFC00000    /* Extended flash address */

Other thoughts that I have are that I have the correct layout with the trunk build, maybe there is some way to install AA into the pre-created partitions as I have ssh access?

(Last edited by Xotic750 on 25 Apr 2016, 23:49)

Hi Xotic750, can you test this patch for the trunk version?

--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1758,7 +1758,7 @@
     pd = dev_get_platdata(&pdev->dev);
     if (pd) {
         memcpy(dev->dev_addr, pd->mac_addr, ETH_ALEN);
-        priv->has_phy = pd->has_phy;
+        priv->has_phy = 1;
         priv->phy_id = pd->phy_id;
         priv->has_phy_interrupt = pd->has_phy_interrupt;
         priv->phy_interrupt = pd->phy_interrupt;
@@ -1799,7 +1799,7 @@
             ret = -ENOMEM;
             goto out_uninit_hw;
         }
-
+        printk("BCM63XX enet: has_phy = 1\n");
         bus = priv->mii_bus;
         bus->name = "bcm63xx_enet MII bus";
         bus->parent = &pdev->dev;
@@ -1817,6 +1817,7 @@
                     GFP_KERNEL);
         if (!bus->irq) {
             ret = -ENOMEM;
+            printk("no irq at bus\n");
             goto out_free_mdio;
         }
 

It just force has_phy to be 1 like with old boards and should force some detection with MDIO involved.

Show me the kernel log if you are able to access the router after flashing with this change.

I can't see the printk I added in the patch at that log.

Please clean up, and test again. Only define the RGMII port for the switch on the board data in kernel, as you did it initially.

Probably when more than one port (RGMII) is defined at the kernel board data then the code looks for the internal switch.
With the patch proposed the effect could be the same, but I just want to be sure.

(Last edited by danitool on 27 Apr 2016, 00:29)

With danitool's help we peformed the extra changes above, and the results showed that we were unable to reach the switch with the extra MDIO code enforced.

[    0.570108] bcm63xx-spi bcm63xx-spi: at 0xb0000800 (irq 9, FIFOs size 542)
[    0.578490] SMP BCM63XX ENET
[    0.582155] BCM63XX enet: has_phy = 1
[    0.590057] bcm63xx_enet bcm63xx_enet.0: unable to register mdio bus
[    0.596765] bcm63xx_enet: probe of bcm63xx_enet.0 failed with error -5
[    0.639752] bcm63xx-wdt bcm63xx-wdt:  started, timer margin: 30 sec

To replicate make the changes that dantitool provided above, and add to board_bcm963xx.c (I think this was the only and correct change)

    .has_enet0            = 1,
    .enet0 = {
        .has_phy        = 1,
        .use_internal_phy    = 1,
    },

At this point we have run out of ideas.

So until there is something more to try I have decided to play a little with the WIFI drivers as the b43 only offers 802.11ag but the hardware supports 802.11agn.

First I took a look at the brcm80211 driver, but the bcm4322 isn't supported. I then too a look at the broadcom-wl but it threw an error in the logs that I could not get past.

wl0: 5.10.56.27 driver failed with code -11

And so I'm back to the b43 driver.

The build is now running a SMP kernel, which makes the device nice and responsive.

In the process of playing with the USB. All devices that I have plugged in have so far been recognised, memory stick, bluetooth adapter and HDD (I have a CDROM that I can also try). Not mounted any partition yet as I have to add some modules and recompile, but so far it looks like their are no issues with USB.

Update: Have mounted USB memory formatted FAT, no issues. Have mounted USB HDD formatted ext3, no issues. Have mounted USB CDROM, no issues. Have used a passive USB hub, no issues. Have connected a webcam and ran MJPEG Streamer, slow but no issues. I have a Netgear USB WNDA3100v1, can see it recognised but haven't managed to get the correct driver for it to work. So overall USB is working great.

(Last edited by Xotic750 on 28 Apr 2016, 00:04)

I have been poking around the device a little and have found that after issuing some commands, lspci seems to bee the culprit, I have occasionally lost wifi. 2 different things can happen, either the radio switches off or the radio stays up and I can connect but get no DHCP. This is with the b43 driver. So I have been going back through things and have some questions.

Originally I was unable to get the wifi to come up at all, or it was there as in wlan, but I could not search and could not start AP mode. In the logs there was

[    0.201926] ssb: Found chip with id 0x4322, rev 0x01 and package 0x09
[    0.209050] ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x17, vendor 0x4243)
[    0.209579] ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x10, vendor 0x4243)
[    0.210107] ssb: Core 2 found: PCI-E (cc 0x820, rev 0x0B, vendor 0x4243)
[    0.210633] ssb: Core 3 found: PCI (cc 0x804, rev 0x0E, vendor 0x4243)
[    0.211160] ssb: Core 4 found: USB 2.0 Device (cc 0x81A, rev 0x05, vendor 0x4243)
[    0.211688] ssb: Core 5 found: ARM Cortex M3 (cc 0x82A, rev 0x00, vendor 0x4243)
[    0.212215] ssb: Core 6 found: Internal Memory (cc 0x80E, rev 0x03, vendor 0x4243)
[    0.234252] ssb: WARNING: Using fallback SPROM failed (err -2)
[    0.240212] ssb: WARNING: Invalid SPROM CRC (corrupt SPROM)
[    0.245944] ssb: Unsupported SPROM revision 255 detected. Will extract v1

It was suggested to add a fallback sprom definition in board_bcm963xx.c

    .use_fallback_sprom     = 1,
    .fallback_sprom = {
            .type               = SPROM_BCM43222,
            .pci_bus            = 0,
            .pci_dev            = 1,
    },

After this the wifi worked.

I have now changed this from SPROM_BCM43222 to SPROM_BCM4322 and it still works, and I haven't had the lspci dropout issue since, a coincidence?

So I am curious as to why SPROM_BCM43222 was suggested when the chip is a bcm4322?

With either sprom defined, I get

root@OpenWrt:~# lspci -vv
00:01.0 Network controller: Broadcom Corporation BCM4322 802.11bgn Wireless Network Controller (rev 01)
    Subsystem: Broadcom Corporation BCM4322 802.11bgn Wireless Network Controller
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort+ <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 64
    Interrupt: pin A routed to IRQ 21
    Region 0: Memory at 30000000 (32-bit, non-prefetchable) [size=16K]
    Region 1: Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
    Region 2: Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
    Region 3: Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
    Region 4: Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
    Region 5: Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
    Expansion ROM at <unassigned> [disabled] [size=2]
    Kernel driver in use: b43-pci-bridge
lspci: Unable to load libkmod resources: error -12

What is the error about, I have searched but was unable to find anything definitive?

I also notice that many of the profiles in board_bcm963xx.c that define a fallback also define some fixup data, we did not? But what is this fixup data and is it needed here?

Currently testing a WDS setup and it is working fine, but then I try the additional step

For wireless connection, one additional step is required: Create a new wireless interface. You can simply add it in LuCi → WiFi, or create a new section of wifi-ifacein /etc/config/wireless. The only difference is that this time you don't need to specify the WDS option. In fact you cannot do that. The SSID and password could be the same as host SSID if you want, but not necessarily. As long as you connect this new interface to lan, which default is, your other wireless devices connecting through this AP will also be seen as part of the big network.

And when I add this, then the WDS on the EVG2000 becomes disabled, related?

(Last edited by Xotic750 on 28 Apr 2016, 14:37)

If your board has the BCM4322 chip then SPROM_BCM4322 is the correct one for the fallback sprom.

These are virtual SPROMs taken from the archive arch/mips/bcm63xx/sprom.c. If you take a look at that archive you will see a bunch of bytes defined for each SPROM, and they contain some calibration data among other (probably unknown/undocumented), stuff.

You can tune the SPROM data defining fixups. If you're not happy with the default virtual SPROM, you can compare it with the one that the original firmware provides at the file bcm4322_map.bin, and fix some bytes.

For the WDS functionality, don't expect much with the b43 driver.

(Last edited by danitool on 28 Apr 2016, 14:33)

Thanks, the WDS as is is great, it means that I can create a DLNA server (if that's the route I take), I don't need the wireless LAN in reality but was curious. It would be nice to have 802.11n though (will b43 ever support it? I hope so. None of the other drivers support the chip or I was unable to get them to work)

As to being happy with the SPROM, well I'm happy that it works but clueless as to what it is all about or even why it was needed (except what was in the logs) I'll take a look at those files you mention to see if I can gain any knowledge, but sounds unlikely. smile

I'm beginning to feel that I'm reaching the end of what I can achieve with the device, and once I clean up a little I will attempt to submit a patch for the trunk, and open a support ticket for the 53115 detection (in the hope that someone will read it and maybe eventually look at it).

I would like to build CC 15.05.1 for the device and be able to use the released modules. I now understand that this is possible by forcing the .vermagic but where do I find that number for v15.05.1 (I took a quick look but didn't see it, a longer look would probably reveal it smile )?

In the OpenWRT source we have

    0x3001, 0x0000, 0x04bc, 0x14e4, 0x432c, 0x8000, 0x0002, 0x0000,
    0x1730, 0x1800, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0x5372, 0x1209, 0x0200, 0x0000, 0x0400, 0x0000, 0x0000, 0x0000,
    0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0x0303, 0x0202,
    0xffff, 0x0033, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0301,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0x2048, 0xfe9a, 0x1571, 0xfabd, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0x2048, 0xfeb9, 0x159f, 0xfadd, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
    0x0000, 0x0000, 0x0000, 0x3333, 0x5555, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
    0xffff, 0xffff, 0xffff, 0x0008,

From the factory source we have

3001 0000 04bc 14e4 432c 8000 0002 0000 1730 1800 0000 0000 ffff ffff ffff ffff ffff
ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff
ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff
ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff 5372 1209 0200 0000
0400 0000 0000 0000 0000 0000 0000 ffff ffff ffff 0303 0202 ffff 0033 ffff ffff ffff
ffff ffff 0301 ffff ffff ffff ffff ffff ffff ffff ffff 2048 fe9a 1571 fabd ffff ffff
ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff 2048 feb9 159f fadd ffff ffff ffff
ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff
ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff
ffff ffff ffff ffff ffff ffff ffff 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 6666 6666 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 3333
5555 ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ec08 0000
0000 0000 0000 

So the only difference (that I could see) is the very ending

OpenWRT

0x0008

Factory

ec08 0000 0000 0000 0000 

I'm guessing that the 0's are some kind of padding that is also added by OpenWRT in the code somewhere (or maybe not?) when compiling, but what does the other difference do/make?

If I wanted to create a fixup, how would I configure this change? how does the offset work?

static struct sprom_fixup __initdata EVG2000_fixups[] = {
    { .offset = xx?, .value = 0xec08 },
};

Update: I am taking a guess that xx? would be 219 (220 - 1)? If offset is a zero based the word count?

(Last edited by Xotic750 on 29 Apr 2016, 14:09)

Have compiled and flashed kernel v4.4.7, not noticed anything different when comparing to v4.1.20, everything working just the same, i.e. without switch detected.

[    0.000000] Linux version 4.4.7 (graham@tyr) (gcc version 5.3.0 (OpenWrt GCC 5.3.0 r49195) ) #1 SMP Sun May 1 21:59:08 UTC 2016