nixwrt icon indicating copy to clipboard operation
nixwrt copied to clipboard

WIP: Add wrt1900acs ARMv7 target

Open phodina opened this issue 5 years ago • 6 comments

This is still WIP attempt to add support for ARMv7 WRT1900ACS router

  • [ ] Currently the build fails on building busybox as a dependency for haveged. I found a patch that should fix the issue regarding the time structure being 64-bit on 32-bit platform. However I don't know how to apply the patch. @telent @mathiashro could you please help me with applying it in nixwrt/overlay.nix?
    CC      libbb/sysconf.o
    CC      libbb/time.o
  libbb/time.c: In function 'get_mono':
  libbb/time.c:260:14: error: '__NR_clock_gettime' undeclared (first use in this function); did you mean 'clock_gettime'?
    260 |  if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts))
        |              ^~~~~~~~~~~~~~~~~~
        |              clock_gettime
  libbb/time.c:260:14: note: each undeclared identifier is reported only once for each function it appears in
  make[1]: *** [scripts/Makefile.build:197: libbb/time.o] Error 1
  make: *** [Makefile:743: libbb] Error 2
building '/nix/store/bm2yya8vy9ql5f62kahk3vibw47jsjsn-haveged-1.9.2-armv7l-unknown-linux-musleabi.drv'...

phodina avatar Mar 02 '21 17:03 phodina

This is exciting, first non-MIPS target. Will take a look shortly

telent avatar Mar 07 '21 15:03 telent

Yes I've spare WRT1900ACS router which is armv7l based and I've compiled custom OpenWRT build for it. Also there is serial line attached to reflash if it gets bricked.

However, I think it would be better to prepare an issue where we can discuss how to support cross-compilation for multiple architectures and define steps to get there.

phodina avatar Mar 08 '21 13:03 phodina

@telent Do you think you could spare time for review?

phodina avatar Mar 14 '21 14:03 phodina

  I found a patch that should fix the issue regarding the time structure being 64-bit on 32-bit platform. 

Seems to be a pair of patches inside another patch, which I think is slightly beyond the ability of fetchpatch to understand. You'd have to download it and extract them locally, and then it'd be a simple matter of

  busybox = stripped (super.busybox.overrideAttrs (o: {
    postConfigure = "true";

    patches = o.patches ++ [ "0001-date-Use-64-prefix-syscall-if-we-have-to.patch" "0001-time-Use-64-prefix-syscall-if-we-have-to.patch" ];
  }));

or something like that. I am curious, though - this is almost the same busybox derivation as used in upstream NixOS, does it not work on Arm 32bit there either? I understand that armv7 is not a first-class target for NixOS but it might be worth trying to patch upstream

telent avatar Mar 30 '21 20:03 telent

How much work do you think it would be to make an image that runs on qemu arm? I don't have any suitable ARM hardware, but it would give me confidence when looking at ARM changes that I hadn't broken everything

telent avatar Mar 30 '21 20:03 telent

A sidenote - I have some ARM routers that could lend/donate if that would be helpful ? No worries if not as well tho :)

cyplo avatar May 14 '21 15:05 cyplo