Compare commits
6 commits
master
...
dev-routeu
Author | SHA1 | Date | |
---|---|---|---|
|
b85d86c685 | ||
|
0698cbb25c | ||
|
3251fc2698 | ||
|
ccd7e80da7 | ||
|
886b9e7c0c | ||
|
aa55031cfd |
7 changed files with 22 additions and 50 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "machines/router/liminix"]
|
||||||
|
path = machines/router/liminix
|
||||||
|
url = https://git.dgnum.eu/HackENS/liminix-fork.git
|
1
machines/router/.gitignore
vendored
Normal file
1
machines/router/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
belkin-boot*.log
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
{ config, pkgs, lib, modulesPath, ... } :
|
{ config, pkgs, lib, modulesPath, ... } :
|
||||||
let
|
let
|
||||||
liminix = (import ./npins).liminix;
|
|
||||||
inherit (pkgs.liminix.services) bundle oneshot longrun;
|
inherit (pkgs.liminix.services) bundle oneshot longrun;
|
||||||
inherit (pkgs) serviceFns;
|
inherit (pkgs) serviceFns;
|
||||||
# EDIT: you can pick your preferred RFC1918 address space
|
# EDIT: you can pick your preferred RFC1918 address space
|
||||||
|
@ -22,13 +21,22 @@ in rec {
|
||||||
ipaddr = "10.0.0.8";
|
ipaddr = "10.0.0.8";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
hardware = {
|
||||||
|
flash = {
|
||||||
|
eraseBlockSize = 131072;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
hardware.flash.eraseBlockSize = 126976;
|
hardware.ubi = {
|
||||||
|
# PLEASE remove this when using the real ROM. These are just tweaks to make tftpboot working
|
||||||
|
minIOSize = lib.mkForce "1";
|
||||||
|
eraseBlockSize = lib.mkForce "130944";
|
||||||
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
"${liminix}/modules/network"
|
(modulesPath + "/network")
|
||||||
"${liminix}/modules/ssh"
|
(modulesPath + "/ssh")
|
||||||
"${liminix}/modules/outputs/ubimage.nix"
|
(modulesPath + "/outputs/ubimage.nix")
|
||||||
];
|
];
|
||||||
rootfsType = "ubifs";
|
rootfsType = "ubifs";
|
||||||
hostname = "hackens-router"; # EDIT
|
hostname = "hackens-router"; # EDIT
|
||||||
|
|
|
@ -3,13 +3,6 @@
|
||||||
, liminix-config ? ./configuration.nix
|
, liminix-config ? ./configuration.nix
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
patchedLiminix = pkgs.applyPatches {
|
liminix = builtins.toString ./liminix;
|
||||||
name = "liminix-patched";
|
|
||||||
src = liminix;
|
|
||||||
patches = [
|
|
||||||
./liminix-dtbsize.patch
|
|
||||||
];
|
|
||||||
};
|
|
||||||
pkgs = import nixpkgs {};
|
|
||||||
in
|
in
|
||||||
(import patchedLiminix { inherit nixpkgs liminix-config; device = import (patchedLiminix + "/devices/belkin-rt3200"); })
|
(import liminix { inherit nixpkgs liminix-config; device = import (liminix + "/devices/belkin-rt3200"); })
|
||||||
|
|
1
machines/router/liminix
Submodule
1
machines/router/liminix
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 5bb68f24b539db1d9591ea320436b9dbdd2dc354
|
|
@ -1,23 +0,0 @@
|
||||||
diff --git a/modules/outputs/tftpboot.nix b/modules/outputs/tftpboot.nix
|
|
||||||
index ad6ed63..9773042 100644
|
|
||||||
--- a/modules/outputs/tftpboot.nix
|
|
||||||
+++ b/modules/outputs/tftpboot.nix
|
|
||||||
@@ -73,8 +73,6 @@ in {
|
|
||||||
rootfsStart=${toString cfg.loadAddress}
|
|
||||||
rootfsSize=$(binsize64k ${o.rootfs} )
|
|
||||||
dtbStart=$(($rootfsStart + $rootfsSize))
|
|
||||||
- dtbSize=$(binsize ${o.dtb} )
|
|
||||||
- imageStart=$(($dtbStart + $dtbSize))
|
|
||||||
imageSize=$(binsize ${image})
|
|
||||||
|
|
||||||
ln -s ${o.manifest} manifest
|
|
||||||
@@ -102,6 +100,9 @@ in {
|
|
||||||
fdtput -p -t s dtb /reserved-memory/$node compatible phram
|
|
||||||
fdtput -p -t lx dtb /reserved-memory/$node reg $ac_prefix $(hex $rootfsStart) $sz_prefix $(hex $rootfsSize)
|
|
||||||
|
|
||||||
+ dtbSize=$(binsize ./dtb )
|
|
||||||
+ imageStart=$(($dtbStart + $dtbSize))
|
|
||||||
+
|
|
||||||
cmd="liminix ${cmdline} mtdparts=phram0:''${rootfsSize}(rootfs) phram.phram=phram0,''${rootfsStart},''${rootfsSize},${toString config.hardware.flash.eraseBlockSize} root=/dev/mtdblock0";
|
|
||||||
fdtput -t s dtb /chosen bootargs "$cmd"
|
|
||||||
|
|
|
@ -1,21 +1,10 @@
|
||||||
{
|
{
|
||||||
"pins": {
|
"pins": {
|
||||||
"liminix": {
|
|
||||||
"type": "Git",
|
|
||||||
"repository": {
|
|
||||||
"type": "Git",
|
|
||||||
"url": "https://gti.telent.net/dan/liminix"
|
|
||||||
},
|
|
||||||
"branch": "main",
|
|
||||||
"revision": "83ee488e4c81124380b8bd4ff8183e632f30eb91",
|
|
||||||
"url": null,
|
|
||||||
"hash": "08mpx615kpqzvwallf91gdqv8rhc2avdgfwldka598ynydlq1wnw"
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"type": "Channel",
|
"type": "Channel",
|
||||||
"name": "nixpkgs-unstable",
|
"name": "nixpkgs-unstable",
|
||||||
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.05pre572676.b06ff4bf8f4a/nixexprs.tar.xz",
|
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.05pre586231.f33dd27a47eb/nixexprs.tar.xz",
|
||||||
"hash": "1alh0waf9hjhxqnxwkmc6g1fq9h1m498g269yncdnhhkiglg73kx"
|
"hash": "15i504pd3y9r0c2fwyjwsc1j8055h20w0j2sj4ij5igvin7v3k9l"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": 3
|
"version": 3
|
||||||
|
|
Loading…
Reference in a new issue