On Mon, May 05, 2025 at 02:31:44PM +0000, Lucas Gabriel Vuotto wrote:
> On Sun, May 04, 2025 at 09:16:53PM -0600, Ted Unangst wrote:
> > CVSROOT: /cvs
> > Module name: src
> > Changes by: [email protected] 2025/05/04 21:16:53
> >
> > Modified files:
> > sys/arch/alpha/conf: Makefile.alpha
> > sys/arch/amd64/conf: Makefile.amd64
> > sys/arch/arm64/conf: Makefile.arm64
> > sys/arch/armv7/conf: Makefile.armv7
> > sys/arch/hppa/conf: Makefile.hppa
> > sys/arch/i386/conf: Makefile.i386
> > sys/arch/landisk/conf: Makefile.landisk
> > sys/arch/loongson/conf: Makefile.loongson
> > sys/arch/luna88k/conf: Makefile.luna88k
> > sys/arch/macppc/conf: Makefile.macppc
> > sys/arch/octeon/conf: Makefile.octeon
> > sys/arch/powerpc64/conf: Makefile.powerpc64
> > sys/arch/riscv64/conf: Makefile.riscv64
> > sys/arch/sparc64/conf: Makefile.sparc64
> >
> > Log message:
> > try this again. reconfig kernel, now with || true if file doesn't exist.
>
> This construction will also exit successfully if config fails. If that
> isn't desired, an ugly and working incantantion is
>
> reconfig:
> if [[ -f /etc/bsd.re-config ]]; then config -e -c /etc/bsd.re-config -f
> bsd; fi
>
I suggest you use the idiom that is used the line above it.
Index: Makefile.amd64
===================================================================
RCS file: /cvs/src/sys/arch/amd64/conf/Makefile.amd64,v
diff -u -p -r1.141 Makefile.amd64
--- Makefile.amd64 5 May 2025 03:16:52 -0000 1.141
+++ Makefile.amd64 5 May 2025 14:42:37 -0000
@@ -329,7 +329,7 @@ hardlink-obsd:
[[ ! -f /bsd ]] || cmp -s bsd /bsd || ln -f /bsd /obsd
reconfig:
- [[ -f /etc/bsd.re-config ]] && config -e -c /etc/bsd.re-config -f bsd
|| true
+ [[ ! -f /etc/bsd.re-config ]] || config -e -c /etc/bsd.re-config -f bsd
newinstall:
install -F -m 700 bsd /bsd && sha256 -h /var/db/kernel.SHA256 /bsd