diff --git a/modules/outputs/tftpboot.nix b/modules/outputs/tftpboot.nix index 6edd730..ac925f9 100644 --- a/modules/outputs/tftpboot.nix +++ b/modules/outputs/tftpboot.nix @@ -97,7 +97,7 @@ in { # decompression code will assume that any memory after the # end of the kernel is free - dtbStart=$(($rootfsStart + $rootfsSize)) + imageStart=$(($rootfsStart + $rootfsSize)) ${if cfg.compressRoot then '' lzma -z9cv ${o.rootfs} > rootfs.lz @@ -123,7 +123,7 @@ in { fdtput -p -t s dtb /reserved-memory/$node compatible phram fdtput -p -t lx dtb /reserved-memory/$node reg $ac_prefix $(hex $rootfsStart) $sz_prefix $(hex $rootfsSize) - cmd="liminix ${cmdline} mtdparts=phram0:''${rootfsSize}(rootfs) phram.phram=phram0,''${rootfsStart},''${rootfsSize},${toString config.hardware.flash.eraseBlockSize} root=/dev/fit0"; + cmd="liminix ${cmdline} mtdparts=phram0:''${rootfsSize}(rootfs) phram.phram=phram0,''${rootfsStart},''${rootfsSize},${toString config.hardware.flash.eraseBlockSize} root=/dev/mtdblock0"; #cmd="liminix ${cmdline}" fdtput -t s dtb /chosen ${config.boot.commandLineDtbNode} "$cmd" @@ -147,22 +147,10 @@ cat << _VARS >> mkimage.its data = /incbin/("./dtb"); arch = "${arch}"; }; - ramdisk-1 { - description = "${arch} Liminix rootfs"; - data = /incbin/("./rootfs"); - type = "ramdisk"; - arch = "${arch}"; - os = "linux"; - }; - }; - configurations { - config-1 { - ramdisk = "ramdisk-1"; - }; }; }; _VARS - mkimage -f mkimage.its kernel.uimage + mkimage -f mkimage.its image tftpcmd="tftpboot $(hex $imageStart) result/image " bootcmd="bootm $(hex $imageStart)" diff --git a/pkgs/kernel/default.nix b/pkgs/kernel/default.nix index 9634127..6662d5a 100644 --- a/pkgs/kernel/default.nix +++ b/pkgs/kernel/default.nix @@ -61,8 +61,9 @@ stdenv.mkDerivation rec { patches = [ ./cmdline-cookie.patch ./mips-malta-fdt-from-bootloader.patch - ] ++ lib.optional (lib.versionOlder version "5.18.0") - ./phram-allow-cached-mappings.patch; + ./phram-always-memremap.patch + ];# ++ lib.optional (lib.versionOlder version "5.18.0") + #./phram-allow-cached-mappings.patch # this is here to work around what I think is a bug in nixpkgs # packaging of ncurses: it installs pkg-config data files which diff --git a/pkgs/kernel/phram-always-memremap.patch b/pkgs/kernel/phram-always-memremap.patch new file mode 100644 index 0000000..46b78e1 --- /dev/null +++ b/pkgs/kernel/phram-always-memremap.patch @@ -0,0 +1,20 @@ +--- a/drivers/mtd/devices/phram.c 2024-12-20 23:42:19.248462526 +0100 ++++ b/drivers/mtd/devices/phram.c 2024-12-20 23:41:11.344218259 +0100 +@@ -85,7 +85,7 @@ + { + void *addr = NULL; + +- if (phram->cached) ++ if (phram->cached || true) + addr = memremap(start, len, MEMREMAP_WB); + else + addr = (void __force *)ioremap(start, len); +@@ -101,7 +101,7 @@ + { + void *addr = phram->mtd.priv; + +- if (phram->cached) { ++ if (phram->cached || true) { + memunmap(addr); + return; + }