router: use liminix submodule

This commit is contained in:
sinavir 2024-01-23 13:13:38 +01:00
parent fc28547693
commit aa55031cfd
7 changed files with 12 additions and 49 deletions

3
.gitmodules vendored Normal file
View 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
View file

@ -0,0 +1 @@
belkin-boot*.log

View file

@ -7,7 +7,7 @@
{ config, pkgs, lib, modulesPath, ... } : { config, pkgs, lib, modulesPath, ... } :
let let
liminix = (import ./npins).liminix; liminix = ./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
@ -23,12 +23,11 @@ in rec {
}; };
}; };
hardware.flash.eraseBlockSize = 126976;
imports = [ imports = [
"${liminix}/modules/network" (liminix + "/modules/network")
"${liminix}/modules/ssh" (liminix + "/modules/ssh")
"${liminix}/modules/outputs/ubimage.nix" (liminix + "/modules/outputs/ubimage.nix")
#(liminix + "/modules/outputs/ext4fs.nix")
]; ];
rootfsType = "ubifs"; rootfsType = "ubifs";
hostname = "hackens-router"; # EDIT hostname = "hackens-router"; # EDIT

View file

@ -3,13 +3,6 @@
, liminix-config ? ./configuration.nix , liminix-config ? ./configuration.nix
}: }:
let let
patchedLiminix = pkgs.applyPatches { liminix = ./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"); })

@ -0,0 +1 @@
Subproject commit 83ee488e4c81124380b8bd4ff8183e632f30eb91

View file

@ -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"

View file

@ -1,16 +1,5 @@
{ {
"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",