diff --git a/lagarto-ox.nix b/lagarto-ox.nix index ab96e84..6b51268 100644 --- a/lagarto-ox.nix +++ b/lagarto-ox.nix @@ -80,6 +80,20 @@ compressor = "gzip"; kernelModules = [ ]; + # Custom init script + extraFiles."/init2".source = pkgs.writeScript "init2" '' + #!${config.system.build.extraUtils}/bin/ash + + set -x + + export PATH=${config.system.build.extraUtils}/bin + + memtool $((64 * 1024)) + + # Unlikely to reach this point + exec /init + ''; + # Add the csrtool to the initrd so we can change the # in-order/out-of-order, and memtool to stress the memory. extraUtilsCommands = '' @@ -91,14 +105,7 @@ # dead. Monitor from the host with: # while [ 1 ]; do xxd -s $((0x1bfff0000 - 0x60000000)) \ # -l 4 /dev/qdma34000-MM-1; sleep 0.2; done - preDeviceCommands = - # Run our memtool to hang the kernel here. Set the maximum block - # size to 64K. - '' - memtool $((64 * 1024)) - '' - + - '' + preDeviceCommands = '' echo "Creating a heartbeat counter at 0x1bfff0000" sh -c 'hb=0; while [ 1 ]; do let hb=$hb+1; devmem 0x1bfff0000 32 $hb; done' & '' @@ -272,7 +279,7 @@ # tp_printk write ftrace events to console # trace_buf_size=1M set ftrace buffer to 1M # - setenv bootargs "root=/dev/ram0 loglevel=7 debug rw earlycon=sbi console=hvc0 init=${init}" + setenv bootargs "root=/dev/ram0 loglevel=7 debug rw earlycon=sbi console=hvc0 rdinit=/init2 init=${init}" EOF