commit bc20f4c6b748960699c9015cbbd6275c8ccdde5e
parent 848214d1047532acb902df7c1a534a1cba26f62b
Author: Daniel Barlow <dan@telent.net>
Date: Mon, 23 Dec 2024 23:59:52 +0000
rt3200 test install
Diffstat:
2 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/devices/belkin-rt3200/default.nix b/devices/belkin-rt3200/default.nix
@@ -44,7 +44,9 @@
MT7622> tftpboot 0x42000000 openwrt-mediatek-mt7622-linksys_e8450-ubi-initramfs-recovery-installer.itb
MT7622> bootm 0x42000000
- Once it's finished booted into Linux you can safely reboot
+ This will write the new flash layout and then boot into a
+ "recovery" OpenWrt installation. Once it's finished booting into
+ Linux you can safely reboot
Installing Liminix
------------------
@@ -73,6 +75,7 @@
../../modules/arch/aarch64.nix
../../modules/outputs/tftpboot.nix
../../modules/outputs/ubifs.nix
+ ../../modules/outputs/ubimage.nix
];
config = {
kernel = {
@@ -203,7 +206,8 @@
in {
ubi = {
minIOSize = "2048";
- eraseBlockSize = "126976";
+ logicalEraseBlockSize = "126976";
+ physicalEraseBlockSize = "131072";
maxLEBcount = "1024"; # guessing
};
diff --git a/modules/outputs/ubimage.nix b/modules/outputs/ubimage.nix
@@ -82,12 +82,11 @@ automatically, you can try booting it by hand to see if it works:
.. code-block:: console
uboot> ubifsmount ubi0:liminix
- uboot> ubifsload ''${loadaddr} boot/uimage
+ uboot> ubifsload ''${loadaddr} boot/fit
uboot> bootm ''${loadaddr}
Once you've done this and you're happy with it, reset the device to
-U-Boot. You don't need to recreate the volume but you do need to
-repeat step 3.
+return to U-Boot.
5) Instructions for configuring autoboot are likely to be very
device-dependent. On the Linksys E8450/Belkin RT3200, the environment
@@ -96,7 +95,10 @@ you could do
.. code-block:: console
- uboot> setenv boot_production 'led $bootled_pwr on ; ubifsmount ubi0:liminix; ubifsload ''${loadaddr} boot/uimage; bootm ''${loadaddr}'
+ uboot> setenv orig_boot_production $boot_production
+ uboot> setenv boot_production 'led $bootled_pwr on ; ubifsmount ubi0:liminix && ubifsload ''${loadaddr} boot/fit && bootm ''${loadaddr}'
+ uboot> saveenv
+ uboot> reset
On other devices, some detective work may be needed. Try running
`printenv` and look for likely commands, try looking at the existing
@@ -111,16 +113,13 @@ boot process, maybe even try looking for documentation for that device.
};
};
- config = mkIf (config.rootfsType == "ubifs") {
- system.outputs = {
- ubimage =
- let o = config.system.outputs; in
- pkgs.runCommand "ubimage" {} ''
- mkdir $out
- cd $out
- ln -s ${o.rootfs} rootfs
- ln -s ${instructions} env.scr
- '';
- };
- };
+ config.system.outputs.ubimage =
+ assert config.rootfsType == "ubifs";
+ let o = config.system.outputs; in
+ pkgs.runCommand "ubimage" {} ''
+ mkdir $out
+ cd $out
+ ln -s ${o.rootfs} rootfs
+ ln -s ${instructions} env.scr
+ '';
}