Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/distrib/i386/floppies/bootfloppy-common Pull up rev. 1....



details:   https://anonhg.NetBSD.org/src/rev/3eaa0262009d
branches:  netbsd-1-5
changeset: 488602:3eaa0262009d
user:      rh <rh%NetBSD.org@localhost>
date:      Thu Jul 20 16:54:49 2000 +0000

description:
Pull up rev. 1.27 (approved by jhawk):
For all filesytem image building targets, build ${IMAGE}.tmp and
move it to ${IMAGE} when done, to ensure that an interrupted
build does not leave a broken non-functional target. (This can occur,
for instance, if one types 'make' as a non-root user and the vnconfig
fails, and then a subsequent 'make' will not rebuild the filesystem
image, using the all-zeroes image created by dd.)

diffstat:

 distrib/i386/floppies/bootfloppy-common/Makefile.inc |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (47 lines):

diff -r 4ea440b8c1e5 -r 3eaa0262009d distrib/i386/floppies/bootfloppy-common/Makefile.inc
--- a/distrib/i386/floppies/bootfloppy-common/Makefile.inc      Thu Jul 20 14:48:13 2000 +0000
+++ b/distrib/i386/floppies/bootfloppy-common/Makefile.inc      Thu Jul 20 16:54:49 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.26.4.1 2000/07/20 00:25:37 fvdl Exp $
+#      $NetBSD: Makefile.inc,v 1.26.4.2 2000/07/20 16:54:49 rh Exp $
 
 # TOP is assumed to be defined by Makefile including this one.
 
@@ -27,8 +27,9 @@
        tar cvf ${FSTMP} boot ${METAFILE} netbsd
        @echo
        @echo Making disk number one
-       dd if=/dev/zero of=${IMAGE} count=${DISKSIZE}
-       vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE}
+       rm -f ${IMAGE}.tmp
+       dd if=/dev/zero of=${IMAGE}.tmp count=${DISKSIZE}
+       vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE}.tmp
        dd bs=8k seek=1 count=${BLOCK8K} if=${FSTMP} of=${VND_CDEV}
        disklabel -rw ${VND_CDEV} ${DISKTYPE}
        @echo "installing new bootblocks"
@@ -44,7 +45,7 @@
                        exit 1; \
                else \
                        dd seek=$$(($${size} / 512 + 15)) count=1 \
-                               if=/dev/zero of=${IMAGE}; \
+                               if=/dev/zero of=${IMAGE}.tmp; \
                fi; \
                echo; \
                 bytes=$$(($$dksize * $$disks - $$size));    \
@@ -60,6 +61,7 @@
                                free on disk $$disks."; \
                fi; \
        )
+       mv -f ${IMAGE}.tmp ${IMAGE}
 
 # Let the kernel on the diskette be called "netbsd" although
 # it is compressed.  This is because the boot code will search
@@ -91,7 +93,7 @@
        done
        
 clean cleandir distclean:
-       /bin/rm -f *.core ${CLEANFILES} ${IMAGE}
+       /bin/rm -f *.core ${CLEANFILES} ${IMAGE} ${IMAGE}.tmp
 
 .include <bsd.own.mk>
 .include <bsd.obj.mk>



Home | Main Index | Thread Index | Old Index