Community discussions

MikroTik App
 
sogico
just joined
Topic Author
Posts: 5
Joined: Mon May 14, 2012 1:26 pm

Error trying to compile our own OpenWrt image

Mon May 14, 2012 1:49 pm

I'm trying to compile my own image of OpenWrt. I'm following the tutorial http://wiki.mikrotik.com/wiki/Manual:Metarouter but when it ends, then the following message appears:
Applying patch platform/099-mips_module_reloc_fix.patch
patching file arch/mips/kernel/module.c
Hunk #1 FAILED at 191
1 out of 1 hunk FAILED -- rejects in file arch/mips/kernel/module.c
Patch platform/099-mips_module_reloc_fix.patch does not apply (enforce with -f)

Any idea?
 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 829
Joined: Tue Aug 03, 2004 9:01 am

Re: Error trying to compile our own OpenWrt image

Mon May 14, 2012 3:06 pm

What version of the MT patch are you using, and what version of OpenWRT are you trying to apply the patch to? Not all combinations have been tested, and it's been a while since MT has updated the patch. You will probably have to compare the part of the patch that failed to be applied (usually output as the file name with a .rej suffixed to the end) with the context provided for the patch in the patch file, and figure out how to modify the file being patched manually.

-- Nathan
 
sogico
just joined
Topic Author
Posts: 5
Joined: Mon May 14, 2012 1:26 pm

Re: Error trying to compile our own OpenWrt image

Mon May 14, 2012 4:37 pm

I'm just following the metarouter manual, so I'm using:

- MT patch: openwrt-metarouter-1.2.patch from wget http://www.mikrotik.com/download/metaro ... -1.2.patch

- OpenWrt version: development branch as is indicated in the tutorial and also in the wiki - openwrt (http://wiki.openwrt.org/toh/mikrotik/rb433). I get this branch from svn co svn://svn.openwrt.org/openwrt/trunk

This packages are cross-compiled using ubuntu 10.10 32bits.

Thanks in advance
 
sogico
just joined
Topic Author
Posts: 5
Joined: Mon May 14, 2012 1:26 pm

Re: Error trying to compile our own OpenWrt image

Mon May 14, 2012 7:07 pm

I'm using the same configuration as the example on Ubuntu 12.04:
MT patch: 1.2 at http://www.mikrotik.com/download/metaro ... -1.2.patch
OpenWrt version: I'm getting the development branch as it's refered in the tutorial svn co svn://svn.openwrt.org/openwrt/trunk

Steps to create my own openwrt image for a 433UAH:
1. mkdir mikrotik
2. sudo apt-get install build-essential asciidoc binutils bzip2 gawk gettext \git libncurses5-dev libz-dev patch unzip zlib1g-dev
3. sudo apt-get install subversion
4. mkdir OpenWrt/
5. cd OpenWrt/
6. svn co svn://svn.openwrt.org/openwrt/trunk
7. cd trunk/
8. wget http://www.mikrotik.com/download/metaro ... -1.2.patch
9. patch -p0 <openwrt-metarouter-1.2.patch
10. svn up
11. ./scripts/feeds update -a
12. ./scripts/feeds install -a
13. make defconfig
14. make menuconfig
select: mikrotik MetaRouter MIPS
SDK option

I gonna try with 1.1 patch with the same openWrt version

Thanks in advance
 
sogico
just joined
Topic Author
Posts: 5
Joined: Mon May 14, 2012 1:26 pm

Re: Error trying to compile our own OpenWrt image

Mon May 14, 2012 8:16 pm

Trying to cross-compile with:
Patch version: 1.1 -- wget http://www.mikrotik.com/download/metaro ... -1.1.patch
OpenWrt version: trunk -- svn co svn://svn.openwrt.org/openwrt/trunk

I've followed the previous steps and appears another error:
#
# configuration written to .config
#
make[4]: Leaving directory `/home/salva/mikrotik/kamikaze/trunk/build_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33/linux-2.6.27.21'
mkdir -p /home/salva/mikrotik/kamikaze/trunk/build_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33/linux-dev
make -C /home/salva/mikrotik/kamikaze/trunk/build_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33/linux-2.6.27.21 ARCH=mips CC="mips-openwrt-linux-uclibc-gcc" CFLAGS="-Os -pipe -mips32 -mtune=mips32 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float" CROSS_COMPILE=mips-openwrt-linux-uclibc- KBUILD_HAVE_NLS=no CONFIG_SHELL=/bin/bash INSTALL_HDR_PATH="/home/salva/mikrotik/kamikaze/trunk/build_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33/linux-dev/" headers_install
make[4]: Entering directory `/home/salva/mikrotik/kamikaze/trunk/build_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33/linux-2.6.27.21'
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  HOSTCC  scripts/unifdef
scripts/unifdef.c:209:25: error: conflicting types for 'getline'
/usr/include/stdio.h:675:20: note: previous declaration of 'getline' was here
make[5]: *** [scripts/unifdef] Error 1
make[4]: *** [__headers] Error 2
make[4]: Leaving directory `/home/salva/mikrotik/kamikaze/trunk/build_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33/linux-2.6.27.21'
make[3]: *** [/home/salva/mikrotik/kamikaze/trunk/build_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33/linux-2.6.27.21/.configured] Error 2
make[3]: Leaving directory `/home/salva/mikrotik/kamikaze/trunk/toolchain/kernel-headers'
make[2]: *** [toolchain/kernel-headers/compile] Error 2
make[2]: Leaving directory `/home/salva/mikrotik/kamikaze/trunk'
make[1]: *** [/home/salva/mikrotik/kamikaze/trunk/staging_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33/stamp/.toolchain_install] Error 2
make[1]: Leaving directory `/home/salva/mikrotik/kamikaze/trunk'
make: *** [world] Error 2

 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 829
Joined: Tue Aug 03, 2004 9:01 am

Re: Error trying to compile our own OpenWrt image

Tue May 22, 2012 6:39 am

sogico,

Perhaps you should take a look at my response to another poster who asked a similar question in this thread.

MikroTik's v1.2 patch, which is 2 years old, requires kernel 2.6.31, which was ripped from OpenWRT 'trunk' a few weeks ago. You should either try building Kamikaze using my patch (linked to in the other thread), or getting revision 31411 from OpenWRT SVN, which was the last revision of 'trunk' to have 2.6.31 support. (No guarantees that r31411 will work; I have not tried it. I can only tell you that r31412 is where they removed 2.6.31 according to SVN changelogs.)

MikroTik's v1.1 patch requires kernel 2.6.27, which is not supported in Kamikaze, Backfire, or Attitude Adjustment/trunk. So you will have the same problem there. Back when MikroTik released that patch, trunk had 2.6.27 support, and when MikroTik released v1.2, trunk had 2.6.31. OpenWRT 'trunk' is a moving target and constantly changing, so the instructions on the Wiki page are outdated and don't work anymore unless you can grab the same release of 'trunk' that MikroTik was using when they crafted these patches.

You will either have to restore 2.6.31 support to whatever version of OpenWRT you want to build using MikroTik's patch, or try your hand at porting their patches to a recent version of the kernel. Recent versions of 'trunk' only build against kernels 3.1, 3.2, and 3.3.

-- Nathan

Who is online

Users browsing this forum: No registered users and 13 guests