Community discussions

 
maxxo1972
just joined
Topic Author
Posts: 4
Joined: Thu May 10, 2012 2:01 pm

Error trying to compile our own OpenWrt image

Fri May 18, 2012 10:50 pm

I'm trying to compile a custom openwrt image following the wiki's guide http://wiki.mikrotik.com/wiki/Manual:Metarouter
But at end i receved this error:
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)
make[4]: *** [/home/maxxo/openwrt-mk/trunk/build_dir/linux-mr-mips/linux-2.6.31.10/.quilt_checked] Error 1
make[4]: Leaving directory `/home/maxxo/openwrt-mk/trunk/target/linux/mr-mips'
make[3]: *** [compile] Error 2
make[3]: Leaving directory `/home/maxxo/openwrt-mk/trunk/target/linux'
make[2]: *** [target/linux/compile] Error 2
make[2]: Leaving directory `/home/maxxo/openwrt-mk/trunk'
make[1]: *** [/home/maxxo/openwrt-mk/trunk/staging_dir/target-mips_uClibc-0.9.33.2/stamp/.target_compile] Error 2
make[1]: Leaving directory `/home/maxxo/openwrt-mk/trunk'
make: *** [world] Errore 2


I tried with:
S.O.:Ubuntu 10.10,11.10,12.40,Centos 6.0
Openwrt:Any version Backfire,kamikaze
I tried with openwrt-metarouter-1.2.patch and openwrt-metarouter-1.1.patch
But Nothing changes...

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

Re: Error trying to compile our own OpenWrt image

Sat May 19, 2012 4:02 am

Did you see this thread?

As I said there, the patch has not been updated by MT in a while (over 2 years!), and that Wiki page is quite old. Many changes have been made to OpenWRT since then.

In fact, I can see now what is causing your problem, and the other poster's problem: the latest version of the patch MikroTik wrote is against Linux kernel version 2.6.31. At the time they wrote the patch, 2.6.31 was supported in 'trunk'. It was never supported in the official Kamikaze (which only supported 2.6.23-2.6.26), or in Backfire (only 2.6.30 and 2.6.32). The current version of 'trunk' only supports kernels 3.1, 3.2, and 3.3...all support of 2.6.x has been removed from 'trunk' by OpenWRT devs as of a couple of weeks ago.

So, again, either you are going to have to study MikroTik's patch and port it forward to a more recent kernel, or grab a copy of OpenWRT that has 2.6.31 support, or introduce support for 2.6.31 into whatever OpenWRT version you want to build.

In my case, I backported kernel 2.6.31 to Kamikaze 8.09.2 (SVN r18961), and I can share those patches with you. I have been planning on working on a build of Backfire 10.03.1, but have not had the time recently.

If you want to try building a version of 'trunk' with 2.6.31 support, it looks like r31411 is the last revision of 'trunk' before OpenWRT devs ripped support for that kernel out. You will have to check 31411 out of SVN and try patching and building against that.

If you want to try building against Kamikaze with my patches that introduce 2.6.31 support, I have them for download here:

http://www.nconx.com/~nathan/openwrt-me ... 1.patch.gz

Kamikaze 8.09.2 buildroot source is available straight from OpenWRT:

http://downloads.openwrt.org/kamikaze/8 ... ce.tar.bz2

First apply MikroTik's 1.2 patch as instructed on the Wiki. Then apply my patches with 'zcat mr1p2_owrt_18961.patch.gz | patch -p1' from within the root of the Kamikaze source tree directory. Finally, 'make menuconfig', make sure to select either MetaROUTER MIPS or PPC, and then select 'tgz' from "Target Images". Save, and then 'make'. Final tgz image file will be located under 'bin/'.

If you elect to try to grab an older revision of 'trunk' to build against that supports kernel 2.6.31, you should be able to simply follow the instructions on the Wiki as-is and all should be well (in theory).

-- Nathan
 
maxxo1972
just joined
Topic Author
Posts: 4
Joined: Thu May 10, 2012 2:01 pm

Re: Error trying to compile our own OpenWrt image

Sun May 20, 2012 12:13 pm

Thank you very much for your response with kamikaze and your patch i've resolved
 
juvann
just joined
Posts: 8
Joined: Thu Sep 20, 2012 3:50 pm

Re: Error trying to compile our own OpenWrt image

Sat Sep 22, 2012 10:48 pm

I receveid a patch from Mikrotik for kernel 2.6.35 and in this patch there are changes for RouterBoards and changes for Metarouter. So I thinks there is only one patch for linux kernel
 
ferywu
just joined
Posts: 22
Joined: Fri Feb 17, 2012 6:24 pm

Re: Error trying to compile our own OpenWrt image

Fri Sep 28, 2012 5:44 am

I receveid a patch from Mikrotik for kernel 2.6.35 and in this patch there are changes for RouterBoards and changes for Metarouter. So I thinks there is only one patch for linux kernel
can you share us with your mr patch for linux kernel 2.6.35 ?
thank you.
 
isleman
just joined
Posts: 1
Joined: Wed Nov 21, 2012 12:16 pm

Re: Error trying to compile our own OpenWrt image

Wed Nov 21, 2012 12:27 pm

I resolved by checking-out openwrt revision 20828 as
svn co -r 20828 svn://svn.openwrt.org/openwrt/trunk
 
but
just joined
Posts: 6
Joined: Mon Apr 01, 2013 5:32 pm

Re: Error trying to compile our own OpenWrt image

Wed Apr 10, 2013 2:32 pm

Is there are way, how to compile trunk for METAROUTER MIPS?
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Error trying to compile our own OpenWrt image

Wed Apr 10, 2013 3:21 pm

please read the posts at the beginning of the thread, there is an answer.
 
but
just joined
Posts: 6
Joined: Mon Apr 01, 2013 5:32 pm

Re: Error trying to compile our own OpenWrt image

Wed Apr 10, 2013 4:06 pm

nothing dosn't work for me for trunk
 
ppaulojr
just joined
Posts: 8
Joined: Wed Oct 30, 2013 4:27 pm

Re: Error trying to compile our own OpenWrt image

Thu Oct 31, 2013 2:11 pm

I tried the NathanA suggestion but it fails even in the revision it was supposed to work.
make[1]: Entering directory `/home/ubuntu/trunk'
make[2]: Entering directory `/home/ubuntu/trunk'
make[3]: Entering directory `/home/ubuntu/trunk/target/linux'
make[4]: Entering directory `/home/ubuntu/trunk/target/linux/mr-mips'
if [ -s "/home/ubuntu/trunk/build_dir/linux-mr-mips/linux-2.6.31.10/patches/series" ]; then (cd "/home/ubuntu/trunk/build_dir/linux-mr-mips/linux-2.6.31.10"; if quilt --quiltrc=- next >/dev/null 2>&1; then quilt --quiltrc=- push -a; else quilt --quiltrc=- top >/dev/null 2>&1; fi ); fi
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)
make[4]: *** [/home/ubuntu/trunk/build_dir/linux-mr-mips/linux-2.6.31.10/.quilt_checked] Error 1
make[4]: Leaving directory `/home/ubuntu/trunk/target/linux/mr-mips'
make[3]: *** [compile] Error 2
make[3]: Leaving directory `/home/ubuntu/trunk/target/linux'
make[2]: *** [target/linux/compile] Error 2
make[2]: Leaving directory `/home/ubuntu/trunk'
make[1]: *** [/home/ubuntu/trunk/staging_dir/target-mips_uClibc-0.9.33.2/stamp/.target_compile] Error 2
make[1]: Leaving directory `/home/ubuntu/trunk'
make: *** [world] Error 2
I used this to build:
sudo apt-get update
sudo apt-get install gcc g++ patch binutils bzip2 flex make gettext pkg-config unzip libz-dev libc6 ncurses-base ncurses-bin libncurses5-dev subversion git
 
svn checkout -r 33081 svn://svn.openwrt.org/openwrt/trunk/
cd trunk/
wget http://www.mikrotik.com/download/metarouter/openwrt-metarouter-1.2.patch
patch -p0 <openwrt-metarouter-1.2.patch
make menuconfig
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Error trying to compile our own OpenWrt image

Fri Nov 01, 2013 9:52 am

maybe try older revision as you get the error while applying the patch. most probably NathanA managed to apply patch to this revision.
 
ppaulojr
just joined
Posts: 8
Joined: Wed Oct 30, 2013 4:27 pm

Re: Error trying to compile our own OpenWrt image

Fri Nov 01, 2013 8:00 pm

maybe try older revision as you get the error while applying the patch. most probably NathanA managed to apply patch to this revision.
Following the suggestion of the Wiki I tried with an even older version but with the same results.
Note: Patch 1.2 was made against older kernel then in current trunk and some extra steps should be taken to apply it to OpenWRT. For example r29684 can be used without modifications
I tried with r29684
 
ppaulojr
just joined
Posts: 8
Joined: Wed Oct 30, 2013 4:27 pm

Re: Error trying to compile our own OpenWrt image

Wed Nov 06, 2013 5:07 pm

I think you should modify the documentation to state that at this moment compiling OpenWRT images to Metarouter is not supported.
 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 801
Joined: Tue Aug 03, 2004 9:01 am

Re: Error trying to compile our own OpenWrt image

Fri Nov 08, 2013 12:44 pm

I tried with r29684
Well apparently you didn't, or you didn't do it correctly, 'cause just a few minutes ago I tried it (compiling r29684 with MikroTik's MR v1.2 patches applied), and it went smooth as silk. I've never even tried to build that version before, and I did it on a brand new install of Ubuntu (10.04 LTS) that I'd never before used to do any other build of OpenWRT. So I can definitely tell you that it does work.
I tried the NathanA suggestion but it fails even in the revision it was supposed to work. [...] I used this to build:
svn checkout -r 33081 svn://svn.openwrt.org/openwrt/trunk/
In this very thread, I specifically called out r31411 as the last version that had support for kernel 2.6.31.10. So what are you doing checking out 33081?
I think you should modify the documentation to state that at this moment compiling OpenWRT images to Metarouter is not supported.
I don't know exactly *what* you're doing wrong, but you are doing *something* wrong.

-- Nathan
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Error trying to compile our own OpenWrt image

Fri Nov 08, 2013 1:04 pm

wrong revision is my error as this was set in the wiki. Corrected that with the revision number you are mentioning here. So wiki will have last revision OpenWRT kamikaze that works with the metarouter patch 1.2
 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 801
Joined: Tue Aug 03, 2004 9:01 am

Re: Error trying to compile our own OpenWrt image

Fri Nov 08, 2013 3:18 pm

wrong revision is my error as this was set in the wiki. Corrected that with the revision number you are mentioning here.
Ah, got it. I didn't realize 33081 had been mentioned on the wiki page.

FYI, I just tried building 31411, which I had never actually tried building before. I just noticed that in 31412, all kernel 2.6.31 patches were ripped out. 31411 does not actually build correctly, but this has nothing to do with the MikroTik patches. The problem is a bug in 31411 when trying to build a MIPS kernel, related to the GCC compiler version being used for the MIPS toolchain in this particular revision of OpenWRT 'trunk'.

I fixed it by taking the file target/linux/generic/patches-2.6.32/032-mips_unused_variables.patch, copying it to target/linux/generic/patches-2.6.31, renaming it to 033-mips_unused_variables.patch, and finally editing this new file (target/linux/generic/patches-2.6.31/033-mips_unused_variables.patch) and deleting lines 12 through 22 (everything related to the syscall.c patch). With this modification, building r31411 for the MIPS architecture proceeded without fault.

In summary:

r29684 builds without any modification
r31411 builds with the changes I described above (there's a bug in r31411 for MIPS with kernel 2.6.31, not the MikroTik patches)
r33081 is not compatible with the MikroTik patches

-- Nathan
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Error trying to compile our own OpenWrt image

Mon Nov 11, 2013 1:47 pm

adjusted wiki to version that can be built without problems.
 
ppaulojr
just joined
Posts: 8
Joined: Wed Oct 30, 2013 4:27 pm

Re: Error trying to compile our own OpenWrt image

Wed Nov 13, 2013 5:06 pm


In summary:

r29684 builds without any modification
r31411 builds with the changes I described above (there's a bug in r31411 for MIPS with kernel 2.6.31, not the MikroTik patches)
r33081 is not compatible with the MikroTik patches

-- Nathan
Not quite. r29689 fails in the following points:
- bison and m4 fails with newer gcc for using gets
- elf.cpp needs an additional "#include <unistd.h>" - bug is exposed by newer gcc versions.
 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 801
Joined: Tue Aug 03, 2004 9:01 am

Re: Error trying to compile our own OpenWrt image

Thu Nov 14, 2013 4:39 am

Not quite. r29689 fails in the following points: [snip]
Aaaaand these are MikroTik's problems...how, exactly?

Also, should I assume that r29689 is just a typo on your part?

-- Nathan
 
ppaulojr
just joined
Posts: 8
Joined: Wed Oct 30, 2013 4:27 pm

Re: Error trying to compile our own OpenWrt image

Thu Nov 14, 2013 1:52 pm

Not quite. r29689 fails in the following points: [snip]
Aaaaand these are MikroTik's problems...how, exactly?

Also, should I assume that r29689 is just a typo on your part?

-- Nathan
Because the patch no longer works with the current version of gcc. And yes it was a typo.
 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 801
Joined: Tue Aug 03, 2004 9:01 am

Re: Error trying to compile our own OpenWrt image

Thu Nov 21, 2013 1:12 am

Because the patch no longer works with the current version of gcc.
The issues you raise have absolutely nothing to do with MikroTik's patches. MikroTik's patches do not touch any of the files you mentioned whatsoever.

-- Nathan

Who is online

Users browsing this forum: No registered users and 5 guests