From: Ben Gras Date: Fri, 23 Dec 2011 14:02:35 +0000 (+0100) Subject: fix for checking CLEAN-ness of ramdisk image X-Git-Tag: v3.2.0~155 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.dnssec-settime.html?a=commitdiff_plain;h=51de979ed975034870f928c58ab3750ba76c9b07;p=minix.git fix for checking CLEAN-ness of ramdisk image . pre-cleanflag ("old") mkfs generates without CLEAN flag, causing boot not working because imgrd disappears after 1st close . fixed sanity check for this situation . disable imgrd disappearing in memory driver so readonly mount succeeds in case it happens anyway --- diff --git a/drivers/memory/memory.c b/drivers/memory/memory.c index e1433f15e..e1805a01b 100644 --- a/drivers/memory/memory.c +++ b/drivers/memory/memory.c @@ -526,6 +526,7 @@ PRIVATE int m_block_close(dev_t minor) } openct[minor]--; +#if 0 /* Special case: free initial ramdisk after it's been unmounted once. */ if(minor == IMGRD_DEV && openct[minor] == 0 && m_vaddrs[IMGRD_DEV]) { vir_bytes vaddr, vlen; @@ -547,6 +548,7 @@ PRIVATE int m_block_close(dev_t minor) m_geom[IMGRD_DEV].dv_size= cvul64(0); m_vaddrs[IMGRD_DEV] = 0; } +#endif return(OK); } diff --git a/drivers/ramdisk/Makefile b/drivers/ramdisk/Makefile index dacf0ffa1..72964e294 100644 --- a/drivers/ramdisk/Makefile +++ b/drivers/ramdisk/Makefile @@ -47,6 +47,7 @@ image: proto.gen mtab rc $(EXTRA) then : ; \ else echo "CLEAN sanity check of image failed." ; \ echo "(Perhaps install current mkfs and fsck.)" ; \ + rm -f image; false; \ fi ahci: ../ahci/ahci