Alright, so here's a script which will do everything for you.
It will download the complete source and make the necessary modifications for building the Broadcom K3 AC mipsel image.
It even takes care of downloading automake-1.14 which is required by one of the packages.
However be sure that you have all of the host tools installed required for building.
There are some strange ones like dia and cmake.
A huge thanks goes out to <Kong> for posting his inittial changes and commiting some of the fixes!
Without him it would've taken me much longer to figure it out.
Save it as a shell script and place it in a empty directory without any spaces.
Something like: /home/user/ddwrt/script.sh
Then run it by pointing it to your toolchain directory:
Code:
cd ddwrt
chmod a+x script.sh
./script.sh /opt/toolchain-mipsel_r2_gcc-4.7-linaro_uClibc-0.9.33.2
Before you run it, you need to make sure you have your docbook xsl sheets.
One of the packages (rtpproxy) is looking for them in:
/usr/local/share/xsl/docbook
In Fedora 20 their installed at:
/usr/share/sgml/docbook/xsl-stylesheets-1.78.1
So you can simply make a symlink in order to satisfy it:
Well I suppose I can look into modifying it so it can produce ARM builds as well.
But I'll be a bit busy in the coming weeks.
And I was actually going to put my limited time into modifying the firmware for my own purposes (oscam, dvbapi, tvheadend etc...).
But wouldn't it be better to try and build for ARM yourself?
I just gave the script a spin here from a empty directory and it produced an image in one run without a hitch..
Basically all the modifications are already present (thx to <Kong> for the most).
All you need to do is find out if the ARM target needs another .config and Makefile and make a few edits..
Then change it to use the ARM toolchain and you should be ready to roll.
Seems like a nice challenge for you
Btw, I'm attaching the image it produced here if anyone wants to give it a spin.
If you're curious what has been changed since the build you're currently running then look here: http://svn.dd-wrt.com/timeline
Beware that I haven't tested it yet for myself and my last build made my router go into emergency mode (which is a easy fix anyways..)
FYI for those that don't have the money for a dedicated machine to play with.
vmplayer for vmware is free for non commercial use. and allows you to install virtual machines of any kind on a pc or laptop. I use it constantly for many OS installations.
Just search vmplayer download on google. _________________ EA-6900
Asus 68U
All you need to do is find out if the ARM target needs another .config and Makefile and make a few edits..
Then change it to use the ARM toolchain and you should be ready to roll.
Seems like a nice challenge for you
The Makefile is called Makefile.northstar and there is a corresponding .config
Will try it out myself when I get some spare time _________________ AC-68U rev. C1 on Build 45863
AC-68U rev. A1 on Build 45493
AC-68U rev. A1 on Build 44340
I picked toolchain-arm_cortex-a9_gcc-4.9-linaro_musl-1.1.2_eabi as it's one of the few that does not enable hard fpu support.
What's odd is that the build version on my R7000 is not even listed. The top of dmesg on my router shows a version of Linaro not listed. I'm running Kong's 24345M build:
Linux version 3.10.25 (bluebat@opensuse) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.01 r39555) ) #1081 SMP PREEMPT Fri Jun 13 21:55:53 CEST 2014
I ran arm-linux-gcc -v in each of the toolchain bin folders to match the Linaro version.
The script will run until it hits the configure part as i said earlier. I had to create some sym links in /usr/bin to an older version of gnu tools (aclocal, automake, etc) as the configure script is expecting it (pretty ridiculous). I also had to comment out some apps from the .config file as they would not compile (radvd for example).
I haven't changed the sed commands in the scripts as I'm not sure if they only pertain to the MIPS build. These are the hints given by Kong at the beginning of this thread.
Good luck.
Code:
#!/bin/bash
if [ "$1" = "" ]
then
echo ""
echo ""
echo "Please run the script with the path to your cross-compiler directory"
echo ""
echo "eg $0 /opt/toolchain-arm_cortex-a9_gcc-4.9-linaro_musl-1.1.2_eabi""
echo ""
exit 0
fi
if [ ! -e $1/bin/arm-openwrt-linux-muslgnueabi-gcc]
then
echo ""
echo ""
echo "$1/bin/arm-openwrt-linux-muslgnueabi-gcc does not exist"
echo ""
echo "Please check that you specify the correct path to your cross-compiler!"
echo ""
exit 0
fi
if [ ! -e src/router/Makefile.northstar ]
then
echo ""
echo "Getting DD-WRT svn..."
svn co svn://svn.dd-wrt.com/DD-WRT .
mkdir mroot
else
echo svn update
fi
export GCCARM="$1/bin"
export PATH=$GCCARM:`pwd`/mroot/bin:$PATH
RDIR="`pwd`"
if [ -e src/router/mipsel-uclibc/dd-wrt.v24-K3_R6300.trx ]
then
rm -f src/router/mipsel-uclibc/dd-wrt.v24-K3_R6300.trx
fi
if [ ! -e init_done ]
then
echo ""
echo "Doing some inittial changes."
echo "Huge thanks to <Kong>!"
echo ""
echo ""
echo "Compiling some userspace tools..."
echo ""
cd opt/tools
gcc -o trx trx.c
cd ../..
cd tools
rm -f ./strip
gcc strip.c -o ./strip
rm -f ./write3
gcc write3.c -o ./write3
rm -f ./write4
gcc write4.c -o ./write4
rm ./webcomp
gcc -o webcomp -DUEMF -DWEBS -DLINUX webcomp.c
cd ..
cd src/router/tools
rm -f jsformat
make jsformat
cd ..
echo ""
echo "Setting up configs and makefiles.."
rm -f .config
cp configs/northstar/.config_northstar .config
patch -p0 < ./kpatch
rm -f ./kpatch
cd router
sed -i 's#cd $(ARCH)-uclibc \&\& ../tools/bufenc/makefw.sh dd-wrt.v24-K3-nandboot#\#cd $(ARCH)-uclibc \&\& ../tools/bufenc/makefw.sh dd-wrt.v24-K3-nandboot#g' Makefile.northstar
sed -i 's#mv $(TARGETDIR)/usr/lib/services.so $(TARGETDIR)/lib#mv $(TARGETDIR)/usr/lib/services.so $(TARGETDIR)/lib\n\tcp emf_bin/mipsel/igs.ko $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/wl/\n\tcp emf_bin/mipsel/emf.ko $(TARGETDIR)/lib/modules/$(LINUXVER)/kernel/drivers/net/wl/#g' Makefile.northstar
sed -i 's#../../opt/asus/asustrx-rt66u -p RT-AC66U -v 3.0.0.1 -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_RT-AC66U.trx $(ARCH)-uclibc/lzma_vmlinuz -a 1024 $(ARCH)-uclibc/rootfs.squashfs#\#../../opt/asus/asustrx-rt66u -p RT-AC66U -v 3.0.0.1 -m 32000000 -o $(ARCH)-uclibc/dd-wrt.v24-K3_RT-AC66U.trx $(ARCH)-uclibc/lzma_vmlinuz -a 1024 $(ARCH)-uclibc/rootfs.squashfs#g' Makefile.northstar
sed -i 's/include rules\/emf.mk/#include rules\/emf.mk/g' rules/all.mk
ln -s $1/bin/lzma `pwd`/netgear/
cd ../..
touch init_done
echo ""
echo "Done"
echo ""
fi
if hash aclocal-1.14 2>/dev/null
then
echo ""
else
echo ""
echo "Automake 1.14 not found!"
if [ -e `pwd`/automake-1.14.1/configure ]
then
echo ""
echo "Previous compile somehow failed.."
echo "Bailing out..."
echo ""
exit 0
fi
echo ""
echo "Going to try to compile it :)"
echo ""
echo ""
wget http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.gz
tar -zxf automake-1.14.1.tar.gz
rm -f automake-1.14.1.tar.gz
cd automake-1.14.1
./configure --prefix=$RDIR/mroot
make
make install
cd ../mroot/bin
rm -f aclocal
rm -f automake
cd ../..
fi
echo ""
echo ""
read -p "Press [Enter] key to continue..."
cd src/router
echo ""
cd libutils
echo -n '#define SVN_REVISION "' > revision.h
svnversion -n . >> revision.h
echo '"' >> revision.h
cd ../httpd/visuals
echo -n '#define SVN_REVISION "' > revision.h
svnversion -n . >> revision.h
echo '"' >> revision.h
cd ..
echo -n '#define SVN_REVISION "' > revision.h
svnversion -n . >> revision.h
echo '"' >> revision.h
cd ..
echo "Installing dependencies.."
#make -f Makefile.northstar jansson
make -f Makefile.northstar jansson-configure
make -f Makefile.northstar jansson
make -f Makefile.northstar jansson-install
make -f Makefile.northstar nvram
make -f Makefile.northstar nvram-install
make -f Makefile.northstar utils
make -f Makefile.northstar utils-install
make -f Makefile.northstar zlib-configure
make -f Makefile.northstar minidlna-configure
make -f Makefile.northstar minidlna
make -f Makefile.northstar minidlna-install
make -f Makefile.northstar install_headers
make -f Makefile.northstar iptables
make -f Makefile.northstar libnet
make -f Makefile.northstar libnet-install
make -f Makefile.northstar kernel
make -f Makefile.northstar ncurses-configure
read -p "Press [Enter] key to continue..."
echo "Configuring.."
make -f Makefile.northstar configure
echo "Building.."
make -f Makefile.northstar clean all install
if [ -e mipsel-uclibc/dd-wrt.v24-K3_R6300.trx ]
then
STAMP="`date +%Y-%m-%d_%H:%M`"
cp mipsel-uclibc/dd-wrt.v24-K3_R6300.trx ../../image/dd-wrt.v24-K3_AC_"$STAMP"_r"`svnversion -n .`".bin
echo ""
echo ""
echo "Image created: dd-wrt.v24-K3_AC_"$STAMP"_r"`svnversion -n .`".bin"
echo "Have a look in the \"image\" directory"
else
echo ""
echo ""
echo "Whoops.. something went wrong, please check the output and consult the forums.."
fi
echo ""
echo ""
I picked toolchain-arm_cortex-a9_gcc-4.9-linaro_musl-1.1.2_eabi as it's one of the few that does not enable hard fpu support.
From what I've found out you picked the right toolchain.
Are you using a 32 or 64-bit linux distro? I read somewhere that the supplied toolchains require a 64-bit distro. Maybe Kong or MastaG can confirm _________________ AC-68U rev. C1 on Build 45863
AC-68U rev. A1 on Build 45493
AC-68U rev. A1 on Build 44340
I picked toolchain-arm_cortex-a9_gcc-4.9-linaro_musl-1.1.2_eabi as it's one of the few that does not enable hard fpu support.
From what I've found out you picked the right toolchain.
Are you using a 32 or 64-bit linux distro? I read somewhere that the supplied toolchains require a 64-bit distro. Maybe Kong or MastaG can confirm
I believe the correct toolchain is toolchain-arm_cortex-a9_gcc-4.9-linaro_musl-1.1.2_eabi
Here's my attempt at creating an ARM script based on MastaG's mips version. I spent some time this afternoon on it but it's not complete.
It's erroring during the configure part (make -f Makefile.northstar configure )
Building ddwrt is not as trivial as openwrt (much more elegant build system). That's all I'm going to comment on it unless I want to get flamed.
Made a quick attempt using Kongs instructions with similar results. I clearly have a problem with some missing dependencies that most likely can be fixed using a few symlinks. I read that there might be a problem with gcc in this forum which of course would be a total showstopper. _________________ AC-68U rev. C1 on Build 45863
AC-68U rev. A1 on Build 45493
AC-68U rev. A1 on Build 44340
I picked toolchain-arm_cortex-a9_gcc-4.9-linaro_musl-1.1.2_eabi as it's one of the few that does not enable hard fpu support.
From what I've found out you picked the right toolchain.
Are you using a 32 or 64-bit linux distro? I read somewhere that the supplied toolchains require a 64-bit distro. Maybe Kong or MastaG can confirm
Wabe,
I'm building under 64-bit Ubuntu 14.04.1
As you mentioned it appears the gcc version is in transition as Kong and BS work out the kinks with musl builds.
Currently (r25138) you can use toolchain-arm_cortex-a9_gcc-4.9-linaro_musl-1.1.2_eabi toolchain it works with the bins in the repo. This might change if BS updates the bins. Of course you need a 64Bit system.
Cant seem to get past this when I run the MastaG Script.
>>
make[1]: *** No rule to make target `/home/xxxxxx/DEV/DD-WRT/src/router/register/register_check.o', needed by `libutils.so'. Stop.
make[1]: Leaving directory `/home/xxxxxx/DEV/DD-WRT/src/router/libutils'
make: *** [libutils] Error 2
Whoops.. something went wrong, please check the output and consult the forums..
>>
Any ideas? I confirmed the "register_check.o" file is not there so I have to assume it is not being built. Not sure which script should make that happen.
I'm beginning to think my development environment is not correct.
I'm running this on 64bit Ubuntu14.04LTS via VMPlayer on a windows 8.1 machine.
Any ideas? I confirmed the "register_check.o" file is not there so I have to assume it is not being built. Not sure which script should make that happen.
I'm beginning to think my development environment is not correct.
I'm running this on 64bit Ubuntu14.04LTS via VMPlayer on a windows 8.1 machine.
Most likely missing host tools in your distro. You need to add missing packages, most likely by installing them with sudo apt-get install xxx.
I don't use Ubuntu, however _________________ AC-68U rev. C1 on Build 45863
AC-68U rev. A1 on Build 45493
AC-68U rev. A1 on Build 44340
Here's my attempt at creating an ARM script based on MastaG's mips version. I spent some time this afternoon on it but it's not complete.
It's erroring during the configure part (make -f Makefile.northstar configure )
Building ddwrt is not as trivial as openwrt (much more elegant build system). That's all I'm going to comment on it unless I want to get flamed.
Made a quick attempt using Kongs instructions with similar results. I clearly have a problem with some missing dependencies that most likely can be fixed using a few symlinks. I read that there might be a problem with gcc in this forum which of course would be a total showstopper.
Fail in the configure step i.e "make -f Makefile.northstar configure" on module glib20 with the following compile error. Cannot figure out what the problem is:
./localename.c: In function '_nl_locale_name_thread_unsafe':
./localename.c:2617:31: error: dereferencing pointer to incomplete type
name = thread_locale->__names[category];
^
make[4]: *** [localename.lo] Error 1
make[4]: Leaving directory `/~/DEV/src/router/glib20/gettext/gettext-runtime/intl'
Anyone knows? _________________ AC-68U rev. C1 on Build 45863
AC-68U rev. A1 on Build 45493
AC-68U rev. A1 on Build 44340