agnivade/funnel

Support openwrt targets

m-anish opened this issue · 4 comments

This would be really nice to have this run on routers running openwrt. I can help with testing on ar71xx and ramips targets (both are MIPS I think)

Go 1.8 has added support for MIPS32 targets as well ! So now, it supports these targets:

  • linux mips
  • linux mipsle
  • linux mips64
  • linux mips64le

Let me know what is your exact target, then I can build it out for you to test.

From the datasheet of the chipsets we use, here is some info:

  • AR9331: MIPS 24K processor operating at up to 400 MHz
  • MT7620: SoC includes a high performance 580 MHz MIPS24KEc CPU

As per the following link, MIPS24k is a 32 bit processor.
https://www.linux-mips.org/wiki/24K

Does this information help?

I tried compiling for mips32.

For 32(both le and be), it throws -

../../../golang.org/x/sys/unix/flock.go:18: undefined: Flock_t
../../../golang.org/x/sys/unix/sockcmsg_linux.go:14: undefined: Ucred
../../../golang.org/x/sys/unix/sockcmsg_linux.go:27: undefined: Ucred
../../../golang.org/x/sys/unix/sockcmsg_unix.go:42: undefined: Cmsghdr

It seems MIPS doesn't support flock and other socket control message primitives. 😞

When funnel opens a log file, it acquires an exclusive lock to protect the file from being overwritten by another spurious funnel process. And that requires flock to work. I even tried to compile by removing this and still it didn't work. Most probably because some other library might be using that. Also, funnel intercepts the SIGTERM signal which imports the syscall library. A lot of the functionalities in those libraries don't seem to be available in MIPS.

So, as of right now, I don't think funnel will work on MIPS platforms. You are most welcome though to fork it and remove all libraries and send a minimal version which works on MIPS. :)

+1

Thanks for your effort in trying to get it to work on MIPS/openwrt.

Feel free to close the issue. :-)