1
0

Compare commits

..

No commits in common. "67768004eedf86608e14951f38892168700bdb13" and "151dc88c285b30819a87676d63ff0a4f3a961d15" have entirely different histories.

8 changed files with 9 additions and 17 deletions

View File

@ -89,7 +89,7 @@
size ="0xfa0000"; size ="0xfa0000";
eraseBlockSize = "65536"; eraseBlockSize = "65536";
}; };
rootDevice = "/dev/mtdblock5"; rootDevice = "1f05";
dts = { dts = {
src = "${openwrt.src}/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts"; src = "${openwrt.src}/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts";
includes = [ includes = [

View File

@ -47,7 +47,7 @@
size ="0xf80000"; size ="0xf80000";
eraseBlockSize = "65536"; eraseBlockSize = "65536";
}; };
rootDevice = "/dev/mtdblock5"; rootDevice = "1f05";
dts = { dts = {
src = "${openwrt.src}/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts"; src = "${openwrt.src}/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts";

View File

@ -44,7 +44,7 @@
size = "0xfb0000"; size = "0xfb0000";
eraseBlockSize = "65536"; eraseBlockSize = "65536";
}; };
rootDevice = "/dev/mtdblock5"; rootDevice = "1f05";
dts = { dts = {
src = "${openwrt.src}/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts"; src = "${openwrt.src}/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts";

View File

@ -25,7 +25,7 @@ let
in rec { in rec {
boot = { boot = {
tftp = { tftp = {
freeSpaceBytes = 3 * 1024 * 1024; enable = true;
serverip = "10.0.0.1"; serverip = "10.0.0.1";
ipaddr = "10.0.0.8"; ipaddr = "10.0.0.8";
}; };

View File

@ -2,6 +2,7 @@
let let
inherit (lib) mkEnableOption mkOption types isDerivation hasAttr ; inherit (lib) mkEnableOption mkOption types isDerivation hasAttr ;
inherit (pkgs.pseudofile) dir symlink; inherit (pkgs.pseudofile) dir symlink;
# inherit (pkgs) busybox;
inherit (pkgs.liminix.networking) address interface; inherit (pkgs.liminix.networking) address interface;
inherit (pkgs.liminix.services) bundle; inherit (pkgs.liminix.services) bundle;
@ -51,6 +52,7 @@ in {
# the right to change them if I think of better ones. # the right to change them if I think of better ones.
ipaddr = mkOption { type = types.str; }; ipaddr = mkOption { type = types.str; };
serverip = mkOption { type = types.str; }; serverip = mkOption { type = types.str; };
enable = mkOption { type = types.boolean; };
}; };
}; };
}; };
@ -117,7 +119,6 @@ in {
}; };
boot.commandLine = [ boot.commandLine = [
"console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8" "console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8"
"root=${config.hardware.rootDevice}"
"rootfstype=${config.rootfsType}" "rootfstype=${config.rootfsType}"
"fw_devlink=off" "fw_devlink=off"
]; ];

View File

@ -53,7 +53,7 @@ in {
setenv serverip ${tftp.serverip} setenv serverip ${tftp.serverip}
setenv ipaddr ${tftp.ipaddr} setenv ipaddr ${tftp.ipaddr}
tftp 0x$(printf %x ${tftp.loadAddress}) result/firmware.bin tftp 0x$(printf %x ${tftp.loadAddress}) result/firmware.bin
erase 0x$(printf %x ${flash.address}) +${flash.size} erase 0x$(printf %x ${flash.address}) +\''${filesize})
cp.b 0x$(printf %x ${tftp.loadAddress}) 0x$(printf %x ${flash.address}) \''${filesize} cp.b 0x$(printf %x ${tftp.loadAddress}) 0x$(printf %x ${flash.address}) \''${filesize}
echo command line was ${builtins.toJSON (concatStringsSep " " config.boot.commandLine)} echo command line was ${builtins.toJSON (concatStringsSep " " config.boot.commandLine)}
EOF EOF

View File

@ -31,11 +31,6 @@ in
dir /dev 0755 0 0 dir /dev 0755 0 0
nod /dev/console 0600 0 0 c 5 1 nod /dev/console 0600 0 0 c 5 1
nod /dev/mtdblock0 0600 0 0 b 31 0 nod /dev/mtdblock0 0600 0 0 b 31 0
nod /dev/mtdblock1 0600 0 0 b 31 1
nod /dev/mtdblock2 0600 0 0 b 31 2
nod /dev/mtdblock3 0600 0 0 b 31 3
nod /dev/mtdblock4 0600 0 0 b 31 4
nod /dev/mtdblock5 0600 0 0 b 31 5
dir /target 0755 0 0 dir /target 0755 0 0
dir /target/persist 0755 0 0 dir /target/persist 0755 0 0
dir /target/nix 0755 0 0 dir /target/nix 0755 0 0

View File

@ -9,10 +9,6 @@ let
cfg = config.boot.tftp; cfg = config.boot.tftp;
in { in {
imports = [ ./ramdisk.nix ]; imports = [ ./ramdisk.nix ];
options.boot.tftp.freeSpaceBytes = mkOption {
type = types.int;
default = 0;
};
config = { config = {
boot.ramdisk.enable = true; boot.ramdisk.enable = true;
@ -37,8 +33,8 @@ in {
uimageSize=$(($(stat -L -c %s ${config.outputs.uimage}) + 0x1000 &(~0xfff))) uimageSize=$(($(stat -L -c %s ${config.outputs.uimage}) + 0x1000 &(~0xfff)))
rootfsStart=0x$(printf %x $((${cfg.loadAddress} + 0x100000 + $uimageSize))) rootfsStart=0x$(printf %x $((${cfg.loadAddress} + 0x100000 + $uimageSize)))
rootfsBytes=$(($(stat -L -c %s ${config.outputs.rootfs}) + 0x100000 &(~0xfffff))) rootfsBytes=$(($(stat -L -c %s ${config.outputs.rootfs}) + 0x100000 &(~0xfffff)))
rootfsBytes=$(($rootfsBytes + ${toString cfg.freeSpaceBytes} )) rootfsMb=$(($rootfsBytes >> 20))
cmd="mtdparts=phram0:''${rootfsMb}M(rootfs) phram.phram=phram0,''${rootfsStart},''${rootfsBytes},${config.hardware.flash.eraseBlockSize} memmap=''${rootfsBytes}\$''${rootfsStart} root=/dev/mtdblock0"; cmd="mtdparts=phram0:''${rootfsMb}M(rootfs) phram.phram=phram0,''${rootfsStart},''${rootfsMb}Mi,${config.hardware.flash.eraseBlockSize} memmap=''${rootfsMb}M\$''${rootfsStart} root=/dev/mtdblock0";
cat > $out << EOF cat > $out << EOF
setenv serverip ${cfg.serverip} setenv serverip ${cfg.serverip}