Check generate rootfs more thoroughly

Test by writing files to various subdirectories and checking the behaviour.