From 223e523335d0135749990714b90c4a40a6c13a02 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Sat, 28 Sep 2024 15:27:25 +0200 Subject: [PATCH 1/4] asahi-bless: Open MTD device by device name "nvram" will not be the sole MTD device on AsahiLinux devices with m1n1-1.4.16 (https://github.com/AsahiLinux/m1n1/pull/399) and CONFIG_MTD_PHRAM. Use "/dev/mtd/by-name/nvram" instead of "/dev/mtd0". Signed-off-by: Janne Grunau --- asahi-bless/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/asahi-bless/src/lib.rs b/asahi-bless/src/lib.rs index 7e95fa5..1f4be46 100644 --- a/asahi-bless/src/lib.rs +++ b/asahi-bless/src/lib.rs @@ -313,7 +313,7 @@ pub fn get_boot_volume(next: bool) -> Result { let mut file = OpenOptions::new() .read(true) .write(true) - .open("/dev/mtd0") + .open("/dev/mtd/by-name/nvram") .map_err(Error::NvramReadError)?; let mut data = Vec::new(); file.read_to_end(&mut data).map_err(Error::NvramReadError)?; @@ -346,7 +346,7 @@ pub fn clear_next_boot() -> Result { let mut file = OpenOptions::new() .read(true) .write(true) - .open("/dev/mtd0") + .open("/dev/mtd/by-name/nvram") .map_err(Error::ApplyError)?; let mut data = Vec::new(); file.read_to_end(&mut data).map_err(Error::ApplyError)?; @@ -381,7 +381,7 @@ pub fn set_boot_volume(cand: &BootCandidate, next: bool) -> Result<()> { let mut file = OpenOptions::new() .read(true) .write(true) - .open("/dev/mtd0") + .open("/dev/mtd/by-name/nvram") .map_err(Error::ApplyError)?; let mut data = Vec::new(); file.read_to_end(&mut data).map_err(Error::ApplyError)?; From 4039bda21936b5bcfb1eeb13d60f9e46dc8ae4fc Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Sat, 28 Sep 2024 15:27:25 +0200 Subject: [PATCH 2/4] asahi-btsync: Open MTD device by device name "nvram" will not be the sole MTD device on AsahiLinux devices with m1n1-1.4.16 (https://github.com/AsahiLinux/m1n1/pull/399) and CONFIG_MTD_PHRAM. Use "/dev/mtd/by-name/nvram" instead of "/dev/mtd0". Signed-off-by: Janne Grunau --- asahi-btsync/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asahi-btsync/src/main.rs b/asahi-btsync/src/main.rs index 71a4b24..de79826 100644 --- a/asahi-btsync/src/main.rs +++ b/asahi-btsync/src/main.rs @@ -68,7 +68,7 @@ fn real_main() -> Result<()> { ) .get_matches(); - let default_name = "/dev/mtd0ro".to_owned(); + let default_name = "/dev/mtd/by-name/nvram".to_owned(); let default_config = "/var/lib/bluetooth".to_owned(); let bt_var = "BluetoothUHEDevices"; From e96f778c565abdeebf426b4ba6e0a34298061174 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Sat, 28 Sep 2024 15:27:25 +0200 Subject: [PATCH 3/4] asahi-nvram: Open MTD device by device name "nvram" will not be the sole MTD device on AsahiLinux devices with m1n1-1.4.16 (https://github.com/AsahiLinux/m1n1/pull/399) and CONFIG_MTD_PHRAM. Use "/dev/mtd/by-name/nvram" instead of "/dev/mtd0". Signed-off-by: Janne Grunau --- asahi-nvram/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asahi-nvram/src/main.rs b/asahi-nvram/src/main.rs index 529cf9e..4f144b2 100644 --- a/asahi-nvram/src/main.rs +++ b/asahi-nvram/src/main.rs @@ -57,7 +57,7 @@ fn real_main() -> Result<()> { .arg(clap::Arg::new("variable=value").multiple_values(true)), ) .get_matches(); - let default_name = "/dev/mtd0".to_owned(); + let default_name = "/dev/mtd/by-name/nvram".to_owned(); let mut file = OpenOptions::new() .read(true) .write(true) From e49c9406eecd47102d33f802eff4da93d5c6e70c Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Sat, 28 Sep 2024 15:27:25 +0200 Subject: [PATCH 4/4] asahi-wifisync: Open MTD device by device name "nvram" will not be the sole MTD device on AsahiLinux devices with m1n1-1.4.16 (https://github.com/AsahiLinux/m1n1/pull/399) and CONFIG_MTD_PHRAM. Use "/dev/mtd/by-name/nvram" instead of "/dev/mtd0". Signed-off-by: Janne Grunau --- asahi-wifisync/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asahi-wifisync/src/main.rs b/asahi-wifisync/src/main.rs index 8de9806..ea4aa30 100644 --- a/asahi-wifisync/src/main.rs +++ b/asahi-wifisync/src/main.rs @@ -57,7 +57,7 @@ fn real_main() -> Result<()> { ) .get_matches(); - let default_name = "/dev/mtd0ro".to_owned(); + let default_name = "/dev/mtd/by-name/nvram".to_owned(); let default_config = "/var/lib/iwd".to_owned(); let wlan_var = "preferred-networks";