Date: Sat, 16 Jul 2016 10:01:57 +0300 From: Slawa Olhovchenkov <slw@zxy.spb.ru> To: Allan Jude <allanjude@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302790 - head/usr.sbin/bsdinstall/scripts Message-ID: <20160716070157.GL20831@zxy.spb.ru> In-Reply-To: <201607132349.u6DNnknJ012881@repo.freebsd.org> References: <201607132349.u6DNnknJ012881@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jul 13, 2016 at 11:49:46PM +0000, Allan Jude wrote: > Author: allanjude > Date: Wed Jul 13 23:49:45 2016 > New Revision: 302790 > URL: https://svnweb.freebsd.org/changeset/base/302790 > > Log: > bsdinstall: Prompt user to set the date and time after selecting timezone > > Not having the correct date and time makes many PKI based things not work > > In 10 and 11, it can mean that Unbound, ntpd, and sshd won't start Can you do more sofistical -- using current date and time as start value? PS: this is don't resolve case of cmos-less machines. > Submitted by: des (original patch) > MFC after: 7 days > > Modified: > head/usr.sbin/bsdinstall/scripts/time > > Modified: head/usr.sbin/bsdinstall/scripts/time > ============================================================================== > --- head/usr.sbin/bsdinstall/scripts/time Wed Jul 13 23:03:34 2016 (r302789) > +++ head/usr.sbin/bsdinstall/scripts/time Wed Jul 13 23:49:45 2016 (r302790) > @@ -26,4 +26,40 @@ > # > # $FreeBSD$ > > +# Select timezone > chroot $BSDINSTALL_CHROOT tzsetup > + > +# Switch to target timezone > +saved_TZ="$TZ" > +TZ="${BSDINSTALL_CHROOT}/etc/localtime" > +export TZ > + > +# Set date > +exec 3>&1 > +DATE=$(dialog --backtitle 'FreeBSD Installer' \ > + --title 'Time & Date' \ > + --ok-label 'Set Date' \ > + --cancel-label 'Skip' \ > + --date-format '%Y%m%d%H%M.%S' \ > + --calendar '' 2 40 \ > +2>&1 1>&3) && date $DATE > +exec 3>&- > + > +# Set time > +exec 3>&1 > +TIME=$(dialog --backtitle 'FreeBSD Installer' \ > + --title 'Time & Date' \ > + --ok-label 'Set Time' \ > + --cancel-label 'Skip' \ > + --time-format '%H%M.%S' \ > + --timebox '' 2 40 \ > +2>&1 1>&3) && date $TIME > +exec 3>&- > + > +# Switch back > +if [ -n "$saved_TZ" ]; then > + TZ="$saved_TZ" > +else > + unset TZ > +fi > +unset saved_TZ > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160716070157.GL20831>