Source-Changes-HG archive

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

[src/trunk]: src/distrib/common/bootimage Check and remove a stale work file ...



details:   https://anonhg.NetBSD.org/src/rev/9d0cd675fa49
branches:  trunk
changeset: 379529:9d0cd675fa49
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Jun 04 17:09:36 2021 +0000

description:
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).

diffstat:

 distrib/common/bootimage/Makefile.bootimage |  11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r 5f2d9dcbaaa5 -r 9d0cd675fa49 distrib/common/bootimage/Makefile.bootimage
--- a/distrib/common/bootimage/Makefile.bootimage       Fri Jun 04 15:37:48 2021 +0000
+++ b/distrib/common/bootimage/Makefile.bootimage       Fri Jun 04 17:09:36 2021 +0000
@@ -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}:



Home | Main Index | Thread Index | Old Index