From dfbc72dd518c79257078edba70b28ee4ff5172eb Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Fri, 22 Dec 2023 17:37:53 +0000 Subject: [PATCH] tftpboot test: fix reserved-memory dt for aarch64 --- modules/outputs/tftpboot.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/outputs/tftpboot.nix b/modules/outputs/tftpboot.nix index 0261696..74b6839 100644 --- a/modules/outputs/tftpboot.nix +++ b/modules/outputs/tftpboot.nix @@ -82,15 +82,16 @@ in { cat ${o.dtb} > $out/dtb address_cells=$(fdtget $out/dtb / '#address-cells') size_cells=$(fdtget $out/dtb / '#size-cells') - if [ address_cells -gt 1 ]; then ac_prefix=0; fi - if [ size_cells -gt 1 ]; then sz_prefix=0; fi + if [ $address_cells -gt 1 ]; then ac_prefix=0; fi + if [ $size_cells -gt 1 ]; then sz_prefix=0; fi + fdtput -p $out/dtb /reserved-memory '#address-cells' $address_cells fdtput -p $out/dtb /reserved-memory '#size-cells' $size_cells fdtput -p $out/dtb /reserved-memory ranges fdtput -p -t s $out/dtb /reserved-memory/phram-rootfs@$rootfsStart compatible phram fdtput -p -t lx $out/dtb /reserved-memory/phram-rootfs@$rootfsStart reg $ac_prefix 0x$rootfsStart $sz_prefix $(printf %x $rootfsBytes) - # dtc -I dtb -O dts -o /dev/stdout $out/dtb; exit 1 + # dtc -I dtb -O dts -o /dev/stdout $out/dtb | grep -A10 reserved-mem ; exit 1 dtbBytes=$(($(stat -L -c %s $out/dtb) + 0x1000 &(~0xfff))) cat > $out/script << EOF