commit 4cfaed7303699d297597cd880f8363c88458a767
parent 6d6dbe1cbbf1c339035fa57e56a5374a58dfb0c9
Author: Daniel Barlow <dan@telent.net>
Date: Wed, 26 Apr 2023 22:16:15 +0100
specify root device as /dev/mtdblockn
the (openwrt?) magic that autodetects it based on mtd labels
won't work with a two-stage boot
Diffstat:
5 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix
@@ -89,7 +89,7 @@
size ="0xfa0000";
eraseBlockSize = "65536";
};
- rootDevice = "1f05";
+ rootDevice = "/dev/mtdblock5";
dts = {
src = "${openwrt.src}/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts";
includes = [
diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix
@@ -47,7 +47,7 @@
size ="0xf80000";
eraseBlockSize = "65536";
};
- rootDevice = "1f05";
+ rootDevice = "/dev/mtdblock5";
dts = {
src = "${openwrt.src}/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts";
diff --git a/devices/gl-mt300n-v2/default.nix b/devices/gl-mt300n-v2/default.nix
@@ -44,7 +44,7 @@
size = "0xfb0000";
eraseBlockSize = "65536";
};
- rootDevice = "1f05";
+ rootDevice = "/dev/mtdblock5";
dts = {
src = "${openwrt.src}/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts";
diff --git a/modules/base.nix b/modules/base.nix
@@ -119,6 +119,7 @@ in {
};
boot.commandLine = [
"console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8"
+ "root=${config.hardware.rootDevice}"
"rootfstype=${config.rootfsType}"
"fw_devlink=off"
];
diff --git a/modules/initramfs.nix b/modules/initramfs.nix
@@ -31,6 +31,11 @@ in
dir /dev 0755 0 0
nod /dev/console 0600 0 0 c 5 1
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/persist 0755 0 0
dir /target/nix 0755 0 0