#!/bin/sh
# freemap_probe.sh - DF-3011 environmental-artifact check (priority 7).
# Question: does a STOCK newfs_hammer image (no crafting) trip
# KKASSERT(layer2->zone == zone) at hammer_blockmap.c:832 on btree-node
# frees (file create + delete + sync)?  If not, the artifact DF-3011 saw
# came from the deepforge image patching, not from the kernel.
set -e
cd /root
vnconfig -c vn1 /root/base.img
mount_hammer /dev/vn1 /mnt
echo MOUNT_OK
echo hello > /mnt/afile
sync
ls -l /mnt/afile
rm /mnt/afile
sync
sleep 2
echo FREEMAP_CYCLE_DONE
umount /mnt
vnconfig -u vn1
echo PROBE_CLEAN
