1
0

Allow flashing

This commit is contained in:
Arnout Engelen 2024-12-31 16:48:10 +01:00
parent 996cf4b472
commit e2f8082a7b
No known key found for this signature in database
GPG Key ID: 061107B0F74A6DAA
4 changed files with 33 additions and 5 deletions

View File

@ -21,9 +21,18 @@
Limitations
===========
- adding `he_bss_color="128"` causes `Invalid argument` for hostap
- nvme support untested
- I don't think the front LEDs work yet
- adding `he_bss_color="128"` causes `Invalid argument` for hostap
Installation
============
- build the default output (the FIT image)
- rename it to 'openwrt-mediatek-filogic-openwrt_one-squashfs-sysupgrade.itb'
- start a TFTP server
- use 'Load production system via TFTP then write to NAND' and 'Boot production system from NAND'
from the serial uboot menu
'';
system = {
@ -652,6 +661,7 @@
#defaultOutput = "tftpboot";
loadAddress = lim.parseInt "0x44000000";
entryPoint = lim.parseInt "0x44000000";
alignment = 2048;
rootDevice = "/dev/fit0";
dts = {
src = "${openwrt.src}/target/linux/mediatek/dts/mt7981b-openwrt-one.dts";

View File

@ -25,6 +25,6 @@ in
inherit (config.boot) commandLineDtbNode;
inherit (config.hardware) loadAddress entryPoint alignment;
inherit (config.boot) imageFormat;
inherit (o) kernel dtb;
inherit (o) kernel dtb rootfs;
};
}

View File

@ -40,8 +40,8 @@
};
configurations {
default = "conf-1";
conf-1 {
default = "config-1";
config-1 {
description = "Boot Linux kernel with FDT blob";
kernel = "kernel";
fdt = "fdt-1";

View File

@ -22,6 +22,7 @@ in {
, imageFormat
, alignment ? null
, dtb ? null
, rootfs
} : stdenv.mkDerivation {
name = "kernel.image";
phases = [
@ -53,6 +54,7 @@ in {
buildPhaseFIT = ''
${stripAndZip}
cp ${rootfs} rootfs
cat ${./kernel_fdt.its} > mkimage.its
cat << _VARS >> mkimage.its
/ {
@ -68,10 +70,26 @@ in {
data = /incbin/("./tmp.dtb");
arch = "${arch}";
};
rootfs-1 {
description = "Liminix rootfs";
data = /incbin/("./rootfs");
type = "filesystem";
hash-1 {
algo = "crc32";
};
hash-2 {
algo = "sha1";
};
};
};
configurations {
config-1 {
loadables = "rootfs-1";
};
};
};
_VARS
mkimage -f mkimage.its ${lib.optionalString (alignment != null) "-B 0x${lib.toHexString alignment}"} kernel.uimage
mkimage -f mkimage.its -E ${lib.optionalString (alignment != null) "-B 0x${lib.toHexString alignment}"} kernel.uimage
mkimage -l kernel.uimage
'';