From 876bd7d8ce244bb6b68144ae3262cb94d7725a95 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 11 Dec 2023 19:02:30 +0000 Subject: [PATCH] rename flashimage to mtdimage --- ci.nix | 2 +- devices/gl-ar750/default.nix | 6 +++--- devices/gl-mt300a/default.nix | 6 +++--- devices/gl-mt300n-v2/default.nix | 6 +++--- devices/turris-omnia/default.nix | 2 +- doc/development.rst | 2 +- modules/all-modules.nix | 2 +- modules/hardware.nix | 2 +- modules/outputs/diskimage.nix | 1 - modules/outputs/{flashimage.nix => mtdimage.nix} | 12 ++++++------ 10 files changed, 20 insertions(+), 21 deletions(-) rename modules/outputs/{flashimage.nix => mtdimage.nix} (94%) diff --git a/ci.nix b/ci.nix index 6720261..2a13a9e 100644 --- a/ci.nix +++ b/ci.nix @@ -40,7 +40,7 @@ let }).outputs.optionsJson; installers = map (f: "system.outputs.${f}") [ "vmroot" - "flashimage" + "mtdimage" "ubimage" ]; inherit (pkgs.lib) concatStringsSep; diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix index 226c5c8..475173d 100644 --- a/devices/gl-ar750/default.nix +++ b/devices/gl-ar750/default.nix @@ -38,7 +38,7 @@ As with many GL.iNet devices, the stock vendor firmware is a fork of OpenWrt, meaning that the binary created by - :ref:`system-outputs-flashimage` can be flashed using the + :ref:`system-outputs-mtdimage` can be flashed using the vendor web UI or the U-Boot emergency "unbrick" routine. For flashing from an existing Liminix system (we believe that) it @@ -97,7 +97,7 @@ ../../modules/network ../../modules/arch/mipseb.nix ../../modules/outputs/tftpboot.nix - ../../modules/outputs/flashimage.nix + ../../modules/outputs/mtdimage.nix ../../modules/outputs/jffs2.nix ]; @@ -105,7 +105,7 @@ FEATURE_DD_IBS_OBS = "y"; # ath10k_cal_data needs skip_bytes,fullblock }; hardware = { - defaultOutput = "flashimage"; + defaultOutput = "mtdimage"; loadAddress = lim.parseInt "0x80060000"; entryPoint = lim.parseInt "0x80060000"; flash = { diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix index 4026d89..e2bf54d 100644 --- a/devices/gl-mt300a/default.nix +++ b/devices/gl-mt300a/default.nix @@ -29,7 +29,7 @@ ============ The stock vendor firmware is a fork of OpenWrt, meaning that the - binary created by :ref:`system-outputs-flashimage` can be flashed + binary created by :ref:`system-outputs-mtdimage` can be flashed using the vendor web UI or the U-Boot emergency "unbrick" routine. For flashing from an existing Liminix system (we think) it @@ -55,11 +55,11 @@ imports = [ ../../modules/arch/mipsel.nix ../../modules/outputs/tftpboot.nix - ../../modules/outputs/flashimage.nix + ../../modules/outputs/mtdimage.nix ../../modules/outputs/jffs2.nix ]; hardware = { - defaultOutput = "flashimage"; + defaultOutput = "mtdimage"; loadAddress = lim.parseInt "0x80000000"; entryPoint = lim.parseInt "0x80000000"; diff --git a/devices/gl-mt300n-v2/default.nix b/devices/gl-mt300n-v2/default.nix index 3d5d94d..a31642b 100644 --- a/devices/gl-mt300n-v2/default.nix +++ b/devices/gl-mt300n-v2/default.nix @@ -22,7 +22,7 @@ ============ The stock vendor firmware is a fork of OpenWrt, meaning that the - binary created by :ref:`system-outputs-flashimage` can be flashed + binary created by :ref:`system-outputs-mtdimage` can be flashed using the vendor web UI or the U-Boot emergency "unbrick" routine. For flashing from an existing Liminix system (we think) it @@ -55,7 +55,7 @@ imports = [ ../../modules/arch/mipsel.nix ../../modules/outputs/tftpboot.nix - ../../modules/outputs/flashimage.nix + ../../modules/outputs/mtdimage.nix ../../modules/outputs/jffs2.nix ]; filesystem = dir { @@ -66,7 +66,7 @@ }; }; hardware = { - defaultOutput = "flashimage"; + defaultOutput = "mtdimage"; loadAddress = lim.parseInt "0x80000000"; entryPoint = lim.parseInt "0x80000000"; diff --git a/devices/turris-omnia/default.nix b/devices/turris-omnia/default.nix index 66f6c34..cfb4139 100644 --- a/devices/turris-omnia/default.nix +++ b/devices/turris-omnia/default.nix @@ -128,7 +128,7 @@ klibBuild = config.system.outputs.kernel.modulesupport; }; in { - defaultOutput = "flashimage"; + defaultOutput = "mtdimage"; loadAddress = lim.parseInt "0x00008000"; entryPoint = lim.parseInt "0x00008000"; rootDevice = "/dev/mtdblock0"; diff --git a/doc/development.rst b/doc/development.rst index 7969817..dca89c5 100644 --- a/doc/development.rst +++ b/doc/development.rst @@ -180,7 +180,7 @@ Now add the device and server IP addresses to your configuration: }; and then build the derivation for ``outputs.default`` or -``outputs.flashimage`` (for which it will be an alias on any device +``outputs.mtdimage`` (for which it will be an alias on any device where this is applicable). You should find it has created * :file:`result/firmware.bin` which is the file you are going to flash diff --git a/modules/all-modules.nix b/modules/all-modules.nix index 1e7f58d..71949a6 100644 --- a/modules/all-modules.nix +++ b/modules/all-modules.nix @@ -24,7 +24,7 @@ ./outputs.nix ./outputs/vmroot.nix ./outputs/ubimage.nix - ./outputs/flashimage.nix + ./outputs/mtdimage.nix ./ppp ./ramdisk.nix ./squashfs.nix diff --git a/modules/hardware.nix b/modules/hardware.nix index 2a6823f..9c8de38 100644 --- a/modules/hardware.nix +++ b/modules/hardware.nix @@ -32,7 +32,7 @@ in { }; }; defaultOutput = mkOption { - description = "\"Default\" output: what gets built for this device when outputs.default is requested. Typically this is \"flashimage\" or \"vmroot\""; + description = "\"Default\" output: what gets built for this device when outputs.default is requested. Typically this is \"mtdimage\" or \"vmroot\""; type = types.nonEmptyStr; }; ram = { diff --git a/modules/outputs/diskimage.nix b/modules/outputs/diskimage.nix index a29db92..a9ee85c 100644 --- a/modules/outputs/diskimage.nix +++ b/modules/outputs/diskimage.nix @@ -9,7 +9,6 @@ let o = config.system.outputs; phram_address = lib.toHexString (config.hardware.ram.startAddress + 256 * 1024 * 1024); in { -# imports = [ ./flashimage.nix ]; options.system.outputs = { diskimage = mkOption { type = types.package; diff --git a/modules/outputs/flashimage.nix b/modules/outputs/mtdimage.nix similarity index 94% rename from modules/outputs/flashimage.nix rename to modules/outputs/mtdimage.nix index 41d6a75..d817679 100644 --- a/modules/outputs/flashimage.nix +++ b/modules/outputs/mtdimage.nix @@ -11,7 +11,7 @@ in { options.system.outputs = { firmware = mkOption { type = types.package; - internal = true; # component of flashimage + internal = true; # component of mtdimage description = '' Binary image (combining kernel, FDT, rootfs, initramfs if needed, etc) for the target device. @@ -19,16 +19,16 @@ in { }; flash-scr = mkOption { type = types.package; - internal = true; # component of flashimage + internal = true; # component of mtdimage description = '' Copy-pastable U-Boot commands to TFTP download the image and write it to flash ''; }; - flashimage = mkOption { + mtdimage = mkOption { type = types.package; description = '' - flashimage + mtdimage ********** This creates an image called :file:`firmware.bin` suitable for @@ -80,10 +80,10 @@ in { dd if=${o.uimage} of=$out bs=${bs} conv=sync dd if=${o.rootfs} of=$out bs=${bs} conv=sync,nocreat,notrunc oflag=append ''; - flashimage = + mtdimage = let o = config.system.outputs; in # could use trivial-builders.linkFarmFromDrvs here? - pkgs.runCommand "flashimage" {} '' + pkgs.runCommand "mtdimage" {} '' mkdir $out cd $out ln -s ${o.firmware} firmware.bin