commit 3851698d35e355c2a4d2758ecc9cc9636e669588
parent f69ebbb6f5174b93c35888ae1abdd8af95512773
Author: Daniel Barlow <dan@telent.net>
Date: Tue, 13 Feb 2024 18:16:17 +0000
fix tftpboot compressed rootfs
Diffstat:
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/modules/outputs/tftpboot.nix b/modules/outputs/tftpboot.nix
@@ -80,14 +80,6 @@ in {
ln -s ${image} image
ln -s ${o.kernel} vmlinux # handy for gdb
- ${if cfg.compressRoot
- then ''
- lzma -z9cv ${o.rootfs} > rootfs.lz
- rootfsLzStart=$(($imageStart + $imageSize))
- rootfsLzSize=$(binsize rootfs.lz)
- ''
- else "ln -s ${o.rootfs} rootfs"
- }
cat ${o.dtb} > dtb
address_cells=$(fdtget dtb / '#address-cells')
size_cells=$(fdtget dtb / '#size-cells')
@@ -103,6 +95,14 @@ in {
dtbSize=$(binsize ./dtb )
imageStart=$(($dtbStart + $dtbSize))
+ ${if cfg.compressRoot
+ then ''
+ lzma -z9cv ${o.rootfs} > rootfs.lz
+ rootfsLzStart=$(($imageStart + $imageSize))
+ rootfsLzSize=$(binsize rootfs.lz)
+ ''
+ else "ln -s ${o.rootfs} rootfs"
+ }
cmd="liminix ${cmdline} mtdparts=phram0:''${rootfsSize}(rootfs) phram.phram=phram0,''${rootfsStart},''${rootfsSize},${toString config.hardware.flash.eraseBlockSize} root=/dev/mtdblock0";
fdtput -t s dtb /chosen bootargs "$cmd"