Module Name:    src
Committed By:   tsutsui
Date:           Fri Jun  4 17:09:36 UTC 2021

Modified Files:
        src/distrib/common/bootimage: Makefile.bootimage

Log Message:
Check and remove a stale work file for UEFI images with incorrect size.

Fixes PR/56132 (build.sh target install-image fails in update-mode).


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/distrib/common/bootimage/Makefile.bootimage

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.26 src/distrib/common/bootimage/Makefile.bootimage:1.27
--- src/distrib/common/bootimage/Makefile.bootimage:1.26	Wed Aug  5 01:35:18 2020
+++ src/distrib/common/bootimage/Makefile.bootimage	Fri Jun  4 17:09:36 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.26 2020/08/05 01:35:18 jmcneill Exp $
+#	$NetBSD: Makefile.bootimage,v 1.27 2021/06/04 17:09:36 tsutsui Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -294,6 +294,15 @@ WORKFATDIR?=	work.fatdir
 
 .if ${USE_GPT} != "no"
 ${WORKFSTAB}: ${WORKMBR}
+
+.BEGIN:
+	@if [ -f ${WORKMBR} ]; then			 		\
+		st_size=`${TOOL_STAT} -f %z ${WORKMBR}`;		\
+		if [ "$$st_size" -ne "$$((${IMAGESECTORS} * 512))" ]; then \
+			echo Removing stale ${WORKMBR} ...;		\
+			rm -f ${WORKMBR};				\
+		fi							\
+	fi
 .endif
 
 ${WORKFSTAB}:

Reply via email to