On Tue, Jul 14, 2020 at 03:03:33PM +0200, Denis Fondras wrote: > I was upgrading an EdgeRouter and it restarted multiple times instead of > booting > /bsd > > When I had a chance to boot it correctly, I noticed that sysmerge and > fw_update > were run multiple times. > > This diff avoids filling rc.firsttime and rc.sysmerge.
This interfers with sysupgrade(8) cleanup. > > > Index: distrib/miniroot/install.sub > =================================================================== > RCS file: /cvs/src/distrib/miniroot/install.sub,v > retrieving revision 1.1154 > diff -u -p -r1.1154 install.sub > --- distrib/miniroot/install.sub 26 May 2020 16:21:00 -0000 1.1154 > +++ distrib/miniroot/install.sub 14 Jul 2020 12:54:27 -0000 > @@ -2734,6 +2734,9 @@ finish_up() { > local _kernel_dir=/mnt/usr/share/relink/kernel > local _kernel=${MDKERNEL:-GENERIC} _syspatch_archs="amd64 arm64 i386" > > + # Empty rc.firsttime > + echo "" >/mnt/etc/rc.firsttime > + > # Mount all known swap partitions. This gives systems with little > # memory a better chance at running 'MAKEDEV all'. > if [[ -x /mnt/sbin/swapctl ]]; then > @@ -2812,7 +2815,7 @@ finish_up() { > > # Ensure that sysmerge in batch mode is run on reboot. > [[ $MODE == upgrade ]] && > - echo "/usr/sbin/sysmerge -b" >>/mnt/etc/rc.sysmerge > + echo "/usr/sbin/sysmerge -b" >/mnt/etc/rc.sysmerge > > # If a proxy was needed to fetch the sets, use it for fw_update and > syspatch > [[ -n $http_proxy ]] && > -- I'm not entirely sure you are real.