NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: install/56132: build.sh target install-image fails in update-mode
The following reply was made to PR install/56132; it has been noted by GNATS.
From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: install/56132: build.sh target install-image fails in update-mode
Date: Tue, 1 Jun 2021 01:22:11 +0900
I wrote:
> Date: Fri, 30 Apr 2021 01:20:14 +0900
>
> I wrote:
>
> > ${WORKFSTAB} needs to depend on ${WORKMBR} image file to get
> > a UUID created by ${TOOL_GPT} with ${GPT_TIMESTAMP}? Umm.
> > (note GPT/UEFI part was not implemented by me)
> >
> > I wonder if we can calculate the UUID from ${GPT_TIMESTAMP}
> > without an actual image, but anyway we need some dummy targets
> > that checks and removes ${WORKMBR} if its size is different
> > from ${IMAGESECTORS}?
>
> There are two options:
>
> 1) always build ${WORKMBR} by .PHONY
[snip]
> 2) check a size of ${WORKMBR} before building targets
>
> Not sure if .BEGIN is correct here..
>
> ---
> Index: distrib/common/bootimage/Makefile.bootimage
> ===================================================================
> RCS file: /cvsroot/src/distrib/common/bootimage/Makefile.bootimage,v
> retrieving revision 1.26
> diff -u -p -d -r1.26 Makefile.bootimage
> --- distrib/common/bootimage/Makefile.bootimage 5 Aug 2020 01:35:18 -0000 1.26
> +++ distrib/common/bootimage/Makefile.bootimage 29 Apr 2021 16:09:58 -0000
> @@ -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}:
> ---
>
> > Needs make(1) guru..
>
> Anyway we need proper reviews..
If there is no further comment, I'll commit the above 2) soon.
Thanks,
---
Izumi Tsutsui
Home |
Main Index |
Thread Index |
Old Index