mfs: clean flag

. also implement now-possible fsck -p option
    	. allows unconditional fsck -p invocation at startup,
    	  only checking each filesystem if not marked clean
    	. mounting unclean is allowed but is forced readonly
    	. updating the superblock while mounted is now not
    	  allowed by mfs - must be done (e.g. by fsck.mfs)
    	  on an unmounted fs
	. clean flag is unset by mfs on mounting, and set by
	  mfs on clean unmounting (if clean flag was set at
	  mount time)

Signed-off-by: Ben Gras <ben@minix3.org>
This commit is contained in:
Ben Gras
2011-12-22 16:53:32 +01:00
parent 9a664b4984
commit 59ff5cbd87
13 changed files with 292 additions and 76 deletions
+12 -1
View File
@@ -3,7 +3,7 @@
.include <bsd.own.mk>
PROGRAMS= at_wini bios_wini cdprobe dev2name floppy loadramdisk mount \
pci procfs sh service sysenv mfs
pci procfs sh service sysenv mfs fsck.mfs
SCRIPTS=newroot
.if ${MKSMALL} != "yes"
@@ -43,6 +43,11 @@ bintoc: bintoc.c
image: proto.gen mtab rc $(EXTRA)
mkfs.mfs image proto.gen || { rm -f image; false; }
if fsck.mfs -s image | grep -q CLEAN; \
then : ; \
else echo "CLEAN sanity check of image failed." ; \
echo "(Perhaps install current mkfs and fsck.)" ; \
fi
ahci: ../ahci/ahci
install ${STRIPFLAG} ../$@/$@ $@
@@ -104,6 +109,12 @@ mount: ../../commands/mount/mount
../../commands/mount/mount:
$(MAKE) -C ../../commands/mount
fsck.mfs: ../../commands/fsck.mfs/fsck.mfs
install ${STRIPFLAG} ../../commands/$@/$@ $@
../../commands/fsck.mfs/fsck.mfs:
$(MAKE) -C ../../commands/fsck.mfs
newroot: ../../commands/newroot/newroot.sh
install ${STRIPFLAG} ../../commands/$@/$@.sh $@