Giter Site home page Giter Site logo

nixwrt's People

Contributors

mathiashro avatar phodina avatar telent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nixwrt's Issues

Define a filesystem hierachy for Nix on wireless routers

The idea to build completely the fimware.bin on a remote builder is definitely a step in the right direction. The embedded device is too constrained to build any derivations in terms of compute power as well as storage. There are usually NOR flash (small 4MiB - 16 MiB) and NAND flash (32 MiB - 256MiB) memory chips. Also the memory layout of each device is unique. To generate the image we can reuse the epic work already done in OpenWrt.

However, in case of the OpenWrt the user has an option to login in and install additional software. A use case might be e.g. tcpdump to debug traffic issues in the network.

Another use case is definitely porting userspace application where a faulty program present in the squashfs could cause the boot to fail leading to reflashing the router through serial line to access the proprietary bootloader and downloading the firmware.bin through TFTP. Repeating this cycle often the flash memory will degrade leading the making a brick, resoldering the memory chip or buying a new router.

To avoid this scenario it we could use EXTROOT approach. These days routers have also USB subsystem and we could leverage that to attach USB Flash drive with e.g. EXT4 filesystem which would be mounted through overlayfs. Therefore we could put the path /nix/store/ on the removable drive solving the issue with storage space, read-only filesystem and flash storage degradation. Nix would be configured to use binary substitutes for derivations. Additionally the extra space can be used to store containers (Docker, Balena, LXD).

To minimalize write operations to the embedded flash memory building derivations should be available only if the external USB flash drive is present.

On the other hand a question arises as we get a newer kernel or anything that's part of the rootfs. It would not recommend to symlink anything that vital on a removable drive. As a result a whole system update would be necessary (flashing a newer version of firmware.bin) by switching into a ramdisk and overwriting the correct partition(s).

Therefore the packages would have to be pinned - e.g. Flakes.

So the conclusion of the idea is to have there rootfs with overlay on the embedded flash memory and another overlayfs on the external flash drive.

Support cross compilation for multiple architectures

  • Currently the only supported platform is MIPS. The cross compilation configuration is defined in mksystem.nix. This code will definitely need to be refactored.

  • It would be great if we could extend the NixOS configuration.nix and just import nixwrt as a module.

  • There are many wireless routers out there but the most important architectures now are probably ARMv7, AARCH64 and MIPS. Porting for AARCH64 might be easier as it's one of the supported architecture by Nix.

  • In order to port the these architectures we'll need probably a lot of patches from OpenWRT as well as Yocto and Buildroot.

  • It seems there is also a project to run Nix on ARM that aims on Single Board Computers such as Raspberry Pi. That means a lot of the userspace components will already have patches to build and run. However, as it's the case with embedded devices the booting process, kernel and image building will differ greatly. But it's a start.

  • The image builder for each SoC and board is defined in OpenWRT. The scripts there will need to be converted into Nix code. Maybe resholve could speed things up? Also if the scripts are ported to Nix how will the changes be tracked?

string is not allowed to refer to a store path

When I make upstaisr image=phramware on NixOS unstable, I get the above error about a string containing a lot of config settings, including:

 "CONFIG_SHELL": "/nix/store/wadmyilr414n7bimxysbny876i2vlm5r-bash-5.1-p8/bin/bash"

That shell does exist on my machine, but isn't the one I'm using - not sure where that comes from.

The full output (with trace) is out.txt

Replacing the two occurances of type -p bash in nixwrt/kernel/make-backport-modules.nix is not sufficient - somehow CONFIG_SHELL comes pre-populated when creating defconfig.json in nixwrt/kernel/default.nix (even before source ${file}) - though I don't understand where that's coming from.

Does it work with git-annex rsync support? (was Question)

Before I get a new router and possibly spend a pointless amount of time fixing strange issues, can you see if git-annex can copy files to and from the server via its rsync support? If not, it will be much more effort. It'd be preferable to just use git-annex directly, but I don't want to hack up undocumented WIP code to do something that almost no one else will need (at least, before you add support for end-user configuration). Also, random request for once you support ARM; can you see if you can add the ARM broadcom-wl drivers? I'm honestly not sure if they exist outside of DD-WRT (which has a license exception to use them in their GPL codebase), but apparently Debian has a cross-architecture DKMS package for them. DD-WRT is buggy for me, and my router is nearly useless on OpenWRT because my router's Wi-Fi card has horrible open-source drivers.

tew-712br : no lights come on

After my TrendNET TEW-712BR has booted, none of the LEDs (power, ports, wlan) light up. This does not seem to affect normal functioning but does make it tricky to tell whether it's functioning

Less eval

Instead of

let onTheBuild = import <nixpkgs> {} ; # this is accessible from that latter
    onTheHost = import <nixpkgs> {
      crossSystem = rec {
        system = "mips-linux-gnu";
        openssl.system = "linux-generic32";
        withTLS = true;
        inherit (platform) gcc; # this is no longer needed
        inherit platform;
      };
};

try

let onTheBuild = onTheHost.buildPackages;
    onTheHost = import <nixpkgs> {
      crossSystem = rec {
        system = "mips-linux-gnu";
        openssl.system = "linux-generic32";
        withTLS = true;
        inherit platform;
      };
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.